#include <stdlib.h>
#include <unistd.h>
#include "ap-utils.h"
-#include "ap-curses.h"
#define TEST_MODE _("[T] Test mode: ")
#define ANTENNA _("[A] Antenna: ")
extern WINDOW *main_sub;
extern short ap_type;
+extern char *channels[];
void test()
{
-
struct TestModeCommandStruct_ATMEL410 {
unsigned char Channel;
unsigned char Antenna;
char message[1024], *antenna[2] =
{ _("Left"), _("Right") }, *filer[2] = {
"EN", "US"}, *rates[4] = {
- "1", "2", "5.5", "11"}, *item_name[14];
+ "1", "2", "5.5", "11"};
char teston = 2, *commands[4] =
{ "CONTINUOUS_TX", "CONTINUOUS_RX", "CARRIER_ACCURACY", "IDLE" };
varbind varbinds[5];
- int ch_num = 0, i;
if (ap_type == ATMEL12350) {
+#if 1 /* Temporary kludge */
+ mvwaddstr(main_sub, 1, 0, _("Devices with ATMEL12350 MIB not yet supported."));
+ wrefresh(main_sub);
+ goto exit;
+#endif
TestModeOnOff[5] = 0xE0;
TestModeOnOff[6] = 0x3E;
TestModeCommandStruct[5] = 0xE0;
TestModeStatistics[6] = 0x3E;
}
- print_title(_("Test mode"));
+ print_top(NULL, _("Test mode"));
mvwaddstr(main_sub, 3, 6,
_
("Using the \"Test mode\" may cause loss of your current"));
mvwaddstr(main_sub, 4, 6, _("configuration."));
mvwaddstr(main_sub, 6, 20, _("Do you want to continue? "));
wrefresh(main_sub);
- print_help(_("(Y - Yes; N - No (it's safer to answer No.)"));
- i = 1;
- while (i)
- switch (getch()) {
- case 'Y':
- case 'y':
- clear_main(3);
- i = 0;
- break;
- case 'n':
- case 'N':
- clear_main(3);
- goto quit;
- }
- if ((ch_num = ch_list(0, item_name)) == 0) {
- print_helperr(ERR_RET);
- goto exit;
- }
+ if (help_ysn())
+ goto quit;
+
+ print_help(__HELP);
sprintf(message, "%s%s", TEST_MODE, OFF);
mvwaddstr(main_sub, 0, 0, message);
wrefresh(main_sub);
noecho();
- print_help(__HELP);
while (1) {
switch (getch()) {
case 'Q':
continue;
case 'C':
case 'c':
- testmode.Channel = menu_choose(3, strlen(CHANNEL), item_name,
- ch_num) + 1;
+ testmode.Channel = menu_choose(3, strlen(CHANNEL), channels,
+ 14) + 1;
clear_main_new(3, 4);
sprintf(message, "%02u (%u MHz)", testmode.Channel,
2407 + 5 * testmode.Channel);
print_help(ANY_KEY);
exit:
getch();
- /* free memory allocated for channel list */
- for (i = 0; i < ch_num; i++)
- free(item_name[i]);
quit:
- print_title("");
+ print_top(NULL, NULL);
clear_main(0);
}