mirror of https://github.com/ARMmbed/mbed-os.git
Added handling for already connected sockets in LWIPInterface::connect
parent
9eac5102fd
commit
df5c05f38c
|
@ -94,6 +94,11 @@ static void set_mac_address(void)
|
|||
/* Interface implementation */
|
||||
int LWIPInterface::connect()
|
||||
{
|
||||
// Check if we've already connected
|
||||
if (get_ip_address()) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Set up network
|
||||
set_mac_address();
|
||||
init_netif(0, 0, 0);
|
||||
|
@ -118,6 +123,8 @@ int LWIPInterface::disconnect()
|
|||
dhcp_stop(&netif);
|
||||
|
||||
eth_arch_disable_interrupts();
|
||||
ip_addr[0] = '\0';
|
||||
mac_addr[0] = '\0';
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue