cancel
Showing results for 
Search instead for 
Did you mean: 

How are the BLE attribute handle offsets defined?

BPaik
Senior

Where can I find documentation on the BLE attribute handle offsets? I was adapting code from the sensor demo for the BLE NRG 2 and am trying to understand the "aci_gatt_attribute_modified_event" callback. Through observation and experimentation I found that adding 1 to the attribute handle identifies write characteristic events from the BLE client and adding 2 to the handle identifies characteristic notifications being enabled or disabled. I haven't seen any description of this behavior in the BLE programming guide, but I would like to know all the available offsets and what they are for.

11 REPLIES 11

Software definitions are possible. Please feel free to customize the macros for the sample projects.

The Client Characteristic Configuration Descriptor would be at the position of characteristic's handle +2, but other descriptors can vary.

I do not understand how this answer got marked as solution to this question.

The link in the answer contains 2 videos, both which confirms that each attribute has a unique handle.

And in the DataThroughput example from ST when a characteristics is created you get a unique handle YET when you get data for a handle sometimes it is with offset +1 or with offset +2 compared.

None of the videos above mention any offset to any handle in the BLE core spec so the question is still valid. What are those handles that are reported via the Event_Handler and why it is +1 or +2?

Furthermore, if you google for any explanation the first and only hit is this forum. "Google knows it all" as the saying goes. Except this time? Why is the only hit this forum entry?

If I google for characteristic handles I only find "each has a unique value". Nothing mentioned about "user has to calculate what handle is what". BLE Article on oracle: "The attribute handle is a unique 16-bit identifier for each attribute on a particular GATT server. "