nimble/l2cap: Rename opcodes for LE CoC

Preparation to add new ones
This commit is contained in:
Łukasz Rymanowski
2020-03-07 01:09:21 +01:00
parent 3a1a6d3d13
commit 01ac200e99
3 changed files with 10 additions and 10 deletions
+2 -2
View File
@@ -51,8 +51,8 @@ struct ble_hs_conn;
#define BLE_L2CAP_SIG_OP_MOVE_CHAN_CONF_RSP 0x11
#define BLE_L2CAP_SIG_OP_UPDATE_REQ 0x12
#define BLE_L2CAP_SIG_OP_UPDATE_RSP 0x13
#define BLE_L2CAP_SIG_OP_CREDIT_CONNECT_REQ 0x14
#define BLE_L2CAP_SIG_OP_CREDIT_CONNECT_RSP 0x15
#define BLE_L2CAP_SIG_OP_LE_CREDIT_CONNECT_REQ 0x14
#define BLE_L2CAP_SIG_OP_LE_CREDIT_CONNECT_RSP 0x15
#define BLE_L2CAP_SIG_OP_FLOW_CTRL_CREDIT 0x16
#define BLE_L2CAP_SIG_OP_MAX 0x17
+4 -4
View File
@@ -121,8 +121,8 @@ static ble_l2cap_sig_rx_fn * const ble_l2cap_sig_dispatch[] = {
[BLE_L2CAP_SIG_OP_MOVE_CHAN_CONF_RSP] = ble_l2cap_sig_rx_noop,
[BLE_L2CAP_SIG_OP_UPDATE_REQ] = ble_l2cap_sig_update_req_rx,
[BLE_L2CAP_SIG_OP_UPDATE_RSP] = ble_l2cap_sig_update_rsp_rx,
[BLE_L2CAP_SIG_OP_CREDIT_CONNECT_REQ] = ble_l2cap_sig_coc_req_rx,
[BLE_L2CAP_SIG_OP_CREDIT_CONNECT_RSP] = ble_l2cap_sig_coc_rsp_rx,
[BLE_L2CAP_SIG_OP_LE_CREDIT_CONNECT_REQ] = ble_l2cap_sig_coc_req_rx,
[BLE_L2CAP_SIG_OP_LE_CREDIT_CONNECT_RSP] = ble_l2cap_sig_coc_rsp_rx,
[BLE_L2CAP_SIG_OP_FLOW_CTRL_CREDIT] = ble_l2cap_sig_le_credits_rx,
};
@@ -651,7 +651,7 @@ ble_l2cap_sig_coc_req_rx(uint16_t conn_handle, struct ble_l2cap_sig_hdr *hdr,
return rc;
}
rsp = ble_l2cap_sig_cmd_get(BLE_L2CAP_SIG_OP_CREDIT_CONNECT_RSP,
rsp = ble_l2cap_sig_cmd_get(BLE_L2CAP_SIG_OP_LE_CREDIT_CONNECT_RSP,
hdr->identifier, sizeof(*rsp), &txom);
if (!rsp) {
/* Well, nothing smart we can do if there is no memory for response.
@@ -840,7 +840,7 @@ ble_l2cap_sig_coc_connect(uint16_t conn_handle, uint16_t psm, uint16_t mtu,
proc->conn_handle = conn_handle;
proc->connect.chan = chan;
req = ble_l2cap_sig_cmd_get(BLE_L2CAP_SIG_OP_CREDIT_CONNECT_REQ, proc->id,
req = ble_l2cap_sig_cmd_get(BLE_L2CAP_SIG_OP_LE_CREDIT_CONNECT_REQ, proc->id,
sizeof(*req), &txom);
if (!req) {
ble_l2cap_chan_free(conn, chan);
+4 -4
View File
@@ -796,7 +796,7 @@ ble_l2cap_test_coc_connect(struct test_data *t)
/* Ensure an update request got sent. */
id = ble_hs_test_util_verify_tx_l2cap_sig(
BLE_L2CAP_SIG_OP_CREDIT_CONNECT_REQ,
BLE_L2CAP_SIG_OP_LE_CREDIT_CONNECT_REQ,
&req, sizeof(req));
/* Use some different parameters for peer. Just keep mtu same for testing
@@ -808,7 +808,7 @@ ble_l2cap_test_coc_connect(struct test_data *t)
rsp.result = htole16(ev->l2cap_status);
rc = ble_hs_test_util_inject_rx_l2cap_sig(2,
BLE_L2CAP_SIG_OP_CREDIT_CONNECT_RSP,
BLE_L2CAP_SIG_OP_LE_CREDIT_CONNECT_RSP,
id, &rsp, sizeof(rsp));
TEST_ASSERT(rc == 0);
@@ -837,7 +837,7 @@ ble_l2cap_test_coc_connect_by_peer(struct test_data *t)
/* Receive remote request*/
rc = ble_hs_test_util_inject_rx_l2cap_sig(2,
BLE_L2CAP_SIG_OP_CREDIT_CONNECT_REQ,
BLE_L2CAP_SIG_OP_LE_CREDIT_CONNECT_REQ,
id, &req, sizeof(req));
TEST_ASSERT_FATAL(rc == 0);
@@ -862,7 +862,7 @@ ble_l2cap_test_coc_connect_by_peer(struct test_data *t)
/* Ensure we sent response. */
TEST_ASSERT(id == ble_hs_test_util_verify_tx_l2cap_sig(
BLE_L2CAP_SIG_OP_CREDIT_CONNECT_RSP,
BLE_L2CAP_SIG_OP_LE_CREDIT_CONNECT_RSP,
&rsp, sizeof(rsp)));
if (ev->l2cap_status == 0) {