aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2023-10-22 05:42:15 +0200
committerSven Gothel <[email protected]>2023-10-22 05:42:15 +0200
commit701ed7e6dbebbc2118726f203ae576df73ea5e2d (patch)
treef52ac44fc2803cc4ebd7200ed78fc88e55f07b98
parentd2ed1668a4702c3973f984448bc2af583125e7e4 (diff)
BTManager::initializeAdapter(): Disable Privacy and reorder modes BREDR -> LE for clarity
-rw-r--r--src/direct_bt/BTManager.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/direct_bt/BTManager.cpp b/src/direct_bt/BTManager.cpp
index 1dd35be9..84520ada 100644
--- a/src/direct_bt/BTManager.cpp
+++ b/src/direct_bt/BTManager.cpp
@@ -257,6 +257,11 @@ HCIStatusCode BTManager::initializeAdapter(AdapterInfo& adapterInfo, const uint1
current_settings = adapterInfo.getCurrentSettingMask();
setMode(dev_id, MgmtCommand::Opcode::SET_POWERED, 0, current_settings);
+ {
+ jau::uint128_t zero_privacy_irk;
+ zero_privacy_irk.clear();
+ setPrivacy(dev_id, 0x00, zero_privacy_irk, current_settings);
+ }
switch ( btMode ) {
case BTMode::DUAL:
@@ -264,8 +269,8 @@ HCIStatusCode BTManager::initializeAdapter(AdapterInfo& adapterInfo, const uint1
setDiscoverable(dev_id, 0, 0, current_settings);
setMode(dev_id, MgmtCommand::Opcode::SET_LE, 1, current_settings);
if constexpr ( USE_LINUX_BT_SECURITY ) {
- setMode(dev_id, MgmtCommand::Opcode::SET_SECURE_CONN, sc_on_param, current_settings);
setMode(dev_id, MgmtCommand::Opcode::SET_SSP, ssp_on_param, current_settings);
+ setMode(dev_id, MgmtCommand::Opcode::SET_SECURE_CONN, sc_on_param, current_settings);
}
break;
case BTMode::BREDR:
@@ -273,8 +278,8 @@ HCIStatusCode BTManager::initializeAdapter(AdapterInfo& adapterInfo, const uint1
setDiscoverable(dev_id, 0, 0, current_settings);
setMode(dev_id, MgmtCommand::Opcode::SET_LE, 0, current_settings);
if constexpr ( USE_LINUX_BT_SECURITY ) {
- setMode(dev_id, MgmtCommand::Opcode::SET_SECURE_CONN, 0, current_settings);
setMode(dev_id, MgmtCommand::Opcode::SET_SSP, ssp_on_param, current_settings);
+ setMode(dev_id, MgmtCommand::Opcode::SET_SECURE_CONN, 0, current_settings);
}
break;
case BTMode::NONE:
@@ -283,8 +288,8 @@ HCIStatusCode BTManager::initializeAdapter(AdapterInfo& adapterInfo, const uint1
setMode(dev_id, MgmtCommand::Opcode::SET_BREDR, 0, current_settings);
setMode(dev_id, MgmtCommand::Opcode::SET_LE, 1, current_settings);
if constexpr ( USE_LINUX_BT_SECURITY ) {
- setMode(dev_id, MgmtCommand::Opcode::SET_SECURE_CONN, sc_on_param, current_settings);
setMode(dev_id, MgmtCommand::Opcode::SET_SSP, 0, current_settings); // SSP not available in LE single mode
+ setMode(dev_id, MgmtCommand::Opcode::SET_SECURE_CONN, sc_on_param, current_settings);
}
break;
}
@@ -294,8 +299,8 @@ HCIStatusCode BTManager::initializeAdapter(AdapterInfo& adapterInfo, const uint1
setMode(dev_id, MgmtCommand::Opcode::SET_IO_CAPABILITY, direct_bt::number(BTManager::defaultIOCapability), current_settings);
setMode(dev_id, MgmtCommand::Opcode::SET_BONDABLE, 1, current_settings); // required for pairing
} else {
- setMode(dev_id, MgmtCommand::Opcode::SET_SECURE_CONN, 0, current_settings);
setMode(dev_id, MgmtCommand::Opcode::SET_SSP, 0, current_settings);
+ setMode(dev_id, MgmtCommand::Opcode::SET_SECURE_CONN, 0, current_settings);
setMode(dev_id, MgmtCommand::Opcode::SET_DEBUG_KEYS, 0, current_settings);
setMode(dev_id, MgmtCommand::Opcode::SET_BONDABLE, 0, current_settings);
}