From 424364ded05baed3388ad1da4b17abcceaf10996 Mon Sep 17 00:00:00 2001 From: Lyle Zhu Date: Fri, 7 Mar 2025 20:35:14 +0800 Subject: [PATCH] Bluetooth: tester: Support l2cap connect rsp `insuff secure authen` If the L2CAP connection response of command `listen` is `BTP_L2CAP_CONNECTION_RESPONSE_INSUFF_SEC_AUTHEN`, set the security level of L2CAP server to level 4. Signed-off-by: Lyle Zhu --- tests/bluetooth/tester/src/btp/btp_l2cap.h | 1 + tests/bluetooth/tester/src/btp_l2cap.c | 3 +++ 2 files changed, 4 insertions(+) diff --git a/tests/bluetooth/tester/src/btp/btp_l2cap.h b/tests/bluetooth/tester/src/btp/btp_l2cap.h index d08a89fba85..32d16d6d75e 100644 --- a/tests/bluetooth/tester/src/btp/btp_l2cap.h +++ b/tests/bluetooth/tester/src/btp/btp_l2cap.h @@ -53,6 +53,7 @@ struct btp_l2cap_send_data_cmd { #define BTP_L2CAP_CONNECTION_RESPONSE_INSUFF_AUTHOR 0x02 #define BTP_L2CAP_CONNECTION_RESPONSE_INSUFF_ENC_KEY 0x03 #define BTP_L2CAP_CONNECTION_RESPONSE_INSUFF_ENCRYPTION 0x04 +#define BTP_L2CAP_CONNECTION_RESPONSE_INSUFF_SEC_AUTHEN 0x05 #define BTP_L2CAP_LISTEN 0x05 struct btp_l2cap_listen_cmd { diff --git a/tests/bluetooth/tester/src/btp_l2cap.c b/tests/bluetooth/tester/src/btp_l2cap.c index cbda506b898..ec7107271ff 100644 --- a/tests/bluetooth/tester/src/btp_l2cap.c +++ b/tests/bluetooth/tester/src/btp_l2cap.c @@ -770,6 +770,9 @@ static uint8_t listen(const void *cmd, uint16_t cmd_len, case BTP_L2CAP_CONNECTION_RESPONSE_INSUFF_ENCRYPTION: server->sec_level = BT_SECURITY_L2; break; + case BTP_L2CAP_CONNECTION_RESPONSE_INSUFF_SEC_AUTHEN: + server->sec_level = BT_SECURITY_L4; + break; default: return BTP_STATUS_FAILED; }