summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2020-07-28 00:59:51 +0200
committerSven Gothel <[email protected]>2020-07-28 00:59:51 +0200
commit5779e14403e88d05f9e8dcfe387d93c389ae8032 (patch)
tree2aeaa865291ede895ba286baab175cf9b265eac6 /src
parent9a9187944ba1862d274bf06d872959168b62d620 (diff)
DBT Adapter/Device: Enhance WARN and DBG PRINT (no more verbosity)
Diffstat (limited to 'src')
-rw-r--r--src/direct_bt/DBTAdapter.cpp14
-rw-r--r--src/direct_bt/DBTDevice.cpp6
2 files changed, 14 insertions, 6 deletions
diff --git a/src/direct_bt/DBTAdapter.cpp b/src/direct_bt/DBTAdapter.cpp
index 3e29b7b9..c5275104 100644
--- a/src/direct_bt/DBTAdapter.cpp
+++ b/src/direct_bt/DBTAdapter.cpp
@@ -604,11 +604,17 @@ bool DBTAdapter::mgmtEvDeviceConnectedHCI(std::shared_ptr<MgmtEvent> e) {
device->ts_last_discovery = ad_report.getTimestamp();
}
if( 0 == new_connect ) {
- WARN_PRINT("DBTAdapter::EventHCI:DeviceConnected(dev_id %d, already connected, updated %s): %s,\n %s\n -> %s",
- dev_id, getEIRDataMaskString(updateMask).c_str(), event.toString().c_str(), ad_report.toString().c_str(), device->toString().c_str());
+ WARN_PRINT("DBTAdapter::EventHCI:DeviceConnected(dev_id %d, already connected, updated %s): %s, handle %s -> %s,\n %s,\n -> %s",
+ dev_id, getEIRDataMaskString(updateMask).c_str(), event.toString().c_str(),
+ uint16HexString(device->getConnectionHandle()).c_str(), uint16HexString(event.getHCIHandle()).c_str(),
+ ad_report.toString().c_str(),
+ device->toString().c_str());
} else {
- DBG_PRINT("DBTAdapter::EventHCI:DeviceConnected(dev_id %d, new_connect %d, updated %s): %s,\n %s\n -> %s",
- dev_id, new_connect, getEIRDataMaskString(updateMask).c_str(), event.toString().c_str(), ad_report.toString().c_str(), device->toString().c_str());
+ DBG_PRINT("DBTAdapter::EventHCI:DeviceConnected(dev_id %d, new_connect %d, updated %s): %s, handle %s -> %s,\n %s,\n -> %s",
+ dev_id, new_connect, getEIRDataMaskString(updateMask).c_str(), event.toString().c_str(),
+ uint16HexString(device->getConnectionHandle()).c_str(), uint16HexString(event.getHCIHandle()).c_str(),
+ ad_report.toString().c_str(),
+ device->toString().c_str());
}
device->notifyConnected(event.getHCIHandle());
diff --git a/src/direct_bt/DBTDevice.cpp b/src/direct_bt/DBTDevice.cpp
index 898feca4..e60fa2d4 100644
--- a/src/direct_bt/DBTDevice.cpp
+++ b/src/direct_bt/DBTDevice.cpp
@@ -386,14 +386,16 @@ HCIStatusCode DBTDevice::connectDefault()
}
void DBTDevice::notifyConnected(const uint16_t handle) {
- DBG_PRINT("DBTDevice::notifyConnected: handle %s, %s", uint16HexString(handle).c_str(), toString().c_str());
+ DBG_PRINT("DBTDevice::notifyConnected: handle %s -> %s, %s",
+ uint16HexString(hciConnHandle).c_str(), uint16HexString(handle).c_str(), toString().c_str());
isConnected = true;
allowDisconnect = true;
hciConnHandle = handle;
}
void DBTDevice::notifyDisconnected() {
- DBG_PRINT("DBTDevice::notifyDisconnected: %s", toString().c_str());
+ DBG_PRINT("DBTDevice::notifyDisconnected: handle %s -> zero, %s",
+ uint16HexString(hciConnHandle).c_str(), toString().c_str());
try {
// coming from disconnect callback, ensure cleaning up!
disconnect(true /* fromDisconnectCB */, false /* ioErrorCause */);