Instance Method

peripheral(_:didUpdateValueFor:error:)

Invoked when you retrieve a specified characteristic’s value, or when the peripheral device notifies your app that the characteristic’s value has changed.

Declaration

optional func peripheral(_ peripheral: CBPeripheral, didUpdateValueFor characteristic: CBCharacteristic, error: Error?)

Parameters

peripheral

The peripheral providing this information.

characteristic

The characteristic whose value has been retrieved.

error

If an error occurred, the cause of the failure.

Discussion

This method is invoked when your app calls the readValue(for:) method, or when the peripheral notifies your app that the value of the characteristic for which notifications and indications are enabled (via a successful call to setNotifyValue(_:for:)) has changed. If successful, the error parameter is nil. If unsuccessful, the error parameter returns the cause of the failure.

See Also

Retrieving Characteristic and Characteristic Descriptor Values

func peripheral(CBPeripheral, didUpdateValueFor: CBDescriptor, error: Error?)

Invoked when you retrieve a specified characteristic descriptor’s value.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software