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

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


The following commit(s) were added to refs/heads/master by this push:
     new d3bf5ec7c nimble/host: Add offset in GATT server long read context
d3bf5ec7c is described below

commit d3bf5ec7c2b639f497d81811bf1920fb2112eaf0
Author: Roman Sukhorukov <[email protected]>
AuthorDate: Sat Aug 10 09:25:44 2024 +0300

    nimble/host: Add offset in GATT server long read context
    
    This allows application to easily determine if client is performing
    GATT Long Read operation.
---
 nimble/host/include/host/ble_gatt.h | 6 ++++++
 nimble/host/src/ble_gatts.c         | 1 +
 2 files changed, 7 insertions(+)

diff --git a/nimble/host/include/host/ble_gatt.h 
b/nimble/host/include/host/ble_gatt.h
index 5a268c0c9..229d99dda 100644
--- a/nimble/host/include/host/ble_gatt.h
+++ b/nimble/host/include/host/ble_gatt.h
@@ -960,6 +960,12 @@ struct ble_gatt_access_ctxt {
          */
         const struct ble_gatt_dsc_def *dsc;
     };
+
+    /**
+     * An offset in case of BLE_ATT_OP_READ_BLOB_REQ.
+     * If the value is greater than zero it's an indication of a long 
attribute read.
+     */
+    uint16_t offset;
 };
 
 /**
diff --git a/nimble/host/src/ble_gatts.c b/nimble/host/src/ble_gatts.c
index bf50305f4..c77e561b7 100644
--- a/nimble/host/src/ble_gatts.c
+++ b/nimble/host/src/ble_gatts.c
@@ -416,6 +416,7 @@ ble_gatts_chr_val_access(uint16_t conn_handle, uint16_t 
attr_handle,
 
     gatt_ctxt.op = ble_gatts_chr_op(att_op);
     gatt_ctxt.chr = chr_def;
+    gatt_ctxt.offset = offset;
 
     ble_gatts_chr_inc_val_stat(gatt_ctxt.op);
     rc = ble_gatts_val_access(conn_handle, attr_handle, offset, &gatt_ctxt, om,

Reply via email to