X-Git-Url: https://git.decadent.org.uk/gitweb/?p=ap-utils.git;a=blobdiff_plain;f=lib%2Faps.c;h=f2c99d7f1cbe5ab680f21c4d61e8eca3725c36fb;hp=b99ad57ea5ffcfcbd9e8180ca02065cc7cf24d16;hb=67fc54773e1504698e80c9cb83977bde32665350;hpb=6a9e980b8799891e0a5467a0126a60b169c8f4eb diff --git a/lib/aps.c b/lib/aps.c index b99ad57..f2c99d7 100644 --- a/lib/aps.c +++ b/lib/aps.c @@ -200,7 +200,9 @@ get_stats: show_stats: print_title(_("Known Access Points")); - print_viewtype(ap_viewtype); + message[0] = ap_viewtype + '0'; + message[1] = '\0'; + print_viewtype(message); /* display column info in main_sub */ mvwin(main_sub, 0, 0); @@ -316,17 +318,18 @@ show_stats: /* display RSSI and LQ indicators */ switch (ap_viewtype) { case 1: - sprintf(message, "%3d", -96 + app->q1); - mvwaddstr(main_sub, aps_num+1, 56, message); + sprintf(message, "%3d%%", + (int)((minimum (app->q1, 40)) * (float)2.5)); + mvwaddstr(main_sub, aps_num+1, 55, message); if (ap_type == ATMEL410) { - sprintf(message, "%3d", (int)(100 - (minimum (app->q2, 40)) * (float)2.5) ); - mvwaddstr(main_sub, aps_num+1, 61, message); + sprintf(message, "%3d%%", + (int)(100 - (minimum (app->q2, 40)) * (float)2.5) ); + mvwaddstr(main_sub, aps_num+1, 60, message); } break; case 2: - sprintf(message, "%3d%%", - (int)((minimum (app->q1, 40)) * (float)2.5)); - mvwaddstr(main_sub, aps_num+1, 55, message); + sprintf(message, "%3d", -96 + app->q1); + mvwaddstr(main_sub, aps_num+1, 56, message); if (ap_type == ATMEL410) { sprintf(message, "%3d%%", (int)(100 - (minimum (app->q2, 40)) * (float)2.5) ); @@ -347,37 +350,37 @@ show_stats: /* display legend in main_sub */ switch (ap_viewtype) { - case 2: - mvwaddstr(main_sub, LINES - 7, 0, - _("CN: Channel Name; P: Preambule Type (S: Short; L: Long);")); + case 1: mvwaddstr(main_sub, LINES - 6, 0, - _("RSSI: Radio Signal Strength Indicator [%];")); + _("CN: Channel Name; P: Preambule Type (S: Short; L: Long);")); + mvwaddstr(main_sub, LINES - 5, 0, + _("RSSI: Radio Signal Strength Indicator [%]")); if (ap_type == ATMEL410) - mvwaddstr(main_sub, LINES - 5, 0, _("LQ: Link Quality [%]")); + waddstr(main_sub, _("; LQ: Link Quality [%]")); break; - case 1: - mvwaddstr(main_sub, LINES - 7, 0, - _("CN: Channel Name; P: Preambule Type (S: Short; L: Long);")); + case 2: mvwaddstr(main_sub, LINES - 6, 0, - _("RSSI: Radio Signal Strength Indicator [dBm];")); + _("CN: Channel Name; P: Preambule Type (S: Short; L: Long);")); + mvwaddstr(main_sub, LINES - 5, 0, + _("RSSI: Radio Signal Strength Indicator [dBm]")); if (ap_type == ATMEL410) - mvwaddstr(main_sub, LINES - 5, 0, _("LQ: Link Quality [%]")); + waddstr(main_sub, _("; LQ: Link Quality [%]")); break; case 3: - mvwaddstr(main_sub, LINES - 7, 0, - _("CN: Channel Name; P: Preambule Type (S: Short; L: Long);")); mvwaddstr(main_sub, LINES - 6, 0, - _("RSSI: Radio Signal Strength Indicator [raw];")); + _("CN: Channel Name; P: Preambule Type (S: Short; L: Long);")); + mvwaddstr(main_sub, LINES - 5, 0, + _("RSSI: Radio Signal Strength Indicator [raw]")); if (ap_type == ATMEL410) - mvwaddstr(main_sub, LINES - 5, 0, _("LQ: Link Quality [raw]")); + waddstr(main_sub, _("; LQ: Link Q. [raw]")); break; } wrefresh(main_sub); if (ap_type == ATMEL410) - print_help(_("# con. to this AP; R refresh with reset; S refresh w/o reset; T toggle; Q quit")); + print_help(_("# con. to AP #; R refresh with reset; T toggle; Q quit; Other = refr. w/o reset")); else /* ATMEL12350 */ - print_help(_("# con. to this AP; R initiate AP scan; S refresh view; T toggle view; Q quit")); + print_help(_("# con. to AP #; R initiate AP scan; T toggle view; Q quit; Other = refresh view")); while (1) switch (i = getch()) { @@ -561,11 +564,6 @@ show_stats: getch(); } goto get_stats; - case 'S': - case 's': - print_help(WAIT_RET); - clear_main(0); - goto get_stats; case 'T': case 't': ap_viewtype += 1; @@ -573,6 +571,10 @@ show_stats: ap_viewtype = 1; clear_main(0); goto show_stats; + default: + print_help(WAIT_RET); + clear_main(0); + goto get_stats; } restore_before_exit: