Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 299
Mike Avatar asked Aug 08 '12 18:08

Mike


People also ask

What are characteristic properties?

A characteristic property is a chemical or physical property that helps identify and classify substances. The characteristic properties of a substance are always the same whether the sample being observed is large or small.

What are 4 characteristic properties that can be used to identify a substance?

Characteristics such as melting point, boiling point, density, solubility, color, odor, etc.

What are 3 characteristics properties of matter?

Extensive properties vary with the amount of the substance and include mass, weight, and volume. Intensive properties, in contrast, do not depend on the amount of the substance; they include color, melting point, boiling point, electrical conductivity, and physical state at a given temperature.

Why is it important to know the characteristics properties of substances?

Why are properties of matter important? Scientists need to understand the properties of matter because it is made up of it. Solid, liquid, and gas are the three primary phases of matter. Depending on their physical features, most matter will exist in any of these states.


1 Answers

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.

like image 192
Mike Avatar answered Oct 12 '22 01:10

Mike