mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
Examples/lwip: sntp example - Make SNTP server configurable
Also updates NTP example test to allow more attempts
This commit is contained in:
parent
696acf5e3f
commit
020047b0f9
@ -15,7 +15,7 @@ def test_examples_sntp(env, extra_data):
|
||||
|
||||
dut.expect_all('Time is not set yet. Connecting to WiFi and getting time over NTP.',
|
||||
'Initializing SNTP',
|
||||
'Waiting for system time to be set... (1/10)',
|
||||
re.compile(r'Waiting for system time to be set... \(\d+/\d+\)'),
|
||||
'Notification of a time synchronization event',
|
||||
timeout=60)
|
||||
|
||||
|
@ -1,5 +1,11 @@
|
||||
menu "Example Configuration"
|
||||
|
||||
config SNTP_TIME_SERVER
|
||||
string "SNTP server name"
|
||||
default "pool.ntp.org"
|
||||
help
|
||||
Hostname of the main SNTP server.
|
||||
|
||||
choice SNTP_TIME_SYNC_METHOD
|
||||
prompt "Time synchronization method"
|
||||
default SNTP_TIME_SYNC_METHOD_IMMED
|
||||
|
@ -183,8 +183,8 @@ static void initialize_sntp(void)
|
||||
#endif /* LWIP_IPV6 */
|
||||
|
||||
#else /* LWIP_DHCP_GET_NTP_SRV && (SNTP_MAX_SERVERS > 1) */
|
||||
// otherwise use DNS address from a pool
|
||||
sntp_setservername(0, "pool.ntp.org");
|
||||
// otherwise, use DNS address from a pool
|
||||
sntp_setservername(0, CONFIG_SNTP_TIME_SERVER);
|
||||
#endif
|
||||
|
||||
sntp_set_time_sync_notification_cb(time_sync_notification_cb);
|
||||
|
Loading…
x
Reference in New Issue
Block a user