Skip to content

Commit

Permalink
Increase at timeout to 10s in AT_CellularSMS::get_sms
Browse files Browse the repository at this point in the history
  • Loading branch information
davidalo committed Dec 30, 2023
1 parent 2d8b04f commit 1c1243e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions connectivity/cellular/source/framework/AT/AT_CellularSMS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -703,6 +703,7 @@ nsapi_size_or_error_t AT_CellularSMS::get_sms(char *buf, uint16_t len, char *pho
}

_at.lock();
_at.set_at_timeout(10s);

nsapi_size_or_error_t err = list_messages();
if (err == NSAPI_ERROR_OK) {
Expand All @@ -716,6 +717,7 @@ nsapi_size_or_error_t AT_CellularSMS::get_sms(char *buf, uint16_t len, char *pho
*buf_size = info->msg_size;
}
free_linked_list();
_at.restore_at_timeout();
_at.unlock();
return NSAPI_ERROR_PARAMETER;
}
Expand All @@ -740,6 +742,7 @@ nsapi_size_or_error_t AT_CellularSMS::get_sms(char *buf, uint16_t len, char *pho

free_linked_list();

_at.restore_at_timeout();
_at.unlock();

// update error only when there really was an error, otherwise we return the length
Expand Down

0 comments on commit 1c1243e

Please sign in to comment.