5 years ago.

IP address change notification

I'd would like to receive notifications when the IP address changes on a network interface. I tried using the attach method of the NetworkInterface class but it doesn't call the callback for changes while in the connected state. For example, the callback is not called when the IP address changes due to DHCP lease expiration.

I made some local changes to the netif_status_callback where it can move to connecting and back to connected when a new IP address is re-negotiated. This seems reasonable to me, but I'm not familiar with the mbed code.

I'd like to hear some feedback on whether the callback registered with NetworkInterface:attach could be used as a trigger to query the IP address from the NetworkInterface. If not, what would be a suggested method to get that information?

Be the first to answer this question.