I have 2 questions concerning FreeRTOS_NetworkDown() in FreeRTOS+TCP.
1) 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 FreeRTOSNetworkDown()? That way the application can get notified whenever this happens, either through vApplicationIPNetworkEventHook() or FreeRTOSIsNetworkUp(). The application can then resume or restart the entire TCP-stack in a proper manner once the ethernet link is recovered.
2) 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?
To question 1) Yes. The network event hook can process both "network up" and "network down" events. The events come from the portable layer (network interface) rather than the generic code that runs on all architectures. Not sure there are examples in our distributions.
2) I don't see a problem with calling NetworkDown here.
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.