ITCB_SDK

public class ITCB_SDK : NSObject, ITCB_SDK_Protocol

This is the implementation of the ITCB protocol contract. The base doesn’t need to be bound to a protocol, as the specializations will be.

It is a Swift class, and this is the “base” class, meant to be specialized for Central and Peripheral variants.

  • Factory function for instantiating Peripherals.

    Declaration

    Swift

    public class func createInstance(isCentral inIsCentral: Bool) -> ITCB_SDK_Protocol?

    Parameters

    isCentral

    This is true, if we want a Central instance, or false, for a Peripheral.

    Return Value

    An instance of the SDK for use by the user.

  • Any error condition associated with this instance. It may be nil.

    Declaration

    Swift

    public var error: ITCB_Errors? { get }
  • This is true, if Core Bluetooth reports that the device Bluetooth interface is powered on and available for use.

    Declaration

    Swift

    public var isCoreBluetoothPoweredOn: Bool { get }
  • This is an Array of observer objects associated with this SDK instance.

    Declaration

    Swift

    public var observers: [ITCB_Observer_Protocol]
  • This is a String that can be applied by the user. It will be advertised, or set to local CoreBluetooth Peripherals and Centrals.

    Declaration

    Swift

    public var localName: String
  • This adds the given observer to the list of observers for this SDK object. If the observer is already registered, nothing happens.

    Declaration

    Swift

    @discardableResult
    public func addObserver(_ inObserver: ITCB_Observer_Protocol) -> UUID!

    Parameters

    inObserver

    The Observer Instance to add.

    Return Value

    The new UUID that was assigned to the instance (discardable).

  • This removes the given observer from the list of observers for this SDK object. If the observer is not registered, nothing happens.

    Declaration

    Swift

    public func removeObserver(_ inObserver: ITCB_Observer_Protocol)

    Parameters

    inObserver

    The Observer Instance to remove.

  • This checks the given observer, to see if it is currently observing this SDK instance.

    Declaration

    Swift

    public func isObserving(_ inObserver: ITCB_Observer_Protocol) -> Bool

    Parameters

    inObserver

    The Observer Instance to check.

    Return Value

    True, if the observer is currently in the list of SDK observers.

Main SDK Interface Base Class

  • Any error condition associated with this instance. It may be nil.

    Declaration

    Swift

    var _error: ITCB_Errors? { get }
  • This is a base class cast of the manager object that wil be attached to this instance.

    Declaration

    Swift

    var managerInstance: CBManager! { get }
  • This is true, if Core Bluetooth reports that the device Bluetooth interface is powered on and available for use.

    Declaration

    Swift

    var _isCoreBluetoothPoweredOn: Bool { get }
  • This adds the given observer to the list of observers for this SDK object. If the observer is already registered, nothing happens.

    Declaration

    Swift

    func _addObserver(_ inObserver: ITCB_Observer_Protocol) -> UUID!

    Parameters

    inObserver

    The Observer Instance to add.

    Return Value

    The newly-assigned UUID. Nil, if the observer was not added.

  • This removes the given observer from the list of observers for this SDK object. If the observer is not registered, nothing happens.

    Declaration

    Swift

    func _removeObserver(_ inObserver: ITCB_Observer_Protocol)

    Parameters

    inObserver

    The Observer Instance to remove.

  • This checks the given observer, to see if it is currently observing this SDK instance.

    Declaration

    Swift

    func _isObserving(_ inObserver: ITCB_Observer_Protocol) -> Bool

    Parameters

    inObserver

    The Observer Instance to check.

    Return Value

    True, if the observer is currently in the list of SDK observers.

  • This sends an error message to all registered observers.

    Declaration

    Swift

    func _sendErrorMessageToAllObservers(error inError: ITCB_Errors)

    Parameters

    error

    The error that we are sending.