Class

CBCentralManager

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

Overview

Before you call CBCentralManager methods, the state of the central manager object must be powered on, as indicated by the poweredOn 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 to use.

Symbols

Initializing a Central Manager

init(delegate: CBCentralManagerDelegate?, queue: DispatchQueue?)

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

init(delegate: CBCentralManagerDelegate?, queue: DispatchQueue?, options: [String : Any]? = nil)

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

Establishing or Canceling Connections with Peripherals

func connect(CBPeripheral, options: [String : Any]? = nil)

Establishes a local connection to a peripheral.

func cancelPeripheralConnection(CBPeripheral)

Cancels an active or pending local connection to a peripheral.

Retrieving Lists of Peripherals

func retrieveConnectedPeripherals(withServices: [CBUUID])

Returns a list of the peripherals (containing any of the specified services) currently connected to the system.

func retrievePeripherals(withIdentifiers: [UUID])

Returns a list of known peripherals by their identifiers.

Scanning or Stopping Scans of Peripherals

func stopScan()

Asks the central manager to stop scanning for peripherals.

Monitoring Properties

var state: CBCentralManagerState

Returns the current state of the central manager.

var delegate: CBCentralManagerDelegate?

The delegate object you want to receive central events.

Constants

Central Manager Initialization Options

Keys used to pass options to the CBCentralManager method.

Peripheral Connection Options

Keys used to pass options to the connect(_:options:) method.

CBCentralManagerState

Values representing the current state of a central manager object.

Initializers

Instance Properties

Relationships

Inherits From

Conforms To