[Breaking] Add disconnect reason to client callback. (#398) (#81)

Adds the reason code as a parameter to the client onDisconnect callback.

* Update examples/docs.
This commit is contained in:
h2zero
2022-08-26 19:51:19 -06:00
committed by GitHub
parent bb3dd5f114
commit bfe68f4a91
6 changed files with 18 additions and 18 deletions
+1 -1
View File
@@ -253,7 +253,7 @@ bool NimBLEDevice::deleteClient(NimBLEClient* pClient) {
}
// Since we set the flag to false the app will not get a callback
// in the disconnect event so we call it here for good measure.
pClient->m_pClientCallbacks->onDisconnect(pClient);
pClient->m_pClientCallbacks->onDisconnect(pClient, BLE_ERR_CONN_TERM_LOCAL);
} else if(pClient->m_pTaskData != nullptr) {
rc = ble_gap_conn_cancel();