Skip to content

Commit e707506

Browse files
authored
Merge pull request #907 from pennam/client-network-check
MbedClient add network status check
2 parents 9194e32 + 636b20e commit e707506

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

libraries/SocketWrapper/src/MbedClient.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ arduino::MbedClient::MbedClient()
1010
}
1111

1212
uint8_t arduino::MbedClient::status() {
13-
return _status;
13+
return (_status && (getNetwork()->get_connection_status() < NSAPI_STATUS_DISCONNECTED));
1414
}
1515

1616

@@ -300,7 +300,7 @@ void arduino::MbedClient::stop() {
300300
}
301301

302302
uint8_t arduino::MbedClient::connected() {
303-
return ((_status) || (available() > 0));
303+
return ((status() == true) || (available() > 0));
304304
}
305305

306306
IPAddress arduino::MbedClient::remoteIP() {

0 commit comments

Comments
 (0)