@@ -1269,6 +1269,37 @@ void networkInterfaceInternetConnectionAvailable(NetIndex_t index)
1269
1269
networkMulticastDNSStart (previousIndex);
1270
1270
}
1271
1271
1272
+ /*
1273
+ Network Loss Handling:
1274
+
1275
+ Arduino IP lost event
1276
+ |
1277
+ |
1278
+ V
1279
+ networkInterfaceEventInternetLost
1280
+ |
1281
+ | Set internet lost event flag
1282
+ V
1283
+ networkUpdate
1284
+ |
1285
+ | Clear internet lost event flag
1286
+ V
1287
+ +<------- Fake connection loss
1288
+ |
1289
+ V
1290
+ networkInterfaceInternetConnectionLost
1291
+ |
1292
+ | Notify Interface of connection loss
1293
+ V
1294
+ .----------------+----------------.
1295
+ | |
1296
+ | |
1297
+ V V
1298
+ networkInterfaceRunning Interface stop sequence
1299
+ called by xxxUpdate
1300
+ or xxxEnabled
1301
+ */
1302
+
1272
1303
// ----------------------------------------
1273
1304
// Mark network interface as having NO access to the internet
1274
1305
// ----------------------------------------
@@ -1377,6 +1408,35 @@ void networkInterfaceInternetConnectionLost(NetIndex_t index)
1377
1408
}
1378
1409
}
1379
1410
1411
+ // ----------------------------------------
1412
+ // Get the interface priority
1413
+ // ----------------------------------------
1414
+ NetPriority_t networkInterfacePriority (NetIndex_t index)
1415
+ {
1416
+ NetPriority_t priority;
1417
+
1418
+ // Validate the index
1419
+ networkValidateIndex (index);
1420
+
1421
+ // Get the interface priority
1422
+ priority = networkIndexTable[index];
1423
+ return priority;
1424
+ }
1425
+
1426
+ // ----------------------------------------
1427
+ // Determine if the interface should be running
1428
+ // ----------------------------------------
1429
+ NetPriority_t networkInterfaceRunning (NetIndex_t index)
1430
+ {
1431
+ NetPriority_t priority;
1432
+
1433
+ // Get the interface priority
1434
+ priority = networkInterfacePriority (index);
1435
+
1436
+ // Return the running status
1437
+ return (networkPriority >= priority);
1438
+ }
1439
+
1380
1440
// ----------------------------------------
1381
1441
// Determine if the specified network interface is higher priority than
1382
1442
// the current network interface
0 commit comments