Skip to content

Commit

Permalink
fix: wifi reset issue when STA cannot be found
Browse files Browse the repository at this point in the history
  • Loading branch information
ZanzyTHEbar committed Dec 21, 2023
1 parent fede284 commit 2a67bb8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions NetworkManager/src/network/wifihandler/wifi_handler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ void WiFiHandler::begin() {
Serial.print(
"Could not connect to the hardcoded "
"network, setting up ADHOC network \n\r");
this->setUpADHOC();
this->configManager.setState(this->getName(),
WiFiState_e::WiFiState_ADHOC);
return;
}

Expand Down Expand Up @@ -67,12 +68,11 @@ void WiFiHandler::begin() {
log_e(
"Could not connect to the hardcoded network, "
"setting up adhoc. \n\r");
this->setUpADHOC();
this->configManager.setState(this->getName(), WiFiState_e::WiFiState_ADHOC);
}

void WiFiHandler::adhoc(const std::string& ssid, uint8_t channel,
const std::string& password) {
this->configManager.setState(this->getName(), WiFiState_e::WiFiState_ADHOC);
log_i("\n[INFO]: Setting Access Point...\n");
log_i("\n[INFO]: Configuring access point...\n");
WiFi.mode(WIFI_AP);
Expand Down

0 comments on commit 2a67bb8

Please sign in to comment.