@@ -91,7 +91,7 @@ void menuFirmware()
91
91
92
92
else if (incoming == ' c' )
93
93
{
94
- if (wifiNetworkCount () == 0 )
94
+ if (networkCanConnect () == false )
95
95
{
96
96
systemPrintln (" Error: Please enter at least one SSID before updating firmware" );
97
97
}
@@ -474,15 +474,14 @@ bool otaCheckVersion(char *versionAvailable, uint8_t versionAvailableLength)
474
474
bool wasInAPmode;
475
475
476
476
uint8_t networkType = networkGetActiveType ();
477
- if ((networkType == NETWORK_TYPE_WIFI)
478
- && (wifiNetworkCount () == 0 ))
477
+ if ((networkType == NETWORK_TYPE_WIFI) && (wifiNetworkCount () == 0 ))
479
478
{
480
479
systemPrintln (" Error: Please enter at least one SSID before getting keys" );
481
480
}
482
481
else
483
482
{
484
- if ((networkType != NETWORK_TYPE_WIFI)
485
- || ( wifiConnect (settings. wifiConnectTimeoutMs , true , &wasInAPmode) == true )) // Use WIFI_AP_STA if already in WIFI_AP mode
483
+ if ((networkType != NETWORK_TYPE_WIFI) || ( wifiConnect (settings. wifiConnectTimeoutMs , true , &wasInAPmode) ==
484
+ true )) // Use WIFI_AP_STA if already in WIFI_AP mode
486
485
{
487
486
char versionString[21 ];
488
487
getFirmwareVersion (versionString, sizeof (versionString), enableRCFirmware);
@@ -522,8 +521,9 @@ bool otaCheckVersion(char *versionAvailable, uint8_t versionAvailableLength)
522
521
523
522
if (systemState != STATE_WIFI_CONFIG)
524
523
{
525
- // WIFI_STOP() turns off the entire radio including the webserver. We need to turn off Station mode only.
526
- // For now, unit exits AP mode via reset so if we are in AP config mode, leave WiFi Station running.
524
+ // WIFI_STOP() turns off the entire radio including the webserver. We need to turn off Station mode
525
+ // only. For now, unit exits AP mode via reset so if we are in AP config mode, leave WiFi Station
526
+ // running.
527
527
528
528
// If WiFi was originally off, turn it off again
529
529
if (previouslyConnected == false )
@@ -579,7 +579,7 @@ void overTheAirUpdate()
579
579
systemPrintln (" OTA Update: Firmware server not available" );
580
580
else
581
581
systemPrintln (" OTA Update: OTA failed" );
582
- #endif // COMPILE_NETWORK
582
+ #endif // COMPILE_NETWORK
583
583
}
584
584
585
585
// Start WiFi and perform the over-the-air update
@@ -590,7 +590,8 @@ void otaUpdate()
590
590
591
591
bool wasInAPmode;
592
592
593
- if (wifiConnect (settings.wifiConnectTimeoutMs , true , &wasInAPmode) == true ) // Use WIFI_AP_STA if already in WIFI_AP mode
593
+ if (wifiConnect (settings.wifiConnectTimeoutMs , true , &wasInAPmode) ==
594
+ true ) // Use WIFI_AP_STA if already in WIFI_AP mode
594
595
overTheAirUpdate ();
595
596
596
597
// Update failed. If we were in WIFI_AP mode, return to WIFI_AP mode
0 commit comments