aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2022-04-10 19:35:59 +0200
committerSven Gothel <[email protected]>2022-04-10 19:35:59 +0200
commit5e97de6426067086e23c1ac81bd8eb6509ac33eb (patch)
tree39f3686c08ca006ca70c516f5aae7fc001fceef0 /src
parentde8ab8595c2da14b926a239486a0d921ec18e009 (diff)
BTDevice::processL2CAPSetup: Only set local server open l2cap_att's BTSecurityLevel is > UNSET (aka set)
Diffstat (limited to 'src')
-rw-r--r--src/direct_bt/BTDevice.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/direct_bt/BTDevice.cpp b/src/direct_bt/BTDevice.cpp
index c4163ffa..35dfec95 100644
--- a/src/direct_bt/BTDevice.cpp
+++ b/src/direct_bt/BTDevice.cpp
@@ -611,7 +611,11 @@ void BTDevice::processL2CAPSetup(std::shared_ptr<BTDevice> sthis) {
bool l2cap_open;
if( is_local_server && l2cap_att->isOpen() ) {
- l2cap_open = l2cap_att->setBTSecurityLevel(sec_level);
+ if( BTSecurityLevel::UNSET < sec_level ) {
+ l2cap_open = l2cap_att->setBTSecurityLevel(sec_level);
+ } else {
+ l2cap_open = true;
+ }
} else {
l2cap_open = l2cap_att->open(*this, sec_level); // initiates hciSMPMsgCallback() if sec_level > BT_SECURITY_LOW
}