mirror of https://github.com/ARMmbed/mbed-os.git
Fixed behaviour of get_ip_address and get_mac_address for LWIPInterface
per the socket API documentation: /** Get the local IP address * * @return Null-terminated representation of the local IP address * or null if not yet connected */ virtual const char *get_ip_address() = 0; LWIPInterface incorrectly returned "\0" if unconnected
parent
1e12b83e56
commit
a506973d0f
|
@ -124,12 +124,12 @@ int LWIPInterface::disconnect()
|
||||||
|
|
||||||
const char *LWIPInterface::get_ip_address()
|
const char *LWIPInterface::get_ip_address()
|
||||||
{
|
{
|
||||||
return ip_addr;
|
return ip_addr[0] ? ip_addr : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *LWIPInterface::get_mac_address()
|
const char *LWIPInterface::get_mac_address()
|
||||||
{
|
{
|
||||||
return mac_addr;
|
return mac_addr[0] ? mac_addr : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct lwip_socket {
|
struct lwip_socket {
|
||||||
|
|
Loading…
Reference in New Issue