Instance Method

peripheralManagerDidUpdateState:

Tells the delegate the peripheral manager’s state updated.

Required.

Declaration

- (void)peripheralManagerDidUpdateState:(CBPeripheralManager *)peripheral;

Parameters

peripheral

The peripheral manager whose state has changed.

Discussion

You implement this required method to ensure that Bluetooth low energy is available to use on the local peripheral device.

Issue commands to the peripheral manager only when the peripheral manager is in the powered-on state, as indicated by the CBPeripheralManagerStatePoweredOn constant. A state with a value lower than CBPeripheralManagerStatePoweredOn implies that advertising has stopped and that any connected centrals have been disconnected. If the state moves below CBPeripheralManagerStatePoweredOff, advertising has stopped you must explicitly restart it. In addition, the powered off state clears the local database; in this case you must explicitly re-add all services. For a complete list and discussion of the possible values representing the state of the peripheral manager, see the CBPeripheralManagerState enumeration in CBPeripheralManager.

See Also

Monitoring Changes to the Peripheral Manager’s State

- 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.