CBBluetoothManagerDelegate Protocol Reference

Conforms to NSObject
Declared in CBBluetoothManager.h
CBConstant.h

Overview

The delegate of a CBBluetoothManager object must adopt the CBBluetoothManagerDelegate protocol.

– bluetoothManagerDidUpdateState: required method

Invoked whenever the bluetooth manager’s state has been updated. Commands should only be issued when the state is CBBluetoothStatePoweredOn. A state below CBBluetoothStatePoweredOn implies that scanning has stopped and any connected peripherals have been disconnected. If the state moves below CBBluetoothStatePoweredOff, all CBPeripheral objects obtained from this bluetooth manager become invalid and must be retrieved or discovered again.

- (void)bluetoothManagerDidUpdateState:(CBBluetoothManager *_Nonnull)manager

Parameters

manager

The current bluetooth manager instance whose state has changed.

Discussion

You implement this required method to ensure that Bluetooth low energy is supported and available to use on the central device. You should issue commands to the bluetooth manager only when the state of the bluetooth manager is powered on, as indicated by the CBBluetoothStatePoweredOn constant. A state with a value lower than CBBluetoothStatePoweredOn implies that scanning has stopped and that any connected peripherals have been disconnected. If the state moves below CBBluetoothStatePoweredOff, all CBPeripheral objects obtained from this bluetooth manager become invalid and must be retrieved or discovered again. For a complete list and discussion of the possible values representing the state of the bluetooth manager, see the CBBluetoothState enumeration in CBConstant.

Declared In

CBBluetoothManager.h