@hangtime/grip-connect 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/commands/tindeq.js +12 -12
- package/src/write.js +5 -3
- package/src/write.ts +5 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hangtime/grip-connect",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "A client that can establish connections with various Force-Sensing Hangboards/Plates used by climbers for strength measurement. Examples of such hangboards include the Motherboard, Climbro, SmartBoard, Entralpi or Tindeq Progressor",
|
|
5
5
|
"main": "src/index.ts",
|
|
6
6
|
"scripts": {
|
package/src/commands/tindeq.js
CHANGED
|
@@ -3,18 +3,18 @@
|
|
|
3
3
|
* Using other commands can seriously harm your device
|
|
4
4
|
*/
|
|
5
5
|
export const TindeqCommands = {
|
|
6
|
-
TARE_SCALE:
|
|
7
|
-
START_WEIGHT_MEAS:
|
|
8
|
-
STOP_WEIGHT_MEAS:
|
|
9
|
-
START_PEAK_RFD_MEAS:
|
|
10
|
-
START_PEAK_RFD_MEAS_SERIES:
|
|
11
|
-
ADD_CALIB_POINT:
|
|
12
|
-
SAVE_CALIB:
|
|
13
|
-
GET_APP_VERSION:
|
|
14
|
-
GET_ERR_INFO:
|
|
15
|
-
CLR_ERR_INFO:
|
|
16
|
-
SLEEP:
|
|
17
|
-
GET_BATT_VLTG:
|
|
6
|
+
TARE_SCALE: "d", // 0x64,
|
|
7
|
+
START_WEIGHT_MEAS: "e", // 0x65,
|
|
8
|
+
STOP_WEIGHT_MEAS: "f", // 0x66,
|
|
9
|
+
START_PEAK_RFD_MEAS: "g", // 0x67,
|
|
10
|
+
START_PEAK_RFD_MEAS_SERIES: "h", // 0x68,
|
|
11
|
+
ADD_CALIB_POINT: "i", // 0x69,
|
|
12
|
+
SAVE_CALIB: "j", // 0x6a,
|
|
13
|
+
GET_APP_VERSION: "k", // 0x6b,
|
|
14
|
+
GET_ERR_INFO: "l", // 0x6c,
|
|
15
|
+
CLR_ERR_INFO: "m", // 0x6d,
|
|
16
|
+
SLEEP: "n", // 0x6e,
|
|
17
|
+
GET_BATT_VLTG: "o", // 0x6f,
|
|
18
18
|
};
|
|
19
19
|
export const NotificationTypes = {
|
|
20
20
|
COMMAND_RESPONSE: 0,
|
package/src/write.js
CHANGED
|
@@ -13,9 +13,11 @@ export const write = (board, serviceId, characteristicId, message, duration = 0)
|
|
|
13
13
|
characteristic
|
|
14
14
|
.writeValue(encoder.encode(message))
|
|
15
15
|
.then(() => {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
if (duration !== 0) {
|
|
17
|
+
setTimeout(() => {
|
|
18
|
+
resolve();
|
|
19
|
+
}, duration);
|
|
20
|
+
}
|
|
19
21
|
})
|
|
20
22
|
.catch((error) => {
|
|
21
23
|
reject(error);
|
package/src/write.ts
CHANGED
|
@@ -22,9 +22,11 @@ export const write = (
|
|
|
22
22
|
characteristic
|
|
23
23
|
.writeValue(encoder.encode(message))
|
|
24
24
|
.then(() => {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
25
|
+
if (duration !== 0) {
|
|
26
|
+
setTimeout(() => {
|
|
27
|
+
resolve()
|
|
28
|
+
}, duration)
|
|
29
|
+
}
|
|
28
30
|
})
|
|
29
31
|
.catch((error) => {
|
|
30
32
|
reject(error)
|