Skip to content

Commit d3bf5ec

Browse files
vandyandrzej-kaczmarek
authored andcommitted
nimble/host: Add offset in GATT server long read context
This allows application to easily determine if client is performing GATT Long Read operation.
1 parent 38d08c9 commit d3bf5ec

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

nimble/host/include/host/ble_gatt.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -960,6 +960,12 @@ struct ble_gatt_access_ctxt {
960960
*/
961961
const struct ble_gatt_dsc_def *dsc;
962962
};
963+
964+
/**
965+
* An offset in case of BLE_ATT_OP_READ_BLOB_REQ.
966+
* If the value is greater than zero it's an indication of a long attribute read.
967+
*/
968+
uint16_t offset;
963969
};
964970

965971
/**

nimble/host/src/ble_gatts.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -416,6 +416,7 @@ ble_gatts_chr_val_access(uint16_t conn_handle, uint16_t attr_handle,
416416

417417
gatt_ctxt.op = ble_gatts_chr_op(att_op);
418418
gatt_ctxt.chr = chr_def;
419+
gatt_ctxt.offset = offset;
419420

420421
ble_gatts_chr_inc_val_stat(gatt_ctxt.op);
421422
rc = ble_gatts_val_access(conn_handle, attr_handle, offset, &gatt_ctxt, om,

0 commit comments

Comments
 (0)