diff --git a/esp8266_deauther/APScan.cpp b/esp8266_deauther/APScan.cpp index a0310ca..150fd53 100644 --- a/esp8266_deauther/APScan.cpp +++ b/esp8266_deauther/APScan.cpp @@ -135,7 +135,7 @@ int APScan::getFirstTarget() { void APScan::sendResults() { if (debug) Serial.print("sending AP scan result JSON "); - size_t _size = 10; // {"aps":[]} + size_t _size = 25; // {"aps":[ ... ],"multiAPs":"1"} for (int i = 0; i < results && i < maxAPScanResults; i++) { /* _size++; // { @@ -185,7 +185,12 @@ void APScan::sendResults() { sendToBuffer(json); } - json = "]}"; + + json = "],\"multiAPs\":\""; + if(settings.multiAPs) json += "1"; + else json += "0"; + json += "\"}"; + sendToBuffer(json); sendBuffer(); @@ -263,14 +268,27 @@ void APScan::sort() { void APScan::select(int num) { if (debug) Serial.println("select " + (String)num + " - " + !selected[num]); - if(!settings.multiAPs){ + if(num < 0) { + if (num == -1){ + if (settings.multiAPs) { + selectedSum = results; + for (int i = 0; i < results; i++) selected[i] = true; + } + } else { + selectedSum = 0; + for (int i = 0; i < maxAPScanResults; i++) selected[i] = false; + } + } else if(!settings.multiAPs) { for (int i = 0; i < maxAPScanResults; i++){ if(i != num) selected[i] = false; + selected[num] = !selected[num]; + selectedSum = 1; } + } else { + selected[num] = !selected[num]; + if (selected[num]) selectedSum--; + else selectedSum++; } - selected[num] = !selected[num]; - if (selected[num]) selectedSum--; - else selectedSum++; } bool APScan::isSelected(int num) { diff --git a/esp8266_deauther/ClientScan.cpp b/esp8266_deauther/ClientScan.cpp index 493498d..636f9d5 100644 --- a/esp8266_deauther/ClientScan.cpp +++ b/esp8266_deauther/ClientScan.cpp @@ -145,9 +145,19 @@ int ClientScan::getFirstClient() { } void ClientScan::select(int num) { - selected[num] = !selected[num]; - if (selected[num]) selectedResults++; - else selectedResults--; + if(num < 0){ + if(num == -1){ + for(int i=0; i 0) tr += 'ChSSIDRSSIEncrypt.Select'; - + if (res.aps.length > 0) { + tr += 'ChSSIDRSSIEncrypt.'; + + if (res.multiAPs == 1) tr += ' |  all'; + else tr += 'Select' + } + for (var i = 0; i < res.aps.length; i++) { if (res.aps[i].se == 1) tr += ''; diff --git a/web_server/html/js/stations.js b/web_server/html/js/stations.js index 840dd5f..ae7ec4b 100644 --- a/web_server/html/js/stations.js +++ b/web_server/html/js/stations.js @@ -35,7 +35,7 @@ function getResults() { clientsFound.innerHTML = res.clients.length; var tr = ''; - if (res.clients.length > 0) tr += 'PktsVendorNameMACAPSelect'; + if (res.clients.length > 0) tr += 'PktsVendorNameMACAP |  all'; for (var i = 0; i < res.clients.length; i++) {