Skip to content

Properly set attribute handles and improve dynamic service changes#1107

Open
h2zero wants to merge 1 commit intomasterfrom
bugfix/attribute-handles
Open

Properly set attribute handles and improve dynamic service changes#1107
h2zero wants to merge 1 commit intomasterfrom
bugfix/attribute-handles

Conversation

@h2zero
Copy link
Owner

@h2zero h2zero commented Mar 9, 2026

This changes how attribute handles are set so they can be correctly identified when there is more than one attribute with the same UUID. Instead of reading from the stack by UUID to get the handles this will now use the registration callback to set them correctly.

This also improves handling of dynamic service changes by properly removing characteristics/descriptors when required and resetting the GATT when advertising is started instead of after the last client disconnects.

  • Adds NimBLEUUID constructor overload for ble_uuid_t*.
  • NimBLECharacteristic::getDescriptorByUUID now takes an optional index value to support multiple same-uuid descriptors.

This changes how attribute handles are set so they can be correctly identified when there is more than one attribute with the same UUID.
Instead of reading from the stack by UUID to get the handles this will now use the registration callback to set them correctly.

This also improves handling of dynamic service changes by properly removing characteristics/descriptors when required and resetting the GATT when advertising is started instead of after the last client disconnects.

* Adds NimBLEUUID constructor overload for ble_uuid_t*.
* NimBLECharacteristic::getDescriptorByUUID now takes an optional index value to support multiple same-uuid descriptors.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant