RVS_BTDriver_VendorProtocol

internal protocol RVS_BTDriver_VendorProtocol

A base protocol for vendors.

  • A reference to the main driver instance.

    Declaration

    Swift

    var driver: RVS_BTDriver! { get }
  • This returns a list of BLE CBUUIDs, which the vendor wants us to filter for.

    Declaration

    Swift

    var searchForTheseServices: [CBUUID] { get }
  • Read-only accessor for the interface.

    Declaration

    Swift

    var interface: RVS_BTDriver_InterfaceProtocol! { get }

    Return Value

    An instance of the interface for this type of device. Can be nil, if makeInterface() has not yet been called.

  • REQUIRED: Factory method for creating an instance of the vendor device.

    Declaration

    Swift

    func makeDevice(_ inDeviceRecord: Any?) -> RVS_BTDriver_Device!

    Parameters

    inDeviceRecord

    The Bluetooth info for the device, the vendor should cast this to its device info. This can be nil. If so, then the method should return nil.

    Return Value

    a device instance. Can be nil, if the vendor can’t instantiate the device.

  • REQUIRED: Factory method for creating an instance of a service.

    Declaration

    Swift

    func makeService(_ inServiceRecord: CBService?, forDevice inDeviceRecord: RVS_BTDriver_Device) -> RVS_BTDriver_Service!

    Parameters

    inServiceRecord

    The Bluetooth info for the service, the vendor should cast this to its service info. This can be nil. If so, then the method should return nil.

    forDevice

    The device that “owns” this service.

    Return Value

    a service instance. Can be nil, if the vendor can’t instantiate the service.

  • Declaration

    Swift

    func makeInterface(queue: DispatchQueue!)

    Parameters

    queue

    The DispatchQueue to use for this (can be nil, in which case, the main queue is used).

  • This is a test, to see if this vendor is the appropriate one to handle a given device.

    Declaration

    Swift

    func iOwnThisDevice(_ device: RVS_BTDriver_Device_BLE) -> Bool

    Parameters

    device

    The device we’re testing for ownership.

    Return Value

    true, if this vendor “owns” this device (is the vendor that should handle it).