FreeRTOS: FreeRTOS Cellular Library v1.4.0
FreeRTOS Cellular Library
 
Loading...
Searching...
No Matches
cellular_at_core.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_AT_CORE_H__
33#define __CELLULAR_AT_CORE_H__
34
35/* *INDENT-OFF* */
36#ifdef __cplusplus
37 extern "C" {
38#endif
39/* *INDENT-ON* */
40
41/* Standard includes */
42#include <stdbool.h>
43#include <string.h>
44
45/* Standard includes. */
46#include <stdint.h>
47
48/* Cellular includes. */
49#ifndef CELLULAR_DO_NOT_USE_CUSTOM_CONFIG
50 /* Include custom config file before other headers. */
51 #include "cellular_config.h"
52#endif
54
55/*-----------------------------------------------------------*/
56
60#define ARRAY_SIZE( x ) ( sizeof( x ) / sizeof( x[ 0 ] ) )
61
62/*-----------------------------------------------------------*/
63
67typedef enum CellularATError
68{
77
78/*-----------------------------------------------------------*/
79
112
143
167
191
223
248
260 char ** ppTokOutput );
261
281 const char * pDelimiter,
282 char ** ppTokOutput );
283
314CellularATError_t Cellular_ATHexStrToHex( const char * pString,
315 uint8_t * pHexData,
316 uint16_t hexDataLen );
317
331CellularATError_t Cellular_ATIsStrDigit( const char * pString,
332 bool * pResult );
333
345 bool * pResult );
346
357 const char * pSrc );
358
369CellularATError_t Cellular_ATStrStartWith( const char * pString,
370 const char * pPrefix,
371 bool * pResult );
372
384CellularATError_t Cellular_ATcheckErrorCode( const char * pInputBuf,
385 const char * const * const ppKeyList,
386 size_t keyListLen,
387 bool * pResult );
388
400CellularATError_t Cellular_ATStrtoi( const char * pStr,
401 int32_t base,
402 int32_t * pResult );
403
404/* *INDENT-OFF* */
405#ifdef __cplusplus
406 }
407#endif
408/* *INDENT-ON* */
409
410#endif /* __CELLULAR_AT_CORE_H__ */
CellularATError_t Cellular_ATGetNextTok(char **ppString, char **ppTokOutput)
Extract the next token based on comma (',') as delimiter.
Definition: cellular_at_core.c:507
CellularATError_t
Represents error codes returned from AT Core APIs.
Definition: cellular_at_core.h:68
@ CELLULAR_AT_UNKNOWN
Definition: cellular_at_core.h:75
@ CELLULAR_AT_MODEM_ERROR
Definition: cellular_at_core.h:73
@ CELLULAR_AT_SUCCESS
Definition: cellular_at_core.h:69
@ CELLULAR_AT_BAD_PARAMETER
Definition: cellular_at_core.h:70
@ CELLULAR_AT_NO_MEMORY
Definition: cellular_at_core.h:71
@ CELLULAR_AT_ERROR
Definition: cellular_at_core.h:74
@ CELLULAR_AT_UNSUPPORTED
Definition: cellular_at_core.h:72
CellularATError_t Cellular_ATRemoveLeadingWhiteSpaces(char **ppString)
Remove all leading white spaces from an AT response.
Definition: cellular_at_core.c:263
CellularATError_t Cellular_ATRemovePrefix(char **ppString)
Remove prefix from a string.
Definition: cellular_at_core.c:219
CellularATError_t Cellular_ATcheckErrorCode(const char *pInputBuf, const char *const *const ppKeyList, size_t keyListLen, bool *pResult)
check if certain success code/error code present in the input buffer
Definition: cellular_at_core.c:723
CellularATError_t Cellular_ATRemoveAllWhiteSpaces(char *pString)
Remove all white spaces from an AT response.
Definition: cellular_at_core.c:356
CellularATError_t Cellular_ATRemoveAllDoubleQuote(char *pString)
Remove all double quotes from an AT response.
Definition: cellular_at_core.c:461
CellularATError_t Cellular_ATStrDup(char **ppDst, const char *pSrc)
duplicate string from pSrc to ppDst, malloc is use to allocate mem space for ppDst
Definition: cellular_at_core.c:767
CellularATError_t Cellular_ATStrtoi(const char *pStr, int32_t base, int32_t *pResult)
Convert string to int32_t.
Definition: cellular_at_core.c:818
CellularATError_t Cellular_ATIsStrDigit(const char *pString, bool *pResult)
Check if a string is numeric.
Definition: cellular_at_core.c:677
CellularATError_t Cellular_ATRemoveTrailingWhiteSpaces(char *pString)
Remove all trailing white spaces from an AT response.
Definition: cellular_at_core.c:303
CellularATError_t Cellular_ATHexStrToHex(const char *pString, uint8_t *pHexData, uint16_t hexDataLen)
Convert HEX string to HEX.
Definition: cellular_at_core.c:614
CellularATError_t Cellular_ATStrStartWith(const char *pString, const char *pPrefix, bool *pResult)
check if a string starts with certain prefix
Definition: cellular_at_core.c:163
CellularATError_t Cellular_ATIsPrefixPresent(const char *pString, bool *pResult)
check if a string as prefix present by determine present of ':'
Definition: cellular_at_core.c:96
CellularATError_t Cellular_ATRemoveOutermostDoubleQuote(char **ppString)
Remove outermost double quotes from an AT response.
Definition: cellular_at_core.c:409
CellularATError_t Cellular_ATGetSpecificNextTok(char **ppString, const char *pDelimiter, char **ppTokOutput)
Extract the next token based on the provided delimiter.
Definition: cellular_at_core.c:528
This represents the default values for the configuration macros for the Cellular library.