diff --git a/source/DeviceManager.mc b/source/DeviceManager.mc index 38867f9..e9a86bd 100644 --- a/source/DeviceManager.mc +++ b/source/DeviceManager.mc @@ -39,11 +39,11 @@ class DeviceManager { _command as Characteristic?, _config as Characteristic?, _scanResult as ScanResult?, - _FL_SERVICE as Uuid?, - _FL_CONFIG as Uuid?, - _FL_COMMAND as Uuid?, _writeInProgress as Boolean = false, - _configDone as Boolean = false; + _configDone as Boolean = false, + _FL_SERVICE as Uuid = BluetoothLowEnergy.stringToUuid("00000000-0000-0000-0000-000000000000"), + _FL_CONFIG as Uuid = BluetoothLowEnergy.stringToUuid("00000000-0000-0000-0000-000000000000"), + _FL_COMMAND as Uuid = BluetoothLowEnergy.stringToUuid("00000000-0000-0000-0000-000000000000"); //! Constructor //! @param bleDelegate The BLE delegate which provides the functions for asynchronous BLE callbacks diff --git a/source/ForumsladerApp.mc b/source/ForumsladerApp.mc index d62a5a9..88c43db 100644 --- a/source/ForumsladerApp.mc +++ b/source/ForumsladerApp.mc @@ -26,12 +26,26 @@ enum { DeviceLock } +(:debug) function debug(val as String or Char or Number) as Void { + switch(val) { + case instanceof Lang.Number: + System.println(val as Number); + break; + case instanceof Lang.Char: + System.print(val as Char); + break; + case instanceof Lang.String: + System.println(val as String); + break; + } +} + //! This data field app uses the BLE data interface of a forumslader. //! The field will pair with the first Forumslader it encounters and will //! show up to 4 user selectable values every 1 second in a simpledatafield. class ForumsladerApp extends Application.AppBase { -private var + private var _bleDelegate as ForumsladerDelegate?, _deviceManager as DeviceManager?, _dataManager as DataManager?; @@ -92,18 +106,4 @@ private var //debug("User Settings: " + $.UserSettings.toString()); } - (:debug) function debug(val as String or Char or Number) as Void { - switch(val) { - case instanceof Lang.Number: - System.println(val as Number); - break; - case instanceof Lang.Char: - System.print(val as Char); - break; - case instanceof Lang.String: - System.println(val as String); - break; - } - } - } \ No newline at end of file diff --git a/source/ForumsladerProfile.mc b/source/ForumsladerProfile.mc index 31cd1a3..34ce5e5 100644 --- a/source/ForumsladerProfile.mc +++ b/source/ForumsladerProfile.mc @@ -1,34 +1,34 @@ import Toybox.BluetoothLowEnergy; import Toybox.Lang; - //! BLE profiles for Forumslader v5/v6 - const - //! Service UUIDs - FL5_SERVICE as Uuid = BluetoothLowEnergy.stringToUuid("0000ffe0-0000-1000-8000-00805f9b34fb"), - FL6_SERVICE as Uuid = BluetoothLowEnergy.stringToUuid("6e40ffe2-b5a3-f393-e0a9-e50e24dcca9e"), +//! BLE profiles for Forumslader v5/v6 +const + //! Service UUIDs + FL5_SERVICE as Uuid = BluetoothLowEnergy.stringToUuid("0000ffe0-0000-1000-8000-00805f9b34fb"), + FL6_SERVICE as Uuid = BluetoothLowEnergy.stringToUuid("6e40ffe2-b5a3-f393-e0a9-e50e24dcca9e"), - //! Characteristic UUIDs - FL5_RXTX_CHARACTERISTIC as Uuid = BluetoothLowEnergy.stringToUuid("0000ef38-0000-1000-8000-00805f9b34fb"), - FL6_RX_CHARACTERISTIC as Uuid = BluetoothLowEnergy.stringToUuid("6e40ef38-b5a3-f393-e0a9-e50e24dcca9e"), - FL6_TX_CHARACTERISTIC as Uuid = BluetoothLowEnergy.stringToUuid("6e40ef39-b5a3-f393-e0a9-e50e24dcca9e"), - - //! profile v5 - FL5_profile = { - :uuid => FL5_SERVICE, - :characteristics => [{ - :uuid => FL5_RXTX_CHARACTERISTIC, - :descriptors => [BluetoothLowEnergy.cccdUuid()] - }] - }, + //! Characteristic UUIDs + FL5_RXTX_CHARACTERISTIC as Uuid = BluetoothLowEnergy.stringToUuid("0000ef38-0000-1000-8000-00805f9b34fb"), + FL6_RX_CHARACTERISTIC as Uuid = BluetoothLowEnergy.stringToUuid("6e40ef38-b5a3-f393-e0a9-e50e24dcca9e"), + FL6_TX_CHARACTERISTIC as Uuid = BluetoothLowEnergy.stringToUuid("6e40ef39-b5a3-f393-e0a9-e50e24dcca9e"), - //! profile v6 - FL6_profile = { - :uuid => FL6_SERVICE, - :characteristics => [{ - :uuid => FL6_RX_CHARACTERISTIC, - :descriptors => [BluetoothLowEnergy.cccdUuid()] - }, { - :uuid => FL6_TX_CHARACTERISTIC, - :descriptors => [BluetoothLowEnergy.cccdUuid()] - }] - }; \ No newline at end of file + //! profile v5 + FL5_profile = { + :uuid => FL5_SERVICE, + :characteristics => [{ + :uuid => FL5_RXTX_CHARACTERISTIC, + :descriptors => [BluetoothLowEnergy.cccdUuid()] + }] + }, + + //! profile v6 + FL6_profile = { + :uuid => FL6_SERVICE, + :characteristics => [{ + :uuid => FL6_RX_CHARACTERISTIC, + :descriptors => [BluetoothLowEnergy.cccdUuid()] + }, { + :uuid => FL6_TX_CHARACTERISTIC, + :descriptors => [BluetoothLowEnergy.cccdUuid()] + }] + }; \ No newline at end of file