From 8fd11ec1a0f2b1ccc669e68c4b0d25765d74be5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Kopy=C5=9Bci=C5=84ski?= Date: Thu, 12 Aug 2021 10:21:36 +0200 Subject: [PATCH] Tests: bluetooth: tester: accomodate L2CAP connect commant to BTP change MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit BTP change extended L2CAP_CONNECT command by ECFC flag, which determines which connection procedure is used (non-enhanced or ecred). Now, only this flag determines the procedure used, not number of requested channels. This was affecting L2CAP/ECFC/BV-25-C Signed-off-by: Krzysztof Kopyściński --- tests/bluetooth/tester/src/bttester.h | 1 + tests/bluetooth/tester/src/l2cap.c | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/bluetooth/tester/src/bttester.h b/tests/bluetooth/tester/src/bttester.h index 826c4749234ba..7027b808190d0 100644 --- a/tests/bluetooth/tester/src/bttester.h +++ b/tests/bluetooth/tester/src/bttester.h @@ -746,6 +746,7 @@ struct l2cap_connect_cmd { uint16_t psm; uint16_t mtu; uint8_t num; + uint8_t ecfc; } __packed; struct l2cap_connect_rp { uint8_t num; diff --git a/tests/bluetooth/tester/src/l2cap.c b/tests/bluetooth/tester/src/l2cap.c index 80ac7b96bc2ad..0e377acb012ac 100644 --- a/tests/bluetooth/tester/src/l2cap.c +++ b/tests/bluetooth/tester/src/l2cap.c @@ -182,12 +182,12 @@ static void connect(uint8_t *data, uint16_t len) allocated_channels[i] = &chan->le.chan; } - if (cmd->num == 1) { + if (cmd->num == 1 && cmd->ecfc == 0) { err = bt_l2cap_chan_connect(conn, &chan->le.chan, cmd->psm); if (err < 0) { goto fail; } - } else if (cmd->num > 1) { + } else if (cmd->ecfc == 1) { #if defined(CONFIG_BT_L2CAP_ECRED) err = bt_l2cap_ecred_chan_connect(conn, allocated_channels, cmd->psm);