Protocol

CBPeripheral​Delegate

The delegate of a CBPeripheral object must adopt the CBPeripheralDelegate protocol. The delegate uses this protocol’s methods to monitor the discovery, exploration, and interaction of a remote peripheral’s services and properties. There are no required methods in this protocol.

Symbols

Discovering Services

func peripheral(CBPeripheral, did​Discover​Services:​ Error?)

Invoked when you discover the peripheral’s available services.

func peripheral(CBPeripheral, did​Discover​Included​Services​For:​ CBService, error:​ Error?)

Invoked when you discover the included services of a specified service.

Discovering Characteristics and Characteristic Descriptors

func peripheral(CBPeripheral, did​Discover​Characteristics​For:​ CBService, error:​ Error?)

Invoked when you discover the characteristics of a specified service.

func peripheral(CBPeripheral, did​Discover​Descriptors​For:​ CBCharacteristic, error:​ Error?)

Invoked when you discover the descriptors of a specified characteristic.

Retrieving Characteristic and Characteristic Descriptor Values

func peripheral(CBPeripheral, did​Update​Value​For:​ CBCharacteristic, error:​ Error?)

Invoked when you retrieve a specified characteristic’s value, or when the peripheral device notifies your app that the characteristic’s value has changed.

func peripheral(CBPeripheral, did​Update​Value​For:​ CBDescriptor, error:​ Error?)

Invoked when you retrieve a specified characteristic descriptor’s value.

Writing Characteristic and Characteristic Descriptor Values

func peripheral(CBPeripheral, did​Write​Value​For:​ CBDescriptor, error:​ Error?)

Invoked when you write data to a characteristic descriptor’s value.

Managing Notifications for a Characteristic’s Value

func peripheral(CBPeripheral, did​Update​Notification​State​For:​ CBCharacteristic, error:​ Error?)

Invoked when the peripheral receives a request to start or stop providing notifications for a specified characteristic’s value.

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

func peripheral​Did​Update​RSSI(CBPeripheral, error:​ Error?)

Invoked when you retrieve the value of the peripheral’s current RSSI while it is connected to the central manager.

func peripheral(CBPeripheral, did​Read​RSSI:​ NSNumber, error:​ Error?)

Invoked after you call read​RSSI() to retrieve the value of the peripheral’s current RSSI while it is connected to the central manager.

Monitoring Changes to a Peripheral’s Name or Services

func peripheral​Did​Update​Name(CBPeripheral)

Invoked when a peripheral’s name changes.

func peripheral(CBPeripheral, did​Modify​Services:​ [CBService])

Invoked when a peripheral’s services have changed.

Relationships

Inherits From