Fix the bug that the query reault is 'connected' when station is disconnected by input 'sta -D'
This commit is contained in:
parent
1325a761e9
commit
ccd60408b3
1 changed files with 9 additions and 10 deletions
|
@ -211,6 +211,7 @@ esp_err_t tcpip_adapter_addr_change_cb(struct netif *netif)
|
||||||
ip4_addr_set(&esp_ip[tcpip_if].gw, ip_2_ip4(&netif->gw));
|
ip4_addr_set(&esp_ip[tcpip_if].gw, ip_2_ip4(&netif->gw));
|
||||||
|
|
||||||
//notify event
|
//notify event
|
||||||
|
if ( !ip4_addr_cmp(ip_2_ip4(&netif->ip_addr), IP4_ADDR_ANY) ) {
|
||||||
evt.event_id = SYSTEM_EVENT_STA_GOTIP;
|
evt.event_id = SYSTEM_EVENT_STA_GOTIP;
|
||||||
memcpy(&evt.event_info.got_ip.ip, &esp_ip[tcpip_if].ip, sizeof(evt.event_info.got_ip.ip));
|
memcpy(&evt.event_info.got_ip.ip, &esp_ip[tcpip_if].ip, sizeof(evt.event_info.got_ip.ip));
|
||||||
memcpy(&evt.event_info.got_ip.netmask, &esp_ip[tcpip_if].netmask, sizeof(evt.event_info.got_ip.netmask));
|
memcpy(&evt.event_info.got_ip.netmask, &esp_ip[tcpip_if].netmask, sizeof(evt.event_info.got_ip.netmask));
|
||||||
|
@ -220,8 +221,6 @@ esp_err_t tcpip_adapter_addr_change_cb(struct netif *netif)
|
||||||
printf("ip: %s, ", inet_ntoa(esp_ip[tcpip_if].ip));
|
printf("ip: %s, ", inet_ntoa(esp_ip[tcpip_if].ip));
|
||||||
printf("mask: %s, ", inet_ntoa(esp_ip[tcpip_if].netmask));
|
printf("mask: %s, ", inet_ntoa(esp_ip[tcpip_if].netmask));
|
||||||
printf("gw: %s\n", inet_ntoa(esp_ip[tcpip_if].gw));
|
printf("gw: %s\n", inet_ntoa(esp_ip[tcpip_if].gw));
|
||||||
|
|
||||||
if (ip_2_ip4(&netif->ip_addr) != IP4_ADDR_ANY) {
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
TCPIP_ADAPTER_DEBUG("ip unchanged\n");
|
TCPIP_ADAPTER_DEBUG("ip unchanged\n");
|
||||||
|
|
Loading…
Reference in a new issue