19#include <zephyr/types.h>
23#define AT_PARAM_SEPARATOR ','
24#define AT_RSP_SEPARATOR ':'
25#define AT_CMD_SEPARATOR '='
26#define AT_CMD_READ_TEST_IDENTIFIER '?'
27#define AT_CMD_BUFFER_TERMINATOR 0
28#define AT_CMD_STRING_IDENTIFIER '\"'
29#define AT_STANDARD_NOTIFICATION_PREFIX '+'
30#define AT_PROP_NOTIFICATION_PREFX '%'
31#define AT_CUSTOM_COMMAND_PREFX '#'
44static inline bool is_notification(char chr)
46 if ((chr == AT_STANDARD_NOTIFICATION_PREFIX) ||
47 (chr == AT_PROP_NOTIFICATION_PREFX) ||
48 (chr == AT_CUSTOM_COMMAND_PREFX)) {
65static inline bool is_valid_command_char(char chr)
67 if (isalpha((int)chr) || isdigit((int)chr)) {
84static inline bool is_valid_notification_char(char chr)
86 chr = toupper((int)chr);
88 if (((chr >= 'A') && (chr <= 'Z')) || (chr == '_')) {
106static inline bool is_terminated(char chr)
108 if (chr == AT_CMD_BUFFER_TERMINATOR) {
126static inline bool is_separator(char chr)
128 if ((chr == AT_PARAM_SEPARATOR) || (chr == AT_RSP_SEPARATOR) ||
129 (chr == AT_CMD_SEPARATOR)) {
146static inline bool is_lfcr(char chr)
148 if ((chr == '\r') || (chr == '\n')) {
166static inline bool is_dblquote(char chr)
225 if (isdigit((
int)chr) || (chr ==
'-') || (chr ==
'+')) {
244 if (strlen(str) < 2) {
248 if ((toupper((
int)str[0]) !=
'A') || (toupper((
int)str[1]) !=
'T')) {
283 if (strlen(str) < 4) {
287 if ((toupper(str[0]) !=
'A') || (toupper(str[1]) !=
'T')) {
292 if ((toupper(str[2]) !=
'+') && (toupper(str[2]) !=
'%')) {
297 if ((toupper(str[2]) ==
'%') && (toupper(str[3]) ==
'X')) {
static bool is_clac(const char *str)
Check if a string is a beginning of an AT CLAC response.
Definition: at_utils.h:276
static bool is_command(const char *str)
Check if a string is a beginning of an AT command.
Definition: at_utils.h:242
#define AT_STANDARD_NOTIFICATION_PREFIX
Definition: at_utils.h:29
static bool is_terminated(char chr)
Check if the character identifies the end of the buffer.
Definition: at_utils.h:106
static bool is_array_start(char chr)
Check if character is an array start character.
Definition: at_utils.h:185
#define AT_CUSTOM_COMMAND_PREFX
Definition: at_utils.h:31
static bool is_lfcr(char chr)
Check if character linefeed or carry return characters.
Definition: at_utils.h:146
#define AT_PROP_NOTIFICATION_PREFX
Definition: at_utils.h:30
static bool is_array_stop(char chr)
Check if character is an array stop character.
Definition: at_utils.h:204
static bool is_number(char chr)
Check if character is a number character (including + and -)
Definition: at_utils.h:223