RVS_BTDriver_DeviceProtocol

public protocol RVS_BTDriver_DeviceProtocol : AnyObject
  • This refers to the driver instance that “owns” this device.

    Declaration

    Swift

    var owner: RVS_BTDriver! { get }
  • This is a String, containing a unique ID for this peripheral.

    Declaration

    Swift

    var uuid: String! { get }
  • A name for the device (may be the model name, may be something else).

    Declaration

    Swift

    var deviceName: String! { get }
  • If the device has a Device Info Service with a model name, it is available here.

    Declaration

    Swift

    var modelName: String! { get }
  • If the device has a Device Info Service with a manufacturer name, it is available here.

    Declaration

    Swift

    var manufacturerName: String! { get }
  • If the device has a Device Info Service with a manufacturer name, it is available here.

    Declaration

    Swift

    var serialNumber: String! { get }
  • If the device has a Device Info Service with a hardware revision, it is available here.

    Declaration

    Swift

    var hardwareRevision: String! { get }
  • If the device has a Device Info Service with a firmware revision, it is available here.

    Declaration

    Swift

    var firmwareRevision: String! { get }
  • If the device has a Device Info Service with a software revision, it is available here.

    Declaration

    Swift

    var softwareRevision: String! { get }
  • This is the public read-only access to the service list.

    Declaration

    Swift

    var services: [RVS_BTDriver_ServiceProtocol] { get }
  • This is the public flag, determining whether or not the device is connected.

    Declaration

    Swift

    var isConnected: Bool { get set }
  • This is the public flag, displaying whether or not the device can be connected.

    Declaration

    Swift

    var canConnect: Bool { get }
  • This is the read-only count of services.

    Declaration

    Swift

    var count: Int { get }
  • This is the device type. Default is .unTested If the device is still being tested, then this will return .testing. .testing and .unTested can be considered the same as .unknown, but things may change, once testing is complete.

    Declaration

    Swift

    var deviceType: RVS_BTDriver_DeviceType { get }
  • This is a public read-only subscript to the service list.

    Declaration

    Swift

    subscript(inIndex: Int) -> RVS_BTDriver_ServiceProtocol { get }
  • Test to see if a subscriber is already subscribed.

    Declaration

    Swift

    func isThisInstanceASubscriber(_ subscriber: RVS_BTDriver_DeviceSubscriberProtocol) -> Bool

    Parameters

    subscriber

    The subscriber to test.

    Return Value

    True, if the instance is subscribed.

  • Add an observer of the device.

    It should be noted that subscribers are held as strong references (if they are classes).

    Declaration

    Swift

    func subscribe(_ subscriber: RVS_BTDriver_DeviceSubscriberProtocol)

    Parameters

    subscriber

    The instance to subscribe. Nothing is done, if we are already subscribed.

  • remove a subscriber from the list. Nothing happens if the subscriber is not already subscribed.

    Declaration

    Swift

    func unsubscribe(_ subscriber: RVS_BTDriver_DeviceSubscriberProtocol)

    Parameters

    subscriber

    The instance to unsubscribe. Nothing is done, if we are not already subscribed.