@hangtime/grip-connect 0.10.9 → 0.12.0
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/README.md +3 -3
- package/dist/cjs/interfaces/command.interface.d.ts +12 -1
- package/dist/cjs/interfaces/command.interface.d.ts.map +1 -1
- package/dist/cjs/interfaces/device/climbro.interface.d.ts +25 -0
- package/dist/cjs/interfaces/device/climbro.interface.d.ts.map +1 -1
- package/dist/cjs/interfaces/device/progressor.interface.d.ts +15 -5
- package/dist/cjs/interfaces/device/progressor.interface.d.ts.map +1 -1
- package/dist/cjs/models/device/climbro.model.d.ts +25 -0
- package/dist/cjs/models/device/climbro.model.d.ts.map +1 -1
- package/dist/cjs/models/device/climbro.model.js +93 -1
- package/dist/cjs/models/device/climbro.model.js.map +1 -1
- package/dist/cjs/models/device/entralpi.model.d.ts.map +1 -1
- package/dist/cjs/models/device/entralpi.model.js +3 -5
- package/dist/cjs/models/device/entralpi.model.js.map +1 -1
- package/dist/cjs/models/device/progressor.model.d.ts +23 -10
- package/dist/cjs/models/device/progressor.model.d.ts.map +1 -1
- package/dist/cjs/models/device/progressor.model.js +79 -17
- package/dist/cjs/models/device/progressor.model.js.map +1 -1
- package/dist/cjs/models/device.model.d.ts.map +1 -1
- package/dist/cjs/models/device.model.js +30 -25
- package/dist/cjs/models/device.model.js.map +1 -1
- package/dist/interfaces/command.interface.d.ts +12 -1
- package/dist/interfaces/command.interface.d.ts.map +1 -1
- package/dist/interfaces/device/climbro.interface.d.ts +25 -0
- package/dist/interfaces/device/climbro.interface.d.ts.map +1 -1
- package/dist/interfaces/device/progressor.interface.d.ts +15 -5
- package/dist/interfaces/device/progressor.interface.d.ts.map +1 -1
- package/dist/models/device/climbro.model.d.ts +25 -0
- package/dist/models/device/climbro.model.d.ts.map +1 -1
- package/dist/models/device/climbro.model.js +93 -1
- package/dist/models/device/climbro.model.js.map +1 -1
- package/dist/models/device/entralpi.model.d.ts.map +1 -1
- package/dist/models/device/entralpi.model.js +3 -5
- package/dist/models/device/entralpi.model.js.map +1 -1
- package/dist/models/device/progressor.model.d.ts +23 -10
- package/dist/models/device/progressor.model.d.ts.map +1 -1
- package/dist/models/device/progressor.model.js +79 -17
- package/dist/models/device/progressor.model.js.map +1 -1
- package/dist/models/device.model.d.ts.map +1 -1
- package/dist/models/device.model.js +30 -25
- package/dist/models/device.model.js.map +1 -1
- package/dist/tsconfig.cjs.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/interfaces/command.interface.ts +14 -1
- package/src/interfaces/device/climbro.interface.ts +30 -0
- package/src/interfaces/device/progressor.interface.ts +17 -5
- package/src/models/device/climbro.model.ts +98 -1
- package/src/models/device/entralpi.model.ts +3 -5
- package/src/models/device/progressor.model.ts +83 -17
- package/src/models/device.model.ts +39 -25
package/README.md
CHANGED
|
@@ -38,8 +38,8 @@ Learn more: [Documentation](https://stevie-ray.github.io/hangtime-grip-connect/)
|
|
|
38
38
|
|
|
39
39
|
## Try it out
|
|
40
40
|
|
|
41
|
-
[
|
|
42
|
-
[Pong](https://hangtime-grip-connect-pong.vercel.app/) -
|
|
41
|
+
[Force Measurement App](https://grip-connect.vercel.app/) -
|
|
42
|
+
[Flappy Bird](https://grip-connect-flappy-bird.vercel.app/) - [Pong](https://hangtime-grip-connect-pong.vercel.app/) -
|
|
43
43
|
[Kilter Board](https://grip-connect-kilter-board.vercel.app/?route=p1083r15p1117r15p1164r12p1185r12p1233r13p1282r13p1303r13p1372r13p1392r14p1505r15)
|
|
44
44
|
|
|
45
45
|
```bash
|
|
@@ -48,7 +48,7 @@ npx @hangtime/cli
|
|
|
48
48
|
|
|
49
49
|
> The CLI requires Node.js 22 or newer
|
|
50
50
|
|
|
51
|
-

|
|
52
52
|
|
|
53
53
|
## Install
|
|
54
54
|
|
|
@@ -93,8 +93,19 @@ export interface Commands {
|
|
|
93
93
|
*/
|
|
94
94
|
GET_PROGRESSOR_ID?: string;
|
|
95
95
|
/**
|
|
96
|
-
* Set calibration
|
|
96
|
+
* Set calibration block. Payload at offsets +2,+6,+10.
|
|
97
|
+
* The 12-byte block is interpreted as 3× float32 LE: slope, intercept, trim.
|
|
97
98
|
*/
|
|
98
99
|
SET_CALIBRATION?: string;
|
|
100
|
+
/**
|
|
101
|
+
* Retrieves the advanced calibration table from the device.
|
|
102
|
+
* Used to inspect the hidden piecewise interpolation table exported by v2 firmware.
|
|
103
|
+
*/
|
|
104
|
+
GET_CALIBRATION_TABLE?: string;
|
|
105
|
+
/**
|
|
106
|
+
* Reboots the device immediately.
|
|
107
|
+
* Intended for diagnostic flows.
|
|
108
|
+
*/
|
|
109
|
+
REBOOT?: string;
|
|
99
110
|
}
|
|
100
111
|
//# sourceMappingURL=command.interface.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command.interface.d.ts","sourceRoot":"","sources":["../../../src/interfaces/command.interface.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,QAAQ;IAGvB;;;OAGG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAE1B;;;OAGG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAA;IAEzB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IAEvB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAA;IAInB;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAA;IAEjB;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAA;IAErB;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,CAAA;IAIxB;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAA;IAIzB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAA;IAEnB;;;OAGG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAA;IAE5B;;;OAGG;IACH,0BAA0B,CAAC,EAAE,MAAM,CAAA;IAEnC;;;OAGG;IACH,qBAAqB,CAAC,EAAE,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C,EAAE,MAAM,CAAA;IAE9B;;;OAGG;IACH,qBAAqB,CAAC,EAAE,MAAM,CAAA;IAE9B;;;OAGG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAA;IAE5B;;OAEG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAE1B;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,CAAA;IAExB;;;OAGG;IACH,qBAAqB,CAAC,EAAE,MAAM,CAAA;IAE9B;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB"}
|
|
@@ -8,5 +8,30 @@ export interface IClimbro extends IDevice {
|
|
|
8
8
|
* @returns {Promise<string | undefined>} A Promise that resolves with the battery level.
|
|
9
9
|
*/
|
|
10
10
|
battery(): Promise<string | undefined>;
|
|
11
|
+
/**
|
|
12
|
+
* Retrieves hardware version from the device.
|
|
13
|
+
* @returns {Promise<string | undefined>} A Promise that resolves with the hardware version.
|
|
14
|
+
*/
|
|
15
|
+
hardware(): Promise<string | undefined>;
|
|
16
|
+
/**
|
|
17
|
+
* Retrieves manufacturer information from the device.
|
|
18
|
+
* @returns {Promise<string | undefined>} A Promise that resolves with the manufacturer information.
|
|
19
|
+
*/
|
|
20
|
+
manufacturer(): Promise<string | undefined>;
|
|
21
|
+
/**
|
|
22
|
+
* Retrieves model number from the device.
|
|
23
|
+
* @returns {Promise<string | undefined>} A Promise that resolves with the model number.
|
|
24
|
+
*/
|
|
25
|
+
model(): Promise<string | undefined>;
|
|
26
|
+
/**
|
|
27
|
+
* Retrieves software version from the device.
|
|
28
|
+
* @returns {Promise<string | undefined>} A Promise that resolves with the software version.
|
|
29
|
+
*/
|
|
30
|
+
software(): Promise<string | undefined>;
|
|
31
|
+
/**
|
|
32
|
+
* Retrieves system id from the device.
|
|
33
|
+
* @returns {Promise<string | undefined>} A Promise that resolves with the system id.
|
|
34
|
+
*/
|
|
35
|
+
system(): Promise<string | undefined>;
|
|
11
36
|
}
|
|
12
37
|
//# sourceMappingURL=climbro.interface.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"climbro.interface.d.ts","sourceRoot":"","sources":["../../../../src/interfaces/device/climbro.interface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAA;AAErD;;GAEG;AACH,MAAM,WAAW,QAAS,SAAQ,OAAO;IACvC;;;OAGG;IACH,OAAO,IAAI,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAA;
|
|
1
|
+
{"version":3,"file":"climbro.interface.d.ts","sourceRoot":"","sources":["../../../../src/interfaces/device/climbro.interface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAA;AAErD;;GAEG;AACH,MAAM,WAAW,QAAS,SAAQ,OAAO;IACvC;;;OAGG;IACH,OAAO,IAAI,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAA;IAEtC;;;OAGG;IACH,QAAQ,IAAI,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAA;IAEvC;;;OAGG;IACH,YAAY,IAAI,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAA;IAE3C;;;OAGG;IACH,KAAK,IAAI,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAA;IAEpC;;;OAGG;IACH,QAAQ,IAAI,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAA;IAEvC;;;OAGG;IACH,MAAM,IAAI,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAA;CACtC"}
|
|
@@ -19,11 +19,16 @@ export interface IProgressor extends IDevice {
|
|
|
19
19
|
*/
|
|
20
20
|
progressorId(): Promise<string | undefined>;
|
|
21
21
|
/**
|
|
22
|
-
* Retrieves calibration
|
|
23
|
-
*
|
|
24
|
-
*
|
|
22
|
+
* Retrieves the linear calibration block from the device (opcode 0x72).
|
|
23
|
+
* Parsed for display as raw hex plus 3× float32 LE coefficients:
|
|
24
|
+
* slope, intercept, and trim. Firmware uses: value = raw * slope + intercept + trim.
|
|
25
25
|
*/
|
|
26
26
|
calibration(): Promise<string | undefined>;
|
|
27
|
+
/**
|
|
28
|
+
* Retrieves the hidden 15-entry piecewise calibration table.
|
|
29
|
+
* Returns newline-separated decoded records in export order.
|
|
30
|
+
*/
|
|
31
|
+
calibrationTable(): Promise<string | undefined>;
|
|
27
32
|
/**
|
|
28
33
|
* Computes calibration curve from stored points and saves to flash.
|
|
29
34
|
* Call after addCalibrationPoint() for zero and reference. Normal flow: i → i → j.
|
|
@@ -35,9 +40,14 @@ export interface IProgressor extends IDevice {
|
|
|
35
40
|
*/
|
|
36
41
|
sleep(): Promise<void>;
|
|
37
42
|
/**
|
|
38
|
-
*
|
|
43
|
+
* Reboots the device immediately.
|
|
44
|
+
* Intended for diagnostic flows. Sends the firmware's required reboot-confirmation payload.
|
|
45
|
+
*/
|
|
46
|
+
reboot(): Promise<void>;
|
|
47
|
+
/**
|
|
48
|
+
* Set a new calibration block.
|
|
39
49
|
* @warning Expert only. This will overwrite the current calibration curve.
|
|
40
|
-
* @param curve - The 12-byte calibration
|
|
50
|
+
* @param curve - The 12-byte calibration block to set (3× float32 LE: slope, intercept, trim).
|
|
41
51
|
*/
|
|
42
52
|
setCalibration(curve: Uint8Array): Promise<void>;
|
|
43
53
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"progressor.interface.d.ts","sourceRoot":"","sources":["../../../../src/interfaces/device/progressor.interface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAA;AAErD;;GAEG;AACH,MAAM,WAAW,WAAY,SAAQ,OAAO;IAC1C;;;OAGG;IACH,OAAO,IAAI,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAA;IAEtC;;;OAGG;IACH,QAAQ,IAAI,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAA;IAEvC;;;OAGG;IACH,YAAY,IAAI,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAA;IAE3C;;;;OAIG;IACH,WAAW,IAAI,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAA;IAE1C;;;OAGG;IACH,eAAe,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;IAEhC;;;OAGG;IACH,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;IAEtB;;;;OAIG;IACH,cAAc,CAAC,KAAK,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAEhD;;;OAGG;IACH,SAAS,IAAI,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAA;IAExC;;;OAGG;IACH,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;IAE/B;;;OAGG;IACH,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;IAErB;;;;OAIG;IACH,MAAM,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAExC;;;OAGG;IACH,mBAAmB,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;IAEpC,+EAA+E;IAC/E,QAAQ,CAAC,gBAAgB,EAAE,IAAI,CAAA;CAChC"}
|
|
1
|
+
{"version":3,"file":"progressor.interface.d.ts","sourceRoot":"","sources":["../../../../src/interfaces/device/progressor.interface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAA;AAErD;;GAEG;AACH,MAAM,WAAW,WAAY,SAAQ,OAAO;IAC1C;;;OAGG;IACH,OAAO,IAAI,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAA;IAEtC;;;OAGG;IACH,QAAQ,IAAI,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAA;IAEvC;;;OAGG;IACH,YAAY,IAAI,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAA;IAE3C;;;;OAIG;IACH,WAAW,IAAI,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAA;IAE1C;;;OAGG;IACH,gBAAgB,IAAI,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAA;IAE/C;;;OAGG;IACH,eAAe,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;IAEhC;;;OAGG;IACH,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;IAEtB;;;OAGG;IACH,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;IAEvB;;;;OAIG;IACH,cAAc,CAAC,KAAK,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAEhD;;;OAGG;IACH,SAAS,IAAI,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAA;IAExC;;;OAGG;IACH,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;IAE/B;;;OAGG;IACH,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;IAErB;;;;OAIG;IACH,MAAM,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAExC;;;OAGG;IACH,mBAAmB,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;IAEpC,+EAA+E;IAC/E,QAAQ,CAAC,gBAAgB,EAAE,IAAI,CAAA;CAChC"}
|
|
@@ -31,6 +31,31 @@ export declare class Climbro extends Device implements IClimbro {
|
|
|
31
31
|
* @returns {Promise<string | undefined>} A Promise that resolves with the battery level.
|
|
32
32
|
*/
|
|
33
33
|
battery: () => Promise<string | undefined>;
|
|
34
|
+
/**
|
|
35
|
+
* Retrieves hardware version from the device.
|
|
36
|
+
* @returns {Promise<string | undefined>} A Promise that resolves with the hardware version.
|
|
37
|
+
*/
|
|
38
|
+
hardware: () => Promise<string | undefined>;
|
|
39
|
+
/**
|
|
40
|
+
* Retrieves manufacturer information from the device.
|
|
41
|
+
* @returns {Promise<string | undefined>} A Promise that resolves with the manufacturer information.
|
|
42
|
+
*/
|
|
43
|
+
manufacturer: () => Promise<string | undefined>;
|
|
44
|
+
/**
|
|
45
|
+
* Retrieves model number from the device.
|
|
46
|
+
* @returns {Promise<string | undefined>} A Promise that resolves with the model number.
|
|
47
|
+
*/
|
|
48
|
+
model: () => Promise<string | undefined>;
|
|
49
|
+
/**
|
|
50
|
+
* Retrieves software version from the device.
|
|
51
|
+
* @returns {Promise<string | undefined>} A Promise that resolves with the software version.
|
|
52
|
+
*/
|
|
53
|
+
software: () => Promise<string | undefined>;
|
|
54
|
+
/**
|
|
55
|
+
* Retrieves system id from the device.
|
|
56
|
+
* @returns {Promise<string | undefined>} A Promise that resolves with the system id.
|
|
57
|
+
*/
|
|
58
|
+
system: () => Promise<string | undefined>;
|
|
34
59
|
/**
|
|
35
60
|
* Handles data received from the device, processes force measurements and battery data
|
|
36
61
|
* according to the Climbro protocol.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"climbro.model.d.ts","sourceRoot":"","sources":["../../../../src/models/device/climbro.model.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAA;AAC3C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,8CAA8C,CAAA;AAoB5E;;;GAGG;AACH,qBAAa,OAAQ,SAAQ,MAAO,YAAW,QAAQ;IACrD;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,cAAc,CAAc;IACpD,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,cAAc,CAAc;IACpD,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,YAAY,CAAoD;IACxF,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,YAAY,CAAkC;IAEtE;;;;;OAKG;IACH,OAAO,CAAC,WAAW,CAAI;IAEvB;;;;OAIG;IACH,OAAO,CAAC,YAAY,CAAI;;
|
|
1
|
+
{"version":3,"file":"climbro.model.d.ts","sourceRoot":"","sources":["../../../../src/models/device/climbro.model.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAA;AAC3C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,8CAA8C,CAAA;AAoB5E;;;GAGG;AACH,qBAAa,OAAQ,SAAQ,MAAO,YAAW,QAAQ;IACrD;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,cAAc,CAAc;IACpD,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,cAAc,CAAc;IACpD,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,YAAY,CAAoD;IACxF,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,YAAY,CAAkC;IAEtE;;;;;OAKG;IACH,OAAO,CAAC,WAAW,CAAI;IAEvB;;;;OAIG;IACH,OAAO,CAAC,YAAY,CAAI;;IA+ExB;;;OAGG;IACH,OAAO,QAAa,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAG9C;IAED;;;OAGG;IACH,QAAQ,QAAa,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAE/C;IAED;;;OAGG;IACH,YAAY,QAAa,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAEnD;IAED;;;OAGG;IACH,KAAK,QAAa,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAE5C;IAED;;;OAGG;IACH,QAAQ,QAAa,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAE/C;IAED;;;OAGG;IACH,MAAM,QAAa,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAE7C;IAED;;;;;OAKG;IACM,mBAAmB,GAAI,OAAO,QAAQ,KAAG,IAAI,CA2FrD;CACF"}
|
|
@@ -36,10 +36,67 @@ class Climbro extends device_model_js_1.Device {
|
|
|
36
36
|
uuid: "49535343-fe7d-4ae5-8fa9-9fafd205e455",
|
|
37
37
|
characteristics: [
|
|
38
38
|
{
|
|
39
|
-
name: "
|
|
39
|
+
name: "UART Tramsmit (we set as rx)",
|
|
40
40
|
id: "rx",
|
|
41
41
|
uuid: "49535343-1e4d-4bd9-ba61-23c647249616",
|
|
42
42
|
},
|
|
43
|
+
{
|
|
44
|
+
name: "UART Receive (we set as tx)",
|
|
45
|
+
id: "tx",
|
|
46
|
+
uuid: "49535343-8841-43f4-a8d4-ecbe34729bb3",
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
name: "Transparent Control Point",
|
|
50
|
+
id: "tcp",
|
|
51
|
+
uuid: "49535343-4c8a-39b3-2f49-511cff073b7e",
|
|
52
|
+
},
|
|
53
|
+
],
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
name: "Device Information",
|
|
57
|
+
id: "device",
|
|
58
|
+
uuid: "0000180a-0000-1000-8000-00805f9b34fb",
|
|
59
|
+
characteristics: [
|
|
60
|
+
{
|
|
61
|
+
name: "System ID",
|
|
62
|
+
id: "system",
|
|
63
|
+
uuid: "00002a23-0000-1000-8000-00805f9b34fb",
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
name: "Model Number String",
|
|
67
|
+
id: "model", // RN487x
|
|
68
|
+
uuid: "00002a24-0000-1000-8000-00805f9b34fb",
|
|
69
|
+
},
|
|
70
|
+
// {
|
|
71
|
+
// name: "Serial Number String (Blocked)",
|
|
72
|
+
// id: "serial",
|
|
73
|
+
// uuid: "00002a25-0000-1000-8000-00805f9b34fb",
|
|
74
|
+
// },
|
|
75
|
+
{
|
|
76
|
+
name: "Firmware Revision String",
|
|
77
|
+
id: "firmware",
|
|
78
|
+
uuid: "00002a26-0000-1000-8000-00805f9b34fb",
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
name: "Hardware Revision String",
|
|
82
|
+
id: "hardware", // 5505 102_BLDK3
|
|
83
|
+
uuid: "00002a27-0000-1000-8000-00805f9b34fb",
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
name: "Software Revision String",
|
|
87
|
+
id: "software", // 1.30
|
|
88
|
+
uuid: "00002a28-0000-1000-8000-00805f9b34fb",
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
name: "Manufacturer Name String",
|
|
92
|
+
id: "manufacturer", // Microchip
|
|
93
|
+
uuid: "00002a29-0000-1000-8000-00805f9b34fb",
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
name: "IEEE 11073-20601 Regulatory Certification Data List",
|
|
97
|
+
id: "certification",
|
|
98
|
+
uuid: "00002a2a-0000-1000-8000-00805f9b34fb",
|
|
99
|
+
},
|
|
43
100
|
],
|
|
44
101
|
},
|
|
45
102
|
],
|
|
@@ -65,6 +122,41 @@ class Climbro extends device_model_js_1.Device {
|
|
|
65
122
|
// Battery level is continuously updated via notifications
|
|
66
123
|
return this.batteryLevel.toString();
|
|
67
124
|
};
|
|
125
|
+
/**
|
|
126
|
+
* Retrieves hardware version from the device.
|
|
127
|
+
* @returns {Promise<string | undefined>} A Promise that resolves with the hardware version.
|
|
128
|
+
*/
|
|
129
|
+
this.hardware = async () => {
|
|
130
|
+
return await this.read("device", "hardware", 250);
|
|
131
|
+
};
|
|
132
|
+
/**
|
|
133
|
+
* Retrieves manufacturer information from the device.
|
|
134
|
+
* @returns {Promise<string | undefined>} A Promise that resolves with the manufacturer information.
|
|
135
|
+
*/
|
|
136
|
+
this.manufacturer = async () => {
|
|
137
|
+
return await this.read("device", "manufacturer", 250);
|
|
138
|
+
};
|
|
139
|
+
/**
|
|
140
|
+
* Retrieves model number from the device.
|
|
141
|
+
* @returns {Promise<string | undefined>} A Promise that resolves with the model number.
|
|
142
|
+
*/
|
|
143
|
+
this.model = async () => {
|
|
144
|
+
return await this.read("device", "model", 250);
|
|
145
|
+
};
|
|
146
|
+
/**
|
|
147
|
+
* Retrieves software version from the device.
|
|
148
|
+
* @returns {Promise<string | undefined>} A Promise that resolves with the software version.
|
|
149
|
+
*/
|
|
150
|
+
this.software = async () => {
|
|
151
|
+
return await this.read("device", "software", 250);
|
|
152
|
+
};
|
|
153
|
+
/**
|
|
154
|
+
* Retrieves system id from the device.
|
|
155
|
+
* @returns {Promise<string | undefined>} A Promise that resolves with the system id.
|
|
156
|
+
*/
|
|
157
|
+
this.system = async () => {
|
|
158
|
+
return await this.read("device", "system", 250);
|
|
159
|
+
};
|
|
68
160
|
/**
|
|
69
161
|
* Handles data received from the device, processes force measurements and battery data
|
|
70
162
|
* according to the Climbro protocol.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"climbro.model.js","sourceRoot":"","sources":["../../../../src/models/device/climbro.model.ts"],"names":[],"mappings":";;;;AAAA,wDAA2C;AAG3C;;GAEG;AACH,IAAK,gBAaJ;AAbD,WAAK,gBAAgB;IACnB;;OAEG;IACH,+DAAc,CAAA;IACd;;OAEG;IACH,iEAAe,CAAA;IACf;;OAEG;IACH,iEAAe,CAAA;AACjB,CAAC,EAbI,gBAAgB,KAAhB,gBAAgB,QAapB;AAED;;;GAGG;AACH,MAAa,OAAQ,SAAQ,wBAAM;IAwBjC;QACE,KAAK,CAAC;YACJ,OAAO,EAAE,CAAC,EAAE,UAAU,EAAE,SAAS,EAAE,CAAC;YACpC,QAAQ,EAAE;gBACR;oBACE,IAAI,EAAE,0BAA0B;oBAChC,EAAE,EAAE,MAAM;oBACV,IAAI,EAAE,sCAAsC;oBAC5C,eAAe,EAAE;wBACf;4BACE,IAAI,EAAE,
|
|
1
|
+
{"version":3,"file":"climbro.model.js","sourceRoot":"","sources":["../../../../src/models/device/climbro.model.ts"],"names":[],"mappings":";;;;AAAA,wDAA2C;AAG3C;;GAEG;AACH,IAAK,gBAaJ;AAbD,WAAK,gBAAgB;IACnB;;OAEG;IACH,+DAAc,CAAA;IACd;;OAEG;IACH,iEAAe,CAAA;IACf;;OAEG;IACH,iEAAe,CAAA;AACjB,CAAC,EAbI,gBAAgB,KAAhB,gBAAgB,QAapB;AAED;;;GAGG;AACH,MAAa,OAAQ,SAAQ,wBAAM;IAwBjC;QACE,KAAK,CAAC;YACJ,OAAO,EAAE,CAAC,EAAE,UAAU,EAAE,SAAS,EAAE,CAAC;Y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,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAE7C;CACF"}
|
|
@@ -164,11 +164,9 @@ class Entralpi extends device_model_js_1.Device {
|
|
|
164
164
|
const receivedTime = Date.now();
|
|
165
165
|
const receivedData = (value.getUint16(0) / 100).toFixed(1);
|
|
166
166
|
const convertedData = Number(receivedData);
|
|
167
|
-
// Adjust weight by using the tare value
|
|
168
|
-
//
|
|
169
|
-
|
|
170
|
-
const tare = this.applyTare(convertedData);
|
|
171
|
-
const numericData = tare === 0 ? convertedData : (convertedData - tare) * -1;
|
|
167
|
+
// Adjust weight by using the tare value.
|
|
168
|
+
// Keep stream output consistent with other devices: positive load after tare.
|
|
169
|
+
const numericData = convertedData - this.applyTare(convertedData);
|
|
172
170
|
const currentMassTotal = Math.max(-1000, numericData);
|
|
173
171
|
// Update session stats before building packet
|
|
174
172
|
this.peak = Math.max(this.peak, numericData);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entralpi.model.js","sourceRoot":"","sources":["../../../../src/models/device/entralpi.model.ts"],"names":[],"mappings":";;;AAAA,wDAA2C;AAG3C;;;GAGG;AACH,MAAa,QAAS,SAAQ,wBAAM;IAClC;QACE,KAAK,CAAC;YACJ,OAAO,EAAE;gBACP;oBACE,IAAI,EAAE,UAAU;iBACjB;aACF;YACD,QAAQ,EAAE;gBACR;oBACE,IAAI,EAAE,oBAAoB;oBAC1B,EAAE,EAAE,QAAQ;oBACZ,IAAI,EAAE,sCAAsC;oBAC5C,eAAe,EAAE;wBACf;4BACE,IAAI,EAAE,WAAW;4BACjB,EAAE,EAAE,QAAQ;4BACZ,IAAI,EAAE,sCAAsC;yBAC7C;wBACD;4BACE,IAAI,EAAE,qBAAqB;4BAC3B,EAAE,EAAE,OAAO;4BACX,IAAI,EAAE,sCAAsC;yBAC7C;wBACD,IAAI;wBACJ,4CAA4C;wBAC5C,kBAAkB;wBAClB,kDAAkD;wBAClD,KAAK;wBACL;4BACE,IAAI,EAAE,0BAA0B;4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MAAM,aAAa,GAAG,MAAM,CAAC,YAAY,CAAC,CAAA;oBAC1C,
|
|
1
|
+
{"version":3,"file":"entralpi.model.js","sourceRoot":"","sources":["../../../../src/models/device/entralpi.model.ts"],"names":[],"mappings":";;;AAAA,wDAA2C;AAG3C;;;GAGG;AACH,MAAa,QAAS,SAAQ,wBAAM;IAClC;QACE,KAAK,CAAC;YACJ,OAAO,EAAE;gBACP;oBACE,IAAI,EAAE,UAAU;iBACjB;aACF;YACD,QAAQ,EAAE;gBACR;oBACE,IAAI,EAAE,oBAAoB;oBAC1B,EAAE,EAAE,QAAQ;oBACZ,IAAI,EAAE,sCAAsC;oBAC5C,eAAe,EAAE;wBACf;4BACE,IAAI,EAAE,WAAW;4BACjB,EAAE,EAAE,QAAQ;4BACZ,IAAI,EAAE,sCAAsC;yBAC7C;wBACD;4BACE,IAAI,EAAE,qBAAqB;4BAC3B,EAAE,EAAE,OAAO;4BACX,IAAI,EAAE,sCAAsC;yBAC7C;wBACD,IAAI;wBACJ,4CAA4C;wBAC5C,kBAAkB;wBAClB,kDAAkD;wBAClD,KAAK;wBACL;4BACE,IAAI,EAAE,0BAA0B;4BAChC,EAAE,EAAE,UAAU;4BACd,IAAI,EAAE,sCAAsC;yBAC7C;wBACD;4BACE,IAAI,EAAE,0BAA0B;4BAChC,EAAE,EAAE,UAAU;4BACd,IAAI,EAAE,sCAAsC;yBAC7C;wBACD;4BACE,IAAI,EAAE,0BAA0B;4BAChC,EAAE,EAAE,UAAU;4BACd,IAAI,EAAE,sCAAsC;yBAC7C;wBACD;4BACE,IAAI,EAAE,0BAA0B;4BAChC,EAAE,EAAE,cAAc;4BAClB,IAAI,EAAE,sCAAsC;yBAC7C;wBACD;4BACE,IAAI,EAAE,qDAAqD;4BAC3D,EAAE,EAAE,eAAe;4BACnB,IAAI,EAAE,sCAAsC;yBAC7C;wBACD;4BACE,IAAI,EAAE,QAAQ;4BACd,EAAE,EAAE,KAAK;4BACT,IAAI,EAAE,sCAAsC;yBA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IAAiC,EAAE;YACjD,OAAO,MAAM,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,UAAU,EAAE,GAAG,CAAC,CAAA;QACnD,CAAC,CAAA;QAED;;;WAGG;QACH,WAAM,GAAG,KAAK,IAAiC,EAAE;YAC/C,OAAO,MAAM,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,QAAQ,EAAE,GAAG,CAAC,CAAA;QACjD,CAAC,CAAA;IAvHD,CAAC;CAwHF;AAjPD,4BAiPC"}
|
|
@@ -3,6 +3,8 @@ import type { IProgressor } from "../../interfaces/device/progressor.interface.j
|
|
|
3
3
|
export declare class Progressor extends Device implements IProgressor {
|
|
4
4
|
/** Device timestamps (µs) of recent samples (samples in last 1s device time). */
|
|
5
5
|
private recentSampleTimestamps;
|
|
6
|
+
/** 1-based index for multi-packet calibration-table export responses. */
|
|
7
|
+
private calibrationTableRecordIndex;
|
|
6
8
|
constructor();
|
|
7
9
|
/**
|
|
8
10
|
* Retrieves battery or voltage information from the device.
|
|
@@ -10,39 +12,45 @@ export declare class Progressor extends Device implements IProgressor {
|
|
|
10
12
|
*/
|
|
11
13
|
battery: () => Promise<string | undefined>;
|
|
12
14
|
/**
|
|
13
|
-
* Retrieves firmware version from the device
|
|
15
|
+
* Retrieves firmware version from the device.
|
|
14
16
|
* @returns {Promise<string>} A Promise that resolves with the firmware version,
|
|
15
17
|
*/
|
|
16
18
|
firmware: () => Promise<string | undefined>;
|
|
17
19
|
/**
|
|
18
|
-
* Retrieves the Progressor ID from the device
|
|
20
|
+
* Retrieves the Progressor ID from the device.
|
|
19
21
|
* @returns {Promise<string>} A Promise that resolves with the raw response (hex of payload).
|
|
20
22
|
*/
|
|
21
23
|
progressorId: () => Promise<string | undefined>;
|
|
22
24
|
/**
|
|
23
|
-
* Retrieves calibration
|
|
24
|
-
*
|
|
25
|
+
* Retrieves the linear calibration block from the device.
|
|
26
|
+
* Returns raw hex plus decoded slope/intercept/trim coefficients.
|
|
25
27
|
*/
|
|
26
28
|
calibration: () => Promise<string | undefined>;
|
|
27
29
|
/**
|
|
28
|
-
*
|
|
30
|
+
* Retrieves the hidden 15-entry piecewise calibration table.
|
|
31
|
+
* Each response packet contains one 16-byte record.
|
|
32
|
+
* @returns {Promise<string | undefined>} Newline-separated decoded records.
|
|
33
|
+
*/
|
|
34
|
+
calibrationTable: () => Promise<string | undefined>;
|
|
35
|
+
/**
|
|
36
|
+
* Computes calibration curve from stored points and saves to flash.
|
|
29
37
|
* Requires addCalibrationPoint() for zero and reference. Normal flow: i → i → j.
|
|
30
38
|
* @returns {Promise<void>} A Promise that resolves when the command is sent.
|
|
31
39
|
*/
|
|
32
40
|
saveCalibration: () => Promise<void>;
|
|
33
41
|
/**
|
|
34
|
-
*
|
|
42
|
+
* Write calibration block directly (raw overwrite).
|
|
35
43
|
*
|
|
36
44
|
* Payload layout (14 bytes):
|
|
37
|
-
* - [0] opcode ('q'
|
|
45
|
+
* - [0] opcode ('q')
|
|
38
46
|
* - [1] reserved (ignored by firmware)
|
|
39
|
-
* - [2..13] 12-byte calibration
|
|
47
|
+
* - [2..13] 12-byte calibration block (3× float32 LE: slope, intercept, trim)
|
|
40
48
|
*
|
|
41
49
|
* Notes:
|
|
42
50
|
* - This command does not compute anything; it overwrites stored calibration data.
|
|
43
|
-
* - Sending only the opcode (no 12-byte
|
|
51
|
+
* - Sending only the opcode (no 12-byte calibration block) is not a supported "reset" mode.
|
|
44
52
|
*
|
|
45
|
-
* @param curve - Raw 12-byte calibration
|
|
53
|
+
* @param curve - Raw 12-byte calibration block (3× float32 LE: slope, intercept, trim) (required).
|
|
46
54
|
* @returns Promise that resolves when the command is sent.
|
|
47
55
|
*/
|
|
48
56
|
setCalibration: (curve: Uint8Array) => Promise<void>;
|
|
@@ -75,6 +83,11 @@ export declare class Progressor extends Device implements IProgressor {
|
|
|
75
83
|
* @returns {Promise<void>} A Promise that resolves when the command is sent.
|
|
76
84
|
*/
|
|
77
85
|
sleep: () => Promise<void>;
|
|
86
|
+
/**
|
|
87
|
+
* Reboots the device immediately.
|
|
88
|
+
* @returns {Promise<void>} A Promise that resolves when the command is sent.
|
|
89
|
+
*/
|
|
90
|
+
reboot: () => Promise<void>;
|
|
78
91
|
/**
|
|
79
92
|
* Retrieves error information from the device.
|
|
80
93
|
* @returns {Promise<string | undefined>} A Promise that resolves with the error info text.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"progressor.model.d.ts","sourceRoot":"","sources":["../../../../src/models/device/progressor.model.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAA;AAC3C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iDAAiD,CAAA;
|
|
1
|
+
{"version":3,"file":"progressor.model.d.ts","sourceRoot":"","sources":["../../../../src/models/device/progressor.model.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAA;AAC3C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iDAAiD,CAAA;AAkHlF,qBAAa,UAAW,SAAQ,MAAO,YAAW,WAAW;IAC3D,iFAAiF;IACjF,OAAO,CAAC,sBAAsB,CAAe;IAC7C,yEAAyE;IACzE,OAAO,CAAC,2BAA2B,CAAI;;IA8DvC;;;OAGG;IACH,OAAO,QAAa,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAM9C;IAED;;;OAGG;IACH,QAAQ,QAAa,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAM/C;IAED;;;OAGG;IACH,YAAY,QAAa,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAMnD;IAED;;;OAGG;IACH,WAAW,QAAa,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAMlD;IAED;;;;OAIG;IACH,gBAAgB,QAAa,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAOvD;IAED;;;;OAIG;IACH,eAAe,QAAa,OAAO,CAAC,IAAI,CAAC,CAExC;IAED;;;;;;;;;;;;;;OAcG;IACH,cAAc,GAAU,OAAO,UAAU,KAAG,OAAO,CAAC,IAAI,CAAC,CAWxD;IAED;;;;;;;;;;;;;;;;;;;OAmBG;IACH,mBAAmB,QAAa,OAAO,CAAC,IAAI,CAAC,CAG5C;IAED,+EAA+E;IAC/E,QAAQ,CAAC,gBAAgB,QAAO;IAEvB,IAAI,CAAC,QAAQ,SAAO,GAAG,OAAO;IAOvC;;;OAGG;IACH,KAAK,QAAa,OAAO,CAAC,IAAI,CAAC,CAG9B;IAED;;;OAGG;IACH,MAAM,QAAa,OAAO,CAAC,IAAI,CAAC,CAI/B;IAED;;;OAGG;IACH,SAAS,QAAa,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAMhD;IAED;;;OAGG;IACH,cAAc,QAAa,OAAO,CAAC,IAAI,CAAC,CAEvC;IAED;;;;;;OAMG;IACM,mBAAmB,GAAI,OAAO,QAAQ,KAAG,IAAI,CA2FrD;IAED;;;OAGG;IACH,IAAI,QAAa,OAAO,CAAC,IAAI,CAAC,CAE7B;IAED;;;;OAIG;IACH,MAAM,GAAU,iBAAY,KAAG,OAAO,CAAC,IAAI,CAAC,CAgB3C;CACF"}
|
|
@@ -61,17 +61,46 @@ function parseProgressorIdPayload(payload) {
|
|
|
61
61
|
return toHex(reversed, "").toUpperCase();
|
|
62
62
|
}
|
|
63
63
|
/**
|
|
64
|
-
* Parse calibration
|
|
65
|
-
*
|
|
66
|
-
* and a third value (version/reserved). Exact layout is device-specific.
|
|
64
|
+
* Parse calibration block: 3× float32 LE.
|
|
65
|
+
* value = raw * slope + intercept + trim.
|
|
67
66
|
*/
|
|
68
67
|
function parseCalibrationCurvePayload(payload) {
|
|
69
68
|
const hex = toHex(payload);
|
|
70
69
|
if (payload.length !== 12)
|
|
71
70
|
return hex;
|
|
72
71
|
const view = new DataView(payload.buffer, payload.byteOffset, payload.byteLength);
|
|
73
|
-
const
|
|
74
|
-
|
|
72
|
+
const slope = view.getFloat32(0, true);
|
|
73
|
+
const intercept = view.getFloat32(4, true);
|
|
74
|
+
const trim = view.getFloat32(8, true);
|
|
75
|
+
const effectiveOffset = intercept + trim;
|
|
76
|
+
const formatSignedFloat = (value) => {
|
|
77
|
+
const formatted = formatCalibrationFloat(Math.abs(value));
|
|
78
|
+
return value < 0 ? ` - ${formatted}` : ` + ${formatted}`;
|
|
79
|
+
};
|
|
80
|
+
return `${hex} — slope: ${formatCalibrationFloat(slope)} | intercept: ${formatCalibrationFloat(intercept)} | trim: ${formatCalibrationFloat(trim)} | effective offset: ${formatCalibrationFloat(effectiveOffset)} | formula: raw * ${formatCalibrationFloat(slope)}${formatSignedFloat(intercept)}${formatSignedFloat(trim)}`;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Format floating-point values for calibration-table display.
|
|
84
|
+
*/
|
|
85
|
+
function formatCalibrationFloat(value) {
|
|
86
|
+
if (!Number.isFinite(value))
|
|
87
|
+
return String(value);
|
|
88
|
+
const abs = Math.abs(value);
|
|
89
|
+
return abs !== 0 && (abs >= 1000000 || abs < 0.0001) ? value.toExponential(6) : value.toFixed(6);
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Parse one calibration table record: [u32 lower, u32 upper, f32 slope, f32 intercept].
|
|
93
|
+
*/
|
|
94
|
+
function parseCalibrationTableRecordPayload(payload, index) {
|
|
95
|
+
if (payload.length !== 16)
|
|
96
|
+
return `${String(index).padStart(2, "0")}: ${toHex(payload)}`;
|
|
97
|
+
const view = new DataView(payload.buffer, payload.byteOffset, payload.byteLength);
|
|
98
|
+
const lowerRaw = view.getUint32(0, true);
|
|
99
|
+
const upperRaw = view.getUint32(4, true);
|
|
100
|
+
const slope = view.getFloat32(8, true);
|
|
101
|
+
const intercept = view.getFloat32(12, true);
|
|
102
|
+
const hex = toHex(payload);
|
|
103
|
+
return `${String(index).padStart(2, "0")}: ${hex} | raw ${lowerRaw.toLocaleString()}..${upperRaw.toLocaleString()} | slope ${formatCalibrationFloat(slope)} | intercept ${formatCalibrationFloat(intercept)}`;
|
|
75
104
|
}
|
|
76
105
|
class Progressor extends device_model_js_1.Device {
|
|
77
106
|
constructor() {
|
|
@@ -108,7 +137,7 @@ class Progressor extends device_model_js_1.Device {
|
|
|
108
137
|
],
|
|
109
138
|
},
|
|
110
139
|
],
|
|
111
|
-
// Tindeq API: opcode = single byte (ASCII char code = decimal 100–114
|
|
140
|
+
// Tindeq API: opcode = single byte (ASCII char code = decimal 100–114 v2 firmware: 115-118)
|
|
112
141
|
commands: {
|
|
113
142
|
TARE_SCALE: "d", // 100 (0x64)
|
|
114
143
|
START_WEIGHT_MEAS: "e", // 101 (0x65)
|
|
@@ -125,10 +154,17 @@ class Progressor extends device_model_js_1.Device {
|
|
|
125
154
|
GET_PROGRESSOR_ID: "p", // 112 (0x70)
|
|
126
155
|
SET_CALIBRATION: "q", // 113 (0x71)
|
|
127
156
|
GET_CALIBRATION: "r", // 114 (0x72)
|
|
157
|
+
// V2 FIRMWARE ONLY COMMANDS
|
|
158
|
+
// ADD_CALIBRATION_TABLE_POINT: "s", // 115 (0x73)
|
|
159
|
+
GET_CALIBRATION_TABLE: "t", // 116 (0x74)
|
|
160
|
+
REBOOT: "u", // 117 (0x75)
|
|
161
|
+
// CLR_CALIBRATION_TABLE: "v", // 118 (0x76)
|
|
128
162
|
},
|
|
129
163
|
});
|
|
130
164
|
/** Device timestamps (µs) of recent samples (samples in last 1s device time). */
|
|
131
165
|
this.recentSampleTimestamps = [];
|
|
166
|
+
/** 1-based index for multi-packet calibration-table export responses. */
|
|
167
|
+
this.calibrationTableRecordIndex = 0;
|
|
132
168
|
/**
|
|
133
169
|
* Retrieves battery or voltage information from the device.
|
|
134
170
|
* @returns {Promise<string | undefined>} A Promise that resolves with the battery or voltage information,
|
|
@@ -141,7 +177,7 @@ class Progressor extends device_model_js_1.Device {
|
|
|
141
177
|
return response;
|
|
142
178
|
};
|
|
143
179
|
/**
|
|
144
|
-
* Retrieves firmware version from the device
|
|
180
|
+
* Retrieves firmware version from the device.
|
|
145
181
|
* @returns {Promise<string>} A Promise that resolves with the firmware version,
|
|
146
182
|
*/
|
|
147
183
|
this.firmware = async () => {
|
|
@@ -152,7 +188,7 @@ class Progressor extends device_model_js_1.Device {
|
|
|
152
188
|
return response;
|
|
153
189
|
};
|
|
154
190
|
/**
|
|
155
|
-
* Retrieves the Progressor ID from the device
|
|
191
|
+
* Retrieves the Progressor ID from the device.
|
|
156
192
|
* @returns {Promise<string>} A Promise that resolves with the raw response (hex of payload).
|
|
157
193
|
*/
|
|
158
194
|
this.progressorId = async () => {
|
|
@@ -163,8 +199,8 @@ class Progressor extends device_model_js_1.Device {
|
|
|
163
199
|
return response;
|
|
164
200
|
};
|
|
165
201
|
/**
|
|
166
|
-
* Retrieves calibration
|
|
167
|
-
*
|
|
202
|
+
* Retrieves the linear calibration block from the device.
|
|
203
|
+
* Returns raw hex plus decoded slope/intercept/trim coefficients.
|
|
168
204
|
*/
|
|
169
205
|
this.calibration = async () => {
|
|
170
206
|
let response = undefined;
|
|
@@ -174,7 +210,20 @@ class Progressor extends device_model_js_1.Device {
|
|
|
174
210
|
return response;
|
|
175
211
|
};
|
|
176
212
|
/**
|
|
177
|
-
*
|
|
213
|
+
* Retrieves the hidden 15-entry piecewise calibration table.
|
|
214
|
+
* Each response packet contains one 16-byte record.
|
|
215
|
+
* @returns {Promise<string | undefined>} Newline-separated decoded records.
|
|
216
|
+
*/
|
|
217
|
+
this.calibrationTable = async () => {
|
|
218
|
+
const responses = [];
|
|
219
|
+
this.calibrationTableRecordIndex = 0;
|
|
220
|
+
await this.write("progressor", "tx", this.commands.GET_CALIBRATION_TABLE, 1000, (data) => {
|
|
221
|
+
responses.push(data);
|
|
222
|
+
});
|
|
223
|
+
return responses.length > 0 ? responses.join("\n") : undefined;
|
|
224
|
+
};
|
|
225
|
+
/**
|
|
226
|
+
* Computes calibration curve from stored points and saves to flash.
|
|
178
227
|
* Requires addCalibrationPoint() for zero and reference. Normal flow: i → i → j.
|
|
179
228
|
* @returns {Promise<void>} A Promise that resolves when the command is sent.
|
|
180
229
|
*/
|
|
@@ -182,24 +231,24 @@ class Progressor extends device_model_js_1.Device {
|
|
|
182
231
|
await this.write("progressor", "tx", this.commands.SAVE_CALIBRATION, 0);
|
|
183
232
|
};
|
|
184
233
|
/**
|
|
185
|
-
*
|
|
234
|
+
* Write calibration block directly (raw overwrite).
|
|
186
235
|
*
|
|
187
236
|
* Payload layout (14 bytes):
|
|
188
|
-
* - [0] opcode ('q'
|
|
237
|
+
* - [0] opcode ('q')
|
|
189
238
|
* - [1] reserved (ignored by firmware)
|
|
190
|
-
* - [2..13] 12-byte calibration
|
|
239
|
+
* - [2..13] 12-byte calibration block (3× float32 LE: slope, intercept, trim)
|
|
191
240
|
*
|
|
192
241
|
* Notes:
|
|
193
242
|
* - This command does not compute anything; it overwrites stored calibration data.
|
|
194
|
-
* - Sending only the opcode (no 12-byte
|
|
243
|
+
* - Sending only the opcode (no 12-byte calibration block) is not a supported "reset" mode.
|
|
195
244
|
*
|
|
196
|
-
* @param curve - Raw 12-byte calibration
|
|
245
|
+
* @param curve - Raw 12-byte calibration block (3× float32 LE: slope, intercept, trim) (required).
|
|
197
246
|
* @returns Promise that resolves when the command is sent.
|
|
198
247
|
*/
|
|
199
248
|
this.setCalibration = async (curve) => {
|
|
200
249
|
if (curve.length !== 12)
|
|
201
250
|
throw new Error("Curve must be 12 bytes");
|
|
202
|
-
const opcode = this.commands.SET_CALIBRATION.charCodeAt(0);
|
|
251
|
+
const opcode = this.commands.SET_CALIBRATION.charCodeAt(0);
|
|
203
252
|
const payload = new Uint8Array(14);
|
|
204
253
|
payload[0] = opcode;
|
|
205
254
|
payload[1] = 0; // reserved/ignored
|
|
@@ -240,6 +289,15 @@ class Progressor extends device_model_js_1.Device {
|
|
|
240
289
|
const cmd = this.commands.SLEEP;
|
|
241
290
|
await this.write("progressor", "tx", typeof cmd === "string" ? cmd : String(cmd), 0);
|
|
242
291
|
};
|
|
292
|
+
/**
|
|
293
|
+
* Reboots the device immediately.
|
|
294
|
+
* @returns {Promise<void>} A Promise that resolves when the command is sent.
|
|
295
|
+
*/
|
|
296
|
+
this.reboot = async () => {
|
|
297
|
+
const opcode = this.commands.REBOOT.charCodeAt(0);
|
|
298
|
+
// Send byte 1 to trigger the reboot.
|
|
299
|
+
await this.write("progressor", "tx", new Uint8Array([opcode, 0, 1]), 0);
|
|
300
|
+
};
|
|
243
301
|
/**
|
|
244
302
|
* Retrieves error information from the device.
|
|
245
303
|
* @returns {Promise<string | undefined>} A Promise that resolves with the error info text.
|
|
@@ -334,6 +392,10 @@ class Progressor extends device_model_js_1.Device {
|
|
|
334
392
|
else if (this.writeLast === this.commands.GET_CALIBRATION) {
|
|
335
393
|
output = parseCalibrationCurvePayload(payload);
|
|
336
394
|
}
|
|
395
|
+
else if (this.writeLast === this.commands.GET_CALIBRATION_TABLE) {
|
|
396
|
+
this.calibrationTableRecordIndex += 1;
|
|
397
|
+
output = parseCalibrationTableRecordPayload(payload, this.calibrationTableRecordIndex);
|
|
398
|
+
}
|
|
337
399
|
else {
|
|
338
400
|
// Unknown command response: return raw hex
|
|
339
401
|
output = toHex(payload);
|