From 4e90bdc4846319508b009e28c3af20321995d093 Mon Sep 17 00:00:00 2001 From: Szymon Czapracki Date: Wed, 27 Nov 2024 20:02:14 +0100 Subject: [PATCH] nimble/eatt: Handle MTU request over enhanced bearer Handle ATT MTU request over enhanced bearer. This request shall return Request Not Supported error (0x06) --- nimble/host/src/ble_att.c | 4 ++++ nimble/host/src/ble_att_svr.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/nimble/host/src/ble_att.c b/nimble/host/src/ble_att.c index 4a867639c4..471f6cab97 100644 --- a/nimble/host/src/ble_att.c +++ b/nimble/host/src/ble_att.c @@ -639,6 +639,10 @@ bool ble_eatt_supported_req(uint8_t opcode) { switch (opcode) { + /* EATT does not support MTU request, + * but we must handle this request with proper error response. + */ + case BLE_ATT_OP_MTU_REQ: case BLE_ATT_OP_WRITE_CMD: case BLE_ATT_OP_FIND_INFO_REQ: case BLE_ATT_OP_FIND_TYPE_VALUE_REQ: diff --git a/nimble/host/src/ble_att_svr.c b/nimble/host/src/ble_att_svr.c index 783999d991..e584cae32d 100644 --- a/nimble/host/src/ble_att_svr.c +++ b/nimble/host/src/ble_att_svr.c @@ -747,7 +747,7 @@ ble_att_svr_rx_mtu(uint16_t conn_handle, uint16_t cid, struct os_mbuf **rxom) mtu = 0; if (cid != BLE_L2CAP_CID_ATT) { - /*TODO */ + /* This operation is not supported over enhanced ATT bearer */ return BLE_HS_ENOTSUP; }