Class

CBPeripheralManager

CBPeripheralManager objects are used to manage published services within the local peripheral device’s Generic Attribute Profile (GATT) database and to advertise these services to central devices (represented by CBCentral objects). While a service is in the database, it is visible to, and can be accessed by, any connected central. That said, if your app has not specified the bluetooth-peripheral background mode, the contents of its services become disabled when it is in the background or in a suspended state; any remote central trying to access the service’s characteristic value or characteristic descriptors receives an error.

Declaration

@interface CBPeripheralManager : CBManager

Overview

Before you call CBPeripheralManager methods, the state of the peripheral manager object must be powered on, as indicated by the CBPeripheralManagerStatePoweredOn. This state indicates that the peripheral device (your iPhone or iPad, for instance) supports Bluetooth low energy and that its Bluetooth is on and available to use.

Topics

Initializing a Peripheral Manager

- initWithDelegate:queue:

Initializes the peripheral manager with a specified delegate and dispatch queue.

- initWithDelegate:queue:options:

Initializes the peripheral manager with specified delegate, dispatch queue, and initialization options.

delegate

The delegate object specified to receive peripheral events.

Monitoring the State of a Peripheral Manager

+ authorizationStatus

Returns the app’s authorization status for sharing data while in the background state.

Deprecated

Adding and Removing Services

- addService:

Publishes a service and any of its associated characteristics and characteristic descriptors to the local GATT database.

- removeService:

Removes a specified published service from the local GATT database.

- removeAllServices

Removes all published services from the local GATT database.

Managing Advertising

- startAdvertising:

Advertises peripheral manager data.

- stopAdvertising

Stops advertising peripheral manager data.

isAdvertising

A Boolean value indicating whether the peripheral is currently advertising data.

Sending Updates of a Characteristic’s Value

- updateValue:forCharacteristic:onSubscribedCentrals:

Sends an updated characteristic value to one or more subscribed centrals, via a notification or indication.

Responding to Read and Write Requests

- respondToRequest:withResult:

Responds to a read or write request from a connected central.

Setting Connection Latency

- setDesiredConnectionLatency:forCentral:

Sets the desired connection latency for an existing connection to a central device.

Constants

CBPeripheralManagerState

Values representing the current state of the peripheral manager.

Deprecated
CBPeripheralManagerConnectionLatency

Values representing the connection latency of the peripheral manager.

CBPeripheralManagerAuthorizationStatus

Values representing the current authorization state of the peripheral manager.

Deprecated

Initializers

Relationships

Inherits From

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software