Unverified Commit 2a256f9c authored by Juraj Andrássy's avatar Juraj Andrássy Committed by GitHub

LwipIntfDev - linkStatus added (#2081)

parent c6221566
......@@ -50,6 +50,11 @@
#define DEFAULT_MTU 1500
#endif
enum EthernetLinkStatus {
Unknown,
LinkON,
LinkOFF
};
extern "C" void cyw43_hal_generate_laa_mac(__unused int idx, uint8_t buf[6]);
......@@ -149,6 +154,9 @@ public:
wl_status_t status();
// Arduino Ethernet compatibility
EthernetLinkStatus linkStatus();
protected:
err_t netif_init();
void check_route();
......@@ -442,6 +450,11 @@ wl_status_t LwipIntfDev<RawDev>::status() {
return _started ? (connected() ? WL_CONNECTED : WL_DISCONNECTED) : WL_NO_SHIELD;
}
template<class RawDev>
EthernetLinkStatus LwipIntfDev<RawDev>::linkStatus() {
return RawDev::isLinkDetectable() ? _started && RawDev::isLinked() ? LinkON : LinkOFF : Unknown;
}
template<class RawDev>
err_t LwipIntfDev<RawDev>::linkoutput_s(netif* netif, struct pbuf* pbuf) {
LwipIntfDev* lid = (LwipIntfDev*)netif->state;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment