FreeRTOS: FreeRTOS Cellular Library v1.4.0
FreeRTOS Cellular Library
 
Loading...
Searching...
No Matches
cellular_common_api.h
Go to the documentation of this file.
1/*
2 * FreeRTOS-Cellular-Interface v1.4.0
3 * Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
4 *
5 * SPDX-License-Identifier: MIT
6 *
7 * Permission is hereby granted, free of charge, to any person obtaining a copy of
8 * this software and associated documentation files (the "Software"), to deal in
9 * the Software without restriction, including without limitation the rights to
10 * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
11 * the Software, and to permit persons to whom the Software is furnished to do so,
12 * subject to the following conditions:
13 *
14 * The above copyright notice and this permission notice shall be included in all
15 * copies or substantial portions of the Software.
16 *
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
19 * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
20 * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
21 * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
22 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 *
24 * https://www.FreeRTOS.org
25 * https://github.com/FreeRTOS
26 */
27
32#ifndef __CELLULAR_COMMON_API_H__
33#define __CELLULAR_COMMON_API_H__
34
35/* *INDENT-OFF* */
36#ifdef __cplusplus
37 extern "C" {
38#endif
39/* *INDENT-ON* */
40
41#include "cellular_types.h"
42#include "cellular_common.h"
44
45/*-----------------------------------------------------------*/
46
51CellularError_t Cellular_CommonInit( CellularHandle_t * pCellularHandle,
52 const CellularCommInterface_t * pCommInterface,
53 const CellularTokenTable_t * pTokenTable );
54
59CellularError_t Cellular_CommonCleanup( CellularHandle_t cellularHandle );
60
66 CellularUrcNetworkRegistrationCallback_t networkRegistrationCallback,
67 void * pCallbackContext );
68
73CellularError_t Cellular_CommonRegisterUrcPdnEventCallback( CellularHandle_t cellularHandle,
74 CellularUrcPdnEventCallback_t pdnEventCallback,
75 void * pCallbackContext );
76
82 CellularUrcSignalStrengthChangedCallback_t signalStrengthChangedCallback,
83 void * pCallbackContext );
84
89CellularError_t Cellular_CommonRegisterUrcGenericCallback( CellularHandle_t cellularHandle,
90 CellularUrcGenericCallback_t genericCallback,
91 void * pCallbackContext );
92
97CellularError_t Cellular_CommonRegisterModemEventCallback( CellularHandle_t cellularHandle,
98 CellularModemEventCallback_t modemEventCallback,
99 void * pCallbackContext );
100
105CellularError_t Cellular_CommonATCommandRaw( CellularHandle_t cellularHandle,
106 const char * pATCommandPrefix,
107 const char * pATCommandPayload,
108 CellularATCommandType_t atCommandType,
109 CellularATCommandResponseReceivedCallback_t responseReceivedCallback,
110 void * pData,
111 uint16_t dataLen );
112
117CellularError_t Cellular_CommonCreateSocket( CellularHandle_t cellularHandle,
118 uint8_t pdnContextId,
119 CellularSocketDomain_t socketDomain,
120 CellularSocketType_t socketType,
121 CellularSocketProtocol_t socketProtocol,
122 CellularSocketHandle_t * pSocketHandle );
123
128CellularError_t Cellular_CommonSocketSetSockOpt( CellularHandle_t cellularHandle,
129 CellularSocketHandle_t socketHandle,
130 CellularSocketOptionLevel_t optionLevel,
132 const uint8_t * pOptionValue,
133 uint32_t optionValueLength );
134
140 CellularSocketHandle_t socketHandle,
141 CellularSocketDataReadyCallback_t dataReadyCallback,
142 void * pCallbackContext );
143
149 CellularSocketHandle_t socketHandle,
150 CellularSocketOpenCallback_t socketOpenCallback,
151 void * pCallbackContext );
152
157CellularError_t Cellular_CommonSocketRegisterClosedCallback( CellularHandle_t cellularHandle,
158 CellularSocketHandle_t socketHandle,
159 CellularSocketClosedCallback_t closedCallback,
160 void * pCallbackContext );
161
166CellularError_t Cellular_CommonRfOn( CellularHandle_t cellularHandle );
167
172CellularError_t Cellular_CommonRfOff( CellularHandle_t cellularHandle );
173
178CellularError_t Cellular_CommonGetIPAddress( CellularHandle_t cellularHandle,
179 uint8_t contextId,
180 char * pBuffer,
181 uint32_t bufferLength );
182
187CellularError_t Cellular_CommonGetModemInfo( CellularHandle_t cellularHandle,
188 CellularModemInfo_t * pModemInfo );
189
194CellularError_t Cellular_CommonGetEidrxSettings( CellularHandle_t cellularHandle,
195 CellularEidrxSettingsList_t * pEidrxSettingsList );
196
201CellularError_t Cellular_CommonSetEidrxSettings( CellularHandle_t cellularHandle,
202 const CellularEidrxSettings_t * pEidrxSettings );
203
208CellularError_t Cellular_CommonGetRegisteredNetwork( CellularHandle_t cellularHandle,
209 CellularPlmnInfo_t * pNetworkInfo );
210
215CellularError_t Cellular_CommonGetNetworkTime( CellularHandle_t cellularHandle,
216 CellularTime_t * pNetworkTime );
217
222CellularError_t Cellular_CommonGetServiceStatus( CellularHandle_t cellularHandle,
223 CellularServiceStatus_t * pServiceStatus );
224
229CellularError_t Cellular_CommonSetPdnConfig( CellularHandle_t cellularHandle,
230 uint8_t contextId,
231 const CellularPdnConfig_t * pPdnConfig );
232
237CellularError_t Cellular_CommonGetPsmSettings( CellularHandle_t cellularHandle,
238 CellularPsmSettings_t * pPsmSettings );
239
244CellularError_t Cellular_CommonSetPsmSettings( CellularHandle_t cellularHandle,
245 const CellularPsmSettings_t * pPsmSettings );
246
251CellularError_t Cellular_CommonGetSimCardInfo( CellularHandle_t cellularHandle,
252 CellularSimCardInfo_t * pSimCardInfo );
253
263CellularError_t Cellular_CommonGetSimCardLockStatus( CellularHandle_t cellularHandle,
264 CellularSimCardStatus_t * pSimCardStatus );
265
277CellularPktStatus_t Cellular_CommonUrcProcessCereg( CellularContext_t * pContext,
278 char * pInputLine );
279
291CellularPktStatus_t Cellular_CommonUrcProcessCgreg( CellularContext_t * pContext,
292 char * pInputLine );
293
305CellularPktStatus_t Cellular_CommonUrcProcessCreg( CellularContext_t * pContext,
306 char * pInputLine );
307
308/* *INDENT-OFF* */
309#ifdef __cplusplus
310 }
311#endif
312/* *INDENT-ON* */
313
314#endif /* __CELLULAR_COMMON_API_H__ */
CellularError_t Cellular_CommonSetPdnConfig(CellularHandle_t cellularHandle, uint8_t contextId, const CellularPdnConfig_t *pPdnConfig)
This function is the common implementation of FreeRTOS Cellular Library API. Reference Cellular_GetSe...
Definition: cellular_3gpp_api.c:2145
CellularError_t Cellular_CommonSocketRegisterClosedCallback(CellularHandle_t cellularHandle, CellularSocketHandle_t socketHandle, CellularSocketClosedCallback_t closedCallback, void *pCallbackContext)
This function is the common implementation of FreeRTOS Cellular Library API. Reference Cellular_Socke...
Definition: cellular_common_api.c:550
CellularError_t Cellular_CommonCleanup(CellularHandle_t cellularHandle)
This function is the common implementation of FreeRTOS Cellular Library API. Reference Cellular_Clean...
Definition: cellular_common_api.c:208
CellularError_t Cellular_CommonRegisterModemEventCallback(CellularHandle_t cellularHandle, CellularModemEventCallback_t modemEventCallback, void *pCallbackContext)
This function is the common implementation of FreeRTOS Cellular Library API. Reference Cellular_Regis...
Definition: cellular_common_api.c:336
CellularError_t Cellular_CommonSetEidrxSettings(CellularHandle_t cellularHandle, const CellularEidrxSettings_t *pEidrxSettings)
This function is the common implementation of FreeRTOS Cellular Library API. Reference Cellular_SetEi...
Definition: cellular_3gpp_api.c:1674
CellularError_t Cellular_CommonCreateSocket(CellularHandle_t cellularHandle, uint8_t pdnContextId, CellularSocketDomain_t socketDomain, CellularSocketType_t socketType, CellularSocketProtocol_t socketProtocol, CellularSocketHandle_t *pSocketHandle)
This function is the common implementation of FreeRTOS Cellular Library API. Reference Cellular_Creat...
Definition: cellular_common_api.c:408
CellularError_t Cellular_CommonRfOn(CellularHandle_t cellularHandle)
This function is the common implementation of FreeRTOS Cellular Library API. Reference Cellular_RfOn ...
Definition: cellular_3gpp_api.c:1729
CellularError_t Cellular_CommonGetPsmSettings(CellularHandle_t cellularHandle, CellularPsmSettings_t *pPsmSettings)
This function is the common implementation of FreeRTOS Cellular Library API. Reference Cellular_GetSe...
Definition: cellular_3gpp_api.c:3017
CellularError_t Cellular_CommonRegisterUrcSignalStrengthChangedCallback(CellularHandle_t cellularHandle, CellularUrcSignalStrengthChangedCallback_t signalStrengthChangedCallback, void *pCallbackContext)
This function is the common implementation of FreeRTOS Cellular Library API. Reference Cellular_Regis...
Definition: cellular_common_api.c:282
CellularError_t Cellular_CommonGetServiceStatus(CellularHandle_t cellularHandle, CellularServiceStatus_t *pServiceStatus)
This function is the common implementation of FreeRTOS Cellular Library API. Reference Cellular_GetSe...
Definition: cellular_3gpp_api.c:1837
CellularPktStatus_t Cellular_CommonUrcProcessCereg(CellularContext_t *pContext, char *pInputLine)
3GPP URC AT+CEREG handler for FreeRTOS Cellular Library.
Definition: cellular_3gpp_urc_handler.c:680
CellularError_t Cellular_CommonGetRegisteredNetwork(CellularHandle_t cellularHandle, CellularPlmnInfo_t *pNetworkInfo)
This function is the common implementation of FreeRTOS Cellular Library API. Reference Cellular_GetRe...
Definition: cellular_3gpp_api.c:1785
CellularError_t Cellular_CommonATCommandRaw(CellularHandle_t cellularHandle, const char *pATCommandPrefix, const char *pATCommandPayload, CellularATCommandType_t atCommandType, CellularATCommandResponseReceivedCallback_t responseReceivedCallback, void *pData, uint16_t dataLen)
This function is the common implementation of FreeRTOS Cellular Library API. Reference Cellular_ATCom...
Definition: cellular_common_api.c:363
CellularError_t Cellular_CommonRfOff(CellularHandle_t cellularHandle)
This function is the common implementation of FreeRTOS Cellular Library API. Reference Cellular_RfOff...
Definition: cellular_3gpp_api.c:1757
CellularPktStatus_t Cellular_CommonUrcProcessCreg(CellularContext_t *pContext, char *pInputLine)
3GPP URC AT+CREG handler for FreeRTOS Cellular Library.
Definition: cellular_3gpp_urc_handler.c:626
CellularError_t Cellular_CommonGetEidrxSettings(CellularHandle_t cellularHandle, CellularEidrxSettingsList_t *pEidrxSettingsList)
This function is the common implementation of FreeRTOS Cellular Library API. Reference Cellular_GetEi...
Definition: cellular_3gpp_api.c:1630
CellularError_t Cellular_CommonGetModemInfo(CellularHandle_t cellularHandle, CellularModemInfo_t *pModemInfo)
This function is the common implementation of FreeRTOS Cellular Library API. Reference Cellular_GetMo...
Definition: cellular_3gpp_api.c:1932
CellularError_t Cellular_CommonRegisterUrcPdnEventCallback(CellularHandle_t cellularHandle, CellularUrcPdnEventCallback_t pdnEventCallback, void *pCallbackContext)
This function is the common implementation of FreeRTOS Cellular Library API. Reference Cellular_Regis...
Definition: cellular_common_api.c:255
CellularPktStatus_t Cellular_CommonUrcProcessCgreg(CellularContext_t *pContext, char *pInputLine)
3GPP URC AT+CGREG handler for FreeRTOS Cellular Library.
Definition: cellular_3gpp_urc_handler.c:653
CellularError_t Cellular_CommonGetIPAddress(CellularHandle_t cellularHandle, uint8_t contextId, char *pBuffer, uint32_t bufferLength)
This function is the common implementation of FreeRTOS Cellular Library API. Reference Cellular_GetIP...
Definition: cellular_3gpp_api.c:2020
CellularError_t Cellular_CommonSocketRegisterDataReadyCallback(CellularHandle_t cellularHandle, CellularSocketHandle_t socketHandle, CellularSocketDataReadyCallback_t dataReadyCallback, void *pCallbackContext)
This function is the common implementation of FreeRTOS Cellular Library API. Reference Cellular_Socke...
Definition: cellular_common_api.c:490
CellularError_t Cellular_CommonSocketRegisterSocketOpenCallback(CellularHandle_t cellularHandle, CellularSocketHandle_t socketHandle, CellularSocketOpenCallback_t socketOpenCallback, void *pCallbackContext)
This function is the common implementation of FreeRTOS Cellular Library API. Reference Cellular_Socke...
Definition: cellular_common_api.c:520
CellularError_t Cellular_CommonInit(CellularHandle_t *pCellularHandle, const CellularCommInterface_t *pCommInterface, const CellularTokenTable_t *pTokenTable)
This function is the common implementation of FreeRTOS Cellular Library API. Reference Cellular_Init ...
Definition: cellular_common_api.c:142
CellularError_t Cellular_CommonGetSimCardInfo(CellularHandle_t cellularHandle, CellularSimCardInfo_t *pSimCardInfo)
This function is the common implementation of FreeRTOS Cellular Library API. Reference Cellular_GetSe...
Definition: cellular_3gpp_api.c:2708
CellularError_t Cellular_CommonGetNetworkTime(CellularHandle_t cellularHandle, CellularTime_t *pNetworkTime)
This function is the common implementation of FreeRTOS Cellular Library API. Reference Cellular_GetNe...
Definition: cellular_3gpp_api.c:1890
CellularError_t Cellular_CommonSetPsmSettings(CellularHandle_t cellularHandle, const CellularPsmSettings_t *pPsmSettings)
This function is the common implementation of FreeRTOS Cellular Library API. Reference Cellular_GetSe...
Definition: cellular_3gpp_api.c:2819
CellularError_t Cellular_CommonRegisterUrcNetworkRegistrationEventCallback(CellularHandle_t cellularHandle, CellularUrcNetworkRegistrationCallback_t networkRegistrationCallback, void *pCallbackContext)
This function is the common implementation of FreeRTOS Cellular Library API. Reference Cellular_Regis...
Definition: cellular_common_api.c:228
CellularError_t Cellular_CommonSocketSetSockOpt(CellularHandle_t cellularHandle, CellularSocketHandle_t socketHandle, CellularSocketOptionLevel_t optionLevel, CellularSocketOption_t option, const uint8_t *pOptionValue, uint32_t optionValueLength)
This function is the common implementation of FreeRTOS Cellular Library API. Reference Cellular_Socke...
Definition: cellular_common_api.c:446
CellularError_t Cellular_CommonRegisterUrcGenericCallback(CellularHandle_t cellularHandle, CellularUrcGenericCallback_t genericCallback, void *pCallbackContext)
This function is the common implementation of FreeRTOS Cellular Library API. Reference Cellular_Regis...
Definition: cellular_common_api.c:309
CellularError_t Cellular_CommonGetSimCardLockStatus(CellularHandle_t cellularHandle, CellularSimCardStatus_t *pSimCardStatus)
Get SIM card lock status.
Definition: cellular_3gpp_api.c:2664
CellularPktStatus_t
packet Status Names.
Definition: cellular_types.h:338
CellularATCommandType_t
Represents AT Command type.
Definition: cellular_types.h:360
CellularSocketType_t
Represents socket type.
Definition: cellular_types.h:273
CellularSocketOption_t
Socket option names.
Definition: cellular_types.h:325
CellularSocketOptionLevel_t
Represents socket option level.
Definition: cellular_types.h:315
CellularError_t
Status code returns from APIs.
Definition: cellular_types.h:88
CellularSocketDomain_t
Represents socket domain.
Definition: cellular_types.h:263
CellularSocketProtocol_t
Represents socket protocol.
Definition: cellular_types.h:283
void(* CellularModemEventCallback_t)(CellularModemEvent_t modemEvent, void *pCallbackContext)
Callback used to inform about modem events.
Definition: cellular_types.h:789
void(* CellularUrcSignalStrengthChangedCallback_t)(CellularUrcEvent_t urcEvent, const CellularSignalInfo_t *pSignalInfo, void *pCallbackContext)
Callback used to inform about signal strength changed URC event.
Definition: cellular_types.h:766
void(* CellularSocketClosedCallback_t)(CellularSocketHandle_t socketHandle, void *pCallbackContext)
Callback used to inform that remote end closed the connection for a connected socket.
Definition: cellular_types.h:826
void(* CellularUrcPdnEventCallback_t)(CellularUrcEvent_t urcEvent, uint8_t contextId, void *pCallbackContext)
Callback used to inform about PDN URC events.
Definition: cellular_types.h:753
void(* CellularUrcNetworkRegistrationCallback_t)(CellularUrcEvent_t urcEvent, const CellularServiceStatus_t *pServiceStatus, void *pCallbackContext)
Callback used to inform about a Network Registration URC event.
Definition: cellular_types.h:740
void(* CellularSocketDataReadyCallback_t)(CellularSocketHandle_t socketHandle, void *pCallbackContext)
Callback used to inform that data is ready for reading on a socket.
Definition: cellular_types.h:813
void(* CellularSocketOpenCallback_t)(CellularUrcEvent_t urcEvent, CellularSocketHandle_t socketHandle, void *pCallbackContext)
Callback used to inform about the status of socket open.
Definition: cellular_types.h:801
CellularPktStatus_t(* CellularATCommandResponseReceivedCallback_t)(CellularHandle_t cellularHandle, const CellularATCommandResponse_t *pAtResp, void *pData, uint16_t dataLen)
Callback used to inform about the response of an AT command sent using Cellular_ATCommandRaw API.
Definition: cellular_types.h:726
void(* CellularUrcGenericCallback_t)(const char *pRawData, void *pCallbackContext)
Generic callback used to inform all other URC events.
Definition: cellular_types.h:778
struct CellularSocketContext * CellularSocketHandle_t
Opaque socket handle.
Definition: cellular_types.h:81
Represents the functions of a comm interface.
Definition: cellular_comm_interface.h:160
Represents e-I-DRX settings.
Definition: cellular_types.h:572
Cellular Represents e-I-DRX settings Lists.
Definition: cellular_types.h:663
Modem information.
Definition: cellular_types.h:408
Represents a PDN config.
Definition: cellular_types.h:683
Public Land Mobile Network (PLMN) information.
Definition: cellular_types.h:387
Represents PSM settings.
Definition: cellular_types.h:493
Represents network service status.
Definition: cellular_types.h:454
SIM Card information.
Definition: cellular_types.h:397
SIM Card status.
Definition: cellular_types.h:377
Represents time.
Definition: cellular_types.h:422
Parameters to setup pktio and pkthandler token tables.
Definition: cellular_common.h:158