CGA_WatchOS_ExtensionDelegate
class CGA_WatchOS_ExtensionDelegate : NSObject
extension CGA_WatchOS_ExtensionDelegate: WKExtensionDelegate
extension CGA_WatchOS_ExtensionDelegate: CGA_BlueThoth_Delegate
This is the main app extension delegate class.
-
This is the Central Manager instance. It is created by the intial screen, but stored here.
Declaration
Swift
var centralManager: RVS_BlueThoth? -
This contains all of our screens. The key is the ID of the device or attribute associated with that screen.
Declaration
Swift
var screenList: [CGA_WatchOS_BaseInterfaceController] -
This contains our stored preferences.
Declaration
Swift
var prefs: CGA_PersistentPrefs -
Quick accessor for the main discovery screen.
Declaration
Swift
var mainScreen: CGA_WatchOS_MainInterfaceController? { get } -
Quick accessor for the top screen.
Declaration
Swift
var topScreen: CGA_WatchOS_BaseInterfaceController? { get }
-
Quick access to the extension delegate object.
Declaration
Swift
class var extensionDelegateObject: CGA_WatchOS_ExtensionDelegate! { get } -
Displays the given message and title in an alert with an “OK” button.
Declaration
Swift
class func displayAlert(header inTitle: String, message inMessage: String = "")Parameters
inTitleREQUIRED: a string to be displayed as the title of the alert. It is localized by this method.
messageOPTIONAL: a string to be displayed as the message of the alert. It is localized by this method.
fromREQUIRED: The controller presenting the error.
-
This special class function creates an Array of String, containing the advertisement data from the indexed device.
Declaration
Swift
class func createAdvertimentStringsFor(_ inAdData: RVS_BlueThoth.AdvertisementData?, id inID: String, power inPower: Int) -> [String]Parameters
inAdDataThe advertisement data.
idThe ID string.
powerThe RSSI level.
Return Value
An Array of String, with the advertisement data in “key: value” form.
-
This is called while the app is in the background, with various tasks that need to be handled.
Declaration
Swift
func handle(_ inBackgroundTasks: Set<WKRefreshBackgroundTask>)Parameters
inBackgroundTasksA set of background tasks that need to be taken care of.
-
Called to report an error.
Declaration
Swift
func handleError(_ inError: CGA_Errors, from inCentralManager: RVS_BlueThoth)Parameters
inErrorThe error being reported.
fromThe manager wrapper view that is calling this.
-
Called to tell this controller to recalculate the discovery table.
Declaration
Swift
func updateFrom(_ inCentralManager: RVS_BlueThoth)Parameters
inCentralManagerThe manager wrapper view that is calling this.
-
Called to tell the instance that the state of the Central manager just became “powered on.”
Declaration
Swift
func centralManagerPoweredOn(_ inCentralManager: RVS_BlueThoth)Parameters
inCentralManagerThe central manager that is calling this.
-
Called to tell the instance that a Peripheral device has been connected.
Declaration
Swift
func centralManager(_ inCentralManager: RVS_BlueThoth, didConnectThisDevice inDevice: CGA_Bluetooth_Peripheral)Parameters
inCentralManagerThe central manager that is calling this.
didConnectThisDeviceThe device instance that was connected.
-
Called to tell the instance that a peripheral device is about to be disconnected. We use this to reset the view stack to the initial (Peripheral List) screen.
Declaration
Swift
func centralManager(_ inCentralManager: RVS_BlueThoth, willDisconnectThisDevice inDevice: CGA_Bluetooth_Peripheral)Parameters
inCentralManagerThe central manager that is calling this.
willDisconnectThisDeviceThe device instance that will be removed after this call.
-
This is called to tell the instance that a Peripheral device has had some change.
Declaration
Swift
func centralManager(_ inCentralManager: RVS_BlueThoth, deviceInfoChanged inDevice: CGA_Bluetooth_Peripheral)Parameters
inCentralManagerThe central manager that is calling this.
deviceInfoChangedThe device instance that was connected.
-
Called to tell the instance that a Service changed.
Declaration
Swift
func centralManager(_ inCentralManager: RVS_BlueThoth, device inDevice: CGA_Bluetooth_Peripheral, changedService inService: CGA_Bluetooth_Service)Parameters
inCentralManagerThe central manager that is calling this.
deviceThe device instance that contained the changed Service.
changedServiceThe Service instance that contained the changed Characteristic.
-
Called to tell the instance that a Characteristic changed its value.
Declaration
Swift
func centralManager(_ inCentralManager: RVS_BlueThoth, device inDevice: CGA_Bluetooth_Peripheral, service inService: CGA_Bluetooth_Service, changedCharacteristic inCharacteristic: CGA_Bluetooth_Characteristic)Parameters
inCentralManagerThe central manager that is calling this.
deviceThe device instance that contained the changed Service.
serviceThe Service instance that contained the changed Characteristic.
changedCharacteristicThe Characteristic that was changed.
-
Called to tell the instance that a Characteristic changed its notification state.
Declaration
Swift
func centralManager(_ inCentral: RVS_BlueThoth, device inDevice: CGA_Bluetooth_Peripheral, service inService: CGA_Bluetooth_Service, changedCharacteristicNotificationState inCharacteristic: CGA_Bluetooth_Characteristic)Parameters
inCentralManagerThe central manager that is calling this.
deviceThe device instance that contained the changed Service.
serviceThe Service instance that contained the changed Characteristic.
changedCharacteristicNotificationStateThe Characteristic that was changed.
-
Called to tell the instance that a Descriptor changed.
Declaration
Swift
func centralManager(_ inCentralManager: RVS_BlueThoth, device inDevice: CGA_Bluetooth_Peripheral, service inService: CGA_Bluetooth_Service, characteristic inCharacteristic: CGA_Bluetooth_Characteristic, changedDescriptor inDescriptor: CGA_Bluetooth_Descriptor)Parameters
inCentralManagerThe central manager that is calling this.
deviceThe device instance that contained the changed Service.
serviceThe Service instance that contained the changed Characteristic.
characteristicThe Characteristic that contains the Descriptor that was changed.
changedDescriptorThe Descriptor that was changed.
-
This is called to tell the instance that a Characteristic write with response received its response.
Declaration
Swift
func centralManager(_ inCentralManager: RVS_BlueThoth, device inPeripheral: CGA_Bluetooth_Peripheral, service inService: CGA_Bluetooth_Service, characteristicWriteComplete inCharacteristic: CGA_Bluetooth_Characteristic)Parameters
inCentralManagerThe central manager that is calling this.
deviceThe device instance that contained the changed Service.
serviceThe Service instance that contained the changed Characteristic.
characteristicWriteCompleteThe Characteristic that had its write completed.
View on GitHub
CGA_WatchOS_ExtensionDelegate Class Reference