Class

CBPeripheral

The CBPeripheral class represents remote peripheral devices that your app—by means of a central manager (an instance of CBCentralManager)—has discovered advertising or is currently connected to. Peripherals are identified by universally unique identifiers (UUIDs), represented by NSUUID objects. Peripherals may contain one or more services or provide useful information about their connected signal strength.

Declaration

@interface CBPeripheral : CBPeer

Overview

You use this class to discover, explore, and interact with the services available on a remote peripheral that supports Bluetooth low energy. A service encapsulates the way part of the device behaves. For example, one service of a heart rate monitor may be to expose heart rate data from the monitor’s heart rate sensor. Services themselves are made up of characteristics or included services (references to other services). Characteristics provide further details about a peripheral’s service. For example, the heart rate service just described may contain one characteristic that describes the intended body location of the device’s heart rate sensor and another characteristic that transmits heart rate measurement data. Finally, characteristics contain any number of descriptors that provide more information about the characteristic’s value, such as a human-readable description and a way to format the value.

Topics

Identifying a Peripheral

name

The name of the peripheral.

delegate

The delegate object specified to receive peripheral events.

Discovering Services

- discoverServices:

Discovers the specified services of the peripheral.

- discoverIncludedServices:forService:

Discovers the specified included services of a service.

services

A list of services on the peripheral that have been discovered.

Discovering Characteristics and Characteristic Descriptors

- discoverCharacteristics:forService:

Discovers the specified characteristics of a service.

- discoverDescriptorsForCharacteristic:

Discovers the descriptors of a characteristic.

Reading Characteristic and Characteristic Descriptor Values

- readValueForCharacteristic:

Retrieves the value of a specified characteristic.

- readValueForDescriptor:

Retrieves the value of a specified characteristic descriptor.

Writing Characteristic and Characteristic Descriptor Values

- writeValue:forCharacteristic:type:

Writes the value of a characteristic.

- writeValue:forDescriptor:

Writes the value of a characteristic descriptor.

Setting Notifications for a Characteristic’s Value

- setNotifyValue:forCharacteristic:

Sets notifications or indications for the value of a specified characteristic.

Monitoring a Peripheral’s Connection State

state

The current connection state of the peripheral.

Accessing a Peripheral’s Received Signal Strength Indicator (RSSI) Data

- readRSSI

Retrieves the current RSSI value for the peripheral while it is connected to the central manager.

RSSI

The RSSI, in decibels, of the peripheral.

Deprecated

Constants

CBCharacteristicWriteType

Values representing the possible types of writes to a characteristic’s value.

CBPeripheralState

Values representing the current connection state of the peripheral.

Instance Properties

Relationships

Inherits From