Skip to content

Commit 0deb516

Browse files
committed
Network: Add fileName & lineNumber to networkInterfaceEventInternetLost
1 parent c54d506 commit 0deb516

File tree

4 files changed

+15
-8
lines changed

4 files changed

+15
-8
lines changed

Firmware/RTK_Everywhere/Cellular.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ void cellularEvent(arduino_event_id_t event)
8787
if (networkInterfaceHasInternet(NETWORK_CELLULAR) && (event != ARDUINO_EVENT_ETH_GOT_IP) &&
8888
(event != ARDUINO_EVENT_ETH_GOT_IP6) && (event != ARDUINO_EVENT_PPP_CONNECTED))
8989
{
90-
networkInterfaceEventInternetLost(NETWORK_CELLULAR);
90+
networkInterfaceEventInternetLost(NETWORK_CELLULAR, __FILE__, __LINE__);
9191
}
9292

9393
// Cellular State Machine

Firmware/RTK_Everywhere/Ethernet.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ void ethernetEvent(arduino_event_id_t event, arduino_event_info_t info)
199199
// Take the network offline if necessary
200200
if (event != ARDUINO_EVENT_ETH_GOT_IP)
201201
{
202-
networkInterfaceEventInternetLost((NetIndex_t)NETWORK_ETHERNET);
202+
networkInterfaceEventInternetLost((NetIndex_t)NETWORK_ETHERNET, __FILE__, __LINE__);
203203
}
204204
}
205205

Firmware/RTK_Everywhere/Network.ino

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1070,11 +1070,18 @@ void networkInterfaceEventInternetAvailable(NetIndex_t index)
10701070
//----------------------------------------
10711071
// Internet lost event
10721072
//----------------------------------------
1073-
void networkInterfaceEventInternetLost(NetIndex_t index)
1073+
void networkInterfaceEventInternetLost(NetIndex_t index,
1074+
const char * fileName,
1075+
uint32_t lineNumber)
10741076
{
10751077
// Validate the index
10761078
networkValidateIndex(index);
10771079

1080+
// Display the call
1081+
if (settings.debugNetworkLayer)
1082+
systemPrintf("Network: Calling networkInterfaceEventInternetLost(%s) from %s at line %d\r\n",
1083+
networkInterfaceTable[index].name, fileName, lineNumber);
1084+
10781085
// Notify networkUpdate of the change in state
10791086
if (settings.debugNetworkLayer)
10801087
systemPrintf("%s lost internet access event\r\n", networkInterfaceTable[index].name);

Firmware/RTK_Everywhere/WiFi.ino

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,7 @@ void menuWiFi()
441441
if (wifiRestartRequested)
442442
{
443443
// Fake the loss of the IP address
444-
networkInterfaceEventInternetLost(NETWORK_WIFI_STATION);
444+
networkInterfaceEventInternetLost(NETWORK_WIFI_STATION, __FILE__, __LINE__);
445445
wifiReconnectRequest = true;
446446
}
447447

@@ -845,7 +845,7 @@ void wifiStationRestart(NetIndex_t index, uintptr_t parameter, bool debug)
845845
{
846846
// Fake a WiFi failure
847847
networkConsumerReconnect(NETWORK_WIFI_STATION);
848-
networkInterfaceEventInternetLost(NETWORK_WIFI_STATION);
848+
networkInterfaceEventInternetLost(NETWORK_WIFI_STATION, __FILE__, __LINE__);
849849

850850
// Clear the bits to perform the restart operation
851851
wifi.clearStarted(WIFI_STA_RECONNECT);
@@ -880,7 +880,7 @@ void wifiStopAll()
880880
wifi.enable(false, false, false, __FILE__, __LINE__);
881881

882882
// Take the network offline
883-
networkInterfaceEventInternetLost(NETWORK_WIFI_STATION);
883+
networkInterfaceEventInternetLost(NETWORK_WIFI_STATION, __FILE__, __LINE__);
884884

885885
// Display the heap state
886886
reportHeapNow(settings.debugWifiState);
@@ -1780,7 +1780,7 @@ void RTK_WIFI::stationEventHandler(arduino_event_id_t event, arduino_event_info_
17801780
// Start the reconnection timer
17811781
if (event == ARDUINO_EVENT_WIFI_STA_DISCONNECTED)
17821782
{
1783-
networkInterfaceEventInternetLost(NETWORK_WIFI_STATION);
1783+
networkInterfaceEventInternetLost(NETWORK_WIFI_STATION, __FILE__, __LINE__);
17841784
wifiReconnectRequest = true;
17851785
}
17861786

@@ -1805,7 +1805,7 @@ void RTK_WIFI::stationEventHandler(arduino_event_id_t event, arduino_event_info_
18051805
case ARDUINO_EVENT_WIFI_STA_LOST_IP:
18061806
if (event == ARDUINO_EVENT_WIFI_STA_LOST_IP)
18071807
{
1808-
networkInterfaceEventInternetLost(NETWORK_WIFI_STATION);
1808+
networkInterfaceEventInternetLost(NETWORK_WIFI_STATION, __FILE__, __LINE__);
18091809
wifiReconnectRequest = true;
18101810
}
18111811

0 commit comments

Comments
 (0)