lwip: DHCP restore last IP

Closes https://github.com/espressif/esp-idf/issues/799
This commit is contained in:
MartinValik
2018-08-29 10:22:54 +02:00
committed by Ivan Grokhotkov
parent 49125a87bb
commit 2e79baa1db
5 changed files with 146 additions and 0 deletions

View File

@@ -44,6 +44,8 @@
#include "esp_system.h"
#include "sdkconfig.h"
#include "netif/dhcp_state.h"
/* Enable all Espressif-only options */
/*
@@ -220,6 +222,19 @@
*/
#define DHCP_DOES_ARP_CHECK CONFIG_LWIP_DHCP_DOES_ARP_CHECK
/**
* CONFIG_LWIP_DHCP_RESTORE_LAST_IP==1: Last valid IP address obtained from DHCP server
* is restored after reset/power-up.
*/
#if CONFIG_LWIP_DHCP_RESTORE_LAST_IP
#define LWIP_DHCP_IP_ADDR_RESTORE() dhcp_ip_addr_restore(netif)
#define LWIP_DHCP_IP_ADDR_STORE() dhcp_ip_addr_store(netif)
#define LWIP_DHCP_IP_ADDR_ERASE() dhcp_ip_addr_erase(esp_netif[tcpip_if])
#endif
/*
------------------------------------
---------- AUTOIP options ----------