Skip to content

Commit

Permalink
Merge pull request #11249 from dextero/get-sms-zero
Browse files Browse the repository at this point in the history
Make AT_CellularSMS::list_messages support index 0 in SMS inbox
  • Loading branch information
0xc0170 authored Aug 20, 2019
2 parents c37b562 + ce0bb7f commit 0b49952
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ TEST_F(TestAT_CellularSMS, test_AT_CellularSMS_get_sms)
EXPECT_TRUE(NSAPI_ERROR_PARAMETER == sms.get_sms(NULL, 16, phone, 21, stamp, 21, &size));

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

//In below we are expecting the stub ATHandler info_resp() to respond
Expand Down
2 changes: 1 addition & 1 deletion features/cellular/framework/AT/AT_CellularSMS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1044,7 +1044,7 @@ nsapi_error_t AT_CellularSMS::list_messages()
(void)_at.consume_to_stop_tag(); // consume until <CR><LF>
}

if (index > 0) {
if (index >= 0) {
add_info(info, index, part_number);
} else {
delete info;
Expand Down

0 comments on commit 0b49952

Please sign in to comment.