@@ -1070,11 +1070,18 @@ void networkInterfaceEventInternetAvailable(NetIndex_t index)
1070
1070
// ----------------------------------------
1071
1071
// Internet lost event
1072
1072
// ----------------------------------------
1073
- void networkInterfaceEventInternetLost (NetIndex_t index)
1073
+ void networkInterfaceEventInternetLost (NetIndex_t index,
1074
+ const char * fileName,
1075
+ uint32_t lineNumber)
1074
1076
{
1075
1077
// Validate the index
1076
1078
networkValidateIndex (index );
1077
1079
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
+
1078
1085
// Notify networkUpdate of the change in state
1079
1086
if (settings.debugNetworkLayer )
1080
1087
systemPrintf (" %s lost internet access event\r\n " , networkInterfaceTable[index ].name );
@@ -1178,7 +1185,7 @@ void networkInterfaceInternetConnectionAvailable(NetIndex_t index)
1178
1185
{
1179
1186
// Stop the previous network
1180
1187
systemPrintf (" Stopping %s\r\n " , networkGetNameByIndex (index ));
1181
- networkSequenceStop (index , settings.debugNetworkLayer );
1188
+ networkSequenceStop (index , settings.debugNetworkLayer , __FILE__, __LINE__ );
1182
1189
}
1183
1190
}
1184
1191
@@ -1195,7 +1202,9 @@ void networkInterfaceInternetConnectionAvailable(NetIndex_t index)
1195
1202
// ----------------------------------------
1196
1203
// Mark network interface as having NO access to the internet
1197
1204
// ----------------------------------------
1198
- void networkInterfaceInternetConnectionLost (NetIndex_t index)
1205
+ void networkInterfaceInternetConnectionLost (NetIndex_t index,
1206
+ const char * fileName,
1207
+ uint32_t lineNumber)
1199
1208
{
1200
1209
NetMask_t bitMask;
1201
1210
NetPriority_t previousPriority;
@@ -1204,6 +1213,11 @@ void networkInterfaceInternetConnectionLost(NetIndex_t index)
1204
1213
// Validate the index
1205
1214
networkValidateIndex (index );
1206
1215
1216
+ // Display the call
1217
+ if (settings.debugNetworkLayer )
1218
+ systemPrintf (" Network: Calling networkInterfaceInternetConnectionLost(%s) from %s at line %d\r\n " ,
1219
+ networkInterfaceTable[index ].name , fileName, lineNumber);
1220
+
1207
1221
// Clear the event flag
1208
1222
networkEventInternetLost[index ] = false ;
1209
1223
@@ -1562,10 +1576,18 @@ void networkSequenceBoot(NetIndex_t index)
1562
1576
// ----------------------------------------
1563
1577
// Exit the sequence by force
1564
1578
// ----------------------------------------
1565
- void networkSequenceExit (NetIndex_t index, bool debug)
1579
+ void networkSequenceExit (NetIndex_t index,
1580
+ bool debug,
1581
+ const char * fileName,
1582
+ uint32_t lineNumber)
1566
1583
{
1584
+ // Display the call
1585
+ if (settings.debugNetworkLayer )
1586
+ systemPrintf (" Network: Calling networkSequenceExit(%s) from %s at line %d\r\n " ,
1587
+ networkInterfaceTable[index ].name , fileName, lineNumber);
1588
+
1567
1589
// Stop the polling for this sequence
1568
- networkSequenceStopPolling (index , debug, true );
1590
+ networkSequenceStopPolling (index , debug, true , __FILE__, __LINE__ );
1569
1591
}
1570
1592
1571
1593
// ----------------------------------------
@@ -1621,13 +1643,16 @@ void networkSequenceNextEntry(NetIndex_t index, bool debug)
1621
1643
1622
1644
// Termination entry found, stop the sequence or start next sequence
1623
1645
else
1624
- networkSequenceStopPolling (index , debug, false );
1646
+ networkSequenceStopPolling (index , debug, false , __FILE__, __LINE__ );
1625
1647
}
1626
1648
1627
1649
// ----------------------------------------
1628
1650
// Attempt to start the start sequence
1629
1651
// ----------------------------------------
1630
- void networkSequenceStart (NetIndex_t index, bool debug)
1652
+ void networkSequenceStart (NetIndex_t index,
1653
+ bool debug,
1654
+ const char * fileName,
1655
+ uint32_t lineNumber)
1631
1656
{
1632
1657
NetMask_t bitMask;
1633
1658
const char *description;
@@ -1636,6 +1661,11 @@ void networkSequenceStart(NetIndex_t index, bool debug)
1636
1661
// Validate the index
1637
1662
networkValidateIndex (index );
1638
1663
1664
+ // Display the call
1665
+ if (settings.debugNetworkLayer )
1666
+ systemPrintf (" Network: Calling networkSequenceStart(%s) from %s at line %d\r\n " ,
1667
+ networkInterfaceTable[index ].name , fileName, lineNumber);
1668
+
1639
1669
// Set the network bit
1640
1670
bitMask = 1 << index ;
1641
1671
@@ -1706,7 +1736,10 @@ void networkSequenceStart(NetIndex_t index, bool debug)
1706
1736
// ----------------------------------------
1707
1737
// Start the stop sequence
1708
1738
// ----------------------------------------
1709
- void networkSequenceStop (NetIndex_t index, bool debug)
1739
+ void networkSequenceStop (NetIndex_t index,
1740
+ bool debug,
1741
+ const char * fileName,
1742
+ uint32_t lineNumber)
1710
1743
{
1711
1744
NetMask_t bitMask;
1712
1745
const char *description;
@@ -1715,6 +1748,11 @@ void networkSequenceStop(NetIndex_t index, bool debug)
1715
1748
// Validate the index
1716
1749
networkValidateIndex (index );
1717
1750
1751
+ // Display the call
1752
+ if (settings.debugNetworkLayer )
1753
+ systemPrintf (" Network: Calling networkSequenceStop(%s) from %s at line %d\r\n " ,
1754
+ networkInterfaceTable[index ].name , fileName, lineNumber);
1755
+
1718
1756
// Set the network bit
1719
1757
bitMask = 1 << index ;
1720
1758
@@ -1784,14 +1822,27 @@ void networkSequenceStop(NetIndex_t index, bool debug)
1784
1822
// ----------------------------------------
1785
1823
// Stop the polling sequence
1786
1824
// ----------------------------------------
1787
- void networkSequenceStopPolling (NetIndex_t index, bool debug, bool forcedStop)
1825
+ void networkSequenceStopPolling (NetIndex_t index,
1826
+ bool debug,
1827
+ bool forcedStop,
1828
+ const char * fileName,
1829
+ uint32_t lineNumber)
1788
1830
{
1789
1831
NetMask_t bitMask;
1790
1832
bool start;
1791
1833
1792
1834
// Validate the index
1793
1835
networkValidateIndex (index );
1794
1836
1837
+ // Display the call
1838
+ if (settings.debugNetworkLayer )
1839
+ systemPrintf (" Network: Calling networkSequenceStopPolling(%s, debug: %s, forcedStop: %s) from %s at line %d\r\n " ,
1840
+ networkInterfaceTable[index ].name ,
1841
+ debug ? " true" : " false" ,
1842
+ forcedStop ? " true" : " false" ,
1843
+ fileName,
1844
+ lineNumber);
1845
+
1795
1846
// Stop the polling for this sequence
1796
1847
networkSequence[index ] = nullptr ;
1797
1848
bitMask = 1 << index ;
@@ -1855,9 +1906,9 @@ void networkSequenceStopPolling(NetIndex_t index, bool debug, bool forcedStop)
1855
1906
1856
1907
// Start the next sequence
1857
1908
if (start)
1858
- networkSequenceStart (index , debug);
1909
+ networkSequenceStart (index , debug, __FILE__, __LINE__ );
1859
1910
else
1860
- networkSequenceStop (index , debug);
1911
+ networkSequenceStop (index , debug, __FILE__, __LINE__ );
1861
1912
}
1862
1913
}
1863
1914
@@ -2017,7 +2068,7 @@ void networkStart(NetIndex_t index, bool debug, const char * fileName, uint32_t
2017
2068
{
2018
2069
if (debug)
2019
2070
systemPrintf (" Starting network: %s\r\n " , networkGetNameByIndex (index ));
2020
- networkSequenceStart (index , debug);
2071
+ networkSequenceStart (index , debug, __FILE__, __LINE__ );
2021
2072
}
2022
2073
}
2023
2074
else if (debug)
@@ -2098,7 +2149,7 @@ void networkStop(NetIndex_t index, bool debug, const char * fileName, uint32_t l
2098
2149
{
2099
2150
if (debug)
2100
2151
systemPrintf (" Stopping network: %s\r\n " , networkGetNameByIndex (index ));
2101
- networkSequenceStop (index , debug);
2152
+ networkSequenceStop (index , debug, __FILE__, __LINE__ );
2102
2153
}
2103
2154
}
2104
2155
}
@@ -2192,7 +2243,7 @@ void networkUpdate()
2192
2243
// Handle the network lost internet event
2193
2244
if (networkEventInternetLost[index ])
2194
2245
{
2195
- networkInterfaceInternetConnectionLost (index );
2246
+ networkInterfaceInternetConnectionLost (index , __FILE__, __LINE__ );
2196
2247
2197
2248
// Attempt to restart WiFi
2198
2249
if ((index == NETWORK_WIFI_STATION) && (networkIsHighestPriority (index )))
@@ -2441,7 +2492,7 @@ void networkVerifyPriority(NetIndex_t index, uintptr_t parameter, bool debug)
2441
2492
if (debug)
2442
2493
systemPrintf (" %s: Value %d > %d, indicating lower priority, stopping device!\r\n " ,
2443
2494
networkInterfaceTable[index ].name , interfacePriority, networkPriority);
2444
- networkSequenceExit (index , debug);
2495
+ networkSequenceExit (index , debug, __FILE__, __LINE__ );
2445
2496
}
2446
2497
2447
2498
// This device is still the highest priority, continue the delay and
0 commit comments