suggested change by Hugues Kamba

Co-authored-by: Hugues Kamba <41612201+hugueskamba@users.noreply.github.com>
pull/13476/head
talorion 2020-08-26 18:43:14 +02:00
parent f8d90dd5b0
commit 73116b7ce0
2 changed files with 5 additions and 2 deletions

View File

@ -25,6 +25,10 @@ static const int sslctxID = 1;
using namespace mbed; using namespace mbed;
namespace mbed{
constexpr auto ME310_SOCKET_TIMEOUT=std::chrono::milliseconds(1000);
}
TELIT_ME310_CellularStack::TELIT_ME310_CellularStack(ATHandler &atHandler, int cid, nsapi_ip_stack_t stack_type, AT_CellularDevice &device) : TELIT_ME310_CellularStack::TELIT_ME310_CellularStack(ATHandler &atHandler, int cid, nsapi_ip_stack_t stack_type, AT_CellularDevice &device) :
AT_CellularStack(atHandler, cid, stack_type, device) AT_CellularStack(atHandler, cid, stack_type, device)
, _tls_sec_level(0) , _tls_sec_level(0)
@ -436,7 +440,7 @@ nsapi_size_or_error_t TELIT_ME310_CellularStack::socket_recvfrom_impl(CellularSo
// read() should not fail // read() should not fail
success = false; success = false;
} }
} else if (std::chrono::duration_cast<std::chrono::milliseconds>(timer.elapsed_time()) < std::chrono::milliseconds(ME310_SOCKET_TIMEOUT)) { } else if (std::chrono::duration_cast<std::chrono::milliseconds>(timer.elapsed_time()) < mbed::ME310_SOCKET_TIMEOUT) {
// Wait for URCs // Wait for URCs
_at.process_oob(); _at.process_oob();
} else { } else {

View File

@ -34,7 +34,6 @@ namespace mbed {
#define ME310_SOCKET_BIND_FAIL 556 #define ME310_SOCKET_BIND_FAIL 556
#define ME310_IPEASY_ACTIVATED_CONTEXT 1 #define ME310_IPEASY_ACTIVATED_CONTEXT 1
#define ME310_IPEASY_DEACTIVATED_CONTEXT 0 #define ME310_IPEASY_DEACTIVATED_CONTEXT 0
#define ME310_SOCKET_TIMEOUT 1000
#define CTRL_Z "\x1a" #define CTRL_Z "\x1a"
#define ESC "\x1b" #define ESC "\x1b"