@hangtime/grip-connect 0.10.3 → 0.10.4

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.
@@ -93,8 +93,8 @@ export interface Commands {
93
93
  */
94
94
  GET_PROGRESSOR_ID?: string;
95
95
  /**
96
- * Reset calibration to default values of the device.
96
+ * Set calibration curve (3× u32 LE). Payload at offsets +2,+6,+10.
97
97
  */
98
- RESET_CALIBRATION?: string;
98
+ SET_CALIBRATION?: string;
99
99
  }
100
100
  //# 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,MAAM,CAAA;IAE9B;;;OAGG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAA;IAEzB;;;OAGG;IACH,oBAAoB,CAAC,EAAE,MAAM,CAAA;IAE7B;;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;;;OAGG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAA;IAE5B;;OAEG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAE1B;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,CAAA;CACzB"}
@@ -20,13 +20,13 @@ export interface IProgressor extends IDevice {
20
20
  progressorId(): Promise<string | undefined>;
21
21
  /**
22
22
  * Retrieves calibration curve from the device (opcode 0x72). Payload is 12 opaque bytes;
23
- * parsed for display as zero-point, ref-point, and version (3× uint32 LE) plus hex.
24
- * @returns {Promise<string | undefined>} A Promise that resolves with a display string (e.g. "hex — zero-point: X | ref-point: Y | version: Z").
23
+ * parsed for display as hex plus 3× uint32 LE.
24
+ * @returns {Promise<string | undefined>} A Promise that resolves with a display string (e.g. "hex — 1: X | 2: Y | 3: Z").
25
25
  */
26
26
  calibration(): Promise<string | undefined>;
27
27
  /**
28
- * Saves the current calibration settings to the device.
29
- * @returns {Promise<void>} A Promise that resolves when the command is sent.
28
+ * Computes calibration curve from stored points and saves to flash.
29
+ * Call after addCalibrationPoint() for zero and reference. Normal flow: i → i → j.
30
30
  */
31
31
  saveCalibration(): Promise<void>;
32
32
  /**
@@ -35,10 +35,11 @@ export interface IProgressor extends IDevice {
35
35
  */
36
36
  sleep(): Promise<void>;
37
37
  /**
38
- * Resets the calibration to default values of the device.
39
- * @returns {Promise<void>} A Promise that resolves when the command is sent.
38
+ * Set a new calibration curve.
39
+ * @warning Expert only. This will overwrite the current calibration curve.
40
+ * @param curve - The 12-byte calibration curve to set.
40
41
  */
41
- resetCalibration(): Promise<void>;
42
+ setCalibration(curve: Uint8Array): Promise<void>;
42
43
  /**
43
44
  * Retrieves error information from the device.
44
45
  * @returns {Promise<string | undefined>} A Promise that resolves with the error info text.
@@ -61,10 +62,10 @@ export interface IProgressor extends IDevice {
61
62
  */
62
63
  stream(duration?: number): Promise<void>;
63
64
  /**
64
- * Adds a calibration point. Use 0 for zero point, then known weight; then saveCalibration().
65
- * @param weightKg - Weight in kg (0 or known reference &lt; 150 kg).
65
+ * Adds a calibration point by capturing the current live ADC reading.
66
+ * Call with no load for zero point, then with known weight; then saveCalibration().
66
67
  */
67
- addCalibrationPoint(weightKg: number): Promise<void>;
68
+ addCalibrationPoint(): Promise<void>;
68
69
  /**
69
70
  * Sends the device tare command to zero the scale (hardware tare).
70
71
  * For software tare over a duration, use the base tare(duration) method.
@@ -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;;;OAGG;IACH,gBAAgB,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;IAEjC;;;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,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAEpD;;;;OAIG;IACH,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;CAC3B"}
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;;;;OAIG;IACH,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;CAC3B"}
@@ -25,23 +25,48 @@ export declare class Progressor extends Device implements IProgressor {
25
25
  */
26
26
  calibration: () => Promise<string | undefined>;
27
27
  /**
28
- * Saves the current calibration to the device. Call after adding both calibration points.
28
+ * Computes calibration curve from stored points and saves to flash (opcode 0x6A).
29
+ * Requires addCalibrationPoint() for zero and reference. Normal flow: i → i → j.
29
30
  * @returns {Promise<void>} A Promise that resolves when the command is sent.
30
31
  */
31
32
  saveCalibration: () => Promise<void>;
32
33
  /**
33
- * Resets the calibration to default values of the device.
34
- * @returns {Promise<void>} A Promise that resolves when the command is sent.
34
+ * Opcode 0x71 ('q'): write calibration curve directly (raw overwrite).
35
+ *
36
+ * Payload layout (14 bytes):
37
+ * - [0] opcode ('q' = 0x71)
38
+ * - [1] reserved (ignored by firmware)
39
+ * - [2..13] 12-byte calibration curve (3× u32 LE read at offsets +2, +6, +10)
40
+ *
41
+ * Notes:
42
+ * - This command does not compute anything; it overwrites stored calibration data.
43
+ * - Sending only the opcode (no 12-byte curve) is not a supported "reset" mode.
44
+ *
45
+ * @param curve - Raw 12-byte calibration curve (required).
46
+ * @returns Promise that resolves when the command is sent.
35
47
  */
36
- resetCalibration: () => Promise<void>;
48
+ setCalibration: (curve: Uint8Array) => Promise<void>;
37
49
  /**
38
- * Adds a calibration point: 0x69 + 32-bit float (weight in kg), 5 bytes to the control characteristic.
39
- * Use for two-point calibration: (1) zero weight — addCalibrationPoint(0); (2) known weight — addCalibrationPoint(knownKg).
40
- * Order can be either way; writing zero first is recommended (hysteresis). Then call saveCalibration().
41
- * @param {number} weightKg - Weight in kg (use 0 for zero point, or known reference weight &lt; 150 kg).
42
- * @returns {Promise<void>} A Promise that resolves when the command is sent.
50
+ * Captures a calibration point from the *current live measurement*.
51
+ *
52
+ * Command: 0x69 ('i') written to the control characteristic.
53
+ *
54
+ * The firmware does **not** parse a float payload for this command. It simply snapshots the
55
+ * current raw ADC/force reading and stores it as the next calibration point (typically
56
+ * used as the zero point and the reference point for two-point calibration).
57
+ *
58
+ * Typical two-point calibration flow:
59
+ * 1) Ensure the device is stable with **no load** attached → send addCalibrationPoint() (zero point)
60
+ * 2) Attach a **known weight** and wait until stable → send addCalibrationPoint() (reference point)
61
+ * 3) Call saveCalibration() ('j') to compute + persist the curve
62
+ *
63
+ * Notes:
64
+ * - Order usually doesn’t matter, but capturing the zero point first is common practice.
65
+ * - Any extra payload bytes are ignored by the firmware for this command.
66
+ *
67
+ * @returns {Promise<void>} Resolves when the command is sent.
43
68
  */
44
- addCalibrationPoint: (weightKg: number) => Promise<void>;
69
+ addCalibrationPoint: () => Promise<void>;
45
70
  /**
46
71
  * Sends the device tare command to zero the scale (hardware tare).
47
72
  * For software tare over a duration, use the base tare(duration) method.
@@ -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;AAkFlF,qBAAa,UAAW,SAAQ,MAAO,YAAW,WAAW;IAC3D,iFAAiF;IACjF,OAAO,CAAC,sBAAsB,CAAe;;IAyD7C;;;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;;;OAGG;IACH,eAAe,QAAa,OAAO,CAAC,IAAI,CAAC,CAExC;IAED;;;OAGG;IACH,gBAAgB,QAAa,OAAO,CAAC,IAAI,CAAC,CAEzC;IAED;;;;;;OAMG;IACH,mBAAmB,GAAU,UAAU,MAAM,KAAG,OAAO,CAAC,IAAI,CAAC,CAK5D;IAED;;;;OAIG;IACH,SAAS,QAAa,OAAO,CAAC,IAAI,CAAC,CAElC;IAED;;;OAGG;IACH,KAAK,QAAa,OAAO,CAAC,IAAI,CAAC,CAG9B;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,CA4FrD;IAED;;;OAGG;IACH,IAAI,QAAa,OAAO,CAAC,IAAI,CAAC,CAE7B;IAED;;;;OAIG;IACH,MAAM,GAAU,iBAAY,KAAG,OAAO,CAAC,IAAI,CAAC,CAgB3C;CACF"}
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;AAkFlF,qBAAa,UAAW,SAAQ,MAAO,YAAW,WAAW;IAC3D,iFAAiF;IACjF,OAAO,CAAC,sBAAsB,CAAe;;IAyD7C;;;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,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;;;;OAIG;IACH,SAAS,QAAa,OAAO,CAAC,IAAI,CAAC,CAElC;IAED;;;OAGG;IACH,KAAK,QAAa,OAAO,CAAC,IAAI,CAAC,CAG9B;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,CAwFrD;IAED;;;OAGG;IACH,IAAI,QAAa,OAAO,CAAC,IAAI,CAAC,CAE7B;IAED;;;;OAIG;IACH,MAAM,GAAU,iBAAY,KAAG,OAAO,CAAC,IAAI,CAAC,CAgB3C;CACF"}
@@ -31,7 +31,7 @@ var ProgressorResponses;
31
31
  * Low battery warning from the device.
32
32
  * Indicates that the battery level is below a critical threshold.
33
33
  */
34
- ProgressorResponses[ProgressorResponses["RESPONSE_LOW_PWR_WARNING"] = 4] = "RESPONSE_LOW_PWR_WARNING";
34
+ ProgressorResponses[ProgressorResponses["RESPONSE_LOW_POWER_WARNING"] = 4] = "RESPONSE_LOW_POWER_WARNING";
35
35
  })(ProgressorResponses || (ProgressorResponses = {}));
