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 <lyle.zhu@nxp.com>
This commit is contained in:
Lyle Zhu 2025-03-07 20:35:14 +08:00 committed by Benjamin Cabé
commit 424364ded0
2 changed files with 4 additions and 0 deletions

View file

@ -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 {

View file

@ -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;
}