From 1c1243e636dbd379d346ef1436c8c30d02469915 Mon Sep 17 00:00:00 2001 From: David Alonso de la Torre Date: Sat, 30 Dec 2023 11:47:56 +0100 Subject: [PATCH] Increase at timeout to 10s in AT_CellularSMS::get_sms --- connectivity/cellular/source/framework/AT/AT_CellularSMS.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/connectivity/cellular/source/framework/AT/AT_CellularSMS.cpp b/connectivity/cellular/source/framework/AT/AT_CellularSMS.cpp index 8820c731c316..949bf17cfb74 100644 --- a/connectivity/cellular/source/framework/AT/AT_CellularSMS.cpp +++ b/connectivity/cellular/source/framework/AT/AT_CellularSMS.cpp @@ -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) { @@ -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; } @@ -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