FreeRTOS: FreeRTOS Cellular Library v1.2.0
FreeRTOS Cellular Library
cellular_at_core.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_AT_CORE_H__
31#define __CELLULAR_AT_CORE_H__
32
33/* *INDENT-OFF* */
34#ifdef __cplusplus
35 extern "C" {
36#endif
37/* *INDENT-ON* */
38
39/* Standard includes */
40#include <stdbool.h>
41#include <string.h>
42
43/* Standard includes. */
44#include <stdint.h>
45
46/*-----------------------------------------------------------*/
47
51#define CELLULAR_AT_MAX_STRING_SIZE ( 256U )
52
56#define CELLULAR_AT_MAX_PREFIX_SIZE ( 32 )
57
61#define ARRY_SIZE( x ) ( sizeof( x ) / sizeof( x[ 0 ] ) )
62
63/*-----------------------------------------------------------*/
64
68typedef enum CellularATError
69{
78
79/*-----------------------------------------------------------*/
80
113
144
168
192
224
249
261 char ** ppTokOutput );
262
282 const char * pDelimiter,
283 char ** ppTokOutput );
284
316 uint8_t * pHexData,
317 uint16_t hexDataLen );
318
333 bool * pResult );
334
346 bool * pResult );
347
358 const char * pSrc );
359
371 const char * pPrefix,
372 bool * pResult );
373
386 const char * const * const ppKeyList,
387 size_t keyListLen,
388 bool * pResult );
389
402 int32_t base,
403 int32_t * pResult );
404
405/* *INDENT-OFF* */
406#ifdef __cplusplus
407 }
408#endif
409/* *INDENT-ON* */
410
411#endif /* __CELLULAR_AT_CORE_H__ */
CellularATError_t Cellular_ATGetNextTok(char **ppString, char **ppTokOutput)
Extract the next token based on comma (',') as delimiter.
CellularATError_t
Represents error codes returned from AT Core APIs.
Definition: cellular_at_core.h:69
@ CELLULAR_AT_UNKNOWN
Definition: cellular_at_core.h:76
@ CELLULAR_AT_MODEM_ERROR
Definition: cellular_at_core.h:74
@ CELLULAR_AT_SUCCESS
Definition: cellular_at_core.h:70
@ CELLULAR_AT_BAD_PARAMETER
Definition: cellular_at_core.h:71
@ CELLULAR_AT_NO_MEMORY
Definition: cellular_at_core.h:72
@ CELLULAR_AT_ERROR
Definition: cellular_at_core.h:75
@ CELLULAR_AT_UNSUPPORTED
Definition: cellular_at_core.h:73
CellularATError_t Cellular_ATRemoveLeadingWhiteSpaces(char **ppString)
Remove all leading white spaces from an AT response.
CellularATError_t Cellular_ATRemovePrefix(char **ppString)
Remove prefix from a string.
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
CellularATError_t Cellular_ATRemoveAllWhiteSpaces(char *pString)
Remove all white spaces from an AT response.
CellularATError_t Cellular_ATRemoveAllDoubleQuote(char *pString)
Remove all double quotes from an AT response.
CellularATError_t Cellular_ATStrDup(char **ppDst, const char *pSrc)
duplicate string from pSrc to ppDst, malloc is use to allocate mem space for ppDst
CellularATError_t Cellular_ATStrtoi(const char *pStr, int32_t base, int32_t *pResult)
Convert string to int32_t.
CellularATError_t Cellular_ATIsStrDigit(const char *pString, bool *pResult)
Check if a string is numeric.
CellularATError_t Cellular_ATRemoveTrailingWhiteSpaces(char *pString)
Remove all trailing white spaces from an AT response.
CellularATError_t Cellular_ATHexStrToHex(const char *pString, uint8_t *pHexData, uint16_t hexDataLen)
Convert HEX string to HEX.
CellularATError_t Cellular_ATStrStartWith(const char *pString, const char *pPrefix, bool *pResult)
check if a string starts with certain prefix
CellularATError_t Cellular_ATIsPrefixPresent(const char *pString, bool *pResult)
check if a string as prefix present by determine present of ':'
CellularATError_t Cellular_ATRemoveOutermostDoubleQuote(char **ppString)
Remove outermost double quotes from an AT response.
CellularATError_t Cellular_ATGetSpecificNextTok(char **ppString, const char *pDelimiter, char **ppTokOutput)
Extract the next token based on the provided delimiter.