Instance Method

centralManager:didDisconnectPeripheral:error:

Tells the delegate that the central manager disconnected from a peripheral.

Declaration

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

Parameters

central

The central manager that provides this information.

peripheral

The now-disconnected peripheral.

error

The cause of the failure, or nil if no error occurred.

Discussion

The manager invokes this method when disconnecting a peripheral previously connected with the connectPeripheral:options: method. The error parameter contains the reason for the disconnection, unless the disconnect resulted from a call to cancelPeripheralConnection:. After this method executes, the peripheral device’s CBPeripheralDelegate object receives no further method calls.

All services, characteristics, and characteristic descriptors a peripheral become invalidated after it disconnects.

See Also

Monitoring Connections with Peripherals

- centralManager:didConnectPeripheral:

Tells the delegate that the central manager connected to a peripheral.

- centralManager:didFailToConnectPeripheral:error:

Tells the delegate the central manager failed to create a connection with a peripheral.

- centralManager:connectionEventDidOccur:forPeripheral:

Tells the delegate that a connection event occurred which matches the registered options.