IoT25S IoT Klocka 0.1
Grupparbete för IoT25S på Jensen YH
Loading...
Searching...
No Matches
time_service.h
Go to the documentation of this file.
1#pragma once
2
8#include <stdbool.h>
9#include <stdint.h>
10#include <time.h>
11
12#include "esp_err.h"
13
19esp_err_t time_service_init(void);
20
27esp_err_t time_service_set_epoch(int64_t epoch);
28
36void time_service_notify_network_connected(bool connected);
37
47bool time_service_get_local_time(struct tm *out_tm, int64_t *out_epoch);
48
63void time_service_apply_timezone(const char *location_id, int16_t fallback_offset_min);
void time_service_apply_timezone(const char *location_id, int16_t fallback_offset_min)
Apply a timezone by IANA location ID with DST support.
esp_err_t time_service_init(void)
Initialize time service state and restore persisted time fallback.
esp_err_t time_service_set_epoch(int64_t epoch)
Set current UTC epoch and persist it as valid time.
void time_service_notify_network_connected(bool connected)
Notify the service about network connectivity changes.
bool time_service_get_local_time(struct tm *out_tm, int64_t *out_epoch)
Get local time adjusted by the configured timezone offset.