component/tcpip_adapter: not update dhcps status when it is stopped after mode switch

When switch the mode from WIFI_MODE_STA/WIFI_MODE_NULL to WIFI_MODE_AP/WIFI_MODE_APSTA,
if the dhcp server is STOPPED, then dhcp server will not start automatically.
This commit is contained in:
liuzhifu 2016-10-25 09:26:10 +08:00
parent beff3aab81
commit 700ed63651

View File

@ -103,7 +103,9 @@ esp_err_t tcpip_adapter_stop(tcpip_adapter_if_t tcpip_if)
if (tcpip_if == TCPIP_ADAPTER_IF_AP) { if (tcpip_if == TCPIP_ADAPTER_IF_AP) {
dhcps_stop(esp_netif[tcpip_if]); // TODO: dhcps checks status by its self dhcps_stop(esp_netif[tcpip_if]); // TODO: dhcps checks status by its self
dhcps_status = TCPIP_ADAPTER_DHCP_INIT; if (TCPIP_ADAPTER_DHCP_STOPPED != dhcps_status){
dhcps_status = TCPIP_ADAPTER_DHCP_INIT;
}
} else if (tcpip_if == TCPIP_ADAPTER_IF_STA) { } else if (tcpip_if == TCPIP_ADAPTER_IF_STA) {
dhcp_release(esp_netif[tcpip_if]); dhcp_release(esp_netif[tcpip_if]);
dhcp_stop(esp_netif[tcpip_if]); dhcp_stop(esp_netif[tcpip_if]);