forked from FreeRTOS/FreeRTOS-Cellular-Interface
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcellular_common_api.h
More file actions
314 lines (277 loc) · 14.9 KB
/
cellular_common_api.h
File metadata and controls
314 lines (277 loc) · 14.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
/*
* FreeRTOS-Cellular-Interface
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* SPDX-License-Identifier: MIT
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
* the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
* the Software, and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* https://www.FreeRTOS.org
* https://github.com/FreeRTOS
*/
/**
* @file cellular_common_api.h
*/
#ifndef __CELLULAR_COMMON_API_H__
#define __CELLULAR_COMMON_API_H__
/* *INDENT-OFF* */
#ifdef __cplusplus
extern "C" {
#endif
/* *INDENT-ON* */
#include "cellular_types.h"
#include "cellular_common.h"
#include "cellular_comm_interface.h"
/*-----------------------------------------------------------*/
/**
* @brief This function is the common implementation of FreeRTOS Cellular Library API.
* Reference Cellular_Init in cellular_api.h for definition.
*/
CellularError_t Cellular_CommonInit( CellularHandle_t * pCellularHandle,
const CellularCommInterface_t * pCommInterface,
const CellularTokenTable_t * pTokenTable );
/**
* @brief This function is the common implementation of FreeRTOS Cellular Library API.
* Reference Cellular_Cleanup in cellular_api.h for definition.
*/
CellularError_t Cellular_CommonCleanup( CellularHandle_t cellularHandle );
/**
* @brief This function is the common implementation of FreeRTOS Cellular Library API.
* Reference Cellular_RegisterUrcNetworkRegistrationEventCallback in cellular_api.h for definition.
*/
CellularError_t Cellular_CommonRegisterUrcNetworkRegistrationEventCallback( CellularHandle_t cellularHandle,
CellularUrcNetworkRegistrationCallback_t networkRegistrationCallback,
void * pCallbackContext );
/**
* @brief This function is the common implementation of FreeRTOS Cellular Library API.
* Reference Cellular_RegisterUrcPdnEventCallback in cellular_api.h for definition.
*/
CellularError_t Cellular_CommonRegisterUrcPdnEventCallback( CellularHandle_t cellularHandle,
CellularUrcPdnEventCallback_t pdnEventCallback,
void * pCallbackContext );
/**
* @brief This function is the common implementation of FreeRTOS Cellular Library API.
* Reference Cellular_RegisterUrcSignalStrengthChangedCallback in cellular_api.h for definition.
*/
CellularError_t Cellular_CommonRegisterUrcSignalStrengthChangedCallback( CellularHandle_t cellularHandle,
CellularUrcSignalStrengthChangedCallback_t signalStrengthChangedCallback,
void * pCallbackContext );
/**
* @brief This function is the common implementation of FreeRTOS Cellular Library API.
* Reference Cellular_RegisterUrcGenericCallback in cellular_api.h for definition.
*/
CellularError_t Cellular_CommonRegisterUrcGenericCallback( CellularHandle_t cellularHandle,
CellularUrcGenericCallback_t genericCallback,
void * pCallbackContext );
/**
* @brief This function is the common implementation of FreeRTOS Cellular Library API.
* Reference Cellular_RegisterModemEventCallback in cellular_api.h for definition.
*/
CellularError_t Cellular_CommonRegisterModemEventCallback( CellularHandle_t cellularHandle,
CellularModemEventCallback_t modemEventCallback,
void * pCallbackContext );
/**
* @brief This function is the common implementation of FreeRTOS Cellular Library API.
* Reference Cellular_ATCommandRaw in cellular_api.h for definition.
*/
CellularError_t Cellular_CommonATCommandRaw( CellularHandle_t cellularHandle,
const char * pATCommandPrefix,
const char * pATCommandPayload,
CellularATCommandType_t atCommandType,
CellularATCommandResponseReceivedCallback_t responseReceivedCallback,
void * pData,
uint16_t dataLen );
/**
* @brief This function is the common implementation of FreeRTOS Cellular Library API.
* Reference Cellular_CreateSocket in cellular_api.h for definition.
*/
CellularError_t Cellular_CommonCreateSocket( CellularHandle_t cellularHandle,
uint8_t pdnContextId,
CellularSocketDomain_t socketDomain,
CellularSocketType_t socketType,
CellularSocketProtocol_t socketProtocol,
CellularSocketHandle_t * pSocketHandle );
/**
* @brief This function is the common implementation of FreeRTOS Cellular Library API.
* Reference Cellular_SocketSetSockOpt in cellular_api.h for definition.
*/
CellularError_t Cellular_CommonSocketSetSockOpt( CellularHandle_t cellularHandle,
CellularSocketHandle_t socketHandle,
CellularSocketOptionLevel_t optionLevel,
CellularSocketOption_t option,
const uint8_t * pOptionValue,
uint32_t optionValueLength );
/**
* @brief This function is the common implementation of FreeRTOS Cellular Library API.
* Reference Cellular_SocketRegisterDataReadyCallback in cellular_api.h for definition.
*/
CellularError_t Cellular_CommonSocketRegisterDataReadyCallback( CellularHandle_t cellularHandle,
CellularSocketHandle_t socketHandle,
CellularSocketDataReadyCallback_t dataReadyCallback,
void * pCallbackContext );
/**
* @brief This function is the common implementation of FreeRTOS Cellular Library API.
* Reference Cellular_SocketRegisterSocketOpenCallback in cellular_api.h for definition.
*/
CellularError_t Cellular_CommonSocketRegisterSocketOpenCallback( CellularHandle_t cellularHandle,
CellularSocketHandle_t socketHandle,
CellularSocketOpenCallback_t socketOpenCallback,
void * pCallbackContext );
/**
* @brief This function is the common implementation of FreeRTOS Cellular Library API.
* Reference Cellular_SocketRegisterClosedCallback in cellular_api.h for definition.
*/
CellularError_t Cellular_CommonSocketRegisterClosedCallback( CellularHandle_t cellularHandle,
CellularSocketHandle_t socketHandle,
CellularSocketClosedCallback_t closedCallback,
void * pCallbackContext );
/**
* @brief This function is the common implementation of FreeRTOS Cellular Library API.
* Reference Cellular_RfOn in cellular_api.h for definition.
*/
CellularError_t Cellular_CommonRfOn( CellularHandle_t cellularHandle );
/**
* @brief This function is the common implementation of FreeRTOS Cellular Library API.
* Reference Cellular_RfOff in cellular_api.h for definition.
*/
CellularError_t Cellular_CommonRfOff( CellularHandle_t cellularHandle );
/**
* @brief This function is the common implementation of FreeRTOS Cellular Library API.
* Reference Cellular_GetIPAddress in cellular_api.h for definition.
*/
CellularError_t Cellular_CommonGetIPAddress( CellularHandle_t cellularHandle,
uint8_t contextId,
char * pBuffer,
uint32_t bufferLength );
/**
* @brief This function is the common implementation of FreeRTOS Cellular Library API.
* Reference Cellular_GetModemInfo in cellular_api.h for definition.
*/
CellularError_t Cellular_CommonGetModemInfo( CellularHandle_t cellularHandle,
CellularModemInfo_t * pModemInfo );
/**
* @brief This function is the common implementation of FreeRTOS Cellular Library API.
* Reference Cellular_GetEidrxSettings in cellular_api.h for definition.
*/
CellularError_t Cellular_CommonGetEidrxSettings( CellularHandle_t cellularHandle,
CellularEidrxSettingsList_t * pEidrxSettingsList );
/**
* @brief This function is the common implementation of FreeRTOS Cellular Library API.
* Reference Cellular_SetEidrxSettings in cellular_api.h for definition.
*/
CellularError_t Cellular_CommonSetEidrxSettings( CellularHandle_t cellularHandle,
const CellularEidrxSettings_t * pEidrxSettings );
/**
* @brief This function is the common implementation of FreeRTOS Cellular Library API.
* Reference Cellular_GetRegisteredNetwork in cellular_api.h for definition.
*/
CellularError_t Cellular_CommonGetRegisteredNetwork( CellularHandle_t cellularHandle,
CellularPlmnInfo_t * pNetworkInfo );
/**
* @brief This function is the common implementation of FreeRTOS Cellular Library API.
* Reference Cellular_GetNetworkTime in cellular_api.h for definition.
*/
CellularError_t Cellular_CommonGetNetworkTime( CellularHandle_t cellularHandle,
CellularTime_t * pNetworkTime );
/**
* @brief This function is the common implementation of FreeRTOS Cellular Library API.
* Reference Cellular_GetServiceStatus in cellular_api.h for definition.
*/
CellularError_t Cellular_CommonGetServiceStatus( CellularHandle_t cellularHandle,
CellularServiceStatus_t * pServiceStatus );
/**
* @brief This function is the common implementation of FreeRTOS Cellular Library API.
* Reference Cellular_GetServiceStatus in cellular_api.h for definition.
*/
CellularError_t Cellular_CommonSetPdnConfig( CellularHandle_t cellularHandle,
uint8_t contextId,
const CellularPdnConfig_t * pPdnConfig );
/**
* @brief This function is the common implementation of FreeRTOS Cellular Library API.
* Reference Cellular_GetServiceStatus in cellular_api.h for definition.
*/
CellularError_t Cellular_CommonGetPsmSettings( CellularHandle_t cellularHandle,
CellularPsmSettings_t * pPsmSettings );
/**
* @brief This function is the common implementation of FreeRTOS Cellular Library API.
* Reference Cellular_GetServiceStatus in cellular_api.h for definition.
*/
CellularError_t Cellular_CommonSetPsmSettings( CellularHandle_t cellularHandle,
const CellularPsmSettings_t * pPsmSettings );
/**
* @brief This function is the common implementation of FreeRTOS Cellular Library API.
* Reference Cellular_GetServiceStatus in cellular_api.h for definition.
*/
CellularError_t Cellular_CommonGetSimCardInfo( CellularHandle_t cellularHandle,
CellularSimCardInfo_t * pSimCardInfo );
/**
* @brief Get SIM card lock status.
*
* @param[in] cellularHandle The opaque cellular context pointer created by Cellular_Init.
* @param[out] pSimCardStatus Out parameter to provide the SIM card status.
*
* @return CELLULAR_SUCCESS if the operation is successful, otherwise an error
* code indicating the cause of the error.
*/
CellularError_t Cellular_CommonGetSimCardLockStatus( CellularHandle_t cellularHandle,
CellularSimCardStatus_t * pSimCardStatus );
/**
* @brief 3GPP URC AT+CEREG handler for FreeRTOS Cellular Library.
*
* This function handles the incoming URC and callback function.
*
* @param[in,out] pContext FreeRTOS Cellular Library context created in Cellular_Init.
* @param[in] pInputLine the input URC string.
*
* @return CELLULAR_PKT_STATUS_OK if the operation is successful, otherwise an error
* code indicating the cause of the error.
*/
CellularPktStatus_t Cellular_CommonUrcProcessCereg( CellularContext_t * pContext,
char * pInputLine );
/**
* @brief 3GPP URC AT+CGREG handler for FreeRTOS Cellular Library.
*
* This function handles the incoming URC and callback function.
*
* @param[in,out] pContext FreeRTOS Cellular Library context created in Cellular_Init.
* @param[in] pInputLine the input URC string.
*
* @return CELLULAR_PKT_STATUS_OK if the operation is successful, otherwise an error
* code indicating the cause of the error.
*/
CellularPktStatus_t Cellular_CommonUrcProcessCgreg( CellularContext_t * pContext,
char * pInputLine );
/**
* @brief 3GPP URC AT+CREG handler for FreeRTOS Cellular Library.
*
* This function handles the incoming URC and callback function.
*
* @param[in,out] pContext FreeRTOS Cellular Library context created in Cellular_Init.
* @param[in] pInputLine the input URC string.
*
* @return CELLULAR_PKT_STATUS_OK if the operation is successful, otherwise an error
* code indicating the cause of the error.
*/
CellularPktStatus_t Cellular_CommonUrcProcessCreg( CellularContext_t * pContext,
char * pInputLine );
/* *INDENT-OFF* */
#ifdef __cplusplus
}
#endif
/* *INDENT-ON* */
#endif /* __CELLULAR_COMMON_API_H__ */