diff options
author | Sven Gothel <[email protected]> | 2020-12-04 14:12:30 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2020-12-04 14:12:30 +0100 |
commit | 016ef2ad1e25cedff5ffb9df97f75dc6741ffaae (patch) | |
tree | 41a4560f34fda357b5ca2ab0049a99ec2660a208 /src | |
parent | 52fd23d707f6961189e83903da095db6de7811ae (diff) |
DBTAdapter::[un]lockConnect(..): Add provisional #if/else USE_LINUX_BT_SECURITY re SMPIOCapability setting
Diffstat (limited to 'src')
-rw-r--r-- | src/direct_bt/DBTAdapter.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/direct_bt/DBTAdapter.cpp b/src/direct_bt/DBTAdapter.cpp index 04d7e9fb..443f7602 100644 --- a/src/direct_bt/DBTAdapter.cpp +++ b/src/direct_bt/DBTAdapter.cpp @@ -392,11 +392,12 @@ bool DBTAdapter::lockConnect(const DBTDevice & device, const bool wait, const SM single_conn_device_ptr = &device; if( SMPIOCapability::UNSET != io_cap ) { +#if USE_LINUX_BT_SECURITY SMPIOCapability pre_io_cap { SMPIOCapability::UNSET }; const bool res_iocap = mgmt.setIOCapability(dev_id, io_cap, pre_io_cap); if( res_iocap ) { iocap_defaultval = pre_io_cap; - COND_PRINT(debug_lock, "DBTAdapter::lockConnect: Success: setIOCapability[%s -> %s], %s", + COND_PRINT(debug_lock, "DBTAdapter::lockConnect: Success: New lock, setIOCapability[%s -> %s], %s", getSMPIOCapabilityString(pre_io_cap).c_str(), getSMPIOCapabilityString(io_cap).c_str(), device.toString(false).c_str()); return true; @@ -408,6 +409,12 @@ bool DBTAdapter::lockConnect(const DBTDevice & device, const bool wait, const SM cv_single_conn_device.notify_all(); // notify waiting getter return false; } +#else + COND_PRINT(debug_lock, "DBTAdapter::lockConnect: Success: New lock, ignored io-cap: %s, %s", + getSMPIOCapabilityString(io_cap).c_str() + device.toString(false).c_str()); + return true; +#endif } else { COND_PRINT(debug_lock, "DBTAdapter::lockConnect: Success: New lock, no io-cap: %s", device.toString(false).c_str()); return true; @@ -421,6 +428,7 @@ bool DBTAdapter::unlockConnect(const DBTDevice & device) noexcept { const SMPIOCapability v = iocap_defaultval; iocap_defaultval = SMPIOCapability::UNSET; if( SMPIOCapability::UNSET != v ) { + // Unreachable: !USE_LINUX_BT_SECURITY SMPIOCapability o; const bool res = mgmt.setIOCapability(dev_id, v, o); COND_PRINT(debug_lock, "DBTAdapter::unlockConnect: Success: setIOCapability[res %d: %s -> %s], %s", @@ -451,6 +459,7 @@ bool DBTAdapter::unlockConnectAny() noexcept { const SMPIOCapability v = iocap_defaultval; iocap_defaultval = SMPIOCapability::UNSET; if( SMPIOCapability::UNSET != v ) { + // Unreachable: !USE_LINUX_BT_SECURITY SMPIOCapability o; const bool res = mgmt.setIOCapability(dev_id, v, o); COND_PRINT(debug_lock, "DBTAdapter::unlockConnectAny: Success: setIOCapability[res %d: %s -> %s]; %s", |