Instance Method

peripheral(_:didDiscoverCharacteristicsFor:error:)

Invoked when you discover the characteristics of a specified service.

Declaration

optional func peripheral(_ peripheral: CBPeripheral, didDiscoverCharacteristicsFor service: CBService, error: Error?)

Parameters

peripheral

The peripheral providing this information.

service

The service that the characteristics belong to.

error

If an error occurred, the cause of the failure.

Discussion

This method is invoked when your app calls the discoverCharacteristics(_:for:) method. If the characteristics of the specified service are successfully discovered, you can access them through the service's characteristics property. If successful, the error parameter is nil. If unsuccessful, the error parameter returns the cause of the failure.

See Also

Discovering Characteristics and Characteristic Descriptors

func peripheral(CBPeripheral, didDiscoverDescriptorsFor: CBCharacteristic, error: Error?)

Invoked when you discover the descriptors of a specified characteristic.