From 0c8dadba43b4b69f212ae61f4235bc9270eacfe9 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Wed, 2 Feb 2022 17:08:55 +0100 Subject: BTAdapter::mgmtEvDeviceConnectedHCI: No last_discovery update; mgmtEvDeviceFoundHCI: Update last_discovery on re-discovered device --- src/direct_bt/BTAdapter.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src/direct_bt/BTAdapter.cpp') diff --git a/src/direct_bt/BTAdapter.cpp b/src/direct_bt/BTAdapter.cpp index c92ce856..b3fd105d 100644 --- a/src/direct_bt/BTAdapter.cpp +++ b/src/direct_bt/BTAdapter.cpp @@ -1852,9 +1852,6 @@ bool BTAdapter::mgmtEvDeviceConnectedHCI(const MgmtEvent& e) noexcept { device->toString().c_str()); } else { addConnectedDevice(device); // track device, if not done yet - if( 2 <= new_connect ) { - device->ts_last_discovery = ad_report.getTimestamp(); - } COND_PRINT(debug_event, "BTAdapter::EventHCI:DeviceConnected(dev_id %d, new_connect %d, updated %s): %s, handle %s -> %s,\n %s,\n -> %s", dev_id, new_connect, to_string(updateMask).c_str(), event.toString().c_str(), jau::to_hexstring(device->getConnectionHandle()).c_str(), jau::to_hexstring(event.getHCIHandle()).c_str(), @@ -2321,6 +2318,7 @@ bool BTAdapter::mgmtEvDeviceFoundHCI(const MgmtEvent& e) noexcept { // Already discovered device // const EIRDataType updateMask = dev_discovered->update(*eir); + dev_discovered->ts_last_discovery = eir->getTimestamp(); if( nullptr == dev_shared ) { // // Discovered but not a shared device, -- cgit v1.2.3