forked from h2zero/esp-nimble-cpp
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:
@ -284,7 +284,8 @@ bool NimBLEClient::connect(const NimBLEAddress &address, bool deleteAttibutes) {
|
|||||||
m_pClientCallbacks->onConnect(this);
|
m_pClientCallbacks->onConnect(this);
|
||||||
|
|
||||||
NIMBLE_LOGD(LOG_TAG, "<< connect()");
|
NIMBLE_LOGD(LOG_TAG, "<< connect()");
|
||||||
return true;
|
// Check if still connected before returning
|
||||||
|
return isConnected();
|
||||||
} // connect
|
} // connect
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user