nimble/host: add support for Characteristic Extended Properties descriptor#2088
Merged
sjanc merged 2 commits intoapache:masterfrom Nov 24, 2025
Merged
nimble/host: add support for Characteristic Extended Properties descriptor#2088sjanc merged 2 commits intoapache:masterfrom
sjanc merged 2 commits intoapache:masterfrom
Conversation
d083506 to
0a00cde
Compare
a7f42ba to
8b48638
Compare
MariuszSkamra
suggested changes
Aug 21, 2025
Comment on lines
+825
to
+855
| static int | ||
| ble_gatts_cep_access_cb(uint16_t conn_handle, uint16_t attr_handle, | ||
| struct ble_gatt_access_ctxt *ctxt, void *arg) | ||
| { | ||
| uint16_t prop = POINTER_TO_UINT(arg); | ||
|
|
||
| if (ctxt->op != BLE_GATT_ACCESS_OP_READ_DSC) { | ||
| return BLE_ATT_ERR_WRITE_NOT_PERMITTED; | ||
| } | ||
|
|
||
| os_mbuf_append(ctxt->om, &prop, sizeof(prop)); | ||
|
|
||
| return 0; | ||
| } | ||
|
|
||
| static int | ||
| ble_gatts_cep_access(uint16_t conn_handle, uint16_t attr_handle, | ||
| uint8_t att_op, uint16_t offset, struct os_mbuf **om, | ||
| void *arg) | ||
| { | ||
| struct ble_gatt_access_ctxt gatt_ctxt; | ||
| int rc; | ||
|
|
||
| gatt_ctxt.op = ble_gatts_dsc_op(att_op); | ||
|
|
||
| ble_gatts_dsc_inc_stat(gatt_ctxt.op); | ||
| rc = ble_gatts_val_access(conn_handle, attr_handle, offset, &gatt_ctxt, | ||
| om, ble_gatts_cep_access_cb, arg); | ||
|
|
||
| return rc; | ||
| } |
Contributor
There was a problem hiding this comment.
I'm not sure whether you need a call ble_gatts_val_access here. It's because you can handle the access request in place:
static int
ble_gatts_cep_access(uint16_t conn_handle, uint16_t attr_handle,
uint8_t att_op, uint16_t offset, struct os_mbuf **om,
void *arg)
{
uint16_t prop = POINTER_TO_UINT(arg);
uint8_t *buf;
ble_gatts_dsc_inc_stat(gatt_ctxt.op);
if (att_op != BLE_ATT_ACCESS_OP_READ) {
return BLE_ATT_ERR_WRITE_NOT_PERMITTED;
}
buf = os_mbuf_extend(*om, 2);
if (buf == NULL) {
return BLE_ATT_ERR_INSUFFICIENT_RES;
}
put_le16(buf, prop);
return 0;
}
should work for you (I believe :P). Note the put_le16 is used to ensure correct endianess
Comment on lines
+848
to
+849
| gatt_ctxt.op = ble_gatts_dsc_op(att_op); | ||
|
|
Contributor
There was a problem hiding this comment.
gatt_ctxt.om is not set but referenced in ble_gatts_cep_access_cb
8b48638 to
d70c47e
Compare
MariuszSkamra
approved these changes
Aug 27, 2025
d70c47e to
530fc9e
Compare
Add support for Characteristic Extended Properties descriptor. For each characteristic that has reliable/auxiliary write flags set an instance of Extended Properties descriptor will be registred.
Fix coding style
530fc9e to
b86b73b
Compare
Contributor
Author
|
Fixed coding style and commit message errors |
sjanc
approved these changes
Nov 24, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add support for Characteristic Extended Properties descriptor. For each characteristic that has reliable/auxiliary flags set an instance of Extended Properties descriptor will be registred.

Note: this is needed for host qualification test case GATT/SR/GAS/BV-02-C and can be tested with #2098