objc

ntp.h
Go to the documentation of this file.
1 
14 #pragma once
15 #include <runtime-sys/date.h>
16 #include <stdbool.h>
17 
19 // TYPES
20 
29 typedef struct net_ntp_t net_ntp_t;
30 
37 typedef void (*net_ntp_callback_t)(net_ntp_t *ntp, const sys_date_t *date,
38  void *user_data);
39 
41 // LIFECYCLE
42 
49 net_ntp_t *net_ntp_init(net_ntp_callback_t callback, void *user_data);
50 
60 bool net_ntp_valid(net_ntp_t *ntp);
61 
67 void net_ntp_finalize(net_ntp_t *ntp);
struct net_ntp_t net_ntp_t
Opaque NTP manager handle.
Definition: ntp.h:29
net_ntp_t * net_ntp_init(net_ntp_callback_t callback, void *user_data)
Initialize (or re-initialize) the NTP manager.
void(* net_ntp_callback_t)(net_ntp_t *ntp, const sys_date_t *date, void *user_data)
Callback invoked when system time should be updated.
Definition: ntp.h:37
bool net_ntp_valid(net_ntp_t *ntp)
Determine if the NTP handle is checking for time updates.
Represents a system date and time structure.
Definition: date.h:45
Date and Time management functions.
void net_ntp_finalize(net_ntp_t *ntp)
Release NTP resources.