mirror of
https://github.com/h2zero/esp-nimble-cpp.git
synced 2024-12-22 19:10:46 +01:00
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:
parent
c157680575
commit
c089eab595
1 changed files with 2 additions and 1 deletions
|
@ -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
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue