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>
This commit was merged in pull request #30.
This commit is contained in:
2026-05-10 12:39:47 +02:00
committed by Hendrik Schutter
parent 085f5b4acb
commit a7d577a948
16 changed files with 930 additions and 399 deletions
+31 -5
View File
@@ -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);