Protocol

CBPeripheralManagerDelegate

A protocol that provides updates for local peripheral state and interactions with remote central devices.

Declaration

@protocol CBPeripheralManagerDelegate

Overview

The delegate of a CBPeripheralManager object must adopt the CBPeripheralManagerDelegate protocol, which consists of numerous optional methods and one required method. The delegate uses the protocol’s optional methods to verify publishing and advertising, and to monitor read, write, and subscription requests from remote central devices.

The protocol’s required one method, peripheralManagerDidUpdateState:, which Core Bluetooth calls whenever the peripheral manager’s state updates to indicate whether the peripheral manager is available.

Topics

Monitoring Changes to the Peripheral Manager’s State

- peripheralManagerDidUpdateState:

Tells the delegate the peripheral manager’s state updated.

Required.

- peripheralManager:willRestoreState:

Tells the delegate the system is about to restore the peripheral manager.

Peripheral Manager State Restoration Options

Keys used to specify options when restoring the state of a peripheral manager.

Adding Services

- peripheralManager:didAddService:error:

Tells the delegate the peripheral manager published a service to the local GATT database.

Advertising Peripheral Data

- peripheralManagerDidStartAdvertising:error:

Tells the delegate the peripheral manager started advertising the local peripheral device’s data.

Monitoring Subscriptions to Characteristic Values

- peripheralManager:central:didSubscribeToCharacteristic:

Tells the delegate that a remote central device subscribed to a characteristic’s value.

- peripheralManager:central:didUnsubscribeFromCharacteristic:

Tells the delegate that a remote central device unsubscribed from a characteristic’s value.

- peripheralManagerIsReadyToUpdateSubscribers:

Tells the delegate that a local peripheral device is ready to send characteristic value updates.

Receiving Read and Write Requests

- peripheralManager:didReceiveReadRequest:

Tells the delegate that a local peripheral received an Attribute Protocol (ATT) read request for a characteristic with a dynamic value.

- peripheralManager:didReceiveWriteRequests:

Tells the delegate that a local peripheral device received an Attribute Protocol (ATT) write request for a characteristic with a dynamic value.

Using L2CAP Channels

- peripheralManager:didPublishL2CAPChannel:error:

Tells the delegate that the peripheral manager created a listener for incoming L2CAP channel connections.

- peripheralManager:didUnpublishL2CAPChannel:error:

Tells the delegate that the peripheral manager removed a published service from the local system.

- peripheralManager:didOpenL2CAPChannel:error:

Tells the delegate that the peripheral manager opened an L2CAP channel.

Relationships

Inherits From

See Also

Peripherals

CBPeripheral

A remote peripheral device.

CBPeripheralDelegate

A protocol that provides updates on the use of a peripheral’s services.

CBPeripheralManager

An object that manages and advertises peripheral services exposed by this app.

CBAttribute

A representation of common aspects of services offered by a peripheral.

CBAttributePermissions

Values that represent the read, write, and encryption permissions for a characteristic’s value.