fix(netif): Add missing SNTP get-reachablitiy API

This commit is contained in:
David Cermak
2024-05-29 17:10:07 +08:00
committed by David Čermák
parent 8cd37950c7
commit d5f086f432
6 changed files with 89 additions and 6 deletions
+13 -1
View File
@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2022-2024 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@@ -177,3 +177,15 @@ esp_err_t esp_netif_sntp_start(void)
{
return esp_netif_tcpip_exec(sntp_start_api, NULL);
}
esp_err_t esp_netif_sntp_reachability(unsigned int index, unsigned int *reachability)
{
if (index >= SNTP_MAX_SERVERS || reachability == NULL) {
return ESP_ERR_INVALID_ARG;
}
if (s_storage == NULL || sntp_enabled() == 0) {
return ESP_ERR_INVALID_STATE;
}
*reachability = sntp_getreachability(index);
return ESP_OK;
}