Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ios ble - Write Without Response" property - ignoring response-less write

On iOS7.1.1, the following BLE operation succeeds - it assumes I have a BLE connection setup etc...

[[self peripheral]writeValue:dataToWrite forCharacteristic:nextCharacteristic type:CBCharacteristicWriteWithResponse];

But If I switch the "type" to CBCharacteristicWriteWithoutResponse, I get the following warning and the peripheral does not receive the command :(

[[self peripheral]writeValue:dataToWrite forCharacteristic:nextCharacteristic type:CBCharacteristicWriteWithoutResponse];

Error:

CoreBluetooth[WARNING] Characteristic <CBCharacteristic: 0x178081f90 UUID = 249C2001-00D7-4D91-AC75-22D57AE2FFB8, Value = (null), Properties = 0x28, Notifying = YES, Broadcasting = NO> does not specify the "Write Without Response" property - ignoring response-less write**

Any clues appreciated!

like image 718
user1813603 Avatar asked Sep 04 '14 18:09

user1813603


1 Answers

When a BLE peripheral advertises characteristics the advertisement includes the properties of those characteristics. These include what operations are supported on that characteristic - read, notify, write without response and write with response.

In this case it seems that the characteristic supports write with response but not write without response, so when you attempt a write without response you get the warning and the write operations doesn't complete

like image 157
Paulw11 Avatar answered Nov 05 '22 22:11

Paulw11