Skip to content

Commit

Permalink
finalizing testing the aditional wifi info on select network
Browse files Browse the repository at this point in the history
  • Loading branch information
GabriWar authored Feb 22, 2025
1 parent 2a710dd commit 9ad82ca
Showing 1 changed file with 19 additions and 14 deletions.
33 changes: 19 additions & 14 deletions src/core/wifi_common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,21 +105,26 @@ bool wifiConnectMenu(wifi_mode_t mode)
break;

case WIFI_STA: // station mode
int nets;
WiFi.mode(WIFI_MODE_STA);
displayTextLine("Scanning..");
nets = WiFi.scanNetworks();
options = {};
for (int i = 0; i < nets; i++) {
options.emplace_back(
WiFi.SSID(i).c_str(), [=]() { _wifiConnect(WiFi.SSID(i), int(WiFi.encryptionType(i))); }
);
}
options.emplace_back("Hidden SSID",[=](){ String __ssid=keyboard("", 32, "Your SSID"); _wifiConnect(__ssid.c_str(),8); });
options.emplace_back( "Main Menu", [=](){ backToMenu(); });

loopOptions(options);
int nets;
WiFi.mode(WIFI_MODE_STA);
displayTextLine("Scanning..");
nets = WiFi.scanNetworks();
options = {};
for (int i = 0; i < nets; i++) {
String ssid = WiFi.SSID(i);
int encryptionType = WiFi.encryptionType(i);
int32_t rssi = WiFi.RSSI(i);

// Check if the network is secured
String encryptionPrefix = (encryptionType == WIFI_AUTH_OPEN) ? "" : "#";
String optionText = encryptionPrefix + ssid + " (" + String(rssi) + ")";

options.emplace_back(optionText.c_str(), [=]() { _wifiConnect(ssid, encryptionType); });
}
options.emplace_back("Hidden SSID",[=](){ String __ssid=keyboard("", 32, "Your SSID"); _wifiConnect(__ssid.c_str(),8); });
options.emplace_back("Main Menu", [=](){ backToMenu(); });

loopOptions(options);
break;

case WIFI_AP_STA: // repeater mode
Expand Down

0 comments on commit 9ad82ca

Please # to comment.