CGA_Bluetooth_Service_Protocol_Internal

internal protocol CGA_Bluetooth_Service_Protocol_Internal : CGA_Bluetooth_Service_Protocol

This protocol publishes an internal interface for our Service wrapper classes.

  • Root class does nothing.

    Declaration

    Swift

    static var uuid: String { get }
  • This holds the instance of CBService that is used by this instance.

    Declaration

    Swift

    var cbElementInstance: CBService! { get }
  • This will contain any required scan criteria. It simply passes on the Central criteria.

    Declaration

    Swift

    var scanCriteria: RVS_BlueThoth.ScanCriteria! { get }
  • This is a “preview cache.” It will aggregate instances of Characteristic wrappers that are still in discovery.

    Declaration

    Swift

    var stagedCharacteristics: Array<Element> { get }
  • This is the init that should always be used.

    Declaration

    Swift

    init(parent: CGA_Bluetooth_Peripheral, cbElementInstance: CBService)

    Parameters

    parent

    The Service instance that “owns” this instance.

    cbElementInstance

    This is the actual CBService instance to be associated with this instance.

  • Called to tell the instance to discover its characteristics.

    Declaration

    Swift

    func discoverCharacteristics(characteristics: [String])

    Parameters

    characteristics

    An optional parameter that is an Array, holding the String UUIDs of Characteristics we are filtering for. If left out, all available Characteristics are found. If specified, this overrides the scanCriteria.

  • Called to tell the instance about its newly discovered Characteristics. This method creates new Characteristic wrappers, and stages them. It then asks each Characteristic to discover its Descriptors.

    Declaration

    Swift

    func discoveredCharacteristics(_ inCharacteristics: [CBCharacteristic])

    Parameters

    inCharacteristics

    The discovered Core Bluetooth Characteristics.

  • Called to add a Characteristic to our “keeper” Array.

    Declaration

    Swift

    func addCharacteristic(_ inCharacteristic: CGA_Bluetooth_Characteristic)

    Parameters

    inCharacteristic

    The Characteristic to add.