error handling and cleanup
This commit is contained in:
36
main/sntp.h
36
main/sntp.h
@ -1,11 +1,37 @@
|
||||
/**
|
||||
* @file sntp.h
|
||||
* @brief SNTP client for time synchronization.
|
||||
*
|
||||
* This module synchronizes system time with an NTP server.
|
||||
* Time sync is required for schedule-based heating control.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "esp_err.h"
|
||||
|
||||
/**
|
||||
* @brief SNTP synchronization state enumeration.
|
||||
*/
|
||||
typedef enum _SntpState
|
||||
{
|
||||
SYNC_SUCCESSFUL,
|
||||
SYNC_NOT_STARTED,
|
||||
SYNC_FAILED,
|
||||
SYNC_SUCCESSFUL, /**< Time synchronized successfully. */
|
||||
SYNC_NOT_STARTED, /**< Synchronization not yet attempted. */
|
||||
SYNC_FAILED, /**< Synchronization failed. */
|
||||
} eSntpState;
|
||||
|
||||
void initSntp(void);
|
||||
eSntpState getSntpState(void);
|
||||
/**
|
||||
* @brief Initialize the SNTP client.
|
||||
*
|
||||
* Configures SNTP with the server from Kconfig and starts
|
||||
* periodic time synchronization.
|
||||
*
|
||||
* @return ESP_OK on success, ESP_FAIL on error.
|
||||
*/
|
||||
esp_err_t initSntp(void);
|
||||
|
||||
/**
|
||||
* @brief Get the current SNTP synchronization state.
|
||||
* @return eSntpState indicating sync status.
|
||||
*/
|
||||
eSntpState getSntpState(void);
|
||||
|
||||
Reference in New Issue
Block a user