mirror of
https://github.com/espressif/esp-nimble.git
synced 2026-09-08 02:00:06 +00:00
apps/bttester: add option to connect single ECFC channel
BTP specification was extended and we can decide weather or not connect ECFC channel by specifying it in 'option' command argument. This allows to connect single ECFC channel.
This commit is contained in:
committed by
Szymon Janc
parent
1fb4475bea
commit
f8f10ab96a
@@ -754,6 +754,8 @@ struct l2cap_read_supported_commands_rp {
|
||||
uint8_t data[0];
|
||||
} __packed;
|
||||
|
||||
#define L2CAP_CONNECT_OPT_ECFC 0x01
|
||||
|
||||
#define L2CAP_CONNECT 0x02
|
||||
struct l2cap_connect_cmd {
|
||||
uint8_t address_type;
|
||||
@@ -761,6 +763,7 @@ struct l2cap_connect_cmd {
|
||||
uint16_t psm;
|
||||
uint16_t mtu;
|
||||
uint8_t num;
|
||||
uint8_t options;
|
||||
} __packed;
|
||||
|
||||
struct l2cap_connect_rp {
|
||||
|
||||
@@ -397,6 +397,7 @@ static void connect(uint8_t *data, uint16_t len)
|
||||
uint16_t mtu = htole16(cmd->mtu);
|
||||
int rc;
|
||||
int i, j;
|
||||
bool ecfc = cmd->options & L2CAP_CONNECT_OPT_ECFC;
|
||||
|
||||
SYS_LOG_DBG("connect: type: %d addr: %s", addr->type, bt_hex(addr->val, 6));
|
||||
|
||||
@@ -439,11 +440,11 @@ static void connect(uint8_t *data, uint16_t len)
|
||||
}
|
||||
}
|
||||
|
||||
if (cmd->num == 1) {
|
||||
if (cmd->num == 1 && !ecfc) {
|
||||
rc = ble_l2cap_connect(desc.conn_handle, htole16(cmd->psm),
|
||||
mtu, sdu_rx[0],
|
||||
tester_l2cap_event, NULL);
|
||||
} else if (cmd->num > 1) {
|
||||
} else if (ecfc) {
|
||||
rc = ble_l2cap_enhanced_connect(desc.conn_handle,
|
||||
htole16(cmd->psm), mtu,
|
||||
cmd->num, sdu_rx,
|
||||
|
||||
Reference in New Issue
Block a user