oveRTOS C API
Embedded RTOS framework — build system, configuration, and portable C API
Loading...
Searching...
No Matches
net_sntp.h
1/*
2 * Copyright (C) 2026 Kamil Lulko <kamil.lulko@gmail.com>
3 *
4 * SPDX-License-Identifier: GPL-3.0-or-later
5 *
6 * This file is part of oveRTOS.
7 */
8
9#ifndef OVE_NET_SNTP_H
10#define OVE_NET_SNTP_H
11
25#include "ove/types.h"
26#include "ove_config.h"
27
28#include <stdint.h>
29
30#ifdef __cplusplus
31extern "C" {
32#endif
33
37typedef struct {
38 const char *server;
39 uint32_t timeout_ms;
41
42#ifdef CONFIG_OVE_NET_SNTP
43
53int ove_sntp_sync(const ove_sntp_config_t *cfg);
54
64int ove_sntp_get_offset_us(int64_t *offset_us);
65
74int ove_sntp_get_utc(uint32_t *utc_s);
75
76#else /* !CONFIG_OVE_NET_SNTP */
77
79static inline int ove_sntp_sync(const ove_sntp_config_t *cfg) { (void)cfg; return OVE_ERR_NOT_SUPPORTED; }
80static inline int ove_sntp_get_offset_us(int64_t *o) { (void)o; return OVE_ERR_NOT_SUPPORTED; }
81static inline int ove_sntp_get_utc(uint32_t *u) { (void)u; return OVE_ERR_NOT_SUPPORTED; }
84#endif /* CONFIG_OVE_NET_SNTP */
85
86#ifdef __cplusplus
87}
88#endif
89
92#endif /* OVE_NET_SNTP_H */
#define OVE_ERR_NOT_SUPPORTED
The requested feature is not supported by the active backend.
Definition types.h:38
SNTP client configuration.
Definition net_sntp.h:37
const char * server
Definition net_sntp.h:38
uint32_t timeout_ms
Definition net_sntp.h:39