36
36
  /**
37
37
  * Represents a Tindeq Progressor device.
@@ -71,7 +71,7 @@ function parseCalibrationCurvePayload(payload) {
71
71
  return hex;
72
72
  const view = new DataView(payload.buffer, payload.byteOffset, payload.byteLength);
73
73
  const [v0, v1, v2] = [0, 4, 8].map((o) => view.getUint32(o, true));
74
- return `${hex} — zero-point: ${v1.toLocaleString()} | ref-point: ${v0.toLocaleString()} | version: ${v2} (0x${v2.toString(16)})`;
74
+ return `${hex} — 1: ${v1.toLocaleString()} | 2: ${v0.toLocaleString()} | 3: ${v2}`;
75
75
  }
76
76
  class Progressor extends device_model_js_1.Device {
77
77
  constructor() {
@@ -123,7 +123,7 @@ class Progressor extends device_model_js_1.Device {
123
123
  SLEEP: "n", // 110 (0x6e)
124
124
  GET_BATTERY_VOLTAGE: "o", // 111 (0x6f)
125
125
  GET_PROGRESSOR_ID: "p", // 112 (0x70)
126
- RESET_CALIBRATION: "q", // 113 (0x71)
126
+ SET_CALIBRATION: "q", // 113 (0x71)
127
127
  GET_CALIBRATION: "r", // 114 (0x72)
128
128
  },
129
129
  });
@@ -174,30 +174,60 @@ class Progressor extends device_model_js_1.Device {
174
174
  return response;
175
175
  };
176
176
  /**
177
- * Saves the current calibration to the device. Call after adding both calibration points.
177
+ * Computes calibration curve from stored points and saves to flash (opcode 0x6A).
178
+ * Requires addCalibrationPoint() for zero and reference. Normal flow: i → i → j.
178
179
  * @returns {Promise<void>} A Promise that resolves when the command is sent.
179
180
  */
180
181
  this.saveCalibration = async () => {
181
182
  await this.write("progressor", "tx", this.commands.SAVE_CALIBRATION, 0);
182
183
  };
183
184
  /**
184
- * Resets the calibration to default values of the device.
185
- * @returns {Promise<void>} A Promise that resolves when the command is sent.
185
+ * Opcode 0x71 ('q'): write calibration curve directly (raw overwrite).
186
+ *
187
+ * Payload layout (14 bytes):
188
+ * - [0] opcode ('q' = 0x71)
189
+ * - [1] reserved (ignored by firmware)
190
+ * - [2..13] 12-byte calibration curve (3× u32 LE read at offsets +2, +6, +10)
191
+ *
192
+ * Notes:
193
+ * - This command does not compute anything; it overwrites stored calibration data.
194
+ * - Sending only the opcode (no 12-byte curve) is not a supported "reset" mode.
195
+ *
196
+ * @param curve - Raw 12-byte calibration curve (required).
197
+ * @returns Promise that resolves when the command is sent.
186
198
  */
187
- this.resetCalibration = async () => {
188
- await this.write("progressor", "tx", this.commands.RESET_CALIBRATION, 0);
199
+ this.setCalibration = async (curve) => {
200
+ if (curve.length !== 12)
201
+ throw new Error("Curve must be 12 bytes");
202
+ const opcode = this.commands.SET_CALIBRATION.charCodeAt(0); // 0x71
203
+ const payload = new Uint8Array(14);
204
+ payload[0] = opcode;
205
+ payload[1] = 0; // reserved/ignored
206
+ payload.set(curve, 2);
207
+ await this.write("progressor", "tx", payload, 0);
189
208
  };
190
209
  /**
191
- * Adds a calibration point: 0x69 + 32-bit float (weight in kg), 5 bytes to the control characteristic.
192
- * Use for two-point calibration: (1) zero weight — addCalibrationPoint(0); (2) known weight — addCalibrationPoint(knownKg).
193
- * Order can be either way; writing zero first is recommended (hysteresis). Then call saveCalibration().
194
- * @param {number} weightKg - Weight in kg (use 0 for zero point, or known reference weight &lt; 150 kg).
195
- * @returns {Promise<void>} A Promise that resolves when the command is sent.
210
+ * Captures a calibration point from the *current live measurement*.
211
+ *
212
+ * Command: 0x69 ('i') written to the control characteristic.
213
+ *
214
+ * The firmware does **not** parse a float payload for this command. It simply snapshots the
215
+ * current raw ADC/force reading and stores it as the next calibration point (typically
216
+ * used as the zero point and the reference point for two-point calibration).
217
+ *
218
+ * Typical two-point calibration flow:
219
+ * 1) Ensure the device is stable with **no load** attached → send addCalibrationPoint() (zero point)
220
+ * 2) Attach a **known weight** and wait until stable → send addCalibrationPoint() (reference point)
221
+ * 3) Call saveCalibration() ('j') to compute + persist the curve
222
+ *
223
+ * Notes:
224
+ * - Order usually doesn’t matter, but capturing the zero point first is common practice.
225
+ * - Any extra payload bytes are ignored by the firmware for this command.
226
+ *
227
+ * @returns {Promise<void>} Resolves when the command is sent.
196
228
  */
197
- this.addCalibrationPoint = async (weightKg) => {
198
- const payload = new Uint8Array(5);
199
- payload[0] = this.commands.ADD_CALIBRATION_POINT.charCodeAt(0); // 0x69
200
- new DataView(payload.buffer).setFloat32(1, weightKg, true);
229
+ this.addCalibrationPoint = async () => {
230
+ const payload = new Uint8Array([this.commands.ADD_CALIBRATION_POINT.charCodeAt(0)]); // 0x69
201
231
  await this.write("progressor", "tx", payload, 0);
202
232
  };
203
233
  /**
@@ -243,97 +273,94 @@ class Progressor extends device_model_js_1.Device {
243
273
  */
244
274
  this.handleNotifications = (value) => {
245
275
  var _a;
246
- if (value) {
247
- // Update timestamp
248
- this.updateTimestamp();
249
- if (value.buffer) {
250
- const receivedTime = Date.now();
251
- // Read the first byte of the buffer to determine the kind of message
252
- const kind = value.getInt8(0);
253
- // Check if the message is a weight measurement
254
- if (kind === ProgressorResponses.RESPONSE_WEIGHT_MEASUREMENT) {
255
- // Payload = bytes from index 2 (skip byte 0 = message type, byte 1 = reserved/length)
256
- const payloadLength = value.byteLength - 2;
257
- if (payloadLength % 8 !== 0)
258
- return;
259
- const samplesPerPacket = payloadLength / 8;
260
- this.currentSamplesPerPacket = samplesPerPacket;
261
- this.recordPacketReceived();
262
- // for (i = 0; i < samplesPerPacket; i++) { offset = i*8; weight = getFloat32(offset); timestampUs = getUint32(offset+4); }
263
- for (let i = 0; i < samplesPerPacket; i++) {
264
- const offset = 2 + i * 8;
265
- const weight = value.getFloat32(offset, true);
266
- const timestampUs = value.getUint32(offset + 4, true);
267
- if (!isNaN(weight)) {
268
- const numericData = weight - this.applyTare(weight);
269
- const currentMassTotal = Math.max(-1000, Number(numericData));
270
- // Update session stats before building packet
271
- this.peak = Math.max(this.peak, Number(numericData));
272
- this.min = Math.min(this.min, Math.max(-1000, Number(numericData)));
273
- this.sum += currentMassTotal;
274
- this.dataPointCount++;
275
- this.mean = this.sum / this.dataPointCount;
276
- this.downloadPackets.push(this.buildDownloadPacket(currentMassTotal, [weight], {
277
- timestamp: receivedTime,
278
- sampleIndex: timestampUs,
279
- }));
280
- this.activityCheck(numericData);
281
- // Hz from device timestamps: keep only samples in last 1s
282
- this.recentSampleTimestamps.push(timestampUs);
283
- const latestUs = (_a = this.recentSampleTimestamps[this.recentSampleTimestamps.length - 1]) !== null && _a !== void 0 ? _a : 0;
284
- this.recentSampleTimestamps = this.recentSampleTimestamps.filter((ts) => latestUs - ts <= ONE_SECOND_US);
285
- const samplingRateHz = this.recentSampleTimestamps.length;
286
- const payload = this.buildForceMeasurement(currentMassTotal);
287
- if (payload.performance)
288
- payload.performance.samplingRateHz = samplingRateHz;
289
- this.notifyCallback(payload);
290
- }
291
- }
292
- }
293
- // Command response
294
- else if (kind === ProgressorResponses.RESPONSE_COMMAND) {
295
- if (!this.writeLast)
296
- return;
297
- let output = "";
298
- const payload = new Uint8Array(value.buffer).slice(2);
299
- if (this.writeLast === this.commands.GET_BATTERY_VOLTAGE) {
300
- output = new DataView(value.buffer, 2).getUint32(0, true).toString();
301
- }
302
- else if (this.writeLast === this.commands.GET_FIRMWARE_VERSION) {
303
- output = new TextDecoder().decode(payload);
304
- }
305
- else if (this.writeLast === this.commands.GET_ERROR_INFORMATION) {
306
- output = new TextDecoder().decode(payload);
307
- }
308
- else if (this.writeLast === this.commands.GET_PROGRESSOR_ID) {
309
- output = parseProgressorIdPayload(payload);
310
- }
311
- else if (this.writeLast === this.commands.GET_CALIBRATION) {
312
- output = parseCalibrationCurvePayload(payload);
313
- }
314
- else {
315
- // Unknown command response: return raw hex
316
- output = toHex(payload);
317
- }
318
- this.writeCallback(output);
319
- }
320
- // RFD peak response
321
- else if (kind === ProgressorResponses.RESPONSE_RFD_PEAK) {
322
- console.warn("⚠️ RFD peak is currently unsupported.");
323
- }
324
- // RFD peak series response
325
- else if (kind === ProgressorResponses.RESPONSE_RFD_PEAK_SERIES) {
326
- console.warn("⚠️ RFD peak series is currently unsupported.");
327
- }
328
- // Low power warning response
329
- else if (kind === ProgressorResponses.RESPONSE_LOW_PWR_WARNING) {
330
- console.warn("⚠️ Low power detected. Please consider connecting to a power source.");
331
- }
332
- else {
333
- throw new Error(`Unknown message kind detected: ${kind}`);
334
- }
276
+ if (!(value === null || value === void 0 ? void 0 : value.buffer))
277
+ return;
278
+ // Update timestamp
279
+ this.updateTimestamp();
280
+ const receivedTime = Date.now();
281
+ // Read the first byte of the buffer to determine the kind of message
282
+ const kind = value.getUint8(0);
283
+ const payloadLength = value.getUint8(1);
284
+ const bytes = new Uint8Array(value.buffer, value.byteOffset, value.byteLength);
285
+ const payload = bytes.slice(2, 2 + payloadLength);
286
+ // Check if the message is a weight measurement
287
+ if (kind === ProgressorResponses.RESPONSE_WEIGHT_MEASUREMENT) {
288
+ if (payloadLength % 8 !== 0)
289
+ return;
290
+ const samplesPerPacket = payloadLength / 8;
291
+ this.currentSamplesPerPacket = samplesPerPacket;
292
+ this.recordPacketReceived();
293
+ for (let i = 0; i < samplesPerPacket; i++) {
294
+ const offset = 2 + i * 8;
295
+ const weight = value.getFloat32(offset, true);
296
+ const timestampUs = value.getUint32(offset + 4, true);
297
+ if (Number.isNaN(weight))
298
+ continue;
299
+ const numericData = weight - this.applyTare(weight);
300
+ const currentMassTotal = Math.max(-1000, Number(numericData));
301
+ // Update session stats before building packet
302
+ this.peak = Math.max(this.peak, Number(numericData));
303
+ this.min = Math.min(this.min, Math.max(-1000, Number(numericData)));
304
+ this.sum += currentMassTotal;
305
+ this.dataPointCount++;
306
+ this.mean = this.sum / this.dataPointCount;
307
+ this.downloadPackets.push(this.buildDownloadPacket(currentMassTotal, [weight], {
308
+ timestamp: receivedTime,
309
+ sampleIndex: timestampUs,
310
+ }));
311
+ this.activityCheck(numericData);
312
+ // Hz from device timestamps: keep only samples in last 1s
313
+ this.recentSampleTimestamps.push(timestampUs);
314
+ const latestUs = (_a = this.recentSampleTimestamps[this.recentSampleTimestamps.length - 1]) !== null && _a !== void 0 ? _a : 0;
315
+ this.recentSampleTimestamps = this.recentSampleTimestamps.filter((ts) => latestUs - ts <= ONE_SECOND_US);
316
+ const samplingRateHz = this.recentSampleTimestamps.length;
317
+ const payload = this.buildForceMeasurement(currentMassTotal);
318
+ if (payload.performance)
319
+ payload.performance.samplingRateHz = samplingRateHz;
320
+ this.notifyCallback(payload);
335
321
  }
336
322
  }
323
+ // Command response
324
+ else if (kind === ProgressorResponses.RESPONSE_COMMAND) {
325
+ if (!this.writeLast)
326
+ return;
327
+ let output = "";
328
+ if (this.writeLast === this.commands.GET_BATTERY_VOLTAGE) {
329
+ output = new DataView(payload.buffer, payload.byteOffset, payload.byteLength).getUint32(0, true).toString();
330
+ }
331
+ else if (this.writeLast === this.commands.GET_FIRMWARE_VERSION) {
332
+ output = new TextDecoder().decode(payload);
333
+ }
334
+ else if (this.writeLast === this.commands.GET_ERROR_INFORMATION) {
335
+ output = new TextDecoder().decode(payload);
336
+ }
337
+ else if (this.writeLast === this.commands.GET_PROGRESSOR_ID) {
338
+ output = parseProgressorIdPayload(payload);
339
+ }
340
+ else if (this.writeLast === this.commands.GET_CALIBRATION) {
341
+ output = parseCalibrationCurvePayload(payload);
342
+ }
343
+ else {
344
+ // Unknown command response: return raw hex
345
+ output = toHex(payload);
346
+ }
347
+ this.writeCallback(output);
348
+ }
349
+ // RFD peak response
350
+ else if (kind === ProgressorResponses.RESPONSE_RFD_PEAK) {
351
+ console.warn("⚠️ RFD peak is currently unsupported.");
352
+ }
353
+ // RFD peak series response
354
+ else if (kind === ProgressorResponses.RESPONSE_RFD_PEAK_SERIES) {
355
+ console.warn("⚠️ RFD peak series is currently unsupported.");
356
+ }
357
+ // Low power warning response
358
+ else if (kind === ProgressorResponses.RESPONSE_LOW_POWER_WARNING) {
359
+ console.warn("⚠️ Low power detected. Please consider connecting to a power source.");
360
+ }
361
+ else {
362
+ throw new Error(`Unknown message kind detected: ${kind}`);
363
+ }
337
364
  };
338
365
  /**
339
366
  * Stops the data stream on the specified device.
@@ -1 +1 @@
1
- {"version":3,"file":"progressor.model.js","sourceRoot":"","sources":["../../../../src/models/device/progressor.model.ts"],"names":[],"mappings":";;;AAAA,wDAA2C;AAG3C;;GAEG;AACH,IAAK,mBA8BJ;AA9BD,WAAK,mBAAmB;IACtB;;;OAGG;IACH,qFAAgB,CAAA;IAEhB;;;OAGG;IACH,2GAA2B,CAAA;IAE3B;;;OAGG;IACH,uFAAiB,CAAA;IAEjB;;;OAGG;IACH,qGAAwB,CAAA;IAExB;;;OAGG;IACH,qGAAwB,CAAA;AAC1B,CAAC,EA9BI,m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AAC,CAAA;YACtF,CAAC;iBAAM,CAAC;gBACN,MAAM,IAAI,KAAK,CAAC,kCAAkC,IAAI,EAAE,CAAC,CAAA;YAC3D,CAAC;QACH,CAAC,CAAA;QAED;;;WAGG;QACH,SAAI,GAAG,KAAK,IAAmB,EAAE;YAC/B,MAAM,IAAI,CAAC,KAAK,CAAC,YAAY,EAAE,IAAI,EAAE,IAAI,CAAC,QAAQ,CAAC,gBAAgB,EAAE,CAAC,CAAC,CAAA;QACzE,CAAC,CAAA;QAED;;;;WAIG;QACH,WAAM,GAAG,KAAK,EAAE,QAAQ,GAAG,CAAC,EAAiB,EAAE;YAC7C,iEAAiE;YACjE,IAAI,CAAC,eAAe,CAAC,MAAM,GAAG,CAAC,CAAA;YAC/B,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC,iBAAiB,CAAA;YACpC,IAAI,CAAC,IAAI,GAAG,CAAC,CAAA;YACb,IAAI,CAAC,GAAG,GAAG,CAAC,CAAA;YACZ,IAAI,CAAC,cAAc,GAAG,CAAC,CAAA;YACvB,IAAI,CAAC,GAAG,GAAG,MAAM,CAAC,iBAAiB,CAAA;YACnC,IAAI,CAAC,mBAAmB,EAAE,CAAA;YAC1B,IAAI,CAAC,sBAAsB,GAAG,EAAE,CAAA;YAChC,uBAAuB;YACvB,MAAM,IAAI,CAAC,KAAK,CAAC,YAAY,EAAE,IAAI,EAAE,IAAI,CAAC,QAAQ,CAAC,iBAAiB,EAAE,QAAQ,CAAC,CAAA;YAC/E,oCAAoC;YACpC,IAAI,QAAQ,KAAK,CAAC,EAAE,CAAC;gBACnB,MAAM,IAAI,CAAC,IAAI,EAAE,CAAA;YACnB,CAAC;QACH,CAAC,CAAA;IApRD,CAAC;CAqRF;AA9UD,gCA8UC"}
@@ -93,8 +93,8 @@ export interface Commands {
93
93
  */
94
94
  GET_PROGRESSOR_ID?: string;
95
95
  /**
96
- * Reset calibration to default values of the device.
96
+ * Set calibration curve (3× u32 LE). Payload at offsets +2,+6,+10.
97
97
  */
98
- RESET_CALIBRATION?: string;
98
+ SET_CALIBRATION?: string;
99
99
  }
100
100
  //# 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,MAAM,CAAA;IAE9B;;;OAGG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAA;IAEzB;;;OAGG;IACH,oBAAoB,CAAC,EAAE,MAAM,CAAA;IAE7B;;;OAGG;IACH,qBAAqB,CAAC,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;;OAEG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAA;CAC3B"}
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,MAAM,CAAA;IAE9B;;;OAGG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAA;IAEzB;;;OAGG;IACH,oBAAoB,CAAC,EAAE,MAAM,CAAA;IAE7B;;;OAGG;IACH,qBAAqB,CAAC,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;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,CAAA;CACzB"}
@@ -20,13 +20,13 @@ export interface IProgressor extends IDevice {
20
20
  progressorId(): Promise<string | undefined>;
21
21
  /**
22
22
  * Retrieves calibration curve from the device (opcode 0x72). Payload is 12 opaque bytes;
23
- * parsed for display as zero-point, ref-point, and version (3× uint32 LE) plus hex.
24
- * @returns {Promise<string | undefined>} A Promise that resolves with a display string (e.g. "hex — zero-point: X | ref-point: Y | version: Z").
23
+ * parsed for display as hex plus 3× uint32 LE.
24
+ * @returns {Promise<string | undefined>} A Promise that resolves with a display string (e.g. "hex — 1: X | 2: Y | 3: Z").
25
25
  */
26
26
  calibration(): Promise<string | undefined>;
27
27
  /**
28
- * Saves the current calibration settings to the device.
29
- * @returns {Promise<void>} A Promise that resolves when the command is sent.
28
+ * Computes calibration curve from stored points and saves to flash.
29
+ * Call after addCalibrationPoint() for zero and reference. Normal flow: i → i → j.
30
30
  */
31
31
  saveCalibration(): Promise<void>;
32
32
  /**
@@ -35,10 +35,11 @@ export interface IProgressor extends IDevice {
35
35
  */
36
36
  sleep(): Promise<void>;
37
37
  /**
38
- * Resets the calibration to default values of the device.
39
- * @returns {Promise<void>} A Promise that resolves when the command is sent.
38
+ * Set a new calibration curve.
39
+ * @warning Expert only. This will overwrite the current calibration curve.
40
+ * @param curve - The 12-byte calibration curve to set.
40
41
  */
41
- resetCalibration(): Promise<void>;
42
+ setCalibration(curve: Uint8Array): Promise<void>;
42
43
  /**
43
44
  * Retrieves error information from the device.
44
45
  * @returns {Promise<string | undefined>} A Promise that resolves with the error info text.
@@ -61,10 +62,10 @@ export interface IProgressor extends IDevice {
61
62
  */
62
63
  stream(duration?: number): Promise<void>;
63
64
  /**
64
- * Adds a calibration point. Use 0 for zero point, then known weight; then saveCalibration().
65
- * @param weightKg - Weight in kg (0 or known reference &lt; 150 kg).
65
+ * Adds a calibration point by capturing the current live ADC reading.
66
+ * Call with no load for zero point, then with known weight; then saveCalibration().
66
67
  */
67
- addCalibrationPoint(weightKg: number): Promise<void>;
68
+ addCalibrationPoint(): Promise<void>;
68
69
  /**
69
70
  * Sends the device tare command to zero the scale (hardware tare).
70
71
  * For software tare over a duration, use the base tare(duration) method.
@@ -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;;;OAGG;IACH,gBAAgB,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;IAEjC;;;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,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAEpD;;;;OAIG;IACH,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;CAC3B"}
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;;;;OAIG;IACH,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;CAC3B"}