iphone - Implementing read/write characteristic in the CoreBluetooth.framework -
i working on corebluetooth framework have created peripheral writable , readable characteristic . working fine me . want create read- write peripheral .i have tried following :
characteristic = [[cbmutablecharacteristic alloc] initwithtype:characteristicuuid properties:(cbcharacteristicpropertyread|cbcharacteristicpropertywrite) value:nil permissions:(cbattributepermissionswriteable|cbattributepermissionsreadable)];
but not working in above case property either readable or writable not both @ time .i think taking first 1 . missing ?
a couple things should check:
make sure when use method
- (void)writevalue:(nsdata *)data forcharacteristic:(cbcharacteristic *)characteristic type:(cbcharacteristicwritetype)type
, cbcharacteristicwritetype use should match cbcharacteristic properties.in peripheral implementation,
- (void)peripheralmanager:(cbperipheralmanager *)peripheral didreceivewriterequests:(nsarray *)requests
,
make sure don't have gem in there: `
[peripheral respondtorequest:request withresult:cbatterrorwritenotpermitted];
i copied corebluetooth programming guide, , messed me full hour.
Comments
Post a Comment