lwip menuconfig option for max number of SNTP servers

LWIP has two definess for setting max number of sntp servers:
 - Total number of handled servers
 - max number of sntp's picked via DHCP

by default both values are equal to 1, but could be set separately

Signed-off-by: Emil Muratov <gpm@hotplug.ru>
pull/7336/head
Emil Muratov 2021-07-22 23:26:05 +03:00
rodzic 166c30e7b2
commit 80810971c8
2 zmienionych plików z 14 dodań i 1 usunięć

Wyświetl plik

@ -837,7 +837,7 @@ menu "LWIP"
menu "SNTP" menu "SNTP"
config LWIP_DHCP_MAX_NTP_SERVERS config LWIP_SNTP_MAX_SERVERS
int "Maximum number of NTP servers" int "Maximum number of NTP servers"
default 1 default 1
range 1 16 range 1 16
@ -846,6 +846,14 @@ menu "LWIP"
First argument of sntp_setserver/sntp_setservername functions First argument of sntp_setserver/sntp_setservername functions
is limited to this value. is limited to this value.
config LWIP_DHCP_MAX_NTP_SERVERS
int "Maximum number of NTP servers aquired via DHCP"
default 1
range 1 16
help
Set maximum number of NTP servers aquired via DHCP-offer.
Must be less or equal to total "Maximum number of NTP servers".
config LWIP_SNTP_UPDATE_DELAY config LWIP_SNTP_UPDATE_DELAY
int "Request interval to update time (ms)" int "Request interval to update time (ms)"
range 15000 4294967295 range 15000 4294967295

Wyświetl plik

@ -1074,6 +1074,11 @@ LWIP_FORWARD_DECLARE_C_CXX void sntp_sync_time(struct timeval *tv);
LWIP_FORWARD_DECLARE_C_CXX uint32_t sntp_get_sync_interval(void); LWIP_FORWARD_DECLARE_C_CXX uint32_t sntp_get_sync_interval(void);
// Max number of SNTP servers handled (default equal to LWIP_DHCP_MAX_NTP_SERVERS)
#if CONFIG_LWIP_SNTP_MAX_SERVERS_DEFINED && !defined SNTP_MAX_SERVERS
#define SNTP_MAX_SERVERS CONFIG_LWIP_SNTP_MAX_SERVERS
#endif // CONFIG_LWIP_SNTP_MAX_SERVERS_DEFINED
/** Set this to 1 to support DNS names (or IP address strings) to set sntp servers /** Set this to 1 to support DNS names (or IP address strings) to set sntp servers
* One server address/name can be defined as default if SNTP_SERVER_DNS == 1: * One server address/name can be defined as default if SNTP_SERVER_DNS == 1:
* \#define SNTP_SERVER_ADDRESS "pool.ntp.org" * \#define SNTP_SERVER_ADDRESS "pool.ntp.org"