Skip to content

Commit

Permalink
Tests: bluetooth: tester: accomodate L2CAP connect commant to BTP change
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
KKopyscinski authored and carlescufi committed Sep 9, 2021
1 parent 6e26512 commit 7a687b8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions tests/bluetooth/tester/src/bttester.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions tests/bluetooth/tester/src/l2cap.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 7a687b8

Please sign in to comment.