Mike
Mike

Reputation: 3084

What do the CBCharacteristicProperties mean?

In the iOS CBCharacteristic Class Reference, there is a description of the bit map used to return the properties of a characteristic. I am looking for information on what three of them mean.

The documentation lists them as follows:

CBCharacteristicProperties

The possible properties of a characteristic.

enum {
    CBCharacteristicPropertyBroadcast = 0x01,
    CBCharacteristicPropertyRead = 0x02,
    CBCharacteristicPropertyWriteWithoutResponse = 0x04,
    CBCharacteristicPropertyWrite = 0x08,
    CBCharacteristicPropertyNotify = 0x10,
    CBCharacteristicPropertyIndicate = 0x20,
    CBCharacteristicPropertyAuthenticatedSignedWrites = 0x40,
    CBCharacteristicPropertyExtendedProperties = 0x80,
};

There is no other documentation or listing of these properties that I could find.

Some are obvious, like Read, Write and Notify. Broadcast is documented in other BLE documentation I found.

CBCharacteristicPropertyWriteWithoutResponse is confusing. Why is this a flag? The CBDevice call writeValue:forCharacteristic:type: has a flag that accepts the following:

enum {
    CBCharacteristicWriteWithResponse = 0,
    CBCharacteristicWriteWithoutResponse,
};

Are these flags redundant, or do you have to supply a type to writeValue:forCharacteristic:type: that matches the CBCharacteristicProperties flag?

Also, what do CBCharacteristicPropertyIndicate and CBCharacteristicPropertyExtendedProperties mean?

Is there a better reference than Apple's documentation that explains these?

Upvotes: 7

Views: 5508

Answers (1)

Mike
Mike

Reputation: 3084

I got this answer on the Apple Developer Forums:

It helps to understand the underlying specificaiton. If you have a look at the GATT section in the Host volume of the 4.0 spec (available here: http://www.bluetooth.org/Technical/Specifications/adopted.htm) the constants should be clearer.
CBCharacteristicPropertyWriteWithoutResponse indicates that the characteristic suports the 'Write without Response' sub-procedure. CBCharacteristicWriteWithoutResponse indicates you actually want to use the 'Write without Response' sub-procedure. Presumably trying to use the 'Write without Response' sub-procedure on a characteristic that does not support it will result in an error. Hope that helps,

Ben

As a follow up, the document in question is Core Version 4.0. See section 3.3.1.1 Characteristic Properties.

Upvotes: 10

Related Questions