esp32/tcpipadapter: correct eth ip got event info

1. Raise SYSTEM_EVENT_ETH_GOT_IP when eth got ip
2. Add default handler for SYSTEM_EVENT_ETH_GOT_IP
3. Minor change about ethernet kconfig
This commit is contained in:
Liu Zhi Fu
2017-10-12 20:24:02 +08:00
parent 6ff5c32ae5
commit e04a0d66b8
3 changed files with 21 additions and 4 deletions

View File

@@ -756,8 +756,13 @@ static void tcpip_adapter_dhcpc_cb(struct netif *netif)
ip4_addr_set(&ip_info->gw, ip_2_ip4(&netif->gw));
//notify event
evt.event_id = SYSTEM_EVENT_STA_GOT_IP;
evt.event_info.got_ip.ip_changed = false;
if (tcpip_if == TCPIP_ADAPTER_IF_ETH) {
evt.event_id = SYSTEM_EVENT_ETH_GOT_IP;
evt.event_info.got_ip.ip_changed = true;
} else {
evt.event_id = SYSTEM_EVENT_STA_GOT_IP;
evt.event_info.got_ip.ip_changed = false;
}
if (memcmp(ip_info, ip_info_old, sizeof(tcpip_adapter_ip_info_t))) {
evt.event_info.got_ip.ip_changed = true;