mirror of
https://github.com/justcallmekoko/ESP32Marauder.git
synced 2025-12-23 07:29:14 -08:00
Join with saved wifi credentials
This commit is contained in:
@@ -1367,6 +1367,7 @@ void CommandLine::runCommand(String input) {
|
||||
else if (cmd_args.get(0) == JOIN_CMD) {
|
||||
int ap_sw = this->argSearch(&cmd_args, "-a");
|
||||
int pw_sw = this->argSearch(&cmd_args, "-p");
|
||||
int s_sw = this->argSearch(&cmd_args, "-s");
|
||||
|
||||
if ((ap_sw != -1) && (pw_sw != -1)) {
|
||||
int index = cmd_args.get(ap_sw + 1).toInt();
|
||||
@@ -1381,6 +1382,20 @@ void CommandLine::runCommand(String input) {
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
else if (s_sw != -1) {
|
||||
String ssid = settings_obj.loadSetting<String>("ClientSSID");
|
||||
String pw = settings_obj.loadSetting<String>("ClientPW");
|
||||
|
||||
if ((ssid != "") && (pw != "")) {
|
||||
wifi_scan_obj.joinWiFi(ssid, pw, false);
|
||||
#ifdef HAS_SCREEN
|
||||
menu_function_obj.changeMenu(menu_function_obj.current_menu);
|
||||
#endif
|
||||
}
|
||||
else {
|
||||
Serial.println("There are no saved WiFi credentials");
|
||||
}
|
||||
}
|
||||
else {
|
||||
Serial.println("You did not provide the proper args");
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user