plek324 wrote on Thursday, June 07, 2018:
Hi,
I have 2 questions concerning FreeRTOS_NetworkDown() in FreeRTOS+TCP.
- I have written an ethernet driver for the RX63N. My driver is highly based on the examples/implementations for other controllers. It works fine for a while now, but now I’m looking to the situations when somethings happen on the network, like the cable getting unplugged.
I see checks on the link status in the EMAC handlers, but shouldn’t there be a call made to FreeRTOS_NetworkDown()? That way the application can get notified whenever this happens, either through vApplicationIPNetworkEventHook() or FreeRTOS_IsNetworkUp(). The application can then resume or restart the entire TCP-stack in a proper manner once the ethernet link is recovered.
- After the user makes a change to the IP setting, like change the IP address or enabling/disabling DHCP, I also want to reset the TCP-stack, so I can start using the new settings without having to restart the entire device. Calling FreeRTOS_NetworkDown() seems to do the trick here, but it feels a bit naughty, since this is not an API call. Is there another way to achieve the same in a officially supported way?