File tree Expand file tree Collapse file tree 7 files changed +12
-10
lines changed Expand file tree Collapse file tree 7 files changed +12
-10
lines changed Original file line number Diff line number Diff line change @@ -206,6 +206,7 @@ uint32_t wifiGetStartTimeout() {return 0;}
206
206
int wifiNetworkCount () {return 0 ;}
207
207
void wifiResetThrottleTimeout () {}
208
208
void wifiResetTimeout () {}
209
+ #define WIFI_SOFT_AP_RUNNING () {return false ;}
209
210
bool wifiStart () {return false ;}
210
211
bool wifiStationIsRunning () {return false ;}
211
212
#define WIFI_STOP () {}
Original file line number Diff line number Diff line change @@ -519,7 +519,7 @@ IPAddress networkGetIpAddress()
519
519
IPAddress ip;
520
520
521
521
// NETIF doesn't capture the IP address of a soft AP
522
- if (wifiApIsRunning () == true && wifiStationIsRunning () == false )
522
+ if (WIFI_SOFT_AP_RUNNING () == true && wifiStationIsRunning () == false )
523
523
return WiFi.softAPIP ();
524
524
525
525
// Get the networkInterfaceTable index
@@ -1491,7 +1491,7 @@ void networkUpdate()
1491
1491
if ((networkHasInternet () == false ) && (consumerTypes & (1 << NETCONSUMER_CELLULAR)))
1492
1492
{
1493
1493
// If we're in AP only mode (no internet), don't start cellular
1494
- if (wifiApIsRunning () == false )
1494
+ if (WIFI_SOFT_AP_RUNNING () == false )
1495
1495
{
1496
1496
// Don't start cellular until WiFi has failed to connect
1497
1497
if (wifiUnavailable () == true )
Original file line number Diff line number Diff line change @@ -308,6 +308,7 @@ RTK_WIFI wifi(false);
308
308
309
309
#define WIFI_IS_CONNECTED () wifiIsConnected()
310
310
#define WIFI_IS_RUNNING () wifiIsRunning()
311
+ #define WIFI_SOFT_AP_RUNNING () wifiApIsRunning()
311
312
#define WIFI_STOP () \
312
313
{ \
313
314
if (settings.debugWifiState ) \
Original file line number Diff line number Diff line change @@ -391,7 +391,7 @@ void tcpServerUpdate()
391
391
tcpServerStop ();
392
392
393
393
// Wait until the network is connected to the media
394
- else if (networkHasInternet () || wifiApIsRunning ())
394
+ else if (networkHasInternet () || WIFI_SOFT_AP_RUNNING ())
395
395
{
396
396
// Delay before starting the TCP server
397
397
if ((millis () - tcpServerTimer) >= (1 * 1000 ))
@@ -409,7 +409,7 @@ void tcpServerUpdate()
409
409
// Handle client connections and link failures
410
410
case TCP_SERVER_STATE_RUNNING:
411
411
// Determine if the network has failed
412
- if ((networkHasInternet () == false && wifiApIsRunning () == false ) || (!settings.enableTcpServer && !settings.baseCasterOverride ))
412
+ if ((networkHasInternet () == false && WIFI_SOFT_AP_RUNNING () == false ) || (!settings.enableTcpServer && !settings.baseCasterOverride ))
413
413
{
414
414
if ((settings.debugTcpServer || PERIODIC_DISPLAY (PD_TCP_SERVER_DATA)) && (!inMainMenu))
415
415
{
Original file line number Diff line number Diff line change @@ -335,7 +335,7 @@ void udpServerUpdate()
335
335
udpServerStop ();
336
336
337
337
// Wait until the network is connected
338
- else if (networkHasInternet () || wifiApIsRunning ())
338
+ else if (networkHasInternet () || WIFI_SOFT_AP_RUNNING ())
339
339
{
340
340
// Delay before starting the UDP server
341
341
if ((millis () - udpServerTimer) >= (1 * 1000 ))
@@ -353,7 +353,7 @@ void udpServerUpdate()
353
353
// Handle client connections and link failures
354
354
case UDP_SERVER_STATE_RUNNING:
355
355
// Determine if the network has failed
356
- if ((networkHasInternet () == false && wifiApIsRunning () == false ) || (!settings.enableUdpServer && !settings.baseCasterOverride ))
356
+ if ((networkHasInternet () == false && WIFI_SOFT_AP_RUNNING () == false ) || (!settings.enableUdpServer && !settings.baseCasterOverride ))
357
357
{
358
358
if ((settings.debugUdpServer || PERIODIC_DISPLAY (PD_UDP_SERVER_DATA)) && (!inMainMenu))
359
359
{
Original file line number Diff line number Diff line change @@ -779,7 +779,7 @@ void webServerUpdate()
779
779
// Wait for connection to the network
780
780
case WEBSERVER_STATE_WAIT_FOR_NETWORK:
781
781
// Wait until the network is connected to the internet or has WiFi AP
782
- if (networkHasInternet () || wifiApIsRunning ())
782
+ if (networkHasInternet () || WIFI_SOFT_AP_RUNNING ())
783
783
{
784
784
if (settings.debugWebServer )
785
785
systemPrintln (" Web Server connected to network" );
@@ -791,7 +791,7 @@ void webServerUpdate()
791
791
// Start the web server
792
792
case WEBSERVER_STATE_NETWORK_CONNECTED: {
793
793
// Determine if the network has failed
794
- if (networkHasInternet () == false && wifiApIsRunning () == false )
794
+ if (networkHasInternet () == false && WIFI_SOFT_AP_RUNNING () == false )
795
795
webServerStop ();
796
796
if (settings.debugWebServer )
797
797
systemPrintln (" Assigning web server resources" );
@@ -807,7 +807,7 @@ void webServerUpdate()
807
807
// Allow web services
808
808
case WEBSERVER_STATE_RUNNING:
809
809
// Determine if the network has failed
810
- if (networkHasInternet () == false && wifiApIsRunning () == false )
810
+ if (networkHasInternet () == false && WIFI_SOFT_AP_RUNNING () == false )
811
811
webServerStop ();
812
812
813
813
// This state is exited when webServerStop() is called
Original file line number Diff line number Diff line change @@ -3127,7 +3127,7 @@ bool wifiStart()
3127
3127
3128
3128
// If we are in AP only mode, as long as the AP is started, return true
3129
3129
if (WiFi.getMode () == WIFI_MODE_AP)
3130
- return (wifiApIsRunning );
3130
+ return WIFI_SOFT_AP_RUNNING ( );
3131
3131
3132
3132
// If we are in STA or AP+STA mode, return if the station connected successfully
3133
3133
wifiStatus = WiFi.status ();
You can’t perform that action at this time.
0 commit comments