8000 Allow DHCP client to be re-enabled using WiFi.config(0U, 0U, 0U) (#1896) · arduino/esp8266@00065ac · GitHub
[go: up one dir, main page]

Skip to content
< 8000 header class="HeaderMktg header-logged-out js-details-container js-header Details f4 py-3" role="banner" data-is-top="true" data-color-mode=light data-light-theme=light data-dark-theme=dark>

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 00065ac

Browse files
committed
Allow DHCP client to be re-enabled using WiFi.config(0U, 0U, 0U) (esp8266#1896)
1 parent 17c02ff commit 00065ac

File tree

1 changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

libraries/ESP8266WiFi/src/ESP8266WiFiSTA.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,12 @@ bool ESP8266WiFiSTAClass::config(IPAddress local_ip, IPAddress gateway, IPAddres
212212
info.gw.addr = static_cast<uint32_t>(gateway);
213213
info.netmask.addr = static_cast<uint32_t>(subnet);
214214

215+
if (local_ip == 0U && gateway == 0U && subnet == 0U) {
216+
_useStaticIp = false;
217+
wifi_station_dhcpc_start();
218+
return true;
219+
}
220+
215221
wifi_station_dhcpc_stop();
216222
if(wifi_set_ip_info(STATION_IF, &info)) {
217223
_useStaticIp = true;

0 commit comments

Comments
 (0)
0