From 71bbaaf4279eb6b672c9f2aadc350f1455b01f5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Kopy=C5=9Bci=C5=84ski?= Date: Fri, 18 Aug 2023 14:01:58 +0200 Subject: [PATCH] host/ble_svc_gatt.c: return local Client supported features based on config EATT supported bit is returned when EATT channel number is greater than 0 and Multiple Handle notification based on BLE_ATT_SVR_NOTIFY_MULTI. --- nimble/host/services/gatt/src/ble_svc_gatt.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/nimble/host/services/gatt/src/ble_svc_gatt.c b/nimble/host/services/gatt/src/ble_svc_gatt.c index 54162afabf..5dcc4fa29c 100644 --- a/nimble/host/services/gatt/src/ble_svc_gatt.c +++ b/nimble/host/services/gatt/src/ble_svc_gatt.c @@ -101,9 +101,10 @@ ble_svc_gatt_cl_sup_feat_access(uint16_t conn_handle, uint16_t attr_handle, struct ble_gatt_access_ctxt *ctxt, void *arg) { if (ctxt->op == BLE_GATT_ACCESS_OP_READ_CHR) { - /* TODO For now just send 1*/ - uint8_t eatt_supported = 2; - os_mbuf_append(ctxt->om, &eatt_supported, sizeof(eatt_supported)); + uint8_t supported_feat = + (MYNEWT_VAL(BLE_EATT_CHAN_NUM) > 0) << 1 | + (MYNEWT_VAL(BLE_ATT_SVR_NOTIFY_MULTI) == 1) << 2; + os_mbuf_append(ctxt->om, &supported_feat, sizeof(supported_feat)); return 0; } if (ctxt->op == BLE_GATT_ACCESS_OP_WRITE_CHR) {