Skip to content

Commit 0b49952

Browse files
authored
Merge pull request #11249 from dextero/get-sms-zero
Make AT_CellularSMS::list_messages support index 0 in SMS inbox
2 parents c37b562 + ce0bb7f commit 0b49952

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

UNITTESTS/features/cellular/framework/AT/at_cellularsms/at_cellularsmstest.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ TEST_F(TestAT_CellularSMS, test_AT_CellularSMS_get_sms)
137137
EXPECT_TRUE(NSAPI_ERROR_PARAMETER == sms.get_sms(NULL, 16, phone, 21, stamp, 21, &size));
138138

139139
ATHandler_stub::resp_info_true_counter = 1;
140-
ATHandler_stub::int_value = 0;
140+
ATHandler_stub::int_value = -1;
141141
EXPECT_TRUE(-1 == sms.get_sms(buf, 16, phone, 21, stamp, 21, &size));
142142

143143
//In below we are expecting the stub ATHandler info_resp() to respond

features/cellular/framework/AT/AT_CellularSMS.cpp

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

1047-
if (index > 0) {
1047+
if (index >= 0) {
10481048
add_info(info, index, part_number);
10491049
} else {
10501050
delete info;

0 commit comments

Comments
 (0)