Skip to content

Commit

Permalink
Wifi enabled plumbed in (#1677)
Browse files Browse the repository at this point in the history
* Wifi enabled

* Wifi requires reboot

* Increment DEVICESTATE_CUR_VER
  • Loading branch information
thebentern authored Sep 6, 2022
1 parent cb3010b commit e87ecc2
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/mesh/NodeDB.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ DeviceState versions used to be defined in the .proto file but really only this
#define here.
*/

#define DEVICESTATE_CUR_VER 15
#define DEVICESTATE_CUR_VER 16
#define DEVICESTATE_MIN_VER DEVICESTATE_CUR_VER

extern DeviceState devicestate;
Expand Down
4 changes: 2 additions & 2 deletions src/mesh/http/WiFiAPClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ static int32_t reconnectWiFi()
const char *wifiName = config.wifi.ssid;
const char *wifiPsw = config.wifi.psk;

if (needReconnect && !WiFi.isConnected()) {
if (config.wifi.enabled && needReconnect && !WiFi.isConnected()) {
// if (radioConfig.has_preferences && needReconnect && !WiFi.isConnected()) {

if (!*wifiPsw) // Treat empty password as no password
Expand Down Expand Up @@ -184,7 +184,7 @@ bool initWifi(bool forceSoftAP)
{
forcedSoftAP = forceSoftAP;

if ((config.wifi.ssid[0]) || forceSoftAP) {
if (config.wifi.enabled && ((config.wifi.ssid[0]) || forceSoftAP)) {
// if ((radioConfig.has_preferences && config.wifi.ssid[0]) || forceSoftAP) {
const char *wifiName = config.wifi.ssid;
const char *wifiPsw = config.wifi.psk;
Expand Down
1 change: 1 addition & 0 deletions src/modules/AdminModule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ void AdminModule::handleSetConfig(const Config &c)
DEBUG_MSG("Setting config: WiFi\n");
config.has_wifi = true;
config.wifi = c.payloadVariant.wifi;
requiresReboot = true;
break;
case Config_display_tag:
DEBUG_MSG("Setting config: Display\n");
Expand Down

0 comments on commit e87ecc2

Please sign in to comment.