|
|
@ -90,12 +90,9 @@ class AhoyNetwork { |
|
|
|
} |
|
|
|
|
|
|
|
#if !defined(ETHERNET) |
|
|
|
bool getAvailNetworks(JsonObject obj) { |
|
|
|
bool getAvailNetworks(JsonObject obj, IApp *app) { |
|
|
|
if(!mScanActive) { |
|
|
|
mScanActive = true; |
|
|
|
if(NetworkState::GOT_IP != mStatus) |
|
|
|
WiFi.disconnect(); |
|
|
|
WiFi.scanNetworks(true, true); |
|
|
|
app->addOnce([this]() {scan();}, 1, F("scan")); |
|
|
|
return false; |
|
|
|
} |
|
|
|
|
|
|
@ -117,6 +114,13 @@ class AhoyNetwork { |
|
|
|
|
|
|
|
return true; |
|
|
|
} |
|
|
|
|
|
|
|
void scan(void) { |
|
|
|
mScanActive = true; |
|
|
|
if(NetworkState::GOT_IP != mStatus) |
|
|
|
WiFi.disconnect(); |
|
|
|
WiFi.scanNetworks(true, true); |
|
|
|
} |
|
|
|
#endif |
|
|
|
|
|
|
|
protected: |
|
|
|