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:

  1. make sure when use method - (void)writevalue:(nsdata *)data forcharacteristic:(cbcharacteristic *)characteristic type:(cbcharacteristicwritetype)type, cbcharacteristicwritetype use should match cbcharacteristic properties.

  2. 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

Popular posts from this blog

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

delphi - Dynamic file type icon -