LwipIntfDev - linkStatus added (#2081)
This commit is contained in:
parent
c62215663f
commit
2a256f9c25
1 changed files with 13 additions and 0 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue