Class

CBUUID

Instances of the CBUUID class represent the 128-bit universally unique identifiers (UUIDs) of attributes used in Bluetooth low energy communication, such as a peripheral’s services, characteristics, and characteristic descriptors. This class provides a number of factory methods for dealing with long UUIDs when developing your app. For example, instead of passing around the string representation of a 128-bit Bluetooth low energy attribute in your code, you can create a CBUUID object that represents it, and pass that around instead.

Overview

Though not all UUIDs that identify Bluetooth-specific attributes are predefined by the Bluetooth Special Interest Group (SIG), Bluetooth SIG has defined and published a number of commonly used UUIDs that have been shortened to 16-bits or 32-bits for convenience. The CBUUID class provides methods that automatically transform these predefined shorter UUIDs into their 128-bit equivalent UUIDs. When you create a CBUUID object from a predefined 16-bit or 32-bit UUID, Core Bluetooth pre-fills the rest of the 128-bit UUID with the Bluetooth base UUID, which is defined in the Bluetooth 4.0 specification, Volume 3, Part F, Section 3.2.1.

In addition to providing methods for creating CBUUID objects, this class defines constants that represent the UUIDs of the Bluetooth-defined characteristic descriptors, which are defined in the Bluetooth 4.0 specification, Volume 3, Part G, Section 3.3.3.

Symbols

Creating New CBUUID Objects

init(string: String)

Creates and returns a CBUUID object from a 16-bit, 32-bit, or 128-bit UUID string.

init(data: Data)

Creates and returns a CBUUID object from a 16-bit, 32-bit, or 128-bit UUID data container.

init(cfuuid: CFUUID)

Creates and returns a CBUUID object from a CFUUID object.

init(nsuuid: UUID)

Creates and returns a CBUUID object from an NSUUID object.

var data: Data

The data of the UUID.

var uuidString: String

The UUID represented as a string.

Constants

Characteristic Descriptors

Values representing the UUIDs of the characteristic descriptors.

GAP and GATT Service UUIDs

Values representing the UUIDs of the GAP and GATT service.

GAP Characteristics

Values representing the UUIDs of the GAP characteristics.

GATT Service Changed UUID

Value representing the GAP service changed UUID.

Relationships

Inherits From