Skip to content

Commit

Permalink
Allow DHCP client to be re-enabled using WiFi.config(0U, 0U, 0U) (esp…
Browse files Browse the repository at this point in the history
  • Loading branch information
igrr committed Jun 12, 2016
1 parent 17c02ff commit 00065ac
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions libraries/ESP8266WiFi/src/ESP8266WiFiSTA.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,12 @@ bool ESP8266WiFiSTAClass::config(IPAddress local_ip, IPAddress gateway, IPAddres
info.gw.addr = static_cast<uint32_t>(gateway);
info.netmask.addr = static_cast<uint32_t>(subnet);

if (local_ip == 0U && gateway == 0U && subnet == 0U) {
_useStaticIp = false;
wifi_station_dhcpc_start();
return true;
}

wifi_station_dhcpc_stop();
if(wifi_set_ip_info(STATION_IF, &info)) {
_useStaticIp = true;
Expand Down

0 comments on commit 00065ac

Please sign in to comment.