le_cellnet_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_cellnet_common.h
12  *
13  * Type definitions for le_cellnet.
14  *
15  */
16 #ifndef LE_CELLNET_COMMON_H_INCLUDE_GUARD
17 #define LE_CELLNET_COMMON_H_INCLUDE_GUARD
18 
19 
20 #include "legato.h"
21 
22 // Interface specific includes
23 #include "le_sim_common.h"
24 
25 #define IFGEN_LE_CELLNET_PROTOCOL_ID "d315388cea9c972a25873e5fdc3cc800"
26 #define IFGEN_LE_CELLNET_MSG_SIZE 24
27 /** @addtogroup le_cellnet
28  * @{ **/
29 
30 
31 //--------------------------------------------------------------------------------------------------
32 /**
33  * Reference returned by Request function and used by Release function
34  */
35 //--------------------------------------------------------------------------------------------------
36 typedef struct le_cellnet_RequestObj* le_cellnet_RequestObjRef_t;
37 
38 
39 //--------------------------------------------------------------------------------------------------
40 /**
41  * Cellular Network states.
42  *
43  */
44 //--------------------------------------------------------------------------------------------------
45 typedef enum
46 {
48  ///< The radio is switched-off.
50  ///< Only emergency calls are allowed.
52  ///< Registered, home network.
54  ///< Registered to a roaming network.
56  ///< Unknown state.
58  ///< No SIM card available.
59 }
61 
62 
63 //--------------------------------------------------------------------------------------------------
64 /**
65  * Reference type used by Add/Remove functions for EVENT 'le_cellnet_StateEvent'
66  */
67 //--------------------------------------------------------------------------------------------------
68 typedef struct le_cellnet_StateEventHandler* le_cellnet_StateEventHandlerRef_t;
69 
70 
71 //--------------------------------------------------------------------------------------------------
72 /**
73  * Handler for network state changes
74  */
75 //--------------------------------------------------------------------------------------------------
76 typedef void (*le_cellnet_StateHandlerFunc_t)
77 (
78  le_cellnet_State_t state,
79  ///< The cellular network state
80  void* contextPtr
81  ///<
82 );
83 
84 
85 //--------------------------------------------------------------------------------------------------
86 /**
87  * Get if this client bound locally.
88  */
89 //--------------------------------------------------------------------------------------------------
90 LE_SHARED bool ifgen_le_cellnet_HasLocalBinding
91 (
92  void
93 );
94 
95 
96 //--------------------------------------------------------------------------------------------------
97 /**
98  * Init data that is common across all threads
99  */
100 //--------------------------------------------------------------------------------------------------
101 LE_SHARED void ifgen_le_cellnet_InitCommonData
102 (
103  void
104 );
105 
106 
107 //--------------------------------------------------------------------------------------------------
108 /**
109  * Perform common initialization and open a session
110  */
111 //--------------------------------------------------------------------------------------------------
112 LE_SHARED le_result_t ifgen_le_cellnet_OpenSession
113 (
114  le_msg_SessionRef_t _ifgen_sessionRef,
115  bool isBlocking
116 );
117 
118 //--------------------------------------------------------------------------------------------------
119 /**
120  * Add handler function for EVENT 'le_cellnet_StateEvent'
121  *
122  * This event provides information on network state changes
123  */
124 //--------------------------------------------------------------------------------------------------
125 LE_SHARED le_cellnet_StateEventHandlerRef_t ifgen_le_cellnet_AddStateEventHandler
126 (
127  le_msg_SessionRef_t _ifgen_sessionRef,
129  ///< [IN]
130  void* contextPtr
131  ///< [IN]
132 );
133 
134 //--------------------------------------------------------------------------------------------------
135 /**
136  * Remove handler function for EVENT 'le_cellnet_StateEvent'
137  */
138 //--------------------------------------------------------------------------------------------------
139 LE_SHARED void ifgen_le_cellnet_RemoveStateEventHandler
140 (
141  le_msg_SessionRef_t _ifgen_sessionRef,
143  ///< [IN]
144 );
145 
146 //--------------------------------------------------------------------------------------------------
147 /**
148  * Request a cellular network
149  *
150  * @return
151  * - A reference to the cellular network
152  * - 0 (zero) if the network requested could not be processed
153  */
154 //--------------------------------------------------------------------------------------------------
155 LE_SHARED le_cellnet_RequestObjRef_t ifgen_le_cellnet_Request
156 (
157  le_msg_SessionRef_t _ifgen_sessionRef
158 );
159 
160 //--------------------------------------------------------------------------------------------------
161 /**
162  * Release a cellular network
163  */
164 //--------------------------------------------------------------------------------------------------
165 LE_SHARED void ifgen_le_cellnet_Release
166 (
167  le_msg_SessionRef_t _ifgen_sessionRef,
168  le_cellnet_RequestObjRef_t cellNetRef
169  ///< [IN] Reference to a cellular network request.
170 );
171 
172 //--------------------------------------------------------------------------------------------------
173 /**
174  * Set the PIN code in the secure storage.
175  *
176  * @return
177  * - LE_OUT_OF_RANGE Invalid simId
178  * - LE_FORMAT_ERROR PIN code is not in string format.
179  * - LE_UNDERFLOW The PIN code is not long enough (min 4 digits).
180  * - LE_OK The function succeeded.
181  * - LE_FAULT The function failed on any other errors
182  *
183  * @note If PIN code is too long (max 8 digits), it is a fatal error, the
184  * function will not return.
185  *
186  */
187 //--------------------------------------------------------------------------------------------------
188 LE_SHARED le_result_t ifgen_le_cellnet_SetSimPinCode
189 (
190  le_msg_SessionRef_t _ifgen_sessionRef,
191  le_sim_Id_t simId,
192  ///< [IN] SIM identifier.
193  const char* LE_NONNULL pinCode
194  ///< [IN] PIN code to insert in the secure storage.
195 );
196 
197 //--------------------------------------------------------------------------------------------------
198 /**
199  * Retrieve the PIN code from the secure storage.
200  *
201  * @return
202  * - LE_OUT_OF_RANGE Invalid simId
203  * - LE_NOT_FOUND PIN code is not found in the secure storage.
204  * - LE_OVERFLOW PIN code exceeds the maximum length of 8 digits.
205  * - LE_UNDERFLOW The PIN code is not long enough (min 4 digits).
206  * - LE_OK The function succeeded.
207  * - LE_FAULT If there are some other errors.
208  */
209 //--------------------------------------------------------------------------------------------------
210 LE_SHARED le_result_t ifgen_le_cellnet_GetSimPinCode
211 (
212  le_msg_SessionRef_t _ifgen_sessionRef,
213  le_sim_Id_t simId,
214  ///< [IN] SIM identifier.
215  char* pinCode,
216  ///< [OUT] Read the PIN code from the secure storage.
217  size_t pinCodeSize
218  ///< [IN]
219 );
220 
221 //--------------------------------------------------------------------------------------------------
222 /**
223  * Retrieve the current cellular network state.
224  *
225  * @return
226  * - LE_OK The function succeeded.
227  * - LE_FAILED The function failed
228  * - LE_BAD_PARAMETER A bad parameter was passed.
229  *
230  * @note If the caller passes a null pointer to this function, this is a fatal error and the
231  * function will not return.
232  */
233 //--------------------------------------------------------------------------------------------------
234 LE_SHARED le_result_t ifgen_le_cellnet_GetNetworkState
235 (
236  le_msg_SessionRef_t _ifgen_sessionRef,
237  le_cellnet_State_t* statePtr
238  ///< [OUT] Cellular network state.
239 );
240 /** @} **/
241 #endif // LE_CELLNET_COMMON_H_INCLUDE_GUARD
struct le_cellnet_RequestObj * le_cellnet_RequestObjRef_t
Definition: le_cellnet_common.h:36
#define LE_SHARED
Definition: le_basics.h:287
The radio is switched-off.
Definition: le_cellnet_common.h:47
struct le_cellnet_StateEventHandler * le_cellnet_StateEventHandlerRef_t
Definition: le_cellnet_common.h:68
No SIM card available.
Definition: le_cellnet_common.h:57
le_result_t
Definition: le_basics.h:46
Registered, home network.
Definition: le_cellnet_common.h:51
Registered to a roaming network.
Definition: le_cellnet_common.h:53
le_cellnet_State_t
Definition: le_cellnet_common.h:45
Only emergency calls are allowed.
Definition: le_cellnet_common.h:49
Unknown state.
Definition: le_cellnet_common.h:55
struct le_msg_Session * le_msg_SessionRef_t
Definition: le_messaging.h:860
void(* le_cellnet_StateHandlerFunc_t)(le_cellnet_State_t state, void *contextPtr)
Definition: le_cellnet_common.h:77
le_sim_Id_t
Definition: le_sim_common.h:228