Skip to content

Commit 028c1e8

Browse files
committed
Stop WiFi network if it loses connectivity.
1 parent 2c77152 commit 028c1e8

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

Firmware/RTK_Everywhere/Network.ino

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1344,13 +1344,11 @@ void networkUpdate()
13441344
networkStop(index, settings.debugNetworkLayer);
13451345
}
13461346

1347-
// Allow consumers to re-start networks
1347+
// Allow consumers to start networks
1348+
// Each network is expected to shut itself down if it is unavailable or of a lower priority
1349+
// so that a networkStart() succeeds.
13481350
if (networkConsumers() > 0 && networkIsOnline() == false)
13491351
{
1350-
// Stop any running networks
1351-
for (int index = 0; index < NETWORK_OFFLINE; index++)
1352-
networkStop(index, settings.debugNetworkLayer);
1353-
13541352
// Start network as needed
13551353
for (int index = 0; index < NETWORK_OFFLINE; index++)
13561354
networkStart(index, settings.debugNetworkLayer);

Firmware/RTK_Everywhere/WiFi.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ void wifiEvent(arduino_event_id_t event, arduino_event_info_t info)
292292
if (networkIsInterfaceOnline(NETWORK_WIFI) && (event != ARDUINO_EVENT_WIFI_STA_GOT_IP) &&
293293
(event != ARDUINO_EVENT_WIFI_STA_GOT_IP6))
294294
{
295-
networkMarkOffline(NETWORK_WIFI);
295+
networkStop(NETWORK_WIFI, settings.debugNetworkLayer); // Stop WiFi to allow it to restart
296296
}
297297

298298
// WiFi State Machine

0 commit comments

Comments
 (0)