aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2021-09-25 02:41:28 +0200
committerSven Gothel <[email protected]>2021-09-25 02:41:28 +0200
commit80e667635815c7faaaca74279dde75519f36c904 (patch)
treeae9587d1a5a6722f4e2cdc4dfbdb7dc07fb3d6fe
parent73ca617a55dbd3af4b66246d211895bbbf377a03 (diff)
BTAdapter::stopDiscovery(): Resolves checkDiscoveryState error message @ HCI command failure.
-rw-r--r--src/direct_bt/BTAdapter.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/direct_bt/BTAdapter.cpp b/src/direct_bt/BTAdapter.cpp
index 8cbc59e0..2a72bb52 100644
--- a/src/direct_bt/BTAdapter.cpp
+++ b/src/direct_bt/BTAdapter.cpp
@@ -927,8 +927,14 @@ HCIStatusCode BTAdapter::stopDiscovery() noexcept {
}
exit:
+ if( HCIStatusCode::SUCCESS != status ) {
+ // Sync nativeDiscoveryState with currentMetaScanType,
+ // the latter git set to NONE via mgmtEvDeviceDiscoveringHCI(..) below.
+ // Resolves checkDiscoveryState error message @ HCI command failure.
+ hci.setCurrentScanType( ScanType::NONE );
+ }
if( le_scan_temp_disabled || HCIStatusCode::SUCCESS != status ) {
- // In case of discoveryTempDisabled, power-off, le_enable_scane failure
+ // In case of discoveryTempDisabled, power-off, le_enable_scan failure
// or already closed HCIHandler, send the event directly.
const MgmtEvtDiscovering e(dev_id, ScanType::LE, false);
mgmtEvDeviceDiscoveringHCI( e );