The documentation for CBMutableDescriptor:initWithType:value:
talks about passing a "128-bit UUID that identifies the characteristic" for the type parameter. Then it should be said that for the type parameter, only one of CBUUIDCharacteristicUserDescriptionString
or CBUUIDCharacteristicFormatString
should be used. Finally, there is no way to add a descriptor to a mutable characteristic.
It seems that the parameter does two mutually exclusive things. On the one hand, it is used to indicate O / S to which characteristic the descriptor belongs, and on the other, the type of descriptor. The second makes more sense, but how do you add a descriptor to a characteristic?
If you pass the UUID for a characteristic or CBUUIDCharacteristicUserDescriptionString
, iOS crashes with
Assertion failure in -[CBMutableDescriptor initWithType:value:], /SourceCache/CoreBluetooth_Sim/CoreBluetooth-59.3/CBDescriptor.m:25
What is the correct way to create a CBMutableDescriptor and add it to CBMutableCharacteristic?
source share