mirror of
https://github.com/SpacehuhnTech/esp8266_deauther.git
synced 2025-12-23 15:38:18 -08:00
Fixing APScan Display Bug
When you scan for a second time and find less APs then before, there was the possibility that the last of the old APs was still shown on the display.
This commit is contained in:
@@ -10,10 +10,17 @@ bool APScan::start() {
|
|||||||
Serial.println("MAC - Ch - RSSI - Encrypt. - SSID - Hidden");// - Vendor");
|
Serial.println("MAC - Ch - RSSI - Encrypt. - SSID - Hidden");// - Vendor");
|
||||||
}
|
}
|
||||||
aps._clear();
|
aps._clear();
|
||||||
for (int i = 0; i < maxAPScanResults; i++) selected[i] = false;
|
results = 0;
|
||||||
|
for (int i = 0; i < maxAPScanResults; i++){
|
||||||
|
selected[i] = false;
|
||||||
|
String("").toCharArray(names[i], 33);
|
||||||
|
}
|
||||||
results = WiFi.scanNetworks(false, settings.apScanHidden); // lets scanNetworks return hidden APs. (async = false & show_hidden = true)
|
results = WiFi.scanNetworks(false, settings.apScanHidden); // lets scanNetworks return hidden APs. (async = false & show_hidden = true)
|
||||||
|
if(results > maxAPScanResults) results = maxAPScanResults;
|
||||||
|
|
||||||
for (int i = 0; i < results && i < maxAPScanResults; i++) {
|
if (debug) Serial.println("Scan results: "+(String)results);
|
||||||
|
|
||||||
|
for (int i = 0; i < results; i++) {
|
||||||
Mac _ap;
|
Mac _ap;
|
||||||
_ap.set(WiFi.BSSID(i)[0], WiFi.BSSID(i)[1], WiFi.BSSID(i)[2], WiFi.BSSID(i)[3], WiFi.BSSID(i)[4], WiFi.BSSID(i)[5]);
|
_ap.set(WiFi.BSSID(i)[0], WiFi.BSSID(i)[1], WiFi.BSSID(i)[2], WiFi.BSSID(i)[3], WiFi.BSSID(i)[4], WiFi.BSSID(i)[5]);
|
||||||
aps.add(_ap);
|
aps.add(_ap);
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
#include <FS.h>
|
#include <FS.h>
|
||||||
|
|
||||||
#define resetPin 4 /* <-- comment out or change if you need GPIO 4 for other purposes */
|
#define resetPin 4 /* <-- comment out or change if you need GPIO 4 for other purposes */
|
||||||
//#define USE_DISPLAY /* <-- uncomment that if you want to use the display */
|
#define USE_DISPLAY /* <-- uncomment that if you want to use the display */
|
||||||
//#define USE_LED16 /* <-- for the Pocket ESP8266 which has a LED on GPIO 16 to indicate if it's running */
|
//#define USE_LED16 /* <-- for the Pocket ESP8266 which has a LED on GPIO 16 to indicate if it's running */
|
||||||
|
|
||||||
#ifdef USE_DISPLAY
|
#ifdef USE_DISPLAY
|
||||||
@@ -94,7 +94,7 @@ void drawInterface() {
|
|||||||
if (i == 0) display.drawString(3, i * fontSize, " --> WiFi " + wifiMode);
|
if (i == 0) display.drawString(3, i * fontSize, " --> WiFi " + wifiMode);
|
||||||
else if (i == 1) display.drawString(3, i * fontSize, " --> " + scanMode);
|
else if (i == 1) display.drawString(3, i * fontSize, " --> " + scanMode);
|
||||||
else if (i == 2) display.drawString(3, i * fontSize, " --> " + attackMode + " attack");
|
else if (i == 2) display.drawString(3, i * fontSize, " --> " + attackMode + " attack");
|
||||||
else if (i - 3 <= apScan.results) {
|
else if (i - 3 < apScan.results) {
|
||||||
display.drawString(3, _lrow * fontSize, apScan.getAPName(i - 3));
|
display.drawString(3, _lrow * fontSize, apScan.getAPName(i - 3));
|
||||||
if (apScan.getAPSelected(i - 3)) {
|
if (apScan.getAPSelected(i - 3)) {
|
||||||
display.drawVerticalLine(1, _lrow * fontSize, fontSize);
|
display.drawVerticalLine(1, _lrow * fontSize, fontSize);
|
||||||
@@ -603,7 +603,8 @@ void loop() {
|
|||||||
|
|
||||||
// ===== SELECT =====
|
// ===== SELECT =====
|
||||||
} else if (buttonPressed == 2) {
|
} else if (buttonPressed == 2) {
|
||||||
//WiFi on/off
|
|
||||||
|
// ===== WiFi on/off =====
|
||||||
if (curRow == 0) {
|
if (curRow == 0) {
|
||||||
if (wifiMode == "ON") stopWifi();
|
if (wifiMode == "ON") stopWifi();
|
||||||
else startWifi();
|
else startWifi();
|
||||||
|
|||||||
Reference in New Issue
Block a user