Skip to content

Commit ac28f25

Browse files
authored
Add module defined prefix char check function (#55)
* Module can override the CELLULAR_CHECK_IS_PREFIX_CHAR macro in "cellular_config.h" if allowed prefix char is different.
1 parent 477bd62 commit ac28f25

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

source/cellular_at_core.c

+4-2
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,12 @@
4343

4444
/*-----------------------------------------------------------*/
4545

46-
#define CHECK_IS_PREFIX_CHAR( inputChar ) \
46+
#ifndef CELLULAR_CHECK_IS_PREFIX_CHAR
47+
#define CELLULAR_CHECK_IS_PREFIX_CHAR( inputChar ) \
4748
( ( ( ( int32_t ) isalpha( ( ( int8_t ) ( inputChar ) ) ) ) == 0 ) && \
4849
( ( ( int32_t ) isdigit( ( ( int8_t ) ( inputChar ) ) ) ) == 0 ) && \
4950
( ( inputChar ) != '+' ) && ( ( inputChar ) != '_' ) )
51+
#endif
5052

5153
/*-----------------------------------------------------------*/
5254

@@ -141,7 +143,7 @@ CellularATError_t Cellular_ATIsPrefixPresent( const char * pString,
141143
/* It's caused by stanard api isalpha and isdigit. */
142144
/* coverity[misra_c_2012_directive_4_6_violation] */
143145
/* coverity[misra_c_2012_rule_10_8_violation] */
144-
if( CHECK_IS_PREFIX_CHAR( ( char ) ( *ptrChar ) ) )
146+
if( CELLULAR_CHECK_IS_PREFIX_CHAR( ( char ) ( *ptrChar ) ) )
145147
{
146148
*pResult = false;
147149
break;

0 commit comments

Comments
 (0)