Skip to content

Commit 1cacf92

Browse files
d-a-vdevyte
authored andcommitted
stop lwIP dhcp client when WiFi goes off. (#5703)
* stop lwIP dhcp client with WiFi goes off. * stop dhcp-client when really unused
1 parent 3f8cd46 commit 1cacf92

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

libraries/ESP8266WiFi/src/ESP8266WiFiGeneric.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -389,6 +389,11 @@ bool ESP8266WiFiGenericClass::mode(WiFiMode_t m) {
389389

390390
bool ret = false;
391391

392+
if (m != WIFI_STA && m != WIFI_AP_STA)
393+
// calls lwIP's dhcp_stop(),
394+
// safe to call even if not started
395+
wifi_station_dhcpc_stop();
396+
392397
ETS_UART_INTR_DISABLE();
393398
if(_persistent) {
394399
ret = wifi_set_opmode(m);

0 commit comments

Comments
 (0)