This is an automated email from the ASF dual-hosted git repository.

kopyscinski pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-nimble.git

commit 27e02e6a2ff388f4a47084c9a6371416d2a3a681
Author: Krzysztof Kopyściński <[email protected]>
AuthorDate: Fri Aug 18 14:01:58 2023 +0200

    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 54162afa..5dcc4fa2 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) {

Reply via email to