AnsweredAssumed Answered

BLE finding correct handle ID

Question asked by on Jul 9, 2020
Latest reply on Jul 15, 2020 by Mario Ignacio Castaneda Lopez

Using QN908x BLE SDK.

How can I find the handle_id for given attribute the simplest way on the connected BLE device?


Something like get_handle id for: service_hex/attribute_hex path

Or can I hard code handle ID, is it same for a BLE profile across iphone/android? 


The longest and only way I found was:


gatt discover 0 -all   // uses GattClient_DiscoverAllPrimaryServices
--> Discovered primary services: 3

--> Generic Attribute Start Handle: 1 End Handle: 5
  - Service Changed Value Handle: 3

--> Generic Access Start Handle: 20 End Handle: 28
  - Device Name Value Handle: 22
  - Appearance Value Handle: 24
  - Central Address Resolution Value Handle: 26

--> User Data Start Handle: 40 End Handle: 65535
  - Serial Number String Value Handle: 42      <---- I'm looking for this number      


gatt discover 0 -service service_hex  

--> Discovered primary services: 1

--> User Data Start Handle: 40 End Handle: 65535   ---> misses 42


Can I use the absolute address of uuid to read out its value (with GattClient_ReadCharacteristicValue)?

What's the point of the uuid if not?