Good afternoon,
As mentioned in topic, I'm trying to detect moment of ethernet cable plug in and out from my application - I need this to immediately disconnect from wifi when cable is connected.
I'm using wiznet W5500 module and nrf5340. I have no network issues on this setup.
Here is what i already tried:
1) Detecting net events like NET_EVENT_L4_CONNECTED or NET_EVENT_L4_DISCONNECTED
This works only once - when cable connected and dhcp ip address assigned. After this events will not be triggered ever (nor for connect and disconnect).
2) Waiting for specific network event using net_mgmt_event_wait_on_iface.
The same behaviour as in point 1.
3) Checking flags like net_if_flag_is_set(netif_get_interface(LAN_KEY), NET_IF_LOWER_UP).
None of this flag is being ever updated.
For all my tests i used code and .conf from NRF SDK samples. None of this were success however :/
Maybe you guys can help me, I guess there are some different ways doing that I am missing here.
Maybe there is simplier way of managing wifi/eth connection without detecting cablke plug in?
Thanks! Damian.