Wirepas SDK
rtc.h
Go to the documentation of this file.
1 /* Copyright 2023 Wirepas Ltd. All Rights Reserved.
2  *
3  * See file LICENSE.txt for full license details.
4  *
5  */
6 
7 #ifndef _RTC_H_
8 #define _RTC_H_
9 
10 #include <stdint.h>
11 #include <stdbool.h>
12 
13 
14 #define RTC_VERSION (uint16_t)(1)
15 
16 
20 typedef enum
21 {
34 } rtc_res_e;
35 
37 typedef enum
38 {
42 
43 typedef uint64_t rtc_timestamp_t;
44 
49 typedef void
51 
56 rtc_res_e RTC_init(void);
57 
66 
74 
81 rtc_res_e RTC_getTimezoneOffsetInSeconds(long * timezoneOffsetInSeconds);
82 
91 
101 
102 #endif //_RTC_H_
RTC_UNKNOWN_CALLBACK
@ RTC_UNKNOWN_CALLBACK
Definition: rtc.h:29
rtc_timestamp_t
uint64_t rtc_timestamp_t
Definition: rtc.h:43
RTC_UNINITIALIZED
@ RTC_UNINITIALIZED
Definition: rtc.h:33
RTC_getLocalTime
rtc_res_e RTC_getLocalTime(rtc_timestamp_t *now)
Get current expected RTC time with timezone from node.
provisioning_data_ids_e
provisioning_data_ids_e
List of Wirepas Ids for TLV encoded provisioning data.
Definition: rtc.h:37
RTC_UNAVAILABLE_YET
@ RTC_UNAVAILABLE_YET
Definition: rtc.h:25
RTC_init
rtc_res_e RTC_init(void)
Initialize the stack state library.
RTC_NO_MORE_CALLBACKS
@ RTC_NO_MORE_CALLBACKS
Definition: rtc.h:27
RTC_removeInitializedCb
rtc_res_e RTC_removeInitializedCb(on_rtc_initialized callback)
Remove an event callback from the list. Removed item fields are all set to 0.
RTC_INVALID_VALUE
@ RTC_INVALID_VALUE
Definition: rtc.h:31
RTC_ID_TIMESTAMP
@ RTC_ID_TIMESTAMP
Definition: rtc.h:39
RTC_getUTCTime
rtc_res_e RTC_getUTCTime(rtc_timestamp_t *now)
Get current expected RTC time from node.
rtc_res_e
rtc_res_e
List of return code.
Definition: rtc.h:20
RTC_ID_TIMEZONE_OFFSET
@ RTC_ID_TIMEZONE_OFFSET
Definition: rtc.h:40
RTC_addInitializeCb
rtc_res_e RTC_addInitializeCb(on_rtc_initialized callback)
Add a new callback to be informed when RTC time is available from network.
RTC_getTimezoneOffsetInSeconds
rtc_res_e RTC_getTimezoneOffsetInSeconds(long *timezoneOffsetInSeconds)
Get configured timezone offset of the node.
on_rtc_initialized
void(* on_rtc_initialized)(void)
Callback called the first time RTC time is aquired from network.
Definition: rtc.h:50
RTC_RES_OK
@ RTC_RES_OK
Definition: rtc.h:23