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

user interface - Python attempting to create a simple gui, getting "AttributeError: 'MainMenu' object has no attribute 'intro_screen'" -

jquery - Common JavaScript snippet to share files on Google Drive, Dropbox, Box.net or SkyDrive -

Android Gson.fromJson error -