@@ -586,30 +586,6 @@ const char *networkGetNameByPriority(NetPriority_t priority)
586
586
return " None" ;
587
587
}
588
588
589
- // ----------------------------------------
590
- // Determine if the network interface is online
591
- // ----------------------------------------
592
- bool networkInterfaceHasInternet (NetIndex_t index)
593
- {
594
- // Validate the index
595
- networkValidateIndex (index);
596
-
597
- // Return the network interface state
598
- return (networkHasInternet_bm & (1 << index)) ? true : false ;
599
- }
600
-
601
- // ----------------------------------------
602
- // Determine if the network interface has completed its start routine
603
- // ----------------------------------------
604
- bool networkIsInterfaceStarted (NetIndex_t index)
605
- {
606
- // Validate the index
607
- networkValidateIndex (index);
608
-
609
- // Return the network started state
610
- return (networkStarted & (1 << index)) ? true : false ;
611
- }
612
-
613
589
// ----------------------------------------
614
590
// Determine if any network interface is online
615
591
// ----------------------------------------
@@ -620,23 +596,23 @@ bool networkHasInternet()
620
596
}
621
597
622
598
// ----------------------------------------
623
- // Determine if the network is present on the platform
599
+ // Interface stop event
624
600
// ----------------------------------------
625
- bool networkIsPresent (NetIndex_t index)
601
+ void networkInterfaceEventStop (NetIndex_t index)
626
602
{
627
- // Validate the index
628
- networkValidateIndex (index);
629
-
630
- // Present if nullptr or bool set to true
631
- return ((!networkInterfaceTable[index].present ) || *(networkInterfaceTable[index].present ));
603
+ networkEventStop[index] = true ;
632
604
}
633
605
634
606
// ----------------------------------------
635
- // Interface stop event
607
+ // Determine if the network interface is online
636
608
// ----------------------------------------
637
- void networkInterfaceEventStop (NetIndex_t index)
609
+ bool networkInterfaceHasInternet (NetIndex_t index)
638
610
{
639
- networkEventStop[index] = true ;
611
+ // Validate the index
612
+ networkValidateIndex (index);
613
+
614
+ // Return the network interface state
615
+ return (networkHasInternet_bm & (1 << index)) ? true : false ;
640
616
}
641
617
642
618
// ----------------------------------------
@@ -780,6 +756,30 @@ void networkInterfaceEventInternetAvailable(NetIndex_t index)
780
756
networkMulticastDNSStart (previousIndex);
781
757
}
782
758
759
+ // ----------------------------------------
760
+ // Determine if the network interface has completed its start routine
761
+ // ----------------------------------------
762
+ bool networkIsInterfaceStarted (NetIndex_t index)
763
+ {
764
+ // Validate the index
765
+ networkValidateIndex (index);
766
+
767
+ // Return the network started state
768
+ return (networkStarted & (1 << index)) ? true : false ;
769
+ }
770
+
771
+ // ----------------------------------------
772
+ // Determine if the network is present on the platform
773
+ // ----------------------------------------
774
+ bool networkIsPresent (NetIndex_t index)
775
+ {
776
+ // Validate the index
777
+ networkValidateIndex (index);
778
+
779
+ // Present if nullptr or bool set to true
780
+ return ((!networkInterfaceTable[index].present ) || *(networkInterfaceTable[index].present ));
781
+ }
782
+
783
783
// ----------------------------------------
784
784
// Change multicast DNS to a given network
785
785
// ----------------------------------------
@@ -1326,42 +1326,6 @@ void networkStartDelayed(NetIndex_t index, uintptr_t parameter, bool debug)
1326
1326
}
1327
1327
}
1328
1328
1329
- // ----------------------------------------
1330
- // Validate the network index
1331
- // ----------------------------------------
1332
- void networkValidateIndex (NetIndex_t index)
1333
- {
1334
- // Validate the index
1335
- if (index >= NETWORK_OFFLINE)
1336
- {
1337
- systemPrintf (" HALTED: Invalid index value %d, valid range (0 - %d)!\r\n " , index, NETWORK_OFFLINE - 1 );
1338
- reportFatalError (" Invalid index value!" );
1339
- }
1340
- }
1341
-
1342
- // ----------------------------------------
1343
- // Validate the network priority
1344
- // ----------------------------------------
1345
- void networkValidatePriority (NetPriority_t priority)
1346
- {
1347
- // Validate the priority
1348
- if (priority >= NETWORK_OFFLINE)
1349
- {
1350
- systemPrintf (" HALTED: Invalid priority value %d, valid range (0 - %d)!\r\n " , priority, NETWORK_OFFLINE - 1 );
1351
- reportFatalError (" Invalid priority value!" );
1352
- }
1353
- }
1354
-
1355
- // ----------------------------------------
1356
- // Verify the network layer tables
1357
- // ----------------------------------------
1358
- void networkVerifyTables ()
1359
- {
1360
- // Verify the table lengths
1361
- if (NETWORK_OFFLINE != NETWORK_MAX)
1362
- reportFatalError (" Fix networkInterfaceTable to match NetworkType" );
1363
- }
1364
-
1365
1329
// ----------------------------------------
1366
1330
// Maintain the network connections
1367
1331
// ----------------------------------------
@@ -1570,6 +1534,42 @@ void networkUpdate()
1570
1534
}
1571
1535
}
1572
1536
1537
+ // ----------------------------------------
1538
+ // Validate the network index
1539
+ // ----------------------------------------
1540
+ void networkValidateIndex (NetIndex_t index)
1541
+ {
1542
+ // Validate the index
1543
+ if (index >= NETWORK_OFFLINE)
1544
+ {
1545
+ systemPrintf (" HALTED: Invalid index value %d, valid range (0 - %d)!\r\n " , index, NETWORK_OFFLINE - 1 );
1546
+ reportFatalError (" Invalid index value!" );
1547
+ }
1548
+ }
1549
+
1550
+ // ----------------------------------------
1551
+ // Validate the network priority
1552
+ // ----------------------------------------
1553
+ void networkValidatePriority (NetPriority_t priority)
1554
+ {
1555
+ // Validate the priority
1556
+ if (priority >= NETWORK_OFFLINE)
1557
+ {
1558
+ systemPrintf (" HALTED: Invalid priority value %d, valid range (0 - %d)!\r\n " , priority, NETWORK_OFFLINE - 1 );
1559
+ reportFatalError (" Invalid priority value!" );
1560
+ }
1561
+ }
1562
+
1563
+ // ----------------------------------------
1564
+ // Verify the network layer tables
1565
+ // ----------------------------------------
1566
+ void networkVerifyTables ()
1567
+ {
1568
+ // Verify the table lengths
1569
+ if (NETWORK_OFFLINE != NETWORK_MAX)
1570
+ reportFatalError (" Fix networkInterfaceTable to match NetworkType" );
1571
+ }
1572
+
1573
1573
// Return the bitfield containing the type of consumers currently using the network
1574
1574
uint16_t networkGetConsumerTypes ()
1575
1575
{
0 commit comments