I need to access a custom BLE GATT service that contains multiple instances of same characteristic. It sounds weird but complies with v4.0 standard (Vol.3, Part G, Sec 3.3.1):
A service may have multiple characteristic definitions with the same Characteristic UUID.
The first characteristic of this service is a list of [CustomID:GattHandle] pairs that represent the identity and position of the following characteristics. A GATT client is supposed to first discover all characteristics and then read the the value of ID:handle list, so that the identity of each characteristics shall be known.
The problem is, CBCharacteristic
class doesn't provide GATT handle of characteristic. And I can't find any information whether CBService.characteristics
will follow the nature order of attribute handle in GATT server.
Is there anyway to acquire the GATT handle of a given CBCharacteristic
object ?