@hangtime/grip-connect 0.12.0 → 0.13.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 +11 -0
- package/dist/cjs/index.d.ts +2 -2
- package/dist/cjs/index.d.ts.map +1 -1
- package/dist/cjs/index.js +2 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/interfaces/command.interface.d.ts +110 -21
- package/dist/cjs/interfaces/command.interface.d.ts.map +1 -1
- package/dist/cjs/interfaces/device/cts500.interface.d.ts +96 -0
- package/dist/cjs/interfaces/device/cts500.interface.d.ts.map +1 -0
- package/dist/cjs/interfaces/device/cts500.interface.js +3 -0
- package/dist/cjs/interfaces/device/cts500.interface.js.map +1 -0
- package/dist/cjs/interfaces/device/forceboard.interface.d.ts +2 -2
- package/dist/cjs/interfaces/device/forceboard.interface.d.ts.map +1 -1
- package/dist/cjs/interfaces/device/progressor.interface.d.ts +2 -2
- package/dist/cjs/interfaces/device/progressor.interface.d.ts.map +1 -1
- package/dist/cjs/interfaces/index.d.ts +2 -0
- package/dist/cjs/interfaces/index.d.ts.map +1 -1
- package/dist/cjs/interfaces/nordic.interface.d.ts +47 -0
- package/dist/cjs/interfaces/nordic.interface.d.ts.map +1 -0
- package/dist/cjs/interfaces/nordic.interface.js +3 -0
- package/dist/cjs/interfaces/nordic.interface.js.map +1 -0
- package/dist/cjs/models/device/cts500.model.d.ts +173 -0
- package/dist/cjs/models/device/cts500.model.d.ts.map +1 -0
- package/dist/cjs/models/device/cts500.model.js +588 -0
- package/dist/cjs/models/device/cts500.model.js.map +1 -0
- package/dist/cjs/models/device/forceboard.model.d.ts +2 -2
- package/dist/cjs/models/device/forceboard.model.d.ts.map +1 -1
- package/dist/cjs/models/device/forceboard.model.js +3 -14
- package/dist/cjs/models/device/forceboard.model.js.map +1 -1
- package/dist/cjs/models/device/progressor.model.d.ts +2 -2
- package/dist/cjs/models/device/progressor.model.d.ts.map +1 -1
- package/dist/cjs/models/device/progressor.model.js +3 -14
- package/dist/cjs/models/device/progressor.model.js.map +1 -1
- package/dist/cjs/models/device.model.d.ts +7 -0
- package/dist/cjs/models/device.model.d.ts.map +1 -1
- package/dist/cjs/models/device.model.js +23 -8
- package/dist/cjs/models/device.model.js.map +1 -1
- package/dist/cjs/models/index.d.ts +2 -0
- package/dist/cjs/models/index.d.ts.map +1 -1
- package/dist/cjs/models/index.js +6 -1
- package/dist/cjs/models/index.js.map +1 -1
- package/dist/cjs/models/nordic.model.d.ts +128 -0
- package/dist/cjs/models/nordic.model.d.ts.map +1 -0
- package/dist/cjs/models/nordic.model.js +405 -0
- package/dist/cjs/models/nordic.model.js.map +1 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/interfaces/command.interface.d.ts +110 -21
- package/dist/interfaces/command.interface.d.ts.map +1 -1
- package/dist/interfaces/device/cts500.interface.d.ts +96 -0
- package/dist/interfaces/device/cts500.interface.d.ts.map +1 -0
- package/dist/interfaces/device/cts500.interface.js +2 -0
- package/dist/interfaces/device/cts500.interface.js.map +1 -0
- package/dist/interfaces/device/forceboard.interface.d.ts +2 -2
- package/dist/interfaces/device/forceboard.interface.d.ts.map +1 -1
- package/dist/interfaces/device/progressor.interface.d.ts +2 -2
- package/dist/interfaces/device/progressor.interface.d.ts.map +1 -1
- package/dist/interfaces/index.d.ts +2 -0
- package/dist/interfaces/index.d.ts.map +1 -1
- package/dist/interfaces/nordic.interface.d.ts +47 -0
- package/dist/interfaces/nordic.interface.d.ts.map +1 -0
- package/dist/interfaces/nordic.interface.js +2 -0
- package/dist/interfaces/nordic.interface.js.map +1 -0
- package/dist/models/device/cts500.model.d.ts +173 -0
- package/dist/models/device/cts500.model.d.ts.map +1 -0
- package/dist/models/device/cts500.model.js +584 -0
- package/dist/models/device/cts500.model.js.map +1 -0
- package/dist/models/device/forceboard.model.d.ts +2 -2
- package/dist/models/device/forceboard.model.d.ts.map +1 -1
- package/dist/models/device/forceboard.model.js +3 -14
- package/dist/models/device/forceboard.model.js.map +1 -1
- package/dist/models/device/progressor.model.d.ts +2 -2
- package/dist/models/device/progressor.model.d.ts.map +1 -1
- package/dist/models/device/progressor.model.js +3 -14
- package/dist/models/device/progressor.model.js.map +1 -1
- package/dist/models/device.model.d.ts +7 -0
- package/dist/models/device.model.d.ts.map +1 -1
- package/dist/models/device.model.js +22 -8
- package/dist/models/device.model.js.map +1 -1
- package/dist/models/index.d.ts +2 -0
- package/dist/models/index.d.ts.map +1 -1
- package/dist/models/index.js +2 -0
- package/dist/models/index.js.map +1 -1
- package/dist/models/nordic.model.d.ts +128 -0
- package/dist/models/nordic.model.d.ts.map +1 -0
- package/dist/models/nordic.model.js +393 -0
- package/dist/models/nordic.model.js.map +1 -0
- package/dist/tsconfig.cjs.tsbuildinfo +1 -1
- package/package.json +4 -3
- package/src/index.ts +2 -0
- package/src/interfaces/command.interface.ts +131 -21
- package/src/interfaces/device/cts500.interface.ts +113 -0
- package/src/interfaces/device/forceboard.interface.ts +2 -2
- package/src/interfaces/device/progressor.interface.ts +2 -2
- package/src/interfaces/index.ts +4 -0
- package/src/interfaces/nordic.interface.ts +47 -0
- package/src/models/device/cts500.model.ts +702 -0
- package/src/models/device/forceboard.model.ts +3 -14
- package/src/models/device/progressor.model.ts +3 -14
- package/src/models/device.model.ts +22 -8
- package/src/models/index.ts +4 -0
- package/src/models/nordic.model.ts +468 -0
|
@@ -6,106 +6,195 @@ export interface Commands {
|
|
|
6
6
|
* Starts a weight measurement on the device.
|
|
7
7
|
* Used to begin collecting weight or force data.
|
|
8
8
|
*/
|
|
9
|
-
START_WEIGHT_MEAS?: string;
|
|
9
|
+
START_WEIGHT_MEAS?: string | Uint8Array;
|
|
10
10
|
/**
|
|
11
11
|
* Stops the current weight measurement on the device.
|
|
12
12
|
* Used to end the data collection.
|
|
13
13
|
*/
|
|
14
|
-
STOP_WEIGHT_MEAS?: string;
|
|
14
|
+
STOP_WEIGHT_MEAS?: string | Uint8Array;
|
|
15
15
|
/**
|
|
16
16
|
* Puts the device to sleep or in a low-power mode.
|
|
17
17
|
* The format can be a string or a number depending on the device.
|
|
18
18
|
*/
|
|
19
|
-
SLEEP?: number | string;
|
|
19
|
+
SLEEP?: number | string | Uint8Array;
|
|
20
20
|
/**
|
|
21
21
|
* Retrieves the serial number of the device.
|
|
22
22
|
* This command fetches the unique identifier assigned by the manufacturer.
|
|
23
23
|
*/
|
|
24
|
-
GET_SERIAL?: string;
|
|
24
|
+
GET_SERIAL?: string | Uint8Array;
|
|
25
25
|
/**
|
|
26
26
|
* Retrieves textual information from the device.
|
|
27
27
|
* May include readable data.
|
|
28
28
|
*/
|
|
29
|
-
GET_TEXT?: string;
|
|
29
|
+
GET_TEXT?: string | Uint8Array;
|
|
30
30
|
/**
|
|
31
31
|
* Starts or stops a debug data stream from the device.
|
|
32
32
|
* Used for diagnostic purposes or to monitor real-time data.
|
|
33
33
|
*/
|
|
34
|
-
DEBUG_STREAM?: string;
|
|
34
|
+
DEBUG_STREAM?: string | Uint8Array;
|
|
35
35
|
/**
|
|
36
36
|
* Retrieves calibration data from the device.
|
|
37
37
|
* Used to ensure accurate measurements by applying calibration points.
|
|
38
38
|
*/
|
|
39
|
-
GET_CALIBRATION?: string;
|
|
39
|
+
GET_CALIBRATION?: string | Uint8Array;
|
|
40
40
|
/**
|
|
41
41
|
* Sets the Force Board into Quick Start mode.
|
|
42
42
|
* In this mode, data transmission starts when force exceeds the threshold
|
|
43
43
|
* and stops when force drops below the threshold.
|
|
44
44
|
*/
|
|
45
|
-
START_QUICK_MEAS?: string;
|
|
45
|
+
START_QUICK_MEAS?: string | Uint8Array;
|
|
46
46
|
/**
|
|
47
47
|
* Tares the scale, zeroing the current weight measurement.
|
|
48
48
|
* Used to reset the baseline for weight data.
|
|
49
49
|
*/
|
|
50
|
-
TARE_SCALE?: string;
|
|
50
|
+
TARE_SCALE?: string | Uint8Array;
|
|
51
51
|
/**
|
|
52
52
|
* Starts measuring the peak rate of force development (RFD).
|
|
53
53
|
* Captures how quickly force is applied over time.
|
|
54
54
|
*/
|
|
55
|
-
START_PEAK_RFD_MEAS?: string;
|
|
55
|
+
START_PEAK_RFD_MEAS?: string | Uint8Array;
|
|
56
56
|
/**
|
|
57
57
|
* Starts measuring a series of peak RFD measurements.
|
|
58
58
|
* This captures multiple RFD data points over a period of time.
|
|
59
59
|
*/
|
|
60
|
-
START_PEAK_RFD_MEAS_SERIES?: string;
|
|
60
|
+
START_PEAK_RFD_MEAS_SERIES?: string | Uint8Array;
|
|
61
61
|
/**
|
|
62
62
|
* Adds a calibration point to the device.
|
|
63
63
|
* Used to improve the accuracy of future measurements.
|
|
64
64
|
*/
|
|
65
|
-
ADD_CALIBRATION_POINT?: string;
|
|
65
|
+
ADD_CALIBRATION_POINT?: string | Uint8Array;
|
|
66
66
|
/**
|
|
67
67
|
* Saves the current calibration settings to the device.
|
|
68
68
|
* Ensures the device remembers the calibration for future sessions.
|
|
69
69
|
*/
|
|
70
|
-
SAVE_CALIBRATION?: string;
|
|
70
|
+
SAVE_CALIBRATION?: string | Uint8Array;
|
|
71
71
|
/**
|
|
72
72
|
* Retrieves the firmware version of the device.
|
|
73
73
|
* Useful for ensuring compatibility and tracking updates.
|
|
74
74
|
*/
|
|
75
|
-
GET_FIRMWARE_VERSION?: string;
|
|
75
|
+
GET_FIRMWARE_VERSION?: string | Uint8Array;
|
|
76
76
|
/**
|
|
77
77
|
* Retrieves error information from the device.
|
|
78
78
|
* Provides details on any faults or issues that occurred during operation.
|
|
79
79
|
*/
|
|
80
|
-
GET_ERROR_INFORMATION?: string;
|
|
80
|
+
GET_ERROR_INFORMATION?: string | Uint8Array;
|
|
81
81
|
/**
|
|
82
82
|
* Clears the error information on the device.
|
|
83
83
|
* Used to reset error logs after troubleshooting or repair.
|
|
84
84
|
*/
|
|
85
|
-
CLR_ERROR_INFORMATION?: string;
|
|
85
|
+
CLR_ERROR_INFORMATION?: string | Uint8Array;
|
|
86
86
|
/**
|
|
87
87
|
* Retrieves the battery voltage level of the device.
|
|
88
88
|
* Provides insight into the device's remaining battery power.
|
|
89
89
|
*/
|
|
90
|
-
GET_BATTERY_VOLTAGE?: string;
|
|
90
|
+
GET_BATTERY_VOLTAGE?: string | Uint8Array;
|
|
91
|
+
/**
|
|
92
|
+
* Retrieves a temperature reading from the device.
|
|
93
|
+
*/
|
|
94
|
+
GET_TEMPERATURE?: string | Uint8Array;
|
|
95
|
+
/**
|
|
96
|
+
* Retrieves the current weight from the device.
|
|
97
|
+
*/
|
|
98
|
+
GET_WEIGHT?: string | Uint8Array;
|
|
99
|
+
/**
|
|
100
|
+
* Sets the device capacity/range.
|
|
101
|
+
* Payload selects the target range.
|
|
102
|
+
*/
|
|
103
|
+
SET_RANGE?: string | number | Uint8Array;
|
|
104
|
+
/**
|
|
105
|
+
* Sets the display division value.
|
|
106
|
+
* Payload selects the target division.
|
|
107
|
+
*/
|
|
108
|
+
SET_DIVISION?: string | number | Uint8Array;
|
|
109
|
+
/**
|
|
110
|
+
* Sets the first calibration reference weight.
|
|
111
|
+
* Payload selects the target calibration mass.
|
|
112
|
+
*/
|
|
113
|
+
SET_FIRST_CALIBRATION_WEIGHT?: string | number | Uint8Array;
|
|
114
|
+
/**
|
|
115
|
+
* Sets the second calibration reference weight.
|
|
116
|
+
* Payload selects the target calibration mass.
|
|
117
|
+
*/
|
|
118
|
+
SET_SECOND_CALIBRATION_WEIGHT?: string | number | Uint8Array;
|
|
119
|
+
/**
|
|
120
|
+
* Runs the no-load calibration routine.
|
|
121
|
+
*/
|
|
122
|
+
NO_LOAD_CALIBRATION?: string | Uint8Array;
|
|
123
|
+
/**
|
|
124
|
+
* Runs the first calibration step after the reference mass is applied.
|
|
125
|
+
*/
|
|
126
|
+
RUN_FIRST_CALIBRATION?: string | Uint8Array;
|
|
127
|
+
/**
|
|
128
|
+
* Runs the second calibration step after the reference mass is applied.
|
|
129
|
+
*/
|
|
130
|
+
RUN_SECOND_CALIBRATION?: string | Uint8Array;
|
|
131
|
+
/**
|
|
132
|
+
* Configures the automatic shutdown timer.
|
|
133
|
+
* Payload selects the timeout or disables it.
|
|
134
|
+
*/
|
|
135
|
+
SET_SHUTDOWN_TIME?: string | number | Uint8Array;
|
|
136
|
+
/**
|
|
137
|
+
* Configures the upper temperature limit threshold.
|
|
138
|
+
*/
|
|
139
|
+
SET_UPPER_TEMPERATURE_LIMIT?: string | number | Uint8Array;
|
|
140
|
+
/**
|
|
141
|
+
* Configures the lower temperature limit threshold.
|
|
142
|
+
*/
|
|
143
|
+
SET_LOWER_TEMPERATURE_LIMIT?: string | number | Uint8Array;
|
|
144
|
+
/**
|
|
145
|
+
* Configures the upper/max weight limit threshold.
|
|
146
|
+
*/
|
|
147
|
+
SET_MAX_WEIGHT_LIMIT?: string | number | Uint8Array;
|
|
148
|
+
/**
|
|
149
|
+
* Configures the lower/min weight limit threshold.
|
|
150
|
+
*/
|
|
151
|
+
SET_MIN_WEIGHT_LIMIT?: string | number | Uint8Array;
|
|
152
|
+
/**
|
|
153
|
+
* Configures the weight-alarm behavior for the configured upper/lower thresholds.
|
|
154
|
+
*/
|
|
155
|
+
SET_WEIGHT_ALARM_MODE?: string | number | Uint8Array;
|
|
156
|
+
/**
|
|
157
|
+
* Enables or disables alarm-frame output over the serial/BLE transport.
|
|
158
|
+
*/
|
|
159
|
+
SET_ALARM_OUTPUT?: string | number | Uint8Array;
|
|
91
160
|
/**
|
|
92
161
|
* Get the Progressor ID.
|
|
93
162
|
*/
|
|
94
|
-
GET_PROGRESSOR_ID?: string;
|
|
163
|
+
GET_PROGRESSOR_ID?: string | Uint8Array;
|
|
95
164
|
/**
|
|
96
165
|
* Set calibration block. Payload at offsets +2,+6,+10.
|
|
97
166
|
* The 12-byte block is interpreted as 3× float32 LE: slope, intercept, trim.
|
|
98
167
|
*/
|
|
99
|
-
SET_CALIBRATION?: string;
|
|
168
|
+
SET_CALIBRATION?: string | Uint8Array;
|
|
100
169
|
/**
|
|
101
170
|
* Retrieves the advanced calibration table from the device.
|
|
102
171
|
* Used to inspect the hidden piecewise interpolation table exported by v2 firmware.
|
|
103
172
|
*/
|
|
104
|
-
GET_CALIBRATION_TABLE?: string;
|
|
173
|
+
GET_CALIBRATION_TABLE?: string | Uint8Array;
|
|
174
|
+
/**
|
|
175
|
+
* Controls whether the device resets to zero on power-up.
|
|
176
|
+
*/
|
|
177
|
+
POWER_ON_RESET?: string | number | Uint8Array;
|
|
178
|
+
/**
|
|
179
|
+
* Updates the device's hardware zero point.
|
|
180
|
+
*/
|
|
181
|
+
ZERO_SCALE?: string | number | Uint8Array;
|
|
182
|
+
/**
|
|
183
|
+
* Toggles the device's peak mode.
|
|
184
|
+
*/
|
|
185
|
+
PEAK_MODE?: string | number | Uint8Array;
|
|
186
|
+
/**
|
|
187
|
+
* Configures the device UART baud rate.
|
|
188
|
+
*/
|
|
189
|
+
SET_BAUD_RATE?: string | number | Uint8Array;
|
|
190
|
+
/**
|
|
191
|
+
* Configures the device sampling rate.
|
|
192
|
+
*/
|
|
193
|
+
SET_SAMPLING_RATE?: string | number | Uint8Array;
|
|
105
194
|
/**
|
|
106
195
|
* Reboots the device immediately.
|
|
107
196
|
* Intended for diagnostic flows.
|
|
108
197
|
*/
|
|
109
|
-
REBOOT?: string;
|
|
198
|
+
REBOOT?: string | Uint8Array;
|
|
110
199
|
}
|
|
111
200
|
//# 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;
|
|
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;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M,GAAG,MAAM,GAAG,UAAU,CAAA;IAE7C;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,UAAU,CAAA;IAEzC;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,UAAU,CAAA;IAExC;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,UAAU,CAAA;IAE5C;;OAEG;IACH,iBAAiB,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,UAAU,CAAA;IAEhD;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,UAAU,CAAA;CAC7B"}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import type { IDevice } from "../device.interface.js";
|
|
2
|
+
export type CTS500BaudRate = 9600 | 19200 | 38400 | 57600 | 115200;
|
|
3
|
+
export type CTS500SamplingRate = 10 | 20 | 40 | 80 | 160 | 320;
|
|
4
|
+
/**
|
|
5
|
+
* Interface representing the CTS500 device, extending the base Device interface.
|
|
6
|
+
*/
|
|
7
|
+
export interface ICTS500 extends IDevice {
|
|
8
|
+
/**
|
|
9
|
+
* Retrieves battery voltage from the device.
|
|
10
|
+
* The returned string is the voltage in volts with two decimal places.
|
|
11
|
+
* @returns {Promise<string | undefined>} A Promise that resolves with the battery voltage.
|
|
12
|
+
*/
|
|
13
|
+
battery(): Promise<string | undefined>;
|
|
14
|
+
/**
|
|
15
|
+
* Retrieves firmware version from the device.
|
|
16
|
+
* @returns {Promise<string | undefined>} A Promise that resolves with the firmware version.
|
|
17
|
+
*/
|
|
18
|
+
firmware(): Promise<string | undefined>;
|
|
19
|
+
/**
|
|
20
|
+
* Retrieves hardware version from the device.
|
|
21
|
+
* @returns {Promise<string | undefined>} A Promise that resolves with the hardware version.
|
|
22
|
+
*/
|
|
23
|
+
hardware(): Promise<string | undefined>;
|
|
24
|
+
/**
|
|
25
|
+
* Retrieves manufacturer information from the device.
|
|
26
|
+
* @returns {Promise<string | undefined>} A Promise that resolves with the manufacturer information.
|
|
27
|
+
*/
|
|
28
|
+
manufacturer(): Promise<string | undefined>;
|
|
29
|
+
/**
|
|
30
|
+
* Retrieves model number from the device.
|
|
31
|
+
* @returns {Promise<string | undefined>} A Promise that resolves with the model number.
|
|
32
|
+
*/
|
|
33
|
+
model(): Promise<string | undefined>;
|
|
34
|
+
/**
|
|
35
|
+
* Retrieves serial number from the device.
|
|
36
|
+
* @returns {Promise<string | undefined>} A Promise that resolves with the serial number.
|
|
37
|
+
*/
|
|
38
|
+
serial(): Promise<string | undefined>;
|
|
39
|
+
/**
|
|
40
|
+
* Retrieves software version from the device.
|
|
41
|
+
* @returns {Promise<string | undefined>} A Promise that resolves with the software version.
|
|
42
|
+
*/
|
|
43
|
+
software(): Promise<string | undefined>;
|
|
44
|
+
/**
|
|
45
|
+
* Sets whether the device should reset to zero on power-up.
|
|
46
|
+
* @param {boolean} enabled - Whether to reset to zero on power-up.
|
|
47
|
+
* @returns {Promise<void>} A Promise that resolves when the command has been acknowledged.
|
|
48
|
+
*/
|
|
49
|
+
powerOnReset(enabled: boolean): Promise<void>;
|
|
50
|
+
/**
|
|
51
|
+
* Enables or disables peak mode.
|
|
52
|
+
* @param {boolean} enabled - Whether peak mode should be enabled.
|
|
53
|
+
* @returns {Promise<void>} A Promise that resolves when the command has been acknowledged.
|
|
54
|
+
*/
|
|
55
|
+
peakMode(enabled?: boolean): Promise<void>;
|
|
56
|
+
/**
|
|
57
|
+
* Configures the transparent UART baud rate on the device.
|
|
58
|
+
* @param {CTS500BaudRate} baudRate - Desired baud rate.
|
|
59
|
+
* @returns {Promise<void>} A Promise that resolves when the command has been acknowledged.
|
|
60
|
+
*/
|
|
61
|
+
setBaudRate(baudRate: CTS500BaudRate): Promise<void>;
|
|
62
|
+
/**
|
|
63
|
+
* Configures the device A/D sampling rate.
|
|
64
|
+
* @param {CTS500SamplingRate} samplingRate - Desired A/D sampling rate in Hz.
|
|
65
|
+
* @returns {Promise<void>} A Promise that resolves when the command has been acknowledged.
|
|
66
|
+
*/
|
|
67
|
+
setSamplingRate(samplingRate: CTS500SamplingRate): Promise<void>;
|
|
68
|
+
/**
|
|
69
|
+
* Starts automatic weight uploads over the notify characteristic.
|
|
70
|
+
* @param {number} [duration=0] - Optional delay before the promise resolves.
|
|
71
|
+
* @returns {Promise<void>} A Promise that resolves once automatic upload has been enabled.
|
|
72
|
+
*/
|
|
73
|
+
stream(duration?: number): Promise<void>;
|
|
74
|
+
/**
|
|
75
|
+
* Stops automatic weight uploads over the notify characteristic.
|
|
76
|
+
* @returns {Promise<void>} A Promise that resolves once automatic upload has been disabled.
|
|
77
|
+
*/
|
|
78
|
+
stop(): Promise<void>;
|
|
79
|
+
/**
|
|
80
|
+
* Retrieves the current temperature reading from the device.
|
|
81
|
+
* The returned string is the temperature in Celsius.
|
|
82
|
+
* @returns {Promise<string | undefined>} A Promise that resolves with the temperature.
|
|
83
|
+
*/
|
|
84
|
+
temperature(): Promise<string | undefined>;
|
|
85
|
+
/**
|
|
86
|
+
* Retrieves the current weight from the device in kilograms.
|
|
87
|
+
* @returns {Promise<number | undefined>} A Promise that resolves with the current weight.
|
|
88
|
+
*/
|
|
89
|
+
weight(): Promise<number | undefined>;
|
|
90
|
+
/**
|
|
91
|
+
* Updates the hardware zero point.
|
|
92
|
+
* @returns {Promise<void>} A Promise that resolves when the command has been acknowledged.
|
|
93
|
+
*/
|
|
94
|
+
zero(): Promise<void>;
|
|
95
|
+
}
|
|
96
|
+
//# sourceMappingURL=cts500.interface.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cts500.interface.d.ts","sourceRoot":"","sources":["../../../src/interfaces/device/cts500.interface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAA;AAErD,MAAM,MAAM,cAAc,GAAG,IAAI,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,GAAG,MAAM,CAAA;AAElE,MAAM,MAAM,kB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AG,SAAS,CAAC,CAAA;IAE1C;;;OAGG;IACH,MAAM,IAAI,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAA;IAErC;;;OAGG;IACH,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;CACtB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cts500.interface.js","sourceRoot":"","sources":["../../../src/interfaces/device/cts500.interface.ts"],"names":[],"mappings":""}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { INordicDfuDevice } from "../nordic.interface.js";
|
|
2
2
|
/**
|
|
3
3
|
* Interface representing the PitchSix ForceBoard device, extending the base Device interface.
|
|
4
4
|
*/
|
|
5
|
-
export interface IForceBoard extends
|
|
5
|
+
export interface IForceBoard extends INordicDfuDevice {
|
|
6
6
|
/**
|
|
7
7
|
* Retrieves battery or voltage information from the device.
|
|
8
8
|
* @returns {Promise<string | undefined>} A Promise that resolves with the battery or voltage information.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"forceboard.interface.d.ts","sourceRoot":"","sources":["../../../src/interfaces/device/forceboard.interface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"forceboard.interface.d.ts","sourceRoot":"","sources":["../../../src/interfaces/device/forceboard.interface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAA;AAE9D;;GAEG;AACH,MAAM,WAAW,WAAY,SAAQ,gBAAgB;IACnD;;;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,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;IAErB;;;;;OAKG;IACH,MAAM,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAExC;;;OAGG;IACH,oBAAoB,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;IAErC;;;;OAIG;IACH,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;IAE3B;;;;OAIG;IACH,SAAS,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAE9C;;;OAGG;IACH,WAAW,IAAI,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAA;IAE1C;;;;;OAKG;IACH,KAAK,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CACxC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { INordicDfuDevice } from "../nordic.interface.js";
|
|
2
2
|
/**
|
|
3
3
|
* Interface representing the Tindeq Progressor device, extending the base Device interface.
|
|
4
4
|
*/
|
|
5
|
-
export interface IProgressor extends
|
|
5
|
+
export interface IProgressor extends INordicDfuDevice {
|
|
6
6
|
/**
|
|
7
7
|
* Retrieves battery or voltage information from the device.
|
|
8
8
|
* @returns {Promise<string | undefined>} A Promise that resolves with the battery or voltage information.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"progressor.interface.d.ts","sourceRoot":"","sources":["../../../src/interfaces/device/progressor.interface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"progressor.interface.d.ts","sourceRoot":"","sources":["../../../src/interfaces/device/progressor.interface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAA;AAE9D;;GAEG;AACH,MAAM,WAAW,WAAY,SAAQ,gBAAgB;IACnD;;;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"}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
export type { IClimbro } from "./device/climbro.interface.js";
|
|
2
|
+
export type { ICTS500 } from "./device/cts500.interface.js";
|
|
2
3
|
export type { IEntralpi } from "./device/entralpi.interface.js";
|
|
3
4
|
export type { IForceBoard } from "./device/forceboard.interface.js";
|
|
4
5
|
export type { IKilterBoard } from "./device/kilterboard.interface.js";
|
|
5
6
|
export type { IMotherboard } from "./device/motherboard.interface.js";
|
|
6
7
|
export type { ImySmartBoard } from "./device/mysmartboard.interface.js";
|
|
8
|
+
export type { INordicDfuDevice } from "./nordic.interface.js";
|
|
7
9
|
export type { IProgressor } from "./device/progressor.interface.js";
|
|
8
10
|
export type { ISmartBoardPro } from "./device/smartboard-pro.interface.js";
|
|
9
11
|
export type { IWHC06 } from "./device/wh-c06.interface.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/interfaces/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAA;AAE7D,YAAY,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAA;AAE/D,YAAY,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAA;AAEnE,YAAY,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAA;AAErE,YAAY,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAA;AAErE,YAAY,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAA;AAEvE,YAAY,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAA;AAEnE,YAAY,EAAE,cAAc,EAAE,MAAM,sCAAsC,CAAA;AAE1E,YAAY,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/interfaces/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAA;AAE7D,YAAY,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAA;AAE3D,YAAY,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAA;AAE/D,YAAY,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAA;AAEnE,YAAY,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAA;AAErE,YAAY,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAA;AAErE,YAAY,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAA;AAEvE,YAAY,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AAE7D,YAAY,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAA;AAEnE,YAAY,EAAE,cAAc,EAAE,MAAM,sCAAsC,CAAA;AAE1E,YAAY,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAA"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { IDevice } from "./device.interface.js";
|
|
2
|
+
/**
|
|
3
|
+
* Shared Nordic Secure DFU functionality for devices that expose the FE59 DFU service.
|
|
4
|
+
*/
|
|
5
|
+
export interface INordicDfuDevice extends IDevice {
|
|
6
|
+
/**
|
|
7
|
+
* Switches the device from application mode into the Nordic DFU bootloader.
|
|
8
|
+
*/
|
|
9
|
+
dfuSwitch(): Promise<void>;
|
|
10
|
+
/**
|
|
11
|
+
* Sends a raw Nordic Secure DFU control operation and resolves with the response payload bytes.
|
|
12
|
+
* Call after dfuSwitch() has reconnected to the DFU bootloader.
|
|
13
|
+
*/
|
|
14
|
+
dfuControl(operation: Uint8Array, payload?: ArrayBuffer): Promise<Uint8Array>;
|
|
15
|
+
/**
|
|
16
|
+
* Sends Nordic Secure DFU SELECT for command or data objects and returns the bootloader state.
|
|
17
|
+
*/
|
|
18
|
+
dfuSelect(objectType: "command" | "data"): Promise<{
|
|
19
|
+
maxSize: number;
|
|
20
|
+
offset: number;
|
|
21
|
+
crc: number;
|
|
22
|
+
}>;
|
|
23
|
+
/**
|
|
24
|
+
* Sends Nordic Secure DFU CREATE for command or data objects.
|
|
25
|
+
*/
|
|
26
|
+
dfuCreate(objectType: "command" | "data", size: number): Promise<void>;
|
|
27
|
+
/**
|
|
28
|
+
* Writes raw bytes to the Nordic Secure DFU packet characteristic.
|
|
29
|
+
*/
|
|
30
|
+
dfuWritePacket(data: Uint8Array | ArrayBuffer): Promise<void>;
|
|
31
|
+
/**
|
|
32
|
+
* Sends Nordic Secure DFU CALCULATE_CHECKSUM and returns the bootloader state.
|
|
33
|
+
*/
|
|
34
|
+
dfuChecksum(): Promise<{
|
|
35
|
+
offset: number;
|
|
36
|
+
crc: number;
|
|
37
|
+
}>;
|
|
38
|
+
/**
|
|
39
|
+
* Sends Nordic Secure DFU EXECUTE for the currently created object.
|
|
40
|
+
*/
|
|
41
|
+
dfuExecute(): Promise<void>;
|
|
42
|
+
/**
|
|
43
|
+
* Runs a complete Nordic Secure DFU upload: switch to bootloader, send init packet, then send firmware.
|
|
44
|
+
*/
|
|
45
|
+
dfuUpload(initPacket: Uint8Array | ArrayBuffer, firmware: Uint8Array | ArrayBuffer): Promise<void>;
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=nordic.interface.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nordic.interface.d.ts","sourceRoot":"","sources":["../../src/interfaces/nordic.interface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAA;AAEpD;;GAEG;AACH,MAAM,WAAW,gBAAiB,SAAQ,OAAO;IAC/C;;OAEG;IACH,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;IAE1B;;;OAGG;IACH,UAAU,CAAC,SAAS,EAAE,UAAU,EAAE,OAAO,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,UAAU,CAAC,CAAA;IAE7E;;OAEG;IACH,SAAS,CAAC,UAAU,EAAE,SAAS,GAAG,MAAM,GAAG,OAAO,CAAC;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;IAEpG;;OAEG;IACH,SAAS,CAAC,UAAU,EAAE,SAAS,GAAG,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAEtE;;OAEG;IACH,cAAc,CAAC,IAAI,EAAE,UAAU,GAAG,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAE7D;;OAEG;IACH,WAAW,IAAI,OAAO,CAAC;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;IAEvD;;OAEG;IACH,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;IAE3B;;OAEG;IACH,SAAS,CAAC,UAAU,EAAE,UAAU,GAAG,WAAW,EAAE,QAAQ,EAAE,UAAU,GAAG,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CACnG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nordic.interface.js","sourceRoot":"","sources":["../../src/interfaces/nordic.interface.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
import { Device } from "../device.model.js";
|
|
2
|
+
import type { CTS500BaudRate, CTS500SamplingRate, ICTS500 } from "../../interfaces/device/cts500.interface.js";
|
|
3
|
+
/**
|
|
4
|
+
* Represents the CTS500 Climbing Training Scale, marketed as "Jlyscales CTS500".
|
|
5
|
+
* Supplier: Hunan Jinlian Cloud Information Technology Co., Ltd.
|
|
6
|
+
* {@link https://www.huaying-scales.com/}
|
|
7
|
+
* {@link https://www.alibaba.com/product-detail/Mini-Climbing-Training-Scale-CTS500-Aluminum_1601637814595.html}
|
|
8
|
+
*/
|
|
9
|
+
export declare class CTS500 extends Device implements ICTS500 {
|
|
10
|
+
private bufferedFrames;
|
|
11
|
+
private pendingFrame;
|
|
12
|
+
private requestQueue;
|
|
13
|
+
private isStreaming;
|
|
14
|
+
private commandOpcodes;
|
|
15
|
+
constructor();
|
|
16
|
+
/**
|
|
17
|
+
* Retrieves battery voltage from the device.
|
|
18
|
+
* The returned string uses two decimal places, e.g. "3.55".
|
|
19
|
+
* @returns {Promise<string | undefined>} A Promise that resolves with the battery voltage.
|
|
20
|
+
*/
|
|
21
|
+
battery: () => Promise<string | undefined>;
|
|
22
|
+
/**
|
|
23
|
+
* Retrieves firmware version from the device.
|
|
24
|
+
* @returns {Promise<string | undefined>} A Promise that resolves with the firmware version.
|
|
25
|
+
*/
|
|
26
|
+
firmware: () => Promise<string | undefined>;
|
|
27
|
+
/**
|
|
28
|
+
* Retrieves hardware version from the device.
|
|
29
|
+
* @returns {Promise<string | undefined>} A Promise that resolves with the hardware version.
|
|
30
|
+
*/
|
|
31
|
+
hardware: () => Promise<string | undefined>;
|
|
32
|
+
/**
|
|
33
|
+
* Retrieves manufacturer information from the device.
|
|
34
|
+
* @returns {Promise<string | undefined>} A Promise that resolves with the manufacturer information.
|
|
35
|
+
*/
|
|
36
|
+
manufacturer: () => Promise<string | undefined>;
|
|
37
|
+
/**
|
|
38
|
+
* Retrieves model number from the device.
|
|
39
|
+
* @returns {Promise<string | undefined>} A Promise that resolves with the model number.
|
|
40
|
+
*/
|
|
41
|
+
model: () => Promise<string | undefined>;
|
|
42
|
+
/**
|
|
43
|
+
* Sets whether the device should reset to zero on power-up.
|
|
44
|
+
* @param {boolean} enabled - Whether power-on reset should be enabled.
|
|
45
|
+
* @returns {Promise<void>} A promise that resolves when the command is acknowledged.
|
|
46
|
+
*/
|
|
47
|
+
powerOnReset: (enabled: boolean) => Promise<void>;
|
|
48
|
+
/**
|
|
49
|
+
* Enables or disables the device peak mode.
|
|
50
|
+
* @param {boolean} [enabled=true] - Whether peak mode should be enabled.
|
|
51
|
+
* @returns {Promise<void>} A promise that resolves when the command is acknowledged.
|
|
52
|
+
*/
|
|
53
|
+
peakMode: (enabled?: boolean) => Promise<void>;
|
|
54
|
+
/**
|
|
55
|
+
* Configures the device UART baud rate.
|
|
56
|
+
* @param {CTS500BaudRate} baudRate - Desired baud rate.
|
|
57
|
+
* @returns {Promise<void>} A promise that resolves when the command is acknowledged.
|
|
58
|
+
*/
|
|
59
|
+
setBaudRate: (baudRate: CTS500BaudRate) => Promise<void>;
|
|
60
|
+
/**
|
|
61
|
+
* Configures the device A/D sampling rate.
|
|
62
|
+
* @param {CTS500SamplingRate} samplingRate - Desired A/D sampling rate in Hz.
|
|
63
|
+
* @returns {Promise<void>} A promise that resolves when the command is acknowledged.
|
|
64
|
+
*/
|
|
65
|
+
setSamplingRate: (samplingRate: CTS500SamplingRate) => Promise<void>;
|
|
66
|
+
/**
|
|
67
|
+
* Retrieves serial number from the device.
|
|
68
|
+
* @returns {Promise<string | undefined>} A Promise that resolves with the serial number.
|
|
69
|
+
*/
|
|
70
|
+
serial: () => Promise<string | undefined>;
|
|
71
|
+
/**
|
|
72
|
+
* Retrieves software version from the device.
|
|
73
|
+
* @returns {Promise<string | undefined>} A Promise that resolves with the software version.
|
|
74
|
+
*/
|
|
75
|
+
software: () => Promise<string | undefined>;
|
|
76
|
+
/**
|
|
77
|
+
* Starts automatic weight uploads.
|
|
78
|
+
* @param {number} [duration=0] - Optional delay before the promise resolves.
|
|
79
|
+
* @returns {Promise<void>} A promise that resolves once upload mode has been enabled.
|
|
80
|
+
*/
|
|
81
|
+
stream: (duration?: number) => Promise<void>;
|
|
82
|
+
/**
|
|
83
|
+
* Stops automatic weight uploads.
|
|
84
|
+
* @returns {Promise<void>} A promise that resolves once upload mode has been disabled.
|
|
85
|
+
*/
|
|
86
|
+
stop: () => Promise<void>;
|
|
87
|
+
/**
|
|
88
|
+
* Reads the current temperature from the device.
|
|
89
|
+
* @returns {Promise<string | undefined>} A Promise that resolves with the temperature in Celsius.
|
|
90
|
+
*/
|
|
91
|
+
temperature: () => Promise<string | undefined>;
|
|
92
|
+
/**
|
|
93
|
+
* Uses the device's hardware tare command when connected and falls back to software tare otherwise.
|
|
94
|
+
* @param {number} [duration=5000] - Software tare duration when the device is not connected.
|
|
95
|
+
* @returns {boolean} `true` when the tare operation started successfully.
|
|
96
|
+
*/
|
|
97
|
+
tare: (duration?: number) => boolean;
|
|
98
|
+
/**
|
|
99
|
+
* Reads the current weight from the device in kilograms.
|
|
100
|
+
* @returns {Promise<number | undefined>} A Promise that resolves with the current weight.
|
|
101
|
+
*/
|
|
102
|
+
weight: () => Promise<number | undefined>;
|
|
103
|
+
/**
|
|
104
|
+
* Updates the device hardware zero point.
|
|
105
|
+
* @returns {Promise<void>} A promise that resolves when the command is acknowledged.
|
|
106
|
+
*/
|
|
107
|
+
zero: () => Promise<void>;
|
|
108
|
+
/**
|
|
109
|
+
* Parses UART frames received over the MY-BT102 notify characteristic.
|
|
110
|
+
* Supports fragmented BLE notifications by buffering until a complete CTS500 frame is available.
|
|
111
|
+
*
|
|
112
|
+
* @param {DataView} value - The notification payload from the device.
|
|
113
|
+
*/
|
|
114
|
+
handleNotifications: (value: DataView) => void;
|
|
115
|
+
/**
|
|
116
|
+
* Waits for a specific frame pattern after sending a CTS500 command.
|
|
117
|
+
*/
|
|
118
|
+
private queryFrame;
|
|
119
|
+
/**
|
|
120
|
+
* Sends a command that should be acknowledged with a 6-byte echo frame.
|
|
121
|
+
*/
|
|
122
|
+
private expectAck;
|
|
123
|
+
/**
|
|
124
|
+
* Sends a configuration command that may reply with either a 6-byte echo, a typed response, or no reply after applying.
|
|
125
|
+
*/
|
|
126
|
+
private applyConfigCommand;
|
|
127
|
+
/**
|
|
128
|
+
* Resolves the currently pending frame promise if the incoming frame matches.
|
|
129
|
+
* @returns {boolean} Whether a pending request consumed the frame.
|
|
130
|
+
*/
|
|
131
|
+
private consumePendingFrame;
|
|
132
|
+
/**
|
|
133
|
+
* Clears the currently pending frame wait, if any.
|
|
134
|
+
*/
|
|
135
|
+
private clearPendingFrame;
|
|
136
|
+
/**
|
|
137
|
+
* Extracts the next valid CTS500 frame from the local notification buffer.
|
|
138
|
+
*/
|
|
139
|
+
private extractNextFrame;
|
|
140
|
+
/**
|
|
141
|
+
* Routes a validated CTS500 frame to pending requests, callbacks, and stream processing.
|
|
142
|
+
*/
|
|
143
|
+
private handleFrame;
|
|
144
|
+
/**
|
|
145
|
+
* Returns whether a frame is a 6-byte command acknowledgment echo for the given opcode.
|
|
146
|
+
*/
|
|
147
|
+
private isAckFrame;
|
|
148
|
+
/**
|
|
149
|
+
* Returns whether a frame is a typed command response (`05 80 <opcode> ... checksum`).
|
|
150
|
+
*/
|
|
151
|
+
private isCommandResponse;
|
|
152
|
+
/**
|
|
153
|
+
* Returns whether a frame contains a weight measurement payload.
|
|
154
|
+
*/
|
|
155
|
+
private isWeightFrame;
|
|
156
|
+
/**
|
|
157
|
+
* Updates rolling statistics and emits a force measurement from a CTS500 weight frame.
|
|
158
|
+
*/
|
|
159
|
+
private recordWeightMeasurement;
|
|
160
|
+
/**
|
|
161
|
+
* Validates a CTS500 frame checksum.
|
|
162
|
+
*/
|
|
163
|
+
private isValidFrame;
|
|
164
|
+
/**
|
|
165
|
+
* Registers a pending frame matcher with a timeout.
|
|
166
|
+
*/
|
|
167
|
+
private waitForFrame;
|
|
168
|
+
/**
|
|
169
|
+
* Serializes CTS500 command/response operations so query-style methods can be called in parallel by consumers.
|
|
170
|
+
*/
|
|
171
|
+
private enqueueRequest;
|
|
172
|
+
}
|
|
173
|
+
//# sourceMappingURL=cts500.model.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cts500.model.d.ts","sourceRoot":"","sources":["../../../src/models/device/cts500.model.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAA;AAC3C,OAAO,KAAK,EAAE,cAAc,EAAE,kBAAkB,EAAE,OAAO,EAAE,MAAM,6CAA6C,CAAA;AAsD9G;;;;;GAKG;AACH,qBAAa,MAAO,SAAQ,MAAO,YAAW,OAAO;IACnD,OAAO,CAAC,cAAc,CAAoB;IAC1C,OAAO,CAAC,YAAY,CAAsC;IAC1D,OAAO,CAAC,YAAY,CAAmC;IACvD,OAAO,CAAC,WAAW,CAAQ;IAC3B,OAAO,CAAC,cAAc,CAAoB;;IAqG1C;;;;OAIG;IACH,OAAO,QAAa,OAAO,CAAC,MAA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