summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2023-11-24 08:02:20 +0100
committerSven Gothel <[email protected]>2023-11-24 08:02:20 +0100
commit7a906ba8bbea95a3b2895951e65573701457dc34 (patch)
tree69e5661bb3b59cbd3bd75b62def318fe15861784
parentcf3d5a2c7e5bd54b9af514061e7d8375a0c4d9da (diff)
BTAdapter::mgmtEvDeviceFoundHCI: Only unpair() shared and non-discovered device if not pre-paired
Avoid losing device pairing if performed via Direct-BT in case explicit startDiscovery() purged discovered devices.
-rw-r--r--src/direct_bt/BTAdapter.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/direct_bt/BTAdapter.cpp b/src/direct_bt/BTAdapter.cpp
index 7081d633..16e9550e 100644
--- a/src/direct_bt/BTAdapter.cpp
+++ b/src/direct_bt/BTAdapter.cpp
@@ -2597,7 +2597,7 @@ void BTAdapter::mgmtEvDeviceFoundHCI(const MgmtEvent& e) noexcept {
printDeviceLists();
}
- {
+ if( !dev_shared->isPrePaired() ) {
HCIStatusCode res = dev_shared->unpair();
if( HCIStatusCode::SUCCESS != res && HCIStatusCode::NOT_PAIRED != res ) {
WARN_PRINT("(dev_id %d): Unpair device failed: %s, %s",