FreeRTOS: FreeRTOS Cellular Library v1.2.0
FreeRTOS Cellular Library
cellular_common_api.h
Go to the documentation of this file.
1/*
2 * FreeRTOS-Cellular-Interface v1.2.0
3 * Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
4 *
5 * Permission is hereby granted, free of charge, to any person obtaining a copy of
6 * this software and associated documentation files (the "Software"), to deal in
7 * the Software without restriction, including without limitation the rights to
8 * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9 * the Software, and to permit persons to whom the Software is furnished to do so,
10 * subject to the following conditions:
11 *
12 * The above copyright notice and this permission notice shall be included in all
13 * copies or substantial portions of the Software.
14 *
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17 * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18 * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19 * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21 *
22 * https://www.FreeRTOS.org
23 * https://github.com/FreeRTOS
24 */
25
30#ifndef __CELLULAR_COMMON_API_H__
31#define __CELLULAR_COMMON_API_H__
32
33/* *INDENT-OFF* */
34#ifdef __cplusplus
35 extern "C" {
36#endif
37/* *INDENT-ON* */
38
39#include "cellular_types.h"
40#include "cellular_common.h"
42
43/*-----------------------------------------------------------*/
44
50 const CellularCommInterface_t * pCommInterface,
51 const CellularTokenTable_t * pTokenTable );
52
58
64 CellularUrcNetworkRegistrationCallback_t networkRegistrationCallback,
65 void * pCallbackContext );
66
72 CellularUrcPdnEventCallback_t pdnEventCallback,
73 void * pCallbackContext );
74
80 CellularUrcSignalStrengthChangedCallback_t signalStrengthChangedCallback,
81 void * pCallbackContext );
82
88 CellularUrcGenericCallback_t genericCallback,
89 void * pCallbackContext );
90
96 CellularModemEventCallback_t modemEventCallback,
97 void * pCallbackContext );
98
104 const char * pATCommandPrefix,
105 const char * pATCommandPayload,
106 CellularATCommandType_t atCommandType,
107 CellularATCommandResponseReceivedCallback_t responseReceivedCallback,
108 void * pData,
109 uint16_t dataLen );
110
116 uint8_t pdnContextId,
117 CellularSocketDomain_t socketDomain,
118 CellularSocketType_t socketType,
119 CellularSocketProtocol_t socketProtocol,
120 CellularSocketHandle_t * pSocketHandle );
121
127 CellularSocketHandle_t socketHandle,
128 CellularSocketOptionLevel_t optionLevel,
130 const uint8_t * pOptionValue,
131 uint32_t optionValueLength );
132
138 CellularSocketHandle_t socketHandle,
139 CellularSocketDataReadyCallback_t dataReadyCallback,
140 void * pCallbackContext );
141
147 CellularSocketHandle_t socketHandle,
148 CellularSocketOpenCallback_t socketOpenCallback,
149 void * pCallbackContext );
150
156 CellularSocketHandle_t socketHandle,
157 CellularSocketClosedCallback_t closedCallback,
158 void * pCallbackContext );
159
165
171
177 uint8_t contextId,
178 char * pBuffer,
179 uint32_t bufferLength );
180
186 CellularModemInfo_t * pModemInfo );
187
193 CellularEidrxSettingsList_t * pEidrxSettingsList );
194
200 const CellularEidrxSettings_t * pEidrxSettings );
201
207 CellularPlmnInfo_t * pNetworkInfo );
208
214 CellularTime_t * pNetworkTime );
215
221 CellularServiceStatus_t * pServiceStatus );
222
228 uint8_t contextId,
229 const CellularPdnConfig_t * pPdnConfig );
230
236 CellularPsmSettings_t * pPsmSettings );
237
243 const CellularPsmSettings_t * pPsmSettings );
244
250 CellularSimCardInfo_t * pSimCardInfo );
251
262 CellularSimCardStatus_t * pSimCardStatus );
263
276 char * pInputLine );
277
290 char * pInputLine );
291
304 char * pInputLine );
305
306/* *INDENT-OFF* */
307#ifdef __cplusplus
308 }
309#endif
310/* *INDENT-ON* */
311
312#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...
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...
CellularError_t Cellular_CommonCleanup(CellularHandle_t cellularHandle)
This function is the common implementation of FreeRTOS Cellular Library API. Reference Cellular_Clean...
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...
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...
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...
CellularError_t Cellular_CommonRfOn(CellularHandle_t cellularHandle)
This function is the common implementation of FreeRTOS Cellular Library API. Reference Cellular_RfOn ...
CellularError_t Cellular_CommonGetPsmSettings(CellularHandle_t cellularHandle, CellularPsmSettings_t *pPsmSettings)
This function is the common implementation of FreeRTOS Cellular Library API. Reference Cellular_GetSe...
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...
CellularError_t Cellular_CommonGetServiceStatus(CellularHandle_t cellularHandle, CellularServiceStatus_t *pServiceStatus)
This function is the common implementation of FreeRTOS Cellular Library API. Reference Cellular_GetSe...
CellularPktStatus_t Cellular_CommonUrcProcessCereg(CellularContext_t *pContext, char *pInputLine)
3GPP URC AT+CEREG handler for FreeRTOS Cellular Library.
CellularError_t Cellular_CommonGetRegisteredNetwork(CellularHandle_t cellularHandle, CellularPlmnInfo_t *pNetworkInfo)
This function is the common implementation of FreeRTOS Cellular Library API. Reference Cellular_GetRe...
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...
CellularError_t Cellular_CommonRfOff(CellularHandle_t cellularHandle)
This function is the common implementation of FreeRTOS Cellular Library API. Reference Cellular_RfOff...
CellularPktStatus_t Cellular_CommonUrcProcessCreg(CellularContext_t *pContext, char *pInputLine)
3GPP URC AT+CREG handler for FreeRTOS Cellular Library.
CellularError_t Cellular_CommonGetEidrxSettings(CellularHandle_t cellularHandle, CellularEidrxSettingsList_t *pEidrxSettingsList)
This function is the common implementation of FreeRTOS Cellular Library API. Reference Cellular_GetEi...
CellularError_t Cellular_CommonGetModemInfo(CellularHandle_t cellularHandle, CellularModemInfo_t *pModemInfo)
This function is the common implementation of FreeRTOS Cellular Library API. Reference Cellular_GetMo...
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...
CellularPktStatus_t Cellular_CommonUrcProcessCgreg(CellularContext_t *pContext, char *pInputLine)
3GPP URC AT+CGREG handler for FreeRTOS Cellular Library.
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...
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...
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...
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 ...
CellularError_t Cellular_CommonGetSimCardInfo(CellularHandle_t cellularHandle, CellularSimCardInfo_t *pSimCardInfo)
This function is the common implementation of FreeRTOS Cellular Library API. Reference Cellular_GetSe...
CellularError_t Cellular_CommonGetNetworkTime(CellularHandle_t cellularHandle, CellularTime_t *pNetworkTime)
This function is the common implementation of FreeRTOS Cellular Library API. Reference Cellular_GetNe...
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...
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...
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...
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...
CellularError_t Cellular_CommonGetSimCardLockStatus(CellularHandle_t cellularHandle, CellularSimCardStatus_t *pSimCardStatus)
Get SIM card lock status.
CellularPktStatus_t
packet Status Names.
Definition: cellular_types.h:335
CellularATCommandType_t
Represents AT Command type.
Definition: cellular_types.h:357
CellularSocketType_t
Represents socket type.
Definition: cellular_types.h:271
CellularSocketOption_t
Socket option names.
Definition: cellular_types.h:323
CellularSocketOptionLevel_t
Represents socket option level.
Definition: cellular_types.h:313
CellularError_t
Status code returns from APIs.
Definition: cellular_types.h:86
CellularSocketDomain_t
Represents socket domain.
Definition: cellular_types.h:261
CellularSocketProtocol_t
Represents socket protocol.
Definition: cellular_types.h:281
void(* CellularModemEventCallback_t)(CellularModemEvent_t modemEvent, void *pCallbackContext)
Callback used to inform about modem events.
Definition: cellular_types.h:784
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:761
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:821
void(* CellularUrcPdnEventCallback_t)(CellularUrcEvent_t urcEvent, uint8_t contextId, void *pCallbackContext)
Callback used to inform about PDN URC events.
Definition: cellular_types.h:748
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:735
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:808
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:796
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:721
void(* CellularUrcGenericCallback_t)(const char *pRawData, void *pCallbackContext)
Generic callback used to inform all other URC events.
Definition: cellular_types.h:773
struct CellularSocketContext * CellularSocketHandle_t
Opaque socket handle.
Definition: cellular_types.h:79
struct CellularContext CellularContext_t
Opaque Cellular context structure type.
Definition: cellular_types.h:65
struct CellularContext * CellularHandle_t
Opaque Cellular handle.
Definition: cellular_types.h:71
Represents the functions of a comm interface.
Definition: cellular_comm_interface.h:158
Represents e-I-DRX settings.
Definition: cellular_types.h:567
Cellular Represents e-I-DRX settings Lists.
Definition: cellular_types.h:658
Modem information.
Definition: cellular_types.h:403
Represents a PDN config.
Definition: cellular_types.h:678
Public Land Mobile Network (PLMN) information.
Definition: cellular_types.h:382
Represents PSM settings.
Definition: cellular_types.h:488
Represents network service status.
Definition: cellular_types.h:449
SIM Card information.
Definition: cellular_types.h:392
SIM Card status.
Definition: cellular_types.h:372
Represents time.
Definition: cellular_types.h:417
Parameters to setup pktio and pkthandler token tables.
Definition: cellular_common.h:156