Anjay Lite
Loading...
Searching...
No Matches
ntp.h
Go to the documentation of this file.
1/*
2 * Copyright 2023-2026 AVSystem <avsystem@avsystem.com>
3 * AVSystem Anjay Lite LwM2M SDK
4 * All rights reserved.
5 *
6 * Licensed under AVSystem Anjay Lite LwM2M Client SDK - Non-Commercial License.
7 * See the attached LICENSE file for details.
8 */
9
10#include <anj/init.h>
11
23#ifndef ANJ_NTP_H
24# define ANJ_NTP_H
25
27
28# include <anj/defs.h>
29
30# ifdef ANJ_WITH_PERSISTENCE
31# include <anj/persistence.h>
32# endif // ANJ_WITH_PERSISTENCE
33
35# define ANJ_INTERNAL_INCLUDE_EXCHANGE
36# include <anj_internal/exchange.h>
37# undef ANJ_INTERNAL_INCLUDE_EXCHANGE
40# ifdef __cplusplus
41extern "C" {
42# endif
43
44# ifdef ANJ_WITH_NTP
45
57# define ANJ_NTP_ERR_IN_PROGRESS -1
58
63# define ANJ_NTP_ERR_CONFIGURATION -2
64
69# define ANJ_NTP_ERR_OBJECT_CREATION_FAILED -3
70
118
137typedef void anj_ntp_event_callback_t(void *arg,
138 anj_ntp_t *ntp,
139 anj_ntp_status_t status,
140 anj_time_real_t synchronized_time);
141
234
254 anj_ntp_t *ntp,
255 const anj_ntp_configuration_t *config);
256
270
280
299
300# ifdef ANJ_WITH_PERSISTENCE
317
333# endif // ANJ_WITH_PERSISTENCE
334
336# define ANJ_INTERNAL_INCLUDE_NTP
337# include <anj_internal/ntp.h>
338# undef ANJ_INTERNAL_INCLUDE_NTP
341# endif // ANJ_WITH_NTP
342
343# ifdef __cplusplus
344}
345# endif
346
347#endif // ANJ_NTP_H
Platform hooks for network transport integration.
Core type and constant definitions for Anjay Lite.
struct anj_struct anj_t
Definition defs.h:129
struct _anj_ntp_struct anj_ntp_t
Definition defs.h:136
Global configuration validation header for Anjay Lite.
struct anj_ntp_configuration_struct anj_ntp_configuration_t
void anj_ntp_step(anj_ntp_t *ntp)
int anj_ntp_start(anj_ntp_t *ntp)
int anj_ntp_init(anj_t *anj, anj_ntp_t *ntp, const anj_ntp_configuration_t *config)
void anj_ntp_event_callback_t(void *arg, anj_ntp_t *ntp, anj_ntp_status_t status, anj_time_real_t synchronized_time)
Definition ntp.h:137
int anj_ntp_obj_restore(anj_ntp_t *ntp, const anj_persistence_context_t *ctx)
void anj_ntp_terminate(anj_ntp_t *ntp)
anj_ntp_status_t
Definition ntp.h:76
@ ANJ_NTP_STATUS_INITIAL
Definition ntp.h:82
@ ANJ_NTP_STATUS_PERIOD_EXCEEDED
Definition ntp.h:89
@ ANJ_NTP_STATUS_OBJECT_UPDATED
Definition ntp.h:115
@ ANJ_NTP_STATUS_FINISHED_SUCCESSFULLY
Definition ntp.h:101
@ ANJ_NTP_STATUS_IN_PROGRESS
Definition ntp.h:94
@ ANJ_NTP_STATUS_FINISHED_WITH_ERROR
Definition ntp.h:108
int anj_ntp_obj_store(anj_ntp_t *ntp, const anj_persistence_context_t *ctx)
Persistence API for storing and restoring Anjay Lite state.
Definition anj_net_api.h:148
Definition ntp.h:146
anj_ntp_event_callback_t * event_cb
Definition ntp.h:153
uint32_t ntp_period_hours
Definition ntp.h:198
const anj_net_socket_configuration_t * net_socket_cfg
Definition ntp.h:232
const char * ntp_server_address
Definition ntp.h:172
const char * backup_ntp_server_address
Definition ntp.h:185
anj_time_duration_t response_timeout
Definition ntp.h:225
uint16_t attempts
Definition ntp.h:208
void * event_cb_arg
Definition ntp.h:159
Definition persistence.h:91
Relative duration of time.
Definition time.h:106
Absolute real (calendar) time.
Definition time.h:131