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.

according this: http://developer.apple.com/library/ios/#documentation/corebluetooth/reference/cbcharacteristic_class/translated_content/cbcharacteristic.html#//apple_ref/doc/c_ref/cbcharacteristicproperties

and this: http://developer.apple.com/library/ios/#documentation/corebluetooth/reference/cbmutablecharacteristic_class/reference/cbmutablecharacteristic.html#//apple_ref/doc/c_ref/cbattributepermissions

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

Popular posts from this blog

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -