Instance Method

centralManager:didDisconnectPeripheral:error:

Invoked when an existing connection with a peripheral is torn down.

Declaration

- (void)centralManager:(CBCentralManager *)central didDisconnectPeripheral:(CBPeripheral *)peripheral error:(NSError *)error;

Parameters

central

The central manager providing this information.

peripheral

The peripheral that has been disconnected.

error

If an error occurred, the cause of the failure.

Discussion

This method is invoked when a peripheral connected via the connectPeripheral:options: method is disconnected. If the disconnection was not initiated by cancelPeripheralConnection:, the cause is detailed in error. After this method is called, no more methods are invoked on the peripheral device’s CBPeripheralDelegate object.

Note that when a peripheral is disconnected, all of its services, characteristics, and characteristic descriptors are invalidated.

See Also

Monitoring Connections with Peripherals

- centralManager:didConnectPeripheral:

Invoked when a connection is successfully created with a peripheral.

- centralManager:didFailToConnectPeripheral:error:

Invoked when the central manager fails to create a connection with a peripheral.