示例#1
0
void show_args_for_debug()
{
    int i, max_pnl;

    if(ttm.set_pnl_num)
        max_pnl = ttm.pnl_num;
    else
        max_pnl = PNL_NUM; 

    for(i=0;i<max_pnl;i++)
    {
        printf("ap %d (on pnl %d), ",get_ap(i), i);
        printf("ap_read_evt: %d, ",get_evt(i));
        printf("ap_display_fb: %d, ",get_fb(i));
        printf("pnl_%d_read_evt: %d\n",i, get_pnl_evt(i));
    }

    printf("master panel : %d\n",ttm.pnl_arg);
    printf("calibrate    : %s\n",(ttm.calibrate)?"yes":"no");
    printf("split mode   : %s\n",(ttm.split)?"yes":"no");

    if(ttm.arg.bind.set)
    {
        int j;
        for (i = 0; i < ttm.bind_data.pnl_num; i++) 
        {
            printf("bind panel %d : ", i);
            for (j = 0; j < ttm.bind_data.pnl[i].ap_num; j++) 
            {
                printf("%d ",ttm.bind_data.pnl[i].group[j]);
            }
            printf("\n");
        }
    }
}
示例#2
0
void init_evt(evt_data_t *evt, int pnl)
{
    memcpy(evt->dev, default_evt, sizeof(default_evt));

    evt->act = 0;
    evt->num = get_ap(pnl);
    evt->dev[EVT_NUM_POS] = '0' + evt->num;
}
示例#3
0
文件: iw.c 项目: mixalturek/xsysguard
static const char *
help_iw(void)
{
	static xsg_string_t *string = NULL;
	xsg_list_t *l;
	int i = 0;

	init_iw();

	if (skfd < 0) {
		return NULL;
	}

	if (string == NULL) {
		string = xsg_string_new(NULL);
	} else {
		xsg_string_truncate(string, 0);
	}

	get_iw_device_list();

	for (l = device_list; l; l = l->next) {
		char name[128];

		snprintf(name, sizeof(name), "IW_INTERFACE%d", i++);
		xsg_setenv(name, (char *) device_list->data, TRUE);

		xsg_string_append_printf(string, "%s:   %s\n", name,
				(char *) device_list->data);
	}

	xsg_string_append(string, "\n");

	for (l = device_list; l; l = l->next) {
		char *ifname = (char *) l->data;

		xsg_string_append_printf(string, "S %s:%s:%-36s%s\n",
				XSG_MODULE_NAME, ifname, "config:name",
				get_name(ifname));
		xsg_string_append_printf(string, "N %s:%s:%-36s%.0f\n",
				XSG_MODULE_NAME, ifname, "config:nwid",
				get_nwid(ifname));
		xsg_string_append_printf(string, "N %s:%s:%-36s%.0f\n",
				XSG_MODULE_NAME, ifname, "config:freq",
				get_freq_number(ifname));
		xsg_string_append_printf(string, "S %s:%s:%-36s%s\n",
				XSG_MODULE_NAME, ifname, "config:freq",
				get_freq_string(ifname));
		xsg_string_append_printf(string, "N %s:%s:%-36s%.0f\n",
				XSG_MODULE_NAME, ifname, "config:channel",
				get_channel(ifname));
		xsg_string_append_printf(string, "S %s:%s:%-36s%s\n",
				XSG_MODULE_NAME, ifname, "config:key",
				get_key(ifname));
		xsg_string_append_printf(string, "N %s:%s:%-36s%.0f\n",
				XSG_MODULE_NAME, ifname, "config:keyid",
				get_keyid(ifname));
		xsg_string_append_printf(string, "S %s:%s:%-36s%s\n",
				XSG_MODULE_NAME, ifname, "config:essid",
				get_essid(ifname));
		xsg_string_append_printf(string, "N %s:%s:%-36s%.0f\n",
				XSG_MODULE_NAME, ifname, "config:mode",
				get_mode_number(ifname));
		xsg_string_append_printf(string, "S %s:%s:%-36s%s\n",
				XSG_MODULE_NAME, ifname, "config:mode",
				get_mode_string(ifname));
		xsg_string_append_printf(string, "N %s:%s:%-36s%.0f\n",
				XSG_MODULE_NAME, ifname, "info:sensitivity",
				get_sens(ifname));
		xsg_string_append_printf(string, "S %s:%s:%-36s%s\n",
				XSG_MODULE_NAME, ifname, "info:nickname",
				get_nickname(ifname));
		xsg_string_append_printf(string, "S %s:%s:%-36s%s\n",
				XSG_MODULE_NAME, ifname, "info:access_point",
				get_ap(ifname));
		xsg_string_append_printf(string, "N %s:%s:%-36s%.0f\n",
				XSG_MODULE_NAME, ifname, "info:bitrate",
				get_bitrate_number(ifname));
		xsg_string_append_printf(string, "S %s:%s:%-36s%s\n",
				XSG_MODULE_NAME, ifname, "info:bitrate",
				get_bitrate_string(ifname));
		xsg_string_append_printf(string, "N %s:%s:%-36s%.0f\n",
				XSG_MODULE_NAME, ifname, "info:rts",
				get_rts_number(ifname));
		xsg_string_append_printf(string, "S %s:%s:%-36s%s\n",
				XSG_MODULE_NAME, ifname, "info:rts",
				get_rts_string(ifname));
		xsg_string_append_printf(string, "N %s:%s:%-36s%.0f\n",
				XSG_MODULE_NAME, ifname, "info:fragment",
				get_frag_number(ifname));
		xsg_string_append_printf(string, "S %s:%s:%-36s%s\n",
				XSG_MODULE_NAME, ifname, "info:fragment",
				get_frag_string(ifname));
		xsg_string_append_printf(string, "S %s:%s:%-36s%s\n",
				XSG_MODULE_NAME, ifname, "info:power_management",
				get_power_management(ifname));
		xsg_string_append_printf(string, "N %s:%s:%-36s%.0f\n",
				XSG_MODULE_NAME, ifname, "info:txpower:dbm",
				get_txpower_dbm(ifname));
		xsg_string_append_printf(string, "N %s:%s:%-36s%.2f\n",
				XSG_MODULE_NAME, ifname, "info:txpower:mw",
				get_txpower_mw(ifname));
		xsg_string_append_printf(string, "S %s:%s:%-36s%s\n",
				XSG_MODULE_NAME, ifname, "info:retry",
				get_retry(ifname));
		xsg_string_append_printf(string, "N %s:%s:%-36s%.0f\n",
				XSG_MODULE_NAME, ifname, "stats:quality:quality",
				get_stats_quality_quality(ifname));
		xsg_string_append_printf(string, "N %s:%s:%-36s%.0f\n",
				XSG_MODULE_NAME, ifname, "stats:quality:signal",
				get_stats_quality_signal(ifname));
		xsg_string_append_printf(string, "N %s:%s:%-36s%.0f\n",
				XSG_MODULE_NAME, ifname, "stats:quality:noise",
				get_stats_quality_noise(ifname));
		xsg_string_append_printf(string, "N %s:%s:%-36s%.0f\n",
				XSG_MODULE_NAME, ifname, "stats:discarded:nwid",
				get_stats_discarded_nwid(ifname));
		xsg_string_append_printf(string, "N %s:%s:%-36s%.0f\n",
				XSG_MODULE_NAME, ifname, "stats:discarded:code",
				get_stats_discarded_code(ifname));
		xsg_string_append_printf(string, "N %s:%s:%-36s%.0f\n",
				XSG_MODULE_NAME, ifname, "stats:discarded:fragment",
				get_stats_discarded_fragment(ifname));
		xsg_string_append_printf(string, "N %s:%s:%-36s%.0f\n",
				XSG_MODULE_NAME, ifname, "stats:discarded:retries",
				get_stats_discarded_retries(ifname));
		xsg_string_append_printf(string, "N %s:%s:%-36s%.0f\n",
				XSG_MODULE_NAME, ifname, "stats:discarded:misc",
				get_stats_discarded_misc(ifname));
		xsg_string_append_printf(string, "N %s:%s:%-36s%.0f\n",
				XSG_MODULE_NAME, ifname, "stats:missed:beacon",
				get_stats_missed_beacon(ifname));
		xsg_string_append_printf(string, "N %s:%s:%-36s%.0f\n",
				XSG_MODULE_NAME, ifname, "range:sensitivity",
				get_range_sensitivity(ifname));
		xsg_string_append_printf(string, "N %s:%s:%-36s%.0f\n",
				XSG_MODULE_NAME, ifname, "range:max_quality:quality",
				get_range_max_quality_quality(ifname));
	}

	return string->str;
}