mirror of
https://github.com/IoTManagerProject/IoTManager.git
synced 2026-03-26 22:22:16 +03:00
асинхронный скан сети по запросу веба
This commit is contained in:
@@ -146,6 +146,7 @@ void setup() {
|
||||
jsonRead(settingsFlashJson, "pinSDA", pinSDA, false);
|
||||
jsonRead(settingsFlashJson, "i2cFreq", i2cFreq, false);
|
||||
jsonRead(settingsFlashJson, "i2c", i2c, false);
|
||||
jsonWriteStr_(ssidListHeapJson, "0", "Scaning...");
|
||||
if (i2c != 0) {
|
||||
#ifdef ESP32
|
||||
Wire.end();
|
||||
|
||||
@@ -177,8 +177,15 @@ void webSocketEvent(uint8_t num, WStype_t type, uint8_t* payload, size_t length)
|
||||
jsonReadArray(settingsFlashJson, "routerssid", jArray);
|
||||
#ifdef ESP8266
|
||||
RouterFind(jArray);
|
||||
#endif
|
||||
sendStringToWs("ssidli", ssidListHeapJson, num);
|
||||
#else
|
||||
//String ssidScan = "{Scaning...}";
|
||||
ssidListHeapJson = "{}";
|
||||
jsonWriteStr_(ssidListHeapJson, "0", "Scaning...");
|
||||
sendStringToWs("ssidli", ssidListHeapJson, num);
|
||||
ScanAsync();
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------//
|
||||
|
||||
@@ -120,7 +120,7 @@ void handleScanResults()
|
||||
connectNumNet = i;
|
||||
}
|
||||
}
|
||||
|
||||
sendStringToWs("ssidli", ssidListHeapJson, -1);
|
||||
// if
|
||||
}
|
||||
SerialPrint("i", "WIFI", "Scan Found: " + ssidListHeapJson);
|
||||
|
||||
Reference in New Issue
Block a user