diff --git a/src/utility/ATT.cpp b/src/utility/ATT.cpp index 9367cfbf..5d920a32 100644 --- a/src/utility/ATT.cpp +++ b/src/utility/ATT.cpp @@ -553,6 +553,22 @@ bool ATTClass::disconnect() numDisconnects++; + BLEDevice bleDevice(_peers[i].addressType, _peers[i].address); + + // clear CCCD values on disconnect + for (uint16_t att = 0; att < GATT.attributeCount(); att++) { + BLELocalAttribute* attribute = GATT.attribute(att); + + if (attribute->type() == BLETypeCharacteristic) { + BLELocalCharacteristic* characteristic = (BLELocalCharacteristic*)attribute; + + characteristic->writeCccdValue(bleDevice, 0x0000); + } + } + + _longWriteHandle = 0x0000; + _longWriteValueLength = 0; + _peers[i].connectionHandle = 0xffff; _peers[i].role = 0x00; _peers[i].addressType = 0x00; pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy