Skip to content

Commit 66096b8

Browse files
Add callback handling on disconnection to ATTClass::disconnect()
Copying method from ATTClass::removeConnection
1 parent 8dc4290 commit 66096b8

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/utility/ATT.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -481,6 +481,12 @@ bool ATTClass::disconnect()
481481
}
482482

483483
numDisconnects++;
484+
485+
BLEDevice bleDevice(_peers[i].addressType, _peers[i].address);
486+
487+
if (_eventHandlers[BLEDisconnected]) {
488+
_eventHandlers[BLEDisconnected](bleDevice);
489+
}
484490

485491
_peers[i].connectionHandle = 0xffff;
486492
_peers[i].role = 0x00;

0 commit comments

Comments
 (0)