From df16fa76d7c3530f813358c2f70f4501225e5a20 Mon Sep 17 00:00:00 2001 From: pennam Date: Mon, 17 Jun 2024 18:01:22 +0200 Subject: [PATCH 1/2] MbedClient: let status() check also for network connection status --- libraries/SocketWrapper/src/MbedClient.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/SocketWrapper/src/MbedClient.cpp b/libraries/SocketWrapper/src/MbedClient.cpp index 2bb933350..1aed4d5ef 100644 --- a/libraries/SocketWrapper/src/MbedClient.cpp +++ b/libraries/SocketWrapper/src/MbedClient.cpp @@ -10,7 +10,7 @@ arduino::MbedClient::MbedClient() } uint8_t arduino::MbedClient::status() { - return _status; + return (_status && (getNetwork()->get_connection_status() < NSAPI_STATUS_DISCONNECTED)); } From 636b20e5a82d5db16fb3bf4b77f716ddd5e401d6 Mon Sep 17 00:00:00 2001 From: pennam Date: Mon, 17 Jun 2024 18:03:12 +0200 Subject: [PATCH 2/2] MbedClient: check for client and network status in connected() --- libraries/SocketWrapper/src/MbedClient.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/SocketWrapper/src/MbedClient.cpp b/libraries/SocketWrapper/src/MbedClient.cpp index 1aed4d5ef..425abad7c 100644 --- a/libraries/SocketWrapper/src/MbedClient.cpp +++ b/libraries/SocketWrapper/src/MbedClient.cpp @@ -305,7 +305,7 @@ void arduino::MbedClient::stop() { } uint8_t arduino::MbedClient::connected() { - return ((_status) || (available() > 0)); + return ((status() == true) || (available() > 0)); } IPAddress arduino::MbedClient::remoteIP() {