nimble/host: Fix L2CAP update request event

This fixes L2CAP update request event handling to be the same a
connection update request as described in documentation.

The copy of requested parameters is passed as peer_params while the
original param struct is passed as self_params so application can update
these if needed.
This commit is contained in:
Andrzej Kaczmarek
2024-09-17 11:10:39 +02:00
parent deb78222b5
commit 16e1bfc679
+5 -1
View File
@@ -2175,13 +2175,17 @@ ble_gap_rx_l2cap_update_req(uint16_t conn_handle,
struct ble_gap_upd_params *params)
{
#if NIMBLE_BLE_CONNECT
struct ble_gap_upd_params peer_params;
struct ble_gap_event event;
int rc;
peer_params = *params;
memset(&event, 0, sizeof event);
event.type = BLE_GAP_EVENT_L2CAP_UPDATE_REQ;
event.conn_update_req.conn_handle = conn_handle;
event.conn_update_req.peer_params = params;
event.conn_update_req.peer_params = &peer_params;
event.conn_update_req.self_params = params;
rc = ble_gap_call_conn_event_cb(&event, conn_handle);
return rc;