Class

CBCentralManager

An object that scans for, discovers, connects to, and manages peripherals.

Declaration

@interface CBCentralManager : CBManager

Overview

CBCentralManager objects manage discovered or connected remote peripheral devices (represented by CBPeripheral objects), including scanning for, discovering, and connecting to advertising peripherals.

Before calling the CBCentralManager methods, set the state of the central manager object to powered on, as indicated by the CBCentralManagerStatePoweredOn constant. This state indicates that the central device (your iPhone or iPad, for instance) supports Bluetooth low energy and that Bluetooth is on and available for use.

Topics

Initializing a Central Manager

- init

Initializes the central manager without a delegate.

- initWithDelegate:queue:

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

- initWithDelegate:queue:options:

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

Central Manager Initialization Options

Keys used to pass options when initializing a central manager.

Central Manager State Restoration Options

Keys used to pass state restoration options to the central manager initializer.

Establishing or Canceling Connections with Peripherals

- connectPeripheral:options:

Establishes a local connection to a peripheral.

Peripheral Connection Options

Keys used to pass options when connecting to a peripheral.

- cancelPeripheralConnection:

Cancels an active or pending local connection to a peripheral.

Retrieving Lists of Peripherals

- retrieveConnectedPeripheralsWithServices:

Returns a list of the peripherals connected to the system whose services match a given set of criteria.

- retrievePeripheralsWithIdentifiers:

Returns a list of known peripherals by their identifiers.

Scanning or Stopping Scans of Peripherals

- scanForPeripheralsWithServices:options:

Scans for peripherals that are advertising services.

Peripheral Scanning Options

Keys used to pass options when scanning for peripherals.

- stopScan

Asks the central manager to stop scanning for peripherals.

isScanning

A Boolean value that indicates whether the central is currently scanning.

Inspecting Feature Support

+ supportsFeatures:

Returns a Boolean that indicates whether the device supports a specific set of features.

CBCentralManagerFeature

An option set of device-specific features.

Monitoring Properties

delegate

The delegate object that you want to receive central manager events.

Receiving Connection Events

- registerForConnectionEventsWithOptions:

Register for an event notification when the central manager makes a connection matching the given options.

Peripheral Connection Options

Keys used to pass options when connecting to a peripheral.

CBConnectionEvent

A change to the connection state of a peer.

CBConnectionEventMatchingOption

A set of options to use when registering for connection events.

Deprecated

CBCentralManagerState

Values representing the current state of a central manager object.

Deprecated

Relationships

Inherits From

See Also

Centrals

CBCentral

A remote device connected to a local app which is acting as a peripheral.

CBCentralManagerDelegate

A protocol that provides updates for the discovery and management of peripheral devices.