Check connection status when returning in NimBLEClient::Connect.

There is a chance to become disconnected before returning from the onConnect callback so the connection
status should be checked when returning from client connect.
This commit is contained in:
h2zero 2021-01-14 10:21:25 -07:00
parent c157680575
commit c089eab595

View file

@ -284,7 +284,8 @@ bool NimBLEClient::connect(const NimBLEAddress &address, bool deleteAttibutes) {
m_pClientCallbacks->onConnect(this);
NIMBLE_LOGD(LOG_TAG, "<< connect()");
return true;
// Check if still connected before returning
return isConnected();
} // connect