mirror of
https://github.com/espressif/esp-idf.git
synced 2026-10-02 11:10:54 +03:00
feat(esp_netif): Support posting event on SNTP time update
This commit is contained in:
committed by
David Čermák
parent
6bfcd4b41c
commit
787bb39765
@@ -17,6 +17,29 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief SNTP event base for esp-netif
|
||||
*/
|
||||
ESP_EVENT_DECLARE_BASE(NETIF_SNTP_EVENT);
|
||||
|
||||
/**
|
||||
* @brief Event IDs for NETIF_SNTP_EVENT
|
||||
*/
|
||||
typedef enum {
|
||||
NETIF_SNTP_TIME_SYNC = 0, /**< System time synchronized via SNTP */
|
||||
} esp_netif_sntp_event_t;
|
||||
|
||||
/**
|
||||
* @brief Event payload for NETIF_SNTP_TIME_SYNC
|
||||
*
|
||||
* The event data passed to handlers registered for
|
||||
* `NETIF_SNTP_EVENT`/`NETIF_SNTP_TIME_SYNC` is a pointer to this struct.
|
||||
*/
|
||||
typedef struct esp_netif_sntp_time_sync {
|
||||
struct timeval tv; ///< Time of synchronization as reported by SNTP
|
||||
} esp_netif_sntp_time_sync_t;
|
||||
|
||||
|
||||
/**
|
||||
* @brief Time sync notification function
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user