I have created an application that act as a CBPeripheral.I am trying to display the name of Service and Characteristic on the connected Central but i am not able to find the way to do it. I have read the class reference of CBCharacteristic their is no variable like name in it. Their are some descriptors variable but they are for showing the characteristic value in human readable format. So I want to know, how to create a CBMutable characteristic so that its name is displayed on Central device. Can anyone help.
This is my code for creating the characteristic
var characteristic = CBMutableCharacteristic(type: charId, properties: charProperties, value: nil, permissions: CBAttributePermissions.Readable|CBAttributePermissions.Writeable)
After some more research I have find the way by which we can display the name of CBCharacteristic which we created on our peripheral side on Central side with the help of descriptors.Currently only these two descriptor types are supported: CBUUIDCharacteristicUserDescriptionString or CBUUIDCharacteristicFormatString.
var charId:CBUUID = CBUUID("D1FE4DDF-61A7-47F6-81BA-29B223F34322")
var characteristic = CBMutableCharacteristic(type: charId, properties: charProperties, value: nil, permissions: CBAttributePermissions.Readable|CBAttributePermissions.Writeable)
let userDescriptionUuid:CBUUID = CBUUID(string:CBUUIDCharacteristicUserDescriptionString)
var myDescriptor = CBMutableDescriptor(type:userDescriptionUuid, value:"your descriptor name")
characteristic.descriptors = [myDescriptor]