Protocols
The following protocols are available globally.
-
This is the main “generic” protocol, applicable to both Central and Peripheral.
The SDK defines an interface between Bluetooth LE devices and abstracts Apple’s Core Bluetooth Library.
The SDK can be instantiated as either a Bluetooth LE “Central,” or as a “Peripheral.”.
The role of the SDK is determined by which variant of the SDK is instantiated.
This is a teaching aid, and, as such, has an extremely limited and tightly-defined functionality. It is a Bluetooth expression of a “Magic 8-Ball” app.
Centrals are instantiated as
ITCB_SDK_Central
instances, and Peripherals are instantiated asITCB_SDK_Peripheral
instances. They are described as protocols, instead of concrete classes or structs, in order to assure opacity and flexibility.All protocol members are required (Except for the internal
See morecreateInstance()
method; which is, in reality, required).Declaration
Swift
public protocol ITCB_SDK_Protocol
-
This specializes the general SDK for Centrals.
See moreDeclaration
Swift
public protocol ITCB_SDK_Central_Protocol : ITCB_SDK_Protocol
-
This specializes the general SDK for Peripherals.
See moreDeclaration
Swift
public protocol ITCB_SDK_Peripheral_Protocol : ITCB_SDK_Protocol
-
This just has a couple of common properties.
See moreDeclaration
Swift
public protocol ITCB_Device_Protocol
-
We simply add a “send question” method.
See moreDeclaration
Swift
public protocol ITCB_Device_Central_Protocol : ITCB_Device_Protocol
-
We add a couple of properties to hold the last question and answer to the peripheral.
See moreDeclaration
Swift
public protocol ITCB_Device_Peripheral_Protocol : ITCB_Device_Protocol
-
This protocol describes an instance that can register to observe the main SDK.
All members are required.
See moreDeclaration
Swift
public protocol ITCB_Observer_Protocol
-
Declaration
Swift
public protocol ITCB_Observer_Central_Protocol : ITCB_Observer_Protocol
-
Declaration
Swift
public protocol ITCB_Observer_Peripheral_Protocol : ITCB_Observer_Protocol