Skip to content

Commit 2c10e0e

Browse files
fixing retrocompatibility issues
1 parent 0c210ee commit 2c10e0e

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

libraries/WiFi/src/WiFi.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,7 @@ IPAddress CWifi::localIP() { //FIXME
177177
// return IPAddress(ni->getIpAdd());
178178
// }
179179
// return IPAddress((uint32_t)0);
180+
return WiFiStation.localIP();
180181
}
181182

182183
/* -------------------------------------------------------------------------- */
@@ -186,6 +187,7 @@ IPAddress CWifi::subnetMask() { // FIXME
186187
// return IPAddress(ni->getNmAdd());
187188
// }
188189
// return IPAddress((uint32_t)0);
190+
return WiFiStation.subnetMask();
189191
}
190192

191193
/* -------------------------------------------------------------------------- */
@@ -195,6 +197,7 @@ IPAddress CWifi::gatewayIP() { // FIXME
195197
// return IPAddress(ni->getGwAdd());
196198
// }
197199
// return IPAddress((uint32_t)0);
200+
return WiFiStation.gatewayIP();
198201
}
199202

200203
/* -------------------------------------------------------------------------- */

libraries/lwIpWrapper/src/CNetIf.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,13 @@ class CNetIf: public NetworkInterface {
148148
uint32_t getNmAdd() { return ip4_addr_get_u32(&(ni.netmask)); }
149149
uint32_t getGwAdd() { return ip4_addr_get_u32(&(ni.gw)); }
150150

151+
// FIXME when dhcp has not provided an ip address yet return IPADDR_NONE
152+
IPAddress localIP() { return IPAddress(this->getIpAdd()); }
153+
IPAddress subnetMask() { return IPAddress(this->getNmAdd()); }
154+
IPAddress gatewayIP() { return IPAddress(this->getGwAdd()); }
155+
IPAddress dnsServerIP() { /* FIXME understand where dns should be managed */}
156+
157+
// FIXME hostname should be defined in the NetworkStack singleton
151158
// void setHostname(const char* name)
152159
// {
153160
// memset(hostname, 0x00, MAX_HOSTNAME_DIM);

0 commit comments

Comments
 (0)