From 56229549cf0cbd0819307936aa15075dc0abac64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Rymanowski?= Date: Wed, 11 Mar 2020 20:49:25 +0100 Subject: [PATCH] nimble/l2cap: Move proc initialization Without that identifier was incorrectly set to 0 --- nimble/host/src/ble_l2cap_sig.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/nimble/host/src/ble_l2cap_sig.c b/nimble/host/src/ble_l2cap_sig.c index 165af9152..bb4d8a5ac 100644 --- a/nimble/host/src/ble_l2cap_sig.c +++ b/nimble/host/src/ble_l2cap_sig.c @@ -1368,6 +1368,10 @@ ble_l2cap_sig_ecoc_connect(uint16_t conn_handle, uint16_t psm, uint16_t mtu, return BLE_HS_ENOMEM; } + proc->op = BLE_L2CAP_SIG_PROC_OP_CONNECT; + proc->id = ble_l2cap_sig_next_id(); + proc->conn_handle = conn_handle; + req = ble_l2cap_sig_cmd_get(BLE_L2CAP_SIG_OP_CREDIT_CONNECT_REQ, proc->id, sizeof(*req) + num * sizeof(uint16_t), &txom); if (!req) { @@ -1396,10 +1400,6 @@ ble_l2cap_sig_ecoc_connect(uint16_t conn_handle, uint16_t psm, uint16_t mtu, } proc->connect.chan_cnt = num; - proc->op = BLE_L2CAP_SIG_PROC_OP_CONNECT; - proc->id = ble_l2cap_sig_next_id(); - proc->conn_handle = conn_handle; - req->psm = htole16(psm); req->mtu = htole16(chan->coc_rx.mtu); req->mps = htole16(chan->my_mtu);