[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
+3 -1
View File
@@ -43,7 +43,9 @@ class MyClientCallback : public BLEClientCallbacks {
void onConnect(BLEClient* pclient) {
}
void onDisconnect(BLEClient* pclient) {
/** onDisconnect now takes a reason parameter to indicate the reason for disconnection
void onDisconnect(BLEClient* pclient) { */
void onDisconnect(BLEClient* pclient, int reason) {
connected = false;
printf("onDisconnect");
}