diff options
author | Sven Gothel <[email protected]> | 2020-10-15 01:47:28 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2020-10-15 01:47:28 +0200 |
commit | 236cb386f133b5aeb4e2db5813709dbb3619daca (patch) | |
tree | e1458e2c6190330c5476fa1060e670762b24168b /src | |
parent | 24a1fc01ea95e1a5612312a17388e7bbf2728d93 (diff) |
DBTDevice::disconnectGATT: Show caller in DBG_PRINT
Diffstat (limited to 'src')
-rw-r--r-- | src/direct_bt/DBTDevice.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/direct_bt/DBTDevice.cpp b/src/direct_bt/DBTDevice.cpp index 14c939df..57394504 100644 --- a/src/direct_bt/DBTDevice.cpp +++ b/src/direct_bt/DBTDevice.cpp @@ -412,16 +412,16 @@ void DBTDevice::notifyDisconnected() noexcept { allowDisconnect = false; isConnected = false; hciConnHandle = 0; - disconnectGATT(); + disconnectGATT(1); } -void DBTDevice::disconnectGATT() noexcept { +void DBTDevice::disconnectGATT(int caller) noexcept { const std::lock_guard<std::recursive_mutex> lock_conn(mtx_gattHandler); if( nullptr != gattHandler ) { - DBG_PRINT("DBTDevice::disconnectGATT: start (has gattHandler)"); + DBG_PRINT("DBTDevice::disconnectGATT: start (has gattHandler, caller %d)", caller); gattHandler->disconnect(false /* disconnectDevice */, false /* ioErrorCause */); } else { - DBG_PRINT("DBTDevice::disconnectGATT: start (nil gattHandler)"); + DBG_PRINT("DBTDevice::disconnectGATT: start (nil gattHandler, caller %d)", caller); } gattHandler = nullptr; DBG_PRINT("DBTDevice::disconnectGATT: end"); @@ -445,7 +445,7 @@ HCIStatusCode DBTDevice::disconnect(const HCIStatusCode reason) noexcept { // Disconnect GATT before device, keeping reversed initialization order intact if possible. // This outside mtx_connect, keeping same mutex lock order intact as well - disconnectGATT(); + disconnectGATT(0); // Lock to avoid other threads connecting while disconnecting const std::lock_guard<std::recursive_mutex> lock_conn(mtx_connect); // RAII-style acquire and relinquish via destructor |