From c667eb5acac79b2c4d076787be5d2ca352d8dc1b Mon Sep 17 00:00:00 2001 From: Lyle Zhu Date: Mon, 3 Mar 2025 19:13:56 +0800 Subject: [PATCH] Bluetooth: tester: Support connectable mode for classic Disable connectable mode for classic if `cp->connectable` is false. Enable connectable mode for classic if `cp->connectable` is true. Signed-off-by: Lyle Zhu --- tests/bluetooth/tester/src/btp_gap.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/bluetooth/tester/src/btp_gap.c b/tests/bluetooth/tester/src/btp_gap.c index f8898b0c792..dd68b2ba9f1 100644 --- a/tests/bluetooth/tester/src/btp_gap.c +++ b/tests/bluetooth/tester/src/btp_gap.c @@ -472,6 +472,15 @@ static uint8_t set_connectable(const void *cmd, uint16_t cmd_len, const struct btp_gap_set_connectable_cmd *cp = cmd; struct btp_gap_set_connectable_rp *rp = rsp; + if (IS_ENABLED(CONFIG_BT_CLASSIC)) { + int err; + + err = bt_br_set_connectable(cp->connectable ? true : false); + if ((err < 0) && (err != -EALREADY)) { + return BTP_STATUS_FAILED; + } + } + if (cp->connectable) { atomic_set_bit(¤t_settings, BTP_GAP_SETTINGS_CONNECTABLE); } else {