le_bootReason_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_bootReason_common.h
12  *
13  * Type definitions for le_bootReason.
14  *
15  */
16 #ifndef LE_BOOTREASON_COMMON_H_INCLUDE_GUARD
17 #define LE_BOOTREASON_COMMON_H_INCLUDE_GUARD
18 
19 
20 #include "legato.h"
21 
22 #define IFGEN_LE_BOOTREASON_PROTOCOL_ID "46c1a166e3822f2cc50a7cffcb3eabe4"
23 #define IFGEN_LE_BOOTREASON_MSG_SIZE 116
24 /** @addtogroup le_bootReason
25  * @{ **/
26 
27 
28 //--------------------------------------------------------------------------------------------------
29 /**
30  * @file le_bootReason_interface.h
31  *
32  * Legato @ref c_bootReason include file.
33  *
34  * Copyright (C) Sierra Wireless Inc.
35  */
36 //--------------------------------------------------------------------------------------------------
37 #define LE_BOOTREASON_MAX_GPIO_ADC_COUNT 100
38 
39 //--------------------------------------------------------------------------------------------------
40 /**
41  */
42 //--------------------------------------------------------------------------------------------------
43 #define LE_BOOTREASON_MAX_GPIO_NAME_BYTES 10
44 
45 //--------------------------------------------------------------------------------------------------
46 /**
47  */
48 //--------------------------------------------------------------------------------------------------
49 #define LE_BOOTREASON_MAX_ADC_NAME_BYTES 10
50 
51 //--------------------------------------------------------------------------------------------------
52 /**
53  */
54 //--------------------------------------------------------------------------------------------------
55 #define LE_BOOTREASON_MAX_GPIO_STATUS_BLOCK_BYTES 41
56 
57 //--------------------------------------------------------------------------------------------------
58 /**
59  */
60 //--------------------------------------------------------------------------------------------------
61 #define LE_BOOTREASON_MAX_ADC_STATUS_BLOCK_BYTES 72
62 
63 //--------------------------------------------------------------------------------------------------
64 /**
65  */
66 //--------------------------------------------------------------------------------------------------
67 #define LE_BOOTREASON_MAX_ADC_INTERVAL_BYTES 24
68 
69 //--------------------------------------------------------------------------------------------------
70 /**
71  */
72 //--------------------------------------------------------------------------------------------------
73 #define LE_BOOTREASON_MAX_TIMER_STATUS_BLOCK_BYTES 37
74 
75 //--------------------------------------------------------------------------------------------------
76 /**
77  */
78 //--------------------------------------------------------------------------------------------------
79 #define LE_BOOTREASON_MAX_SHUTDOWN_STRATEGY_BLOCK_BYTES 40
80 
81 
82 //--------------------------------------------------------------------------------------------------
83 /**
84  * Get if this client bound locally.
85  */
86 //--------------------------------------------------------------------------------------------------
87 LE_SHARED bool ifgen_le_bootReason_HasLocalBinding
88 (
89  void
90 );
91 
92 
93 //--------------------------------------------------------------------------------------------------
94 /**
95  * Init data that is common across all threads
96  */
97 //--------------------------------------------------------------------------------------------------
98 LE_SHARED void ifgen_le_bootReason_InitCommonData
99 (
100  void
101 );
102 
103 
104 //--------------------------------------------------------------------------------------------------
105 /**
106  * Perform common initialization and open a session
107  */
108 //--------------------------------------------------------------------------------------------------
109 LE_SHARED le_result_t ifgen_le_bootReason_OpenSession
110 (
111  le_msg_SessionRef_t _ifgen_sessionRef,
112  bool isBlocking
113 );
114 
115 //--------------------------------------------------------------------------------------------------
116 /**
117  * Checks whether boot-reason was timer expiry.
118  *
119  * @return
120  * - TRUE if boot-reason was timer expiry.
121  * - FALSE otherwise.
122  */
123 //--------------------------------------------------------------------------------------------------
124 LE_SHARED bool ifgen_le_bootReason_WasTimer
125 (
126  le_msg_SessionRef_t _ifgen_sessionRef
127 );
128 
129 //--------------------------------------------------------------------------------------------------
130 /**
131  * Checks whether boot-reason was specific gpio change. GPIO number is specified in parameter.
132  *
133  * @return
134  * - TRUE if boot-reason was specified gpio change.
135  * - FALSE otherwise.
136  *
137  * @note The process exits if invalid gpio number is passed. Check corresponding device documents
138  * for valid list of gpio.
139  */
140 //--------------------------------------------------------------------------------------------------
141 LE_SHARED bool ifgen_le_bootReason_WasGpio
142 (
143  le_msg_SessionRef_t _ifgen_sessionRef,
144  uint32_t gpioNum
145  ///< [IN] GPIO number.
146 );
147 
148 //--------------------------------------------------------------------------------------------------
149 /**
150  * Checks whether boot reason was due to the specified ADC having a reading above or below the
151  * configured limits.
152  *
153  * @return
154  * true if boot reason was due to the given ADC or false otherwise.
155  *
156  * @note
157  * The process exits if an invalid ADC number is passed. Check corresponding device documents
158  * for valid list of ADC numbers.
159  */
160 //--------------------------------------------------------------------------------------------------
161 LE_SHARED bool ifgen_le_bootReason_WasAdc
162 (
163  le_msg_SessionRef_t _ifgen_sessionRef,
164  uint32_t adcNum
165  ///< [IN] ADC number
166 );
167 
168 //--------------------------------------------------------------------------------------------------
169 /**
170  * Get the number of GPIOs that are specified in the system.
171  *
172  * @return
173  * LE_OK if we successfully get all the GPIOs and place them in the array.
174  * LE_FAULT otherwise.
175  */
176 //--------------------------------------------------------------------------------------------------
177 LE_SHARED le_result_t ifgen_le_bootReason_GetGpioCount
178 (
179  le_msg_SessionRef_t _ifgen_sessionRef,
180  uint8_t* gpioArrayPtr,
181  ///< [OUT]
182  size_t* gpioArraySizePtr
183  ///< [INOUT]
184 );
185 
186 //--------------------------------------------------------------------------------------------------
187 /**
188  * Get the information for a specific GPIO and place all the information into the buffer.
189  *
190  * @return
191  * LE_OK if we successfully get all the information.
192  * LE_FAULT otherwise.
193  */
194 //--------------------------------------------------------------------------------------------------
195 LE_SHARED le_result_t ifgen_le_bootReason_GetGpioInfo
196 (
197  le_msg_SessionRef_t _ifgen_sessionRef,
198  char* buf,
199  ///< [OUT]
200  size_t bufSize,
201  ///< [IN]
202  const char* LE_NONNULL gpio
203  ///< [IN]
204 );
205 
206 //--------------------------------------------------------------------------------------------------
207 /**
208  * Get the number of ADCs that are specified in the system.
209  *
210  * @return
211  * LE_OK if we successfully get all the ADCs and place them in the array.
212  * LE_FAULT otherwise.
213  */
214 //--------------------------------------------------------------------------------------------------
215 LE_SHARED le_result_t ifgen_le_bootReason_GetAdcCount
216 (
217  le_msg_SessionRef_t _ifgen_sessionRef,
218  uint8_t* adcArrayPtr,
219  ///< [OUT]
220  size_t* adcArraySizePtr
221  ///< [INOUT]
222 );
223 
224 //--------------------------------------------------------------------------------------------------
225 /**
226  * Get the information for a specific ADC and place all the information into the buffer.
227  *
228  * @return
229  * LE_OK if we successfully get all the information.
230  * LE_FAULT otherwise.
231  */
232 //--------------------------------------------------------------------------------------------------
233 LE_SHARED le_result_t ifgen_le_bootReason_GetAdcInfo
234 (
235  le_msg_SessionRef_t _ifgen_sessionRef,
236  char* buf,
237  ///< [OUT]
238  size_t bufSize,
239  ///< [IN]
240  const char* LE_NONNULL adc
241  ///< [IN]
242 );
243 
244 //--------------------------------------------------------------------------------------------------
245 /**
246  * Get the information about ADC interval and place all the information into the buffer.
247  *
248  * @return
249  * LE_OK if we successfully get all the information.
250  * LE_FAULT otherwise.
251  */
252 //--------------------------------------------------------------------------------------------------
253 LE_SHARED le_result_t ifgen_le_bootReason_GetAdcInterval
254 (
255  le_msg_SessionRef_t _ifgen_sessionRef,
256  char* buf,
257  ///< [OUT]
258  size_t bufSize
259  ///< [IN]
260 );
261 
262 //--------------------------------------------------------------------------------------------------
263 /**
264  * Get the information about timer and place all the information into the buffer.
265  *
266  * @return
267  * LE_OK if we successfully get all the information.
268  * LE_FAULT otherwise.
269  */
270 //--------------------------------------------------------------------------------------------------
271 LE_SHARED le_result_t ifgen_le_bootReason_GetTimerInfo
272 (
273  le_msg_SessionRef_t _ifgen_sessionRef,
274  char* buf,
275  ///< [OUT]
276  size_t bufSize
277  ///< [IN]
278 );
279 
280 //--------------------------------------------------------------------------------------------------
281 /**
282  * Get the information about shutdown strategy and place all the information into the buffer.
283  *
284  * @return
285  * LE_OK if we successfully get all the information.
286  * LE_FAULT otherwise.
287  */
288 //--------------------------------------------------------------------------------------------------
289 LE_SHARED le_result_t ifgen_le_bootReason_GetShutdownStrategy
290 (
291  le_msg_SessionRef_t _ifgen_sessionRef,
292  char* buf,
293  ///< [OUT]
294  size_t bufSize
295  ///< [IN]
296 );
297 /** @} **/
298 #endif // LE_BOOTREASON_COMMON_H_INCLUDE_GUARD
#define LE_SHARED
Definition: le_basics.h:287
le_result_t
Definition: le_basics.h:46
struct le_msg_Session * le_msg_SessionRef_t
Definition: le_messaging.h:860