]> git.decadent.org.uk Git - ap-utils.git/blobdiff - src/stations.c
Imported Upstream version 1.5.1~pre1
[ap-utils.git] / src / stations.c
index b37463e33a826fe37478861459181221673b56df..5211f40c9623a35269fef0c98b717aaf700876d2 100644 (file)
@@ -82,7 +82,6 @@ void atmel_stations()
        mvwaddstr(main_sub, 1, 1, _("Not available (device not in AP mode)."));
        print_help(ANY_KEY);
        wrefresh(main_sub);
-       getch();
        goto exit;
     }
 
@@ -105,7 +104,6 @@ refresh:
 
     if (snmp(varbinds, 1, GET) <= 0) {
        print_helperr(ERR_RET);
-       getch();
        goto exit;
     }
 
@@ -131,7 +129,6 @@ refresh:
 
        if (snmp(varbinds, 1, SET) <= 0) {
            print_helperr(ERR_RET);
-           getch();
            goto exit;
        }
 
@@ -159,7 +156,7 @@ refresh:
                memcpy(curr->ParentMacAddress, ap_410.ParentMacAddress, 6);
                memcpy(&(curr->IP.s_addr), ap_410.IP, 4);
                curr->rssi = ap_410.RSSI;
-               curr->quality = ap_410.LinkQuality;
+               curr->quality = 100 - (minimum(ap_410.LinkQuality,40))*2,5;
                curr->Status = ap_410.Status;
                curr->Port = ap_410.Port;
            }
@@ -219,7 +216,7 @@ refresh:
                continue;
            case 'Q':
            case 'q':
-               goto exit;
+               goto quit;
            case 'T':
            case 't':
                if ((ap_type == ATMEL410 && ap_vendorext == SBRIDGES) ||
@@ -240,6 +237,8 @@ refresh:
     }
 
 exit:
+    getch();
+quit:
     while ((curr = first)) {
        first = curr->next;
        free(curr);
@@ -336,7 +335,8 @@ void nwn_stations()
                curr = curr->next;
            } 
            memcpy(curr->addr, varbinds[0].value, 6);
-           curr->quality = *varbinds[1].value;
+           curr->quality = 100 - (minimum(*varbinds[1].value,40))*2,5;
+//         curr->quality = *varbinds[1].value;
            curr->idle = *varbinds[2].value;
            curr->rssi = *varbinds[3].value;
            curr->next = NULL;
@@ -414,4 +414,3 @@ void nwn_stations()
     print_top(NULL, NULL);
     clear_main(0);
 }
-