Skip to content

Commit

Permalink
stop lwIP dhcp client when WiFi goes off. (#5703)
Browse files Browse the repository at this point in the history
* stop lwIP dhcp client with WiFi goes off.

* stop dhcp-client when really unused
  • Loading branch information
d-a-v authored and devyte committed Feb 1, 2019
1 parent 3f8cd46 commit 1cacf92
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions libraries/ESP8266WiFi/src/ESP8266WiFiGeneric.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,11 @@ bool ESP8266WiFiGenericClass::mode(WiFiMode_t m) {

bool ret = false;

if (m != WIFI_STA && m != WIFI_AP_STA)
// calls lwIP's dhcp_stop(),
// safe to call even if not started
wifi_station_dhcpc_stop();

ETS_UART_INTR_DISABLE();
if(_persistent) {
ret = wifi_set_opmode(m);
Expand Down

0 comments on commit 1cacf92

Please sign in to comment.