Skip to content

Commit 65b0d76

Browse files
committed
code sanitizations
1 parent 1330c8b commit 65b0d76

File tree

3 files changed

+48
-48
lines changed

3 files changed

+48
-48
lines changed

source/DeviceManager.mc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,11 @@ class DeviceManager {
3939
_command as Characteristic?,
4040
_config as Characteristic?,
4141
_scanResult as ScanResult?,
42-
_FL_SERVICE as Uuid?,
43-
_FL_CONFIG as Uuid?,
44-
_FL_COMMAND as Uuid?,
4542
_writeInProgress as Boolean = false,
46-
_configDone as Boolean = false;
43+
_configDone as Boolean = false,
44+
_FL_SERVICE as Uuid = BluetoothLowEnergy.stringToUuid("00000000-0000-0000-0000-000000000000"),
45+
_FL_CONFIG as Uuid = BluetoothLowEnergy.stringToUuid("00000000-0000-0000-0000-000000000000"),
46+
_FL_COMMAND as Uuid = BluetoothLowEnergy.stringToUuid("00000000-0000-0000-0000-000000000000");
4747

4848
//! Constructor
4949
//! @param bleDelegate The BLE delegate which provides the functions for asynchronous BLE callbacks

source/ForumsladerApp.mc

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,26 @@ enum {
2626
DeviceLock
2727
}
2828

29+
(:debug) function debug(val as String or Char or Number) as Void {
30+
switch(val) {
31+
case instanceof Lang.Number:
32+
System.println(val as Number);
33+
break;
34+
case instanceof Lang.Char:
35+
System.print(val as Char);
36+
break;
37+
case instanceof Lang.String:
38+
System.println(val as String);
39+
break;
40+
}
41+
}
42+
2943
//! This data field app uses the BLE data interface of a forumslader.
3044
//! The field will pair with the first Forumslader it encounters and will
3145
//! show up to 4 user selectable values every 1 second in a simpledatafield.
3246
class ForumsladerApp extends Application.AppBase {
3347

34-
private var
48+
private var
3549
_bleDelegate as ForumsladerDelegate?,
3650
_deviceManager as DeviceManager?,
3751
_dataManager as DataManager?;
@@ -92,18 +106,4 @@ private var
92106
//debug("User Settings: " + $.UserSettings.toString());
93107
}
94108

95-
(:debug) function debug(val as String or Char or Number) as Void {
96-
switch(val) {
97-
case instanceof Lang.Number:
98-
System.println(val as Number);
99-
break;
100-
case instanceof Lang.Char:
101-
System.print(val as Char);
102-
break;
103-
case instanceof Lang.String:
104-
System.println(val as String);
105-
break;
106-
}
107-
}
108-
109109
}

source/ForumsladerProfile.mc

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,34 @@
11
import Toybox.BluetoothLowEnergy;
22
import Toybox.Lang;
33

4-
//! BLE profiles for Forumslader v5/v6
5-
const
6-
//! Service UUIDs
7-
FL5_SERVICE as Uuid = BluetoothLowEnergy.stringToUuid("0000ffe0-0000-1000-8000-00805f9b34fb"),
8-
FL6_SERVICE as Uuid = BluetoothLowEnergy.stringToUuid("6e40ffe2-b5a3-f393-e0a9-e50e24dcca9e"),
4+
//! BLE profiles for Forumslader v5/v6
5+
const
6+
//! Service UUIDs
7+
FL5_SERVICE as Uuid = BluetoothLowEnergy.stringToUuid("0000ffe0-0000-1000-8000-00805f9b34fb"),
8+
FL6_SERVICE as Uuid = BluetoothLowEnergy.stringToUuid("6e40ffe2-b5a3-f393-e0a9-e50e24dcca9e"),
99

10-
//! Characteristic UUIDs
11-
FL5_RXTX_CHARACTERISTIC as Uuid = BluetoothLowEnergy.stringToUuid("0000ef38-0000-1000-8000-00805f9b34fb"),
12-
FL6_RX_CHARACTERISTIC as Uuid = BluetoothLowEnergy.stringToUuid("6e40ef38-b5a3-f393-e0a9-e50e24dcca9e"),
13-
FL6_TX_CHARACTERISTIC as Uuid = BluetoothLowEnergy.stringToUuid("6e40ef39-b5a3-f393-e0a9-e50e24dcca9e"),
14-
15-
//! profile v5
16-
FL5_profile = {
17-
:uuid => FL5_SERVICE,
18-
:characteristics => [{
19-
:uuid => FL5_RXTX_CHARACTERISTIC,
20-
:descriptors => [BluetoothLowEnergy.cccdUuid()]
21-
}]
22-
},
10+
//! Characteristic UUIDs
11+
FL5_RXTX_CHARACTERISTIC as Uuid = BluetoothLowEnergy.stringToUuid("0000ef38-0000-1000-8000-00805f9b34fb"),
12+
FL6_RX_CHARACTERISTIC as Uuid = BluetoothLowEnergy.stringToUuid("6e40ef38-b5a3-f393-e0a9-e50e24dcca9e"),
13+
FL6_TX_CHARACTERISTIC as Uuid = BluetoothLowEnergy.stringToUuid("6e40ef39-b5a3-f393-e0a9-e50e24dcca9e"),
2314

24-
//! profile v6
25-
FL6_profile = {
26-
:uuid => FL6_SERVICE,
27-
:characteristics => [{
28-
:uuid => FL6_RX_CHARACTERISTIC,
29-
:descriptors => [BluetoothLowEnergy.cccdUuid()]
30-
}, {
31-
:uuid => FL6_TX_CHARACTERISTIC,
32-
:descriptors => [BluetoothLowEnergy.cccdUuid()]
33-
}]
34-
};
15+
//! profile v5
16+
FL5_profile = {
17+
:uuid => FL5_SERVICE,
18+
:characteristics => [{
19+
:uuid => FL5_RXTX_CHARACTERISTIC,
20+
:descriptors => [BluetoothLowEnergy.cccdUuid()]
21+
}]
22+
},
23+
24+
//! profile v6
25+
FL6_profile = {
26+
:uuid => FL6_SERVICE,
27+
:characteristics => [{
28+
:uuid => FL6_RX_CHARACTERISTIC,
29+
:descriptors => [BluetoothLowEnergy.cccdUuid()]
30+
}, {
31+
:uuid => FL6_TX_CHARACTERISTIC,
32+
:descriptors => [BluetoothLowEnergy.cccdUuid()]
33+
}]
34+
};

0 commit comments

Comments
 (0)