CGA_Class_Protocol

public protocol CGA_Class_Protocol : AnyObject

This protocol is the “base” protocol to which all the exposed types conform.

  • REQUIRED: This is used to reference an “owning instance” of this instance.

    Declaration

    Swift

    var parent: CGA_Class_Protocol? { get }
  • REQUIRED: This is used to reference an “owning instance” of this instance.

    Declaration

    Swift

    var central: RVS_BlueThoth? { get }
  • id

    REQUIRED: This returns a unique UUID String for the instance.

    Declaration

    Swift

    var id: String { get }
  • findEntityByUUIDString(_:) Default implementation

    OPTIONAL: This searches the hierarchy, and will return any instance that has an ID that matches the string passed in. This could be a Peripheral, Service, Characteristic or Descriptor. The response will need to be cast.

    Default Implementation

    Default does nothing.

    Declaration

    Swift

    func findEntityByUUIDString(_ inUUIDString: String) -> CGA_Class_Protocol?

    Parameters

    inUUIDString

    The String for the UUID for which we are searching.

    Return Value

    Any element in the hierarchy with a UUID that matches the one passed in, or nil.

  • handleError(_:) Default implementation

    OPTIONAL: This is called to tell the instance to do whatever it needs to do to handle an error.

    Default Implementation

    Default simply passes the buck.

    Declaration

    Swift

    func handleError(_ error: CGA_Errors)

    Parameters

    error

    The error to be handled.

  • startOver() Default implementation

    OPTIONAL: Forces the instance to restart its discovery process.

    Default Implementation

    Default does nothing.

    Declaration

    Swift

    func startOver()
  • cbUUIDString Default implementation

    OPTIONAL: This returns a unique UUID String for the Service or Characteristic, if this is a specialized class.

    Default Implementation

    Default is an empty String.

    Declaration

    Swift

    static var cbUUIDString: String { get }