File tree Expand file tree Collapse file tree 3 files changed +33
-10
lines changed Expand file tree Collapse file tree 3 files changed +33
-10
lines changed Original file line number Diff line number Diff line change 440440 ( !( CELLULAR_CHECK_IS_PREFIX_LEADING_CHAR( inputChar ) ) ) )
441441#endif
442442
443+ /**
444+ * @brief Cellular AT string length.<br>
445+ *
446+ * The maximum length of an AT string.<br>
447+ *
448+ * <b>Possible values:</b>`Any positive integer`<br>
449+ * <b>Default value (if undefined):</b> 256
450+ */
451+ #ifndef CELLULAR_AT_MAX_STRING_SIZE
452+ #define CELLULAR_AT_MAX_STRING_SIZE ( 256U )
453+ #endif
454+
443455/**
444456 * @brief Macro that is called in the cellular library for logging "Error" level
445457 * messages.
Original file line number Diff line number Diff line change 4545/* Standard includes. */
4646#include <stdint.h>
4747
48- /*----------------------------------------------------------- */
49-
50- /**
51- * @brief Maximum size of an AT string.
52- */
53- #define CELLULAR_AT_MAX_STRING_SIZE ( 256U )
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
53+ #include "cellular_config_defaults.h"
5454
55- /**
56- * @brief Maximum size of an AT prefix.
57- */
58- #define CELLULAR_AT_MAX_PREFIX_SIZE ( 32 )
55+ /*-----------------------------------------------------------*/
5956
6057/**
6158 * @brief The array size of an array.
Original file line number Diff line number Diff line change @@ -888,6 +888,20 @@ void test_Cellular_ATStrStartWith_Empty_Prefix( void )
888888 TEST_ASSERT_EQUAL ( CELLULAR_AT_BAD_PARAMETER , cellularStatus );
889889}
890890
891+ /**
892+ * @brief Test the long string case for Cellular_ATStrStartWith to return CELLULAR_AT_BAD_PARAMETER.
893+ */
894+ void test_Cellular_ATStrStartWith_ATStringTooLong ( void )
895+ {
896+ CellularATError_t cellularStatus = CELLULAR_AT_SUCCESS ;
897+ bool result ;
898+ char * pPrefix = "" ;
899+ char pStringSuccess [] = CELLULAR_SAMPLE_PREFIX_STRING_LARGE_INPUT ;
900+
901+ cellularStatus = Cellular_ATStrStartWith ( pStringSuccess , pPrefix , & result );
902+ TEST_ASSERT_EQUAL ( CELLULAR_AT_BAD_PARAMETER , cellularStatus );
903+ }
904+
891905/**
892906 * @brief Test that any NULL parameter causes Cellular_ATStrtoi to return CELLULAR_AT_BAD_PARAMETER.
893907 */
You can’t perform that action at this time.
0 commit comments