le_antenna_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_antenna_common.h
12  *
13  * Type definitions for le_antenna.
14  *
15  */
16 #ifndef LE_ANTENNA_COMMON_H_INCLUDE_GUARD
17 #define LE_ANTENNA_COMMON_H_INCLUDE_GUARD
18 
19 
20 #include "legato.h"
21 
22 #define IFGEN_LE_ANTENNA_PROTOCOL_ID "c6ad7def5425943d0e3b97ad84593ed5"
23 #define IFGEN_LE_ANTENNA_MSG_SIZE 16
24 /** @addtogroup le_antenna
25  * @{ **/
26 
27 
28 //--------------------------------------------------------------------------------------------------
29 /**
30  * Reference type for an antenna diagnostic.
31  */
32 //--------------------------------------------------------------------------------------------------
33 typedef struct le_antenna_Obj* le_antenna_ObjRef_t;
34 
35 
36 //--------------------------------------------------------------------------------------------------
37 /**
38  * Antenna type.
39  */
40 //--------------------------------------------------------------------------------------------------
41 typedef enum
42 {
44  ///< Cellular antenna type
46  ///< Diversity antenna type
48  ///< GNSS positioning antenna type
49  LE_ANTENNA_MAX = 3
50  ///<
51 }
53 
54 
55 //--------------------------------------------------------------------------------------------------
56 /**
57  * Antenna status
58  */
59 //--------------------------------------------------------------------------------------------------
60 typedef enum
61 {
63  ///< antenna in short circuit: unknown state.
65  ///< antenna in closed circuit: presence of antenna.
67  ///< antenna in open circuit: there is no antenna.
69  ///< antenna in short circuit and current HW protection circuitry has
70  ///< tripped. Only applicable for GNSS antenna.
72  ///< Antenna diagnosis feature is inactive.
74  ///< last status value.
75 }
77 
78 
79 //--------------------------------------------------------------------------------------------------
80 /**
81  * Reference type used by Add/Remove functions for EVENT 'le_antenna_StatusEvent'
82  */
83 //--------------------------------------------------------------------------------------------------
84 typedef struct le_antenna_StatusEventHandler* le_antenna_StatusEventHandlerRef_t;
85 
86 
87 //--------------------------------------------------------------------------------------------------
88 /**
89  * Handler for antenna status.
90  *
91  */
92 //--------------------------------------------------------------------------------------------------
93 typedef void (*le_antenna_StatusHandlerFunc_t)
94 (
95  le_antenna_ObjRef_t antennaRef,
96  ///< antenna reference
97  le_antenna_Status_t status,
98  ///< antenna status
99  void* contextPtr
100  ///<
101 );
102 
103 
104 //--------------------------------------------------------------------------------------------------
105 /**
106  * Get if this client bound locally.
107  */
108 //--------------------------------------------------------------------------------------------------
109 LE_SHARED bool ifgen_le_antenna_HasLocalBinding
110 (
111  void
112 );
113 
114 
115 //--------------------------------------------------------------------------------------------------
116 /**
117  * Init data that is common across all threads
118  */
119 //--------------------------------------------------------------------------------------------------
120 LE_SHARED void ifgen_le_antenna_InitCommonData
121 (
122  void
123 );
124 
125 
126 //--------------------------------------------------------------------------------------------------
127 /**
128  * Perform common initialization and open a session
129  */
130 //--------------------------------------------------------------------------------------------------
131 LE_SHARED le_result_t ifgen_le_antenna_OpenSession
132 (
133  le_msg_SessionRef_t _ifgen_sessionRef,
134  bool isBlocking
135 );
136 
137 //--------------------------------------------------------------------------------------------------
138 /**
139  * Requested the antenna monitoring.
140  *
141  * @return
142  * - Reference to the antenna object.
143  * - NULL on failure.
144  */
145 //--------------------------------------------------------------------------------------------------
146 LE_SHARED le_antenna_ObjRef_t ifgen_le_antenna_Request
147 (
148  le_msg_SessionRef_t _ifgen_sessionRef,
149  le_antenna_Type_t antennaType
150  ///< [IN] antenna to be monitored
151 );
152 
153 //--------------------------------------------------------------------------------------------------
154 /**
155  * Get the antenna type.
156  *
157  * @return
158  * - LE_OK on success
159  * - LE_NOT_FOUND if the antenna reference is unknown
160  * - LE_BAD_PARAMETER if an invalid reference provided.
161  */
162 //--------------------------------------------------------------------------------------------------
163 LE_SHARED le_result_t ifgen_le_antenna_GetType
164 (
165  le_msg_SessionRef_t _ifgen_sessionRef,
166  le_antenna_ObjRef_t antennaRef,
167  ///< [IN] antenna reference
168  le_antenna_Type_t* antennaTypePtr
169  ///< [OUT] allocated antenna type
170 );
171 
172 //--------------------------------------------------------------------------------------------------
173 /**
174  * Set the ADC value used to detect a short circuit.
175  *
176  * @return
177  * - LE_OK on success
178  * - LE_NOT_FOUND if the antenna reference is unknown
179  * - LE_FAULT on other failure
180  */
181 //--------------------------------------------------------------------------------------------------
182 LE_SHARED le_result_t ifgen_le_antenna_SetShortLimit
183 (
184  le_msg_SessionRef_t _ifgen_sessionRef,
185  le_antenna_ObjRef_t antennaRef,
186  ///< [IN] antenna reference
187  uint32_t shortLimit
188  ///< [IN] ADC value used to detect a short circuit
189 );
190 
191 //--------------------------------------------------------------------------------------------------
192 /**
193  * Get the ADC value used to detect a short circuit.
194  *
195  * @return
196  * - LE_OK on success
197  * - LE_NOT_FOUND if the antenna reference is unknown
198  * - LE_FAULT on other failure
199  */
200 //--------------------------------------------------------------------------------------------------
201 LE_SHARED le_result_t ifgen_le_antenna_GetShortLimit
202 (
203  le_msg_SessionRef_t _ifgen_sessionRef,
204  le_antenna_ObjRef_t antennaRef,
205  ///< [IN] antenna reference
206  uint32_t* shortLimitPtr
207  ///< [OUT] ADC value used to detect a short circuit
208 );
209 
210 //--------------------------------------------------------------------------------------------------
211 /**
212  * Set the ADC value used to detect an open circuit.
213  *
214  * @return
215  * - LE_OK on success
216  * - LE_NOT_FOUND if the antenna reference is unknown
217  * - LE_FAULT on other failure
218  */
219 //--------------------------------------------------------------------------------------------------
220 LE_SHARED le_result_t ifgen_le_antenna_SetOpenLimit
221 (
222  le_msg_SessionRef_t _ifgen_sessionRef,
223  le_antenna_ObjRef_t antennaRef,
224  ///< [IN] antenna reference
225  uint32_t openLimit
226  ///< [IN] ADC value used to detect an open circuit
227 );
228 
229 //--------------------------------------------------------------------------------------------------
230 /**
231  * Get the ADC value used to detect an open circuit.
232  *
233  * @return
234  * - LE_OK on success
235  * - LE_NOT_FOUND if the antenna reference is unknown
236  * - LE_FAULT on other failure
237  */
238 //--------------------------------------------------------------------------------------------------
239 LE_SHARED le_result_t ifgen_le_antenna_GetOpenLimit
240 (
241  le_msg_SessionRef_t _ifgen_sessionRef,
242  le_antenna_ObjRef_t antennaRef,
243  ///< [IN] antenna reference
244  uint32_t* openLimitPtr
245  ///< [OUT] ADC value used to detect an open circuit
246 );
247 
248 //--------------------------------------------------------------------------------------------------
249 /**
250  * Add handler function for EVENT 'le_antenna_StatusEvent'
251  *
252  * This event provides information on antenna status for the given antennaRef.
253  *
254  */
255 //--------------------------------------------------------------------------------------------------
256 LE_SHARED le_antenna_StatusEventHandlerRef_t ifgen_le_antenna_AddStatusEventHandler
257 (
258  le_msg_SessionRef_t _ifgen_sessionRef,
259  le_antenna_ObjRef_t antennaRef,
260  ///< [IN] antenna reference
262  ///< [IN]
263  void* contextPtr
264  ///< [IN]
265 );
266 
267 //--------------------------------------------------------------------------------------------------
268 /**
269  * Remove handler function for EVENT 'le_antenna_StatusEvent'
270  */
271 //--------------------------------------------------------------------------------------------------
272 LE_SHARED void ifgen_le_antenna_RemoveStatusEventHandler
273 (
274  le_msg_SessionRef_t _ifgen_sessionRef,
276  ///< [IN]
277 );
278 
279 //--------------------------------------------------------------------------------------------------
280 /**
281  * Get the antenna status.
282  *
283  * @return
284  * - LE_OK on success
285  * - LE_NOT_FOUND if the antenna reference is unknown
286  * - LE_UNSUPPORTED if the antenna detection is not supported
287  * - LE_FAULT on other failure
288  *
289  */
290 //--------------------------------------------------------------------------------------------------
291 LE_SHARED le_result_t ifgen_le_antenna_GetStatus
292 (
293  le_msg_SessionRef_t _ifgen_sessionRef,
294  le_antenna_ObjRef_t antennaRef,
295  ///< [IN] antenna reference
296  le_antenna_Status_t* statusPtr
297  ///< [OUT] antenna status
298 );
299 
300 //--------------------------------------------------------------------------------------------------
301 /**
302  * Set the external ADC used to monitor the requested antenna.
303  *
304  * @return
305  * - LE_OK on success
306  * - LE_NOT_FOUND if the antenna reference is unknown
307  * - LE_UNSUPPORTED request not supported
308  * - LE_FAULT on other failure
309  *
310  * @note The same external ADC may not be selected for both antennas at the same time.
311  */
312 //--------------------------------------------------------------------------------------------------
313 LE_SHARED le_result_t ifgen_le_antenna_SetExternalAdc
314 (
315  le_msg_SessionRef_t _ifgen_sessionRef,
316  le_antenna_ObjRef_t antennaRef,
317  ///< [IN] antenna reference
318  int8_t adcId
319  ///< [IN] ADC index used to monitor the requested antenna
320 );
321 
322 //--------------------------------------------------------------------------------------------------
323 /**
324  * Get the external ADC used to monitor the requested antenna.
325  *
326  * @return
327  * - LE_OK on success
328  * - LE_NOT_FOUND if the antenna reference is unknown
329  * - LE_UNSUPPORTED request not supported
330  * - LE_FAULT on other failure
331  *
332  * @note If the returned ADC index is "-1", it means no external ADC are used to monitor
333  * the requested antenna.
334  */
335 //--------------------------------------------------------------------------------------------------
336 LE_SHARED le_result_t ifgen_le_antenna_GetExternalAdc
337 (
338  le_msg_SessionRef_t _ifgen_sessionRef,
339  le_antenna_ObjRef_t antennaRef,
340  ///< [IN] antenna reference
341  int8_t* adcIdPtr
342  ///< [OUT] ADC index used to monitor the requested antenna
343 );
344 /** @} **/
345 #endif // LE_ANTENNA_COMMON_H_INCLUDE_GUARD
Definition: le_antenna_common.h:68
#define LE_SHARED
Definition: le_basics.h:300
le_result_t
Definition: le_basics.h:46
le_antenna_Status_t
Definition: le_antenna_common.h:60
Diversity antenna type.
Definition: le_antenna_common.h:45
antenna in closed circuit: presence of antenna.
Definition: le_antenna_common.h:64
GNSS positioning antenna type.
Definition: le_antenna_common.h:47
struct le_antenna_Obj * le_antenna_ObjRef_t
Definition: le_antenna_common.h:33
antenna in open circuit: there is no antenna.
Definition: le_antenna_common.h:66
Cellular antenna type.
Definition: le_antenna_common.h:43
last status value.
Definition: le_antenna_common.h:73
Antenna diagnosis feature is inactive.
Definition: le_antenna_common.h:71
struct le_msg_Session * le_msg_SessionRef_t
Definition: le_messaging.h:860
struct le_antenna_StatusEventHandler * le_antenna_StatusEventHandlerRef_t
Definition: le_antenna_common.h:84
void(* le_antenna_StatusHandlerFunc_t)(le_antenna_ObjRef_t antennaRef, le_antenna_Status_t status, void *contextPtr)
Definition: le_antenna_common.h:94
le_antenna_Type_t
Definition: le_antenna_common.h:41
antenna in short circuit: unknown state.
Definition: le_antenna_common.h:62