Skip to content

Commit

Permalink
code sanitizations
Browse files Browse the repository at this point in the history
  • Loading branch information
cyberman54 committed Jun 15, 2024
1 parent 1330c8b commit 65b0d76
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 48 deletions.
8 changes: 4 additions & 4 deletions source/DeviceManager.mc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
30 changes: 15 additions & 15 deletions source/ForumsladerApp.mc
Original file line number Diff line number Diff line change
Expand Up @@ -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?;
Expand Down Expand Up @@ -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;
}
}

}
58 changes: 29 additions & 29 deletions source/ForumsladerProfile.mc
Original file line number Diff line number Diff line change
@@ -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()]
}]
};
//! 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()]
}]
};

0 comments on commit 65b0d76

Please sign in to comment.