le_clkSync_common.h

Go to the documentation of this file.
1 
2 /*
3  * ====================== WARNING ======================
4  *
5  * THE CONTENTS OF THIS FILE HAVE BEEN AUTO-GENERATED.
6  * DO NOT MODIFY IN ANY WAY.
7  *
8  * ====================== WARNING ======================
9  */
10 /**
11  * @file le_clkSync_common.h
12  *
13  * Type definitions for le_clkSync.
14  *
15  */
16 #ifndef LE_CLKSYNC_COMMON_H_INCLUDE_GUARD
17 #define LE_CLKSYNC_COMMON_H_INCLUDE_GUARD
18 
19 
20 #include "legato.h"
21 
22 #define IFGEN_LE_CLKSYNC_PROTOCOL_ID "6692a5d299bc2dc2cf3401fbaebe0473"
23 #define IFGEN_LE_CLKSYNC_MSG_SIZE 44
24 /** @addtogroup le_clkSync
25  * @{ **/
26 
27 
28 //--------------------------------------------------------------------------------------------------
29 /**
30  * Max length of a clock source as an address or name. This is taken as the max length required for
31  * the max width of an IPv6 address, i.e. 128
32  */
33 //--------------------------------------------------------------------------------------------------
34 #define LE_CLKSYNC_IPV6_ADDR_LENGTH_MAX 128
35 
36 //--------------------------------------------------------------------------------------------------
37 /**
38  */
39 //--------------------------------------------------------------------------------------------------
40 #define LE_CLKSYNC_SOURCE_CONFIG_LENGTH_MAX 128
41 
42 //--------------------------------------------------------------------------------------------------
43 /**
44  * Clock source's priority max and min values
45  */
46 //--------------------------------------------------------------------------------------------------
47 #define LE_CLKSYNC_SOURCE_PRIORITY_MAX 9
48 
49 //--------------------------------------------------------------------------------------------------
50 /**
51  */
52 //--------------------------------------------------------------------------------------------------
53 #define LE_CLKSYNC_SOURCE_PRIORITY_MIN 0
54 
55 //--------------------------------------------------------------------------------------------------
56 /**
57  * Config tree root directory and node paths for clock time configurations
58  */
59 //--------------------------------------------------------------------------------------------------
60 #define LE_CLKSYNC_CONFIG_TREE_ROOT_SOURCE "clockTime:/source"
61 
62 //--------------------------------------------------------------------------------------------------
63 /**
64  */
65 //--------------------------------------------------------------------------------------------------
66 #define LE_CLKSYNC_CONFIG_NODE_SOURCE "source"
67 
68 //--------------------------------------------------------------------------------------------------
69 /**
70  */
71 //--------------------------------------------------------------------------------------------------
72 #define LE_CLKSYNC_CONFIG_NODE_SOURCE_PRIORITY "priority"
73 
74 //--------------------------------------------------------------------------------------------------
75 /**
76  */
77 //--------------------------------------------------------------------------------------------------
78 #define LE_CLKSYNC_CONFIG_NODE_SOURCE_CONFIG "config"
79 
80 //--------------------------------------------------------------------------------------------------
81 /**
82  */
83 //--------------------------------------------------------------------------------------------------
84 #define LE_CLKSYNC_CONFIG_NODE_SOURCE_LAST_STATUS "lastStatus"
85 
86 //--------------------------------------------------------------------------------------------------
87 /**
88  */
89 //--------------------------------------------------------------------------------------------------
90 #define LE_CLKSYNC_CONFIG_NODE_SOURCE_AVC_TIMESTAMP "timeStamp"
91 
92 //--------------------------------------------------------------------------------------------------
93 /**
94  * Clock source type. Note that these defined values are the same as defined in Sierra Wireless'
95  * proprietary LWM2M object 33405's instance ID
96  */
97 //--------------------------------------------------------------------------------------------------
98 typedef enum
99 {
101  ///< Time Protocol server provided clock
103  ///< Network Time Protocol server provided clock
105  ///< GPS provided clock
107  ///< Max value in range
108 }
110 
111 
112 //--------------------------------------------------------------------------------------------------
113 /**
114  * Clock source's update status. Note that these defined values are the same as defined in Sierra
115  * Wireless' proprietary LWM2M object 33405's resource 3
116  */
117 //--------------------------------------------------------------------------------------------------
118 typedef enum
119 {
121  ///< Successful
123  ///< Not tried
125  ///< In progress & not finished
127  ///< General error
129  ///< Not configured
131  ///< Unsupported source type
133  ///< Unavailable source
135  ///< Failed to get clock time
137  ///< Failed to update system time
138  LE_CLKSYNC_UPDATE_SYSTEM_STATUS_MAX = 9
139  ///<
140 }
142 
143 
144 //--------------------------------------------------------------------------------------------------
145 /**
146  * Data structure for clock time
147  */
148 //--------------------------------------------------------------------------------------------------
149 typedef struct
150 {
151  int32_t msec;
152  int32_t sec;
153  int32_t min;
154  int32_t hour;
155  int32_t day;
156  int32_t mon;
157  int32_t year;
158 }
160 
161 
162 //--------------------------------------------------------------------------------------------------
163 /**
164  * Handler for the receiving the status of the execution of a system time update
165  */
166 //--------------------------------------------------------------------------------------------------
168 (
169  le_result_t status,
170  ///< Overall status of the system time update execution
171  void* contextPtr
172  ///<
173 );
174 
175 
176 //--------------------------------------------------------------------------------------------------
177 /**
178  * Get if this client bound locally.
179  */
180 //--------------------------------------------------------------------------------------------------
181 LE_SHARED bool ifgen_le_clkSync_HasLocalBinding
182 (
183  void
184 );
185 
186 
187 //--------------------------------------------------------------------------------------------------
188 /**
189  * Init data that is common across all threads
190  */
191 //--------------------------------------------------------------------------------------------------
192 LE_SHARED void ifgen_le_clkSync_InitCommonData
193 (
194  void
195 );
196 
197 
198 //--------------------------------------------------------------------------------------------------
199 /**
200  * Perform common initialization and open a session
201  */
202 //--------------------------------------------------------------------------------------------------
203 LE_SHARED le_result_t ifgen_le_clkSync_OpenSession
204 (
205  le_msg_SessionRef_t _ifgen_sessionRef,
206  bool isBlocking
207 );
208 
209 //--------------------------------------------------------------------------------------------------
210 /**
211  * Retrieve the current clock time from the clock source(s) configured and return it back to the
212  * caller without updating it into the system clock
213  *
214  * @return
215  * - LE_OK Function successful
216  * - LE_BAD_PARAMETER A parameter is incorrect
217  * - LE_FAULT Function failed
218  * - LE_UNSUPPORTED Function not supported by the target
219  */
220 //--------------------------------------------------------------------------------------------------
221 LE_SHARED le_result_t ifgen_le_clkSync_GetCurrentTime
222 (
223  le_msg_SessionRef_t _ifgen_sessionRef,
224  le_clkSync_ClockTime_t * timePtr,
225  ///< [OUT] Clock time retrieved from configured source
226  le_clkSync_ClockSource_t* sourcePtr
227  ///< [OUT] Clock source from which the current time is acquired
228 );
229 
230 //--------------------------------------------------------------------------------------------------
231 /**
232  * Retrieve the status of the execution of a system time update using the given source
233  *
234  * @return
235  * - le_clkSync_UpdateSystemStatus_t
236  */
237 //--------------------------------------------------------------------------------------------------
238 LE_SHARED le_clkSync_UpdateSystemStatus_t ifgen_le_clkSync_GetUpdateSystemStatus
239 (
240  le_msg_SessionRef_t _ifgen_sessionRef,
242  ///< [IN] Clock source used to get the current time
243 );
244 
245 //--------------------------------------------------------------------------------------------------
246 /**
247  * Execute a system clock time update that will be completed asynchronously & return the resulting
248  * status back via its callback UpdateSystemTimeHandler
249  */
250 //--------------------------------------------------------------------------------------------------
251 LE_SHARED void ifgen_le_clkSync_UpdateSystemTime
252 (
253  le_msg_SessionRef_t _ifgen_sessionRef,
255  ///< [IN] Requester's handler for receiving results
256  void* contextPtr
257  ///< [IN]
258 );
259 /** @} **/
260 #endif // LE_CLKSYNC_COMMON_H_INCLUDE_GUARD
le_clkSync_ClockSource_t
Definition: le_clkSync_common.h:98
Time Protocol server provided clock.
Definition: le_clkSync_common.h:100
#define LE_SHARED
Definition: le_basics.h:287
le_result_t
Definition: le_basics.h:46
General error.
Definition: le_clkSync_common.h:126
Network Time Protocol server provided clock.
Definition: le_clkSync_common.h:102
In progress & not finished.
Definition: le_clkSync_common.h:124
Not configured.
Definition: le_clkSync_common.h:128
Max value in range.
Definition: le_clkSync_common.h:106
Definition: le_clkSync_common.h:149
Successful.
Definition: le_clkSync_common.h:120
Unavailable source.
Definition: le_clkSync_common.h:132
Failed to get clock time.
Definition: le_clkSync_common.h:134
Not tried.
Definition: le_clkSync_common.h:122
le_clkSync_UpdateSystemStatus_t
Definition: le_clkSync_common.h:118
struct le_msg_Session * le_msg_SessionRef_t
Definition: le_messaging.h:860
Failed to update system time.
Definition: le_clkSync_common.h:136
void(* le_clkSync_UpdateSystemTimeHandlerFunc_t)(le_result_t status, void *contextPtr)
Definition: le_clkSync_common.h:168
GPS provided clock.
Definition: le_clkSync_common.h:104
Unsupported source type.
Definition: le_clkSync_common.h:130