|
From: | Ray Martin |
Subject: | [lwip-users] Reconnect cable to a DIFFERENT network |
Date: | Mon, 4 Feb 2013 09:22:54 -0800 |
Hello,
I poll the PHY chip to detect the Link state and call netif_set_link_down (or up) when it changes. I’m able to disconnect then reconnect the cable to the same network and everything magically continues to work even if the connection used DHCP. In other words, I don’t reset the PHY or close my original TCP and UDP ports but they’re still able to receive and send packets after the reconnect.
But what happens if I reconnect the cable to a completely different network? I can’t assume that network supports the DHCP address granted by the other network. It seems I should reset the PHY to reestablish Link, negotiate the protocol/speed of the new network then call dhcp_start. But I’d like to avoid doing this if it’s the same network since it seems to work fine if I don’t. Plus, if it’s the same network, I should also go through a dhcp_release and dhcp_stop sequence of the old IP first. Another reason to avoid resetting and restarting everything is if Link was briefly lost due to a cable glitch.
Could someone please outline and explain the approved LWIP and PHY sequence when reconnecting the cable to a different network or the same network? Is there a way to detect if the cable was connected to a different network or the same network and not just that the Link state changed?
Ray Martin
[Prev in Thread] | Current Thread | [Next in Thread] |