]> git.decadent.org.uk Git - ap-utils.git/blobdiff - lib/set_oeminfo.c
Imported Upstream version 1.5
[ap-utils.git] / lib / set_oeminfo.c
index 5b4241c2a953ca62b20b37a6a76d871c1c7e2c0d..3d137a3fd3d6e2c1db7a4272dea256104d2fd32a 100644 (file)
@@ -1,7 +1,7 @@
 /*
- *      sysinfo_set.c from Access Point SNMP Utils for Linux
+ *      set_oeminfo.c from Access Point SNMP Utils for Linux
  *
- * Copyright (c) Jan Rafaj <jr-aputils at cedric dot unob dot cz>
+ * Copyright (c) 2005 Jan Rafaj <jr-aputils at cedric dot unob dot cz>
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License Version 2 from
@@ -159,7 +159,7 @@ void atmel_set_oeminfo()
 
     st_len = varbinds[0].len_val;
 
-    if (st_len == 128) { /* SHORTst */
+    if (st_len == 92 || st_len == 128) { /* SHORTst */
        memcpy(&str128, varbinds[0].value,
            sizeof(struct sysDeviceInfo_128));
        StructVersion           = str128.StructVersion;
@@ -262,11 +262,11 @@ void atmel_set_oeminfo()
            waddstr(main_sub, message);
        }
 
-       sprintf(message, "Vendor ID: 0x%04X", (PID_VID[0] & 0xFF) |
+       sprintf(message, "USB Vendor ID: 0x%04X", (PID_VID[0] & 0xFF) |
            ((PID_VID[1] & 0xFF) << 8));
        mvwaddstr(main_sub, 16, 0, message);
 
-       sprintf(message, "Product ID: 0x%04X", (PID_VID[2] & 0xFF) |
+       sprintf(message, "USB Product ID: 0x%04X", (PID_VID[2] & 0xFF) |
            ((PID_VID[3] & 0xFF) << 8));
        mvwaddstr(main_sub, 17, 0, message);
 
@@ -348,7 +348,7 @@ void atmel_set_oeminfo()
                continue;
            case 'o':
            case 'O':
-               if (st_len == 128)
+               if (st_len == 92 || st_len == 128)
                    continue;
 
                get_value(CountryCode, 10, strlen(S_COUNTRYC), 3, ANY_STRING,
@@ -356,7 +356,7 @@ void atmel_set_oeminfo()
                continue;
            case 'c':
            case 'C':
-               if (st_len == 128)
+               if (st_len == 92 || st_len == 128)
                    continue;
 
                Channel = menu_choose(11 - regdom_types[rd_idx].chans / 2,
@@ -372,7 +372,7 @@ void atmel_set_oeminfo()
                continue;
            case 'a':
            case 'A':
-               if (st_len == 128)
+               if (st_len == 92 || st_len == 128)
                    continue;
 
                get_value(message, 12, strlen(S_CHANNELS), 3, INT_STRING, 1, 14,
@@ -386,7 +386,7 @@ void atmel_set_oeminfo()
                continue;
            case 'p':
            case 'P':
-               if (st_len == 128)
+               if (st_len == 92 || st_len == 128)
                    continue;
 
                get_value(message, 13, strlen(S_TXPOWER), 4, INT_STRING, 0, 255,
@@ -415,7 +415,7 @@ void atmel_set_oeminfo()
                varbinds[0].len_oid = sizeof(sysDeviceInfo);
                varbinds[0].type = STRING_VALUE;
 
-               if (st_len == 128) { /* SHORTst */
+               if (st_len == 92 || st_len == 128) { /* SHORTst */
                    str128.RegulatoryDomain     = RegulatoryDomain;
                    str128.ProductType          = ProductType;
                    str128.OEMID                = OEMID;
@@ -454,6 +454,8 @@ void atmel_set_oeminfo()
                    }
                }
 
+               wbkgd(main_sub, A_NORMAL);
+               wrefresh(main_sub);
                print_help(DONE_SET);
                goto exit;
        }