Skip to content

Commit bb50717

Browse files
author
Mika Leppänen
committed
Updated lwip API and configuration files to lwip 2.0
1 parent 5f7a953 commit bb50717

File tree

5 files changed

+372
-71
lines changed

5 files changed

+372
-71
lines changed

features/net/FEATURE_IPV4/lwip-interface/EthernetInterface.cpp

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,17 +59,29 @@ const char *EthernetInterface::get_mac_address()
5959

6060
const char *EthernetInterface::get_ip_address()
6161
{
62-
return lwip_get_ip_address();
62+
if (lwip_get_ip_address(_ip_address, sizeof _ip_address)) {
63+
return _ip_address;
64+
}
65+
66+
return 0;
6367
}
6468

6569
const char *EthernetInterface::get_netmask()
6670
{
67-
return lwip_get_netmask();
71+
if (lwip_get_netmask(_netmask, sizeof _netmask)) {
72+
return _netmask;
73+
}
74+
75+
return 0;
6876
}
6977

7078
const char *EthernetInterface::get_gateway()
7179
{
72-
return lwip_get_gateway();
80+
if (lwip_get_gateway(_gateway, sizeof _gateway)) {
81+
return _gateway;
82+
}
83+
84+
return 0;
7385
}
7486

7587
NetworkStack *EthernetInterface::get_stack()

features/net/FEATURE_IPV4/lwip-interface/EthernetInterface.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ class EthernetInterface : public EthInterface
9292
*/
9393
virtual const char *get_netmask();
9494

95-
/** Get the local gateway
95+
/** Get the local gateways
9696
*
9797
* @return Null-terminated representation of the local gateway
9898
* or null if no network mask has been recieved
@@ -107,7 +107,7 @@ class EthernetInterface : public EthInterface
107107
virtual NetworkStack *get_stack();
108108

109109
bool _dhcp;
110-
char _ip_address[NSAPI_IPv4_SIZE];
110+
char _ip_address[IPADDR_STRLEN_MAX];
111111
char _netmask[NSAPI_IPv4_SIZE];
112112
char _gateway[NSAPI_IPv4_SIZE];
113113
};

0 commit comments

Comments
 (0)