File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
libraries/lwIP_Ethernet/src Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change 5050#define DEFAULT_MTU 1500
5151#endif
5252
53+ enum EthernetLinkStatus {
54+ Unknown,
55+ LinkON,
56+ LinkOFF
57+ };
5358
5459extern " C" void cyw43_hal_generate_laa_mac (__unused int idx, uint8_t buf[6 ]);
5560
@@ -149,6 +154,9 @@ class LwipIntfDev: public LwipIntf, public RawDev {
149154
150155 wl_status_t status ();
151156
157+ // Arduino Ethernet compatibility
158+ EthernetLinkStatus linkStatus ();
159+
152160protected:
153161 err_t netif_init ();
154162 void check_route ();
@@ -442,6 +450,11 @@ wl_status_t LwipIntfDev<RawDev>::status() {
442450 return _started ? (connected () ? WL_CONNECTED : WL_DISCONNECTED) : WL_NO_SHIELD;
443451}
444452
453+ template <class RawDev >
454+ EthernetLinkStatus LwipIntfDev<RawDev>::linkStatus() {
455+ return RawDev::isLinkDetectable () ? _started && RawDev::isLinked () ? LinkON : LinkOFF : Unknown;
456+ }
457+
445458template <class RawDev >
446459err_t LwipIntfDev<RawDev>::linkoutput_s(netif* netif, struct pbuf * pbuf) {
447460 LwipIntfDev* lid = (LwipIntfDev*)netif->state ;
You can’t perform that action at this time.
0 commit comments