Skip to content

Commit

Permalink
Merge pull request #907 from pennam/client-network-check
Browse files Browse the repository at this point in the history
MbedClient add network status check
  • Loading branch information
pennam committed Jun 28, 2024
2 parents 9194e32 + 636b20e commit e707506
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions libraries/SocketWrapper/src/MbedClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ arduino::MbedClient::MbedClient()
}

uint8_t arduino::MbedClient::status() {
return _status;
return (_status && (getNetwork()->get_connection_status() < NSAPI_STATUS_DISCONNECTED));
}


Expand Down Expand Up @@ -300,7 +300,7 @@ void arduino::MbedClient::stop() {
}

uint8_t arduino::MbedClient::connected() {
return ((_status) || (available() > 0));
return ((status() == true) || (available() > 0));
}

IPAddress arduino::MbedClient::remoteIP() {
Expand Down

0 comments on commit e707506

Please sign in to comment.