Skip to content

Commit 0cd1e77

Browse files
committed
WiFi: Replace wifiApIsRunning with WIFI_SOFT_AP_RUNNING
1 parent 7b0e01a commit 0cd1e77

File tree

7 files changed

+12
-10
lines changed

7 files changed

+12
-10
lines changed

Firmware/RTK_Everywhere/Developer.ino

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,7 @@ uint32_t wifiGetStartTimeout() {return 0;}
206206
int wifiNetworkCount() {return 0;}
207207
void wifiResetThrottleTimeout() {}
208208
void wifiResetTimeout() {}
209+
#define WIFI_SOFT_AP_RUNNING() {return false;}
209210
bool wifiStart() {return false;}
210211
bool wifiStationIsRunning() {return false;}
211212
#define WIFI_STOP() {}

Firmware/RTK_Everywhere/Network.ino

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -519,7 +519,7 @@ IPAddress networkGetIpAddress()
519519
IPAddress ip;
520520

521521
// 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)
523523
return WiFi.softAPIP();
524524

525525
// Get the networkInterfaceTable index
@@ -1491,7 +1491,7 @@ void networkUpdate()
14911491
if ((networkHasInternet() == false) && (consumerTypes & (1 << NETCONSUMER_CELLULAR)))
14921492
{
14931493
// If we're in AP only mode (no internet), don't start cellular
1494-
if (wifiApIsRunning() == false)
1494+
if (WIFI_SOFT_AP_RUNNING() == false)
14951495
{
14961496
// Don't start cellular until WiFi has failed to connect
14971497
if (wifiUnavailable() == true)

Firmware/RTK_Everywhere/RTK_Everywhere.ino

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,7 @@ RTK_WIFI wifi(false);
308308

309309
#define WIFI_IS_CONNECTED() wifiIsConnected()
310310
#define WIFI_IS_RUNNING() wifiIsRunning()
311+
#define WIFI_SOFT_AP_RUNNING() wifiApIsRunning()
311312
#define WIFI_STOP() \
312313
{ \
313314
if (settings.debugWifiState) \

Firmware/RTK_Everywhere/TcpServer.ino

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,7 @@ void tcpServerUpdate()
391391
tcpServerStop();
392392

393393
// Wait until the network is connected to the media
394-
else if (networkHasInternet() || wifiApIsRunning())
394+
else if (networkHasInternet() || WIFI_SOFT_AP_RUNNING())
395395
{
396396
// Delay before starting the TCP server
397397
if ((millis() - tcpServerTimer) >= (1 * 1000))
@@ -409,7 +409,7 @@ void tcpServerUpdate()
409409
// Handle client connections and link failures
410410
case TCP_SERVER_STATE_RUNNING:
411411
// 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))
413413
{
414414
if ((settings.debugTcpServer || PERIODIC_DISPLAY(PD_TCP_SERVER_DATA)) && (!inMainMenu))
415415
{

Firmware/RTK_Everywhere/UdpServer.ino

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ void udpServerUpdate()
335335
udpServerStop();
336336

337337
// Wait until the network is connected
338-
else if (networkHasInternet() || wifiApIsRunning())
338+
else if (networkHasInternet() || WIFI_SOFT_AP_RUNNING())
339339
{
340340
// Delay before starting the UDP server
341341
if ((millis() - udpServerTimer) >= (1 * 1000))
@@ -353,7 +353,7 @@ void udpServerUpdate()
353353
// Handle client connections and link failures
354354
case UDP_SERVER_STATE_RUNNING:
355355
// 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))
357357
{
358358
if ((settings.debugUdpServer || PERIODIC_DISPLAY(PD_UDP_SERVER_DATA)) && (!inMainMenu))
359359
{

Firmware/RTK_Everywhere/WebServer.ino

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -779,7 +779,7 @@ void webServerUpdate()
779779
// Wait for connection to the network
780780
case WEBSERVER_STATE_WAIT_FOR_NETWORK:
781781
// Wait until the network is connected to the internet or has WiFi AP
782-
if (networkHasInternet() || wifiApIsRunning())
782+
if (networkHasInternet() || WIFI_SOFT_AP_RUNNING())
783783
{
784784
if (settings.debugWebServer)
785785
systemPrintln("Web Server connected to network");
@@ -791,7 +791,7 @@ void webServerUpdate()
791791
// Start the web server
792792
case WEBSERVER_STATE_NETWORK_CONNECTED: {
793793
// Determine if the network has failed
794-
if (networkHasInternet() == false && wifiApIsRunning() == false)
794+
if (networkHasInternet() == false && WIFI_SOFT_AP_RUNNING() == false)
795795
webServerStop();
796796
if (settings.debugWebServer)
797797
systemPrintln("Assigning web server resources");
@@ -807,7 +807,7 @@ void webServerUpdate()
807807
// Allow web services
808808
case WEBSERVER_STATE_RUNNING:
809809
// Determine if the network has failed
810-
if (networkHasInternet() == false && wifiApIsRunning() == false)
810+
if (networkHasInternet() == false && WIFI_SOFT_AP_RUNNING() == false)
811811
webServerStop();
812812

813813
// This state is exited when webServerStop() is called

Firmware/RTK_Everywhere/WiFi.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3127,7 +3127,7 @@ bool wifiStart()
31273127

31283128
// If we are in AP only mode, as long as the AP is started, return true
31293129
if (WiFi.getMode() == WIFI_MODE_AP)
3130-
return (wifiApIsRunning);
3130+
return WIFI_SOFT_AP_RUNNING();
31313131

31323132
// If we are in STA or AP+STA mode, return if the station connected successfully
31333133
wifiStatus = WiFi.status();

0 commit comments

Comments
 (0)