Skip to content

Commit 17f6f1c

Browse files
author
Marcin Radomski
committed
Make AT_CellularSMS support index 0 in SMS inbox
When AT+CGML is used to retrieve list of SMS stored in modem inbox, every message has an associated index. ETSI TS 127 005 v7.0.0 does not specify what is the allowed range of such indices - all it says is "integer type; value in the range of location numbers supported by the associated memory". Usually, AT modems use positive indexes (starting at 1). Quectel BG96 modem takes a different approach, indexing messages starting at 0. Current implementation of `AT_CellularSMS::list_messages()` considers index 0 invalid and ignores such message, effectively making it impossible to access using mbed-os API. This commit changes the behavior so that value of 0 is handled as any other positive message index.
1 parent 033fffe commit 17f6f1c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

features/cellular/framework/AT/AT_CellularSMS.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1037,7 +1037,7 @@ nsapi_error_t AT_CellularSMS::list_messages()
10371037
(void)_at.consume_to_stop_tag(); // consume until <CR><LF>
10381038
}
10391039

1040-
if (index > 0) {
1040+
if (index >= 0) {
10411041
add_info(info, index, part_number);
10421042
} else {
10431043
delete info;

0 commit comments

Comments
 (0)