RVS_BTDriver_Vendor_GenericBLE

class RVS_BTDriver_Vendor_GenericBLE : NSObject, RVS_BTDriver_VendorProtocol

A factory class for goTenna Mesh devices

Enums for Proprietary BLE Service and Characteristic UUIDs

  • These are String-based enums that we use to reference various services and characteristics in our driver.

    See more

    Declaration

    Swift

    fileprivate enum RVS_BLE_GATT_UUID : String
  • This is the data we need to match against the advertisement data.

    Declaration

    Swift

    private let _manufacturerCode: [UInt8]
  • Read-only accessor for the interface. This is a weak reference.

    Declaration

    Swift

    internal weak var interface: RVS_BTDriver_InterfaceProtocol!

    Return Value

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

  • A weak reference to the main driver instance.

    Declaration

    Swift

    internal weak var internal_driver: RVS_BTDriver!
  • A read-only accessor to the main driver instance.

    Declaration

    Swift

    internal 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 }
  • Factory for creating (or referencing) the appropriate interface instance.

    Declaration

    Swift

    internal func makeInterface(queue inQueue: DispatchQueue!)

    Parameters

    queue

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

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

    Declaration

    Swift

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

    Parameters

    inDeviceRecord

    The peripheral and central manager instances for this device.

    Return Value

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

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

    Declaration

    Swift

    internal 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.

    Return Value

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

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

    Declaration

    Swift

    internal func iOwnThisDevice(_ inDevice: RVS_BTDriver_Device_BLE) -> Bool

    Parameters

    inDevice

    The device we’re testing for ownership.

    Return Value

    always false, for this base class.

  • The default initializer.

    Declaration

    Swift

    internal init(driver inDriver: RVS_BTDriver!)

    Parameters

    driver

    The RVS_BTDriver instance that “owns” this instance. It can be nil (for testing purposes only)

  • This returns an easy-to-display description string

    Declaration

    Swift

    public override var description: String { get }