aboutsummaryrefslogtreecommitdiffstats
path: root/src/direct_bt/BTGattHandler.cpp
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2021-09-26 21:57:16 +0200
committerSven Gothel <[email protected]>2021-09-26 21:57:16 +0200
commit84aa57d04f485493408791dfdacd053973d018dd (patch)
treeb6684ea370119446054374b8ba1935d52b52baf3 /src/direct_bt/BTGattHandler.cpp
parentc2c3a74d101ce1e8235315213f72a10300574422 (diff)
Add BTGattHandler::getCharListenerCount() to validate [add|remove]CharListener(), see dbt_scanner10.cpp. Also add DBG_PRINT at BTGattHandler dtor
Diffstat (limited to 'src/direct_bt/BTGattHandler.cpp')
-rw-r--r--src/direct_bt/BTGattHandler.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/direct_bt/BTGattHandler.cpp b/src/direct_bt/BTGattHandler.cpp
index aef257e5..0902dabe 100644
--- a/src/direct_bt/BTGattHandler.cpp
+++ b/src/direct_bt/BTGattHandler.cpp
@@ -347,10 +347,12 @@ BTGattHandler::BTGattHandler(const std::shared_ptr<BTDevice> &device, L2CAPComm&
}
BTGattHandler::~BTGattHandler() noexcept {
+ DBG_PRINT("GATTHandler::dtor: Start: %s", toString().c_str());
disconnect(false /* disconnectDevice */, false /* ioErrorCause */);
characteristicListenerList.clear();
services.clear();
genericAccess = nullptr;
+ DBG_PRINT("GATTHandler::dtor: End: %s", toString().c_str());
}
bool BTGattHandler::disconnect(const bool disconnectDevice, const bool ioErrorCause) noexcept {
@@ -1123,5 +1125,5 @@ std::shared_ptr<GattDeviceInformationSvc> BTGattHandler::getDeviceInformation(ja
}
std::string BTGattHandler::toString() const noexcept {
- return "GattHndlr["+to_string(getRole())+", "+deviceString+"]";
+ return "GattHndlr["+to_string(getRole())+", "+std::to_string(characteristicListenerList.size())+" listener, "+deviceString+", "+getStateString()+"]";
}