ios - How to initialize a CBMutableCharacteristic with multiple CBCharacteristicProperties and Permissions -
i'm creating new cbmutablecharacteristic use in bluetooth app i'm making. got code tutorial, looks this:
_customcharacteristic = [[cbmutablecharacteristic alloc] initwithtype:characteristicuuid properties:cbcharacteristicpropertynotify value:nil permissions:cbattributepermissionsreadable];
where _customcharacteristic
cbmutablecharacteristic.
however, want initialize _customcharacteristic
other properties, such cbcharacteristicpropertyread
, cbcharacteristicpropertywrite
. same true permissions: want give cbattributepermissionswriteable
.
i can have both multiple properties , permissions each characteristic. however, don't know how initialize cbmutablecharacteristic in way.
its enum, different values can ored bitwisely, can use characteristic properties , permissions together:
cbmutablecharacteristic *_customcharacteristic = [[cbmutablecharacteristic alloc] initwithtype:characteristicuuid properties:cbcharacteristicpropertynotify+cbcharacteristicpropertyread value:nil permissions:cbattributepermissionsreadable|cbattributepermissionswriteable];
Comments
Post a Comment