Is there ever a case where CBPeripheralDelegate
's peripheral:didUpdateValueForCharacteristic:error:
will pass back an error when the characteristic's isNotifying
property is set to YES
?
Obviously this makes sense in the context of when an explicit read request is sent, but if the peripheral's characteristic is notifying the central and that notification is successfully received by the central then it doesn't seem like an error is possible.
The documentation for the method doesn't add any details to this.
Looking at the possible Core Bluetooth Attribute Errors most would not seem to apply. The ones that I can see that are possible (if not likely) are -
- CBATTErrorUnlikelyError
The ATT request has encountered an unlikely error and therefore could not be completed.
which seems to be a sort of catch-all "something went wrong" and
- CBATTErrorInsufficientResources
Resources are insufficient to complete the ATT request.
At the very least you should check for a non-nil error and not process the update in that case. I think you will probably get a disconnect in most cases where an error is reported to this method.