Is there any usage of pfGetPhyLinkStatus anywhere? It doesn’t appear to be used in code
Is there a proper way to check link status from the application? (vApplicationIPNetworkEventHook_Multi does not report link status rather network status)
I don’t know if I have a suggestion, but it seems funny to have pfGetPhyLinkStatus() in the api, but it never actually is used by the ip stack. It also seems a bit of an unknown to be calling this from user API, is it a thread safe call necessarily?
In my particular scenario, I have wifi and ethernet option, they connect to the same network, so I really just want wifi to turn off if ethernet is available. By the time the ethernet stack is up, the wifi was already connected, so In my case I really just want wifi to turn off when a cable is plugged in.
Here is what I’ve done, I don’t know if it is thread ready, as bInterfaceUp isn’t volatile.
case BUSEV_100_MS_TICK:
ret = xInterfaceETH.bits.bInterfaceUp;
if (ret != isEthernetUp) {
isEthernetUp = ret;
if (isEthernetUp) {
activeEndpoint = &xEndPointETH;
MULTI_TRACE(("ETH UP\n"));
} else {
activeEndpoint = &xEndPointWLAN;
MULTI_TRACE(("ETH DN\n"));
}
event_value_t* out = eventAlloc(
sizeof(event_value_t), BUSEV_ETHLINK_STATUS, BUS_PUBLISHER_NET);
out->value = ret;
publishEvent((event_t*)out, false);
vARPAgeCache();
}
break