CBDescriptor Class Reference

Inherits from
Conforms to
Framework
/System/Library/Frameworks/CoreBluetooth.framework
Availability
Available in iOS 5.0 and later.
Companion guide
Declared in
CBDescriptor.h

Overview

CBDescriptor and it subclass CBMutableDescriptor represent a descriptor of a peripheral’s characteristic. CBDescriptor objects in particular represent the descriptors of a remote peripheral’s characteristic (remote peripheral devices are represented by CBPeripheral objects). Descriptors provide further information about a characteristic’s value. For example, they may describe the value in human-readable form and describe how the value should be formatted for presentation purposes. Characteristic descriptors also indicate whether a characteristic’s value is configured on a server (a peripheral) to indicate or notify a client (a central) when the value of the characteristic changes.

There are six predefined types of descriptors that—along with their corresponding value types—are detailed in CBUUID Class Reference. “Predefined descriptors” lists the predefined types of descriptors and the CBUUID constants that are used to represent them.

Table 1  Predefined descriptors

Descriptor type

Descriptor constant

Characteristic extended properties

CBUUIDCharacteristicExtendedPropertiesString

Characteristic user description

CBUUIDCharacteristicUserDescriptionString

Client characteristic configuration

CBUUIDClientCharacteristicConfigurationString

Server characteristic configuration

CBUUIDServerCharacteristicConfigurationString

Characteristic format

CBUUIDCharacteristicFormatString

Characteristic aggregate format

CBUUIDCharacteristicAggregateFormatString

Tasks

Identifying a Descriptor

Accessing Descriptor Data

Properties

characteristic

The characteristic that this descriptor belongs to. (read-only)

@property(weak, readonly, nonatomic) CBCharacteristic *characteristic
Availability
  • Available in iOS 5.0 and later.
Declared In
CBDescriptor.h

UUID

The Bluetooth-specific UUID of the descriptor. (read-only)

@property(readonly, nonatomic) CBUUID *UUID
Discussion

This property is a 128-bit UUID that identifies the descriptor.

Availability
  • Available in iOS 5.0 and later.
Declared In
CBDescriptor.h

value

The value of the descriptor. (read-only)

@property(retain, readonly) id value
Discussion

The value types for the various types of descriptors are detailed in CBUUID Class Reference.

You can read the value of a descriptor by calling the readValueForDescriptor: method of the CBPeripheral class. You can write the value of a descriptor by calling the writeValue:forDescriptor: method of the CBPeripheral class. That said, you cannot use the writeValue:forDescriptor: method to write the value of a client configuration descriptor (CBUUIDClientCharacteristicConfigurationString); instead, you should use the setNotifyValue:forCharacteristic: method of the CBPeripheral class to configure client indications or notifications of a characteristic’s value on a server.

Availability
  • Available in iOS 5.0 and later.
Declared In
CBDescriptor.h