Files
smart-oil-heating-control-s…/main/sntp.h
T
localhorst a7d577a948 Error handling on system boot (#30)
Implements #3

Reviewed-on: #30
Co-authored-by: localhorst <localhorst@mosad.xyz>
Co-committed-by: localhorst <localhorst@mosad.xyz>
2026-05-10 12:39:47 +02:00

38 lines
873 B
C

/**
* @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, /**< Time synchronized successfully. */
SYNC_NOT_STARTED, /**< Synchronization not yet attempted. */
SYNC_FAILED, /**< Synchronization failed. */
} eSntpState;
/**
* @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);