RVS_BTDriver_DeviceSubscriberProtocol
public protocol RVS_BTDriver_DeviceSubscriberProtocol : RVS_BTDriver_SubscriberProtocol
This is a protocol for classes, structs or enums that want to “subscribe” to a device.
-
REQUIRED: Error reporting method.
Declaration
Swift
func subscribedDevice(_ device: RVS_BTDriver_DeviceProtocol, encounteredThisError: RVS_BTDriver.Errors)
Parameters
device
The
RVS_BTDriver_DeviceProtocol
instance that has the service.encounteredThisError
The error that was encountered.
-
subscribedDevice(_:serviceAdded:)
Default implementationOPTIONAL: Called When a service is added to the main list.
Default Implementation
Default does nothing.
Declaration
Swift
func subscribedDevice(_ device: RVS_BTDriver_DeviceProtocol, serviceAdded: RVS_BTDriver_ServiceProtocol)
Parameters
device
The
RVS_BTDriver_DeviceProtocol
instance that has the service.serviceAdded
The
RVS_BTDriver_ServiceProtocol
service that was added. -
subscribedDeviceStatusUpdate(_:)
Default implementationOPTIONAL: Called to indicate that the device’s status should be checked.
It may be called frequently, and there may not be any changes. This is mereley a “make you aware of the POSSIBILITY of a change” call.
This is optional, and is NOT guaranteed to be called in the main thread.
Default Implementation
Default does nothing.
Declaration
Swift
func subscribedDeviceStatusUpdate(_ device: RVS_BTDriver_DeviceProtocol)
Parameters
device
The
RVS_BTDriver_DeviceProtocol
instance calling this.