@ovok/native 0.4.7 → 0.4.8
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/lib/commonjs/modules/bt-device/constants/device-instruction-pdfs.js +3 -1
- package/lib/commonjs/modules/bt-device/constants/device-instruction-pdfs.js.map +1 -1
- package/lib/commonjs/modules/bt-management/constants/integrated-devices-map.js +1 -1
- package/lib/commonjs/modules/bt-management/constants/integrated-devices-map.js.map +1 -1
- package/lib/commonjs/modules/bt-management/index.js +44 -0
- package/lib/commonjs/modules/bt-management/index.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/custom/compile-case-shape.js +52 -0
- package/lib/commonjs/modules/bt-management/services/custom/compile-case-shape.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/custom/compile-custom-case.js +8 -2
- package/lib/commonjs/modules/bt-management/services/custom/compile-custom-case.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/custom/compile-custom-field.js +3 -0
- package/lib/commonjs/modules/bt-management/services/custom/compile-custom-field.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/device-creator.js +5 -1
- package/lib/commonjs/modules/bt-management/services/device-creator.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/devices/bt-command-writer.js +15 -1
- package/lib/commonjs/modules/bt-management/services/devices/bt-command-writer.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/devices/custom/custom-lepu-sequencer.js +20 -1
- package/lib/commonjs/modules/bt-management/services/devices/custom/custom-lepu-sequencer.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/devices/custom/custom.device.js +30 -44
- package/lib/commonjs/modules/bt-management/services/devices/custom/custom.device.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/devices/frame-parser.js +2 -1
- package/lib/commonjs/modules/bt-management/services/devices/frame-parser.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/devices/sentinel-frame-reader.js +84 -0
- package/lib/commonjs/modules/bt-management/services/devices/sentinel-frame-reader.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/devices/standard-gatt/standard-gatt.devices.js +27 -53
- package/lib/commonjs/modules/bt-management/services/devices/standard-gatt/standard-gatt.devices.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/devices/standard-gatt/standard-gatt.profile.js +55 -0
- package/lib/commonjs/modules/bt-management/services/devices/standard-gatt/standard-gatt.profile.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/devices/veroval/veroval.bp-monitors.js +43 -0
- package/lib/commonjs/modules/bt-management/services/devices/veroval/veroval.bp-monitors.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/devices/veroval/veroval.duo-control-device.js +113 -0
- package/lib/commonjs/modules/bt-management/services/devices/veroval/veroval.duo-control-device.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/devices/veroval/veroval.duo-control-sequencer.js +120 -0
- package/lib/commonjs/modules/bt-management/services/devices/veroval/veroval.duo-control-sequencer.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/devices/veroval/veroval.ecg-device.js +92 -0
- package/lib/commonjs/modules/bt-management/services/devices/veroval/veroval.ecg-device.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/devices/veroval/veroval.ecg-samples.js +64 -0
- package/lib/commonjs/modules/bt-management/services/devices/veroval/veroval.ecg-samples.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/devices/veroval/veroval.ecg-transfer.js +94 -0
- package/lib/commonjs/modules/bt-management/services/devices/veroval/veroval.ecg-transfer.js.map +1 -0
- package/lib/commonjs/modules/bt-management/types/integrated-devices.js +2 -0
- package/lib/commonjs/modules/bt-management/types/integrated-devices.js.map +1 -1
- package/lib/commonjs/modules/bt-management/utils/create-custom-field-parser.js +21 -0
- package/lib/commonjs/modules/bt-management/utils/create-custom-field-parser.js.map +1 -1
- package/lib/commonjs/modules/bt-management/utils/parse-measurement.js +10 -7
- package/lib/commonjs/modules/bt-management/utils/parse-measurement.js.map +1 -1
- package/lib/commonjs/modules/bt-management/utils/reject-custom-reading.js +34 -0
- package/lib/commonjs/modules/bt-management/utils/reject-custom-reading.js.map +1 -0
- package/lib/module/modules/bt-device/constants/device-instruction-pdfs.js +3 -1
- package/lib/module/modules/bt-device/constants/device-instruction-pdfs.js.map +1 -1
- package/lib/module/modules/bt-management/constants/integrated-devices-map.js +1 -1
- package/lib/module/modules/bt-management/constants/integrated-devices-map.js.map +1 -1
- package/lib/module/modules/bt-management/index.js +4 -0
- package/lib/module/modules/bt-management/index.js.map +1 -1
- package/lib/module/modules/bt-management/services/custom/compile-case-shape.js +48 -0
- package/lib/module/modules/bt-management/services/custom/compile-case-shape.js.map +1 -0
- package/lib/module/modules/bt-management/services/custom/compile-custom-case.js +8 -2
- package/lib/module/modules/bt-management/services/custom/compile-custom-case.js.map +1 -1
- package/lib/module/modules/bt-management/services/custom/compile-custom-field.js +3 -0
- package/lib/module/modules/bt-management/services/custom/compile-custom-field.js.map +1 -1
- package/lib/module/modules/bt-management/services/device-creator.js +5 -1
- package/lib/module/modules/bt-management/services/device-creator.js.map +1 -1
- package/lib/module/modules/bt-management/services/devices/bt-command-writer.js +15 -1
- package/lib/module/modules/bt-management/services/devices/bt-command-writer.js.map +1 -1
- package/lib/module/modules/bt-management/services/devices/custom/custom-lepu-sequencer.js +20 -1
- package/lib/module/modules/bt-management/services/devices/custom/custom-lepu-sequencer.js.map +1 -1
- package/lib/module/modules/bt-management/services/devices/custom/custom.device.js +31 -45
- package/lib/module/modules/bt-management/services/devices/custom/custom.device.js.map +1 -1
- package/lib/module/modules/bt-management/services/devices/frame-parser.js +2 -1
- package/lib/module/modules/bt-management/services/devices/frame-parser.js.map +1 -1
- package/lib/module/modules/bt-management/services/devices/sentinel-frame-reader.js +79 -0
- package/lib/module/modules/bt-management/services/devices/sentinel-frame-reader.js.map +1 -0
- package/lib/module/modules/bt-management/services/devices/standard-gatt/standard-gatt.devices.js +19 -45
- package/lib/module/modules/bt-management/services/devices/standard-gatt/standard-gatt.devices.js.map +1 -1
- package/lib/module/modules/bt-management/services/devices/standard-gatt/standard-gatt.profile.js +50 -0
- package/lib/module/modules/bt-management/services/devices/standard-gatt/standard-gatt.profile.js.map +1 -0
- package/lib/module/modules/bt-management/services/devices/veroval/veroval.bp-monitors.js +38 -0
- package/lib/module/modules/bt-management/services/devices/veroval/veroval.bp-monitors.js.map +1 -0
- package/lib/module/modules/bt-management/services/devices/veroval/veroval.duo-control-device.js +108 -0
- package/lib/module/modules/bt-management/services/devices/veroval/veroval.duo-control-device.js.map +1 -0
- package/lib/module/modules/bt-management/services/devices/veroval/veroval.duo-control-sequencer.js +116 -0
- package/lib/module/modules/bt-management/services/devices/veroval/veroval.duo-control-sequencer.js.map +1 -0
- package/lib/module/modules/bt-management/services/devices/veroval/veroval.ecg-device.js +87 -0
- package/lib/module/modules/bt-management/services/devices/veroval/veroval.ecg-device.js.map +1 -0
- package/lib/module/modules/bt-management/services/devices/veroval/veroval.ecg-samples.js +60 -0
- package/lib/module/modules/bt-management/services/devices/veroval/veroval.ecg-samples.js.map +1 -0
- package/lib/module/modules/bt-management/services/devices/veroval/veroval.ecg-transfer.js +89 -0
- package/lib/module/modules/bt-management/services/devices/veroval/veroval.ecg-transfer.js.map +1 -0
- package/lib/module/modules/bt-management/types/device-measurement-map.js +3 -3
- package/lib/module/modules/bt-management/types/device-measurement-map.js.map +1 -1
- package/lib/module/modules/bt-management/types/integrated-devices.js +2 -0
- package/lib/module/modules/bt-management/types/integrated-devices.js.map +1 -1
- package/lib/module/modules/bt-management/utils/create-custom-field-parser.js +21 -0
- package/lib/module/modules/bt-management/utils/create-custom-field-parser.js.map +1 -1
- package/lib/module/modules/bt-management/utils/parse-measurement.js +10 -7
- package/lib/module/modules/bt-management/utils/parse-measurement.js.map +1 -1
- package/lib/module/modules/bt-management/utils/reject-custom-reading.js +29 -0
- package/lib/module/modules/bt-management/utils/reject-custom-reading.js.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-device/constants/device-instruction-pdfs.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/constants/integrated-devices-map.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/index.d.ts +4 -0
- package/lib/typescript/commonjs/src/modules/bt-management/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/custom/compile-case-shape.d.ts +19 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/custom/compile-case-shape.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/custom/compile-custom-case.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/custom/compile-custom-field.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/device-creator.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bt-command-writer.d.ts +7 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bt-command-writer.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/custom/custom-lepu-sequencer.d.ts +11 -2
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/custom/custom-lepu-sequencer.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/custom/custom.device.d.ts +10 -13
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/custom/custom.device.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/frame-parser.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/sentinel-frame-reader.d.ts +52 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/sentinel-frame-reader.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.devices.d.ts +22 -13
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.devices.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.profile.d.ts +45 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.profile.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/veroval/veroval.bp-monitors.d.ts +18 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/veroval/veroval.bp-monitors.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/veroval/veroval.duo-control-device.d.ts +19 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/veroval/veroval.duo-control-device.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/veroval/veroval.duo-control-sequencer.d.ts +45 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/veroval/veroval.duo-control-sequencer.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/veroval/veroval.ecg-device.d.ts +30 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/veroval/veroval.ecg-device.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/veroval/veroval.ecg-samples.d.ts +39 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/veroval/veroval.ecg-samples.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/veroval/veroval.ecg-transfer.d.ts +35 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/veroval/veroval.ecg-transfer.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/types/custom-case-spec.d.ts +30 -0
- package/lib/typescript/commonjs/src/modules/bt-management/types/custom-case-spec.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/types/custom-field-encoding.d.ts +7 -1
- package/lib/typescript/commonjs/src/modules/bt-management/types/custom-field-encoding.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/types/dependent-result-handler-params.d.ts +7 -0
- package/lib/typescript/commonjs/src/modules/bt-management/types/dependent-result-handler-params.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/types/device-command.d.ts +9 -0
- package/lib/typescript/commonjs/src/modules/bt-management/types/device-command.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/types/device-measurement-map.d.ts +2 -0
- package/lib/typescript/commonjs/src/modules/bt-management/types/device-measurement-map.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/types/integrated-devices.d.ts +3 -1
- package/lib/typescript/commonjs/src/modules/bt-management/types/integrated-devices.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/types/parsing-case.d.ts +8 -0
- package/lib/typescript/commonjs/src/modules/bt-management/types/parsing-case.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/utils/create-custom-field-parser.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/utils/parse-measurement.d.ts +4 -1
- package/lib/typescript/commonjs/src/modules/bt-management/utils/parse-measurement.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/utils/reject-custom-reading.d.ts +15 -0
- package/lib/typescript/commonjs/src/modules/bt-management/utils/reject-custom-reading.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-device/constants/device-instruction-pdfs.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/constants/integrated-devices-map.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/index.d.ts +4 -0
- package/lib/typescript/module/src/modules/bt-management/index.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/custom/compile-case-shape.d.ts +19 -0
- package/lib/typescript/module/src/modules/bt-management/services/custom/compile-case-shape.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/custom/compile-custom-case.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/custom/compile-custom-field.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/device-creator.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/devices/bt-command-writer.d.ts +7 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/bt-command-writer.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/devices/custom/custom-lepu-sequencer.d.ts +11 -2
- package/lib/typescript/module/src/modules/bt-management/services/devices/custom/custom-lepu-sequencer.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/devices/custom/custom.device.d.ts +10 -13
- package/lib/typescript/module/src/modules/bt-management/services/devices/custom/custom.device.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/devices/frame-parser.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/devices/sentinel-frame-reader.d.ts +52 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/sentinel-frame-reader.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.devices.d.ts +22 -13
- package/lib/typescript/module/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.devices.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.profile.d.ts +45 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.profile.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/veroval/veroval.bp-monitors.d.ts +18 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/veroval/veroval.bp-monitors.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/veroval/veroval.duo-control-device.d.ts +19 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/veroval/veroval.duo-control-device.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/veroval/veroval.duo-control-sequencer.d.ts +45 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/veroval/veroval.duo-control-sequencer.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/veroval/veroval.ecg-device.d.ts +30 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/veroval/veroval.ecg-device.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/veroval/veroval.ecg-samples.d.ts +39 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/veroval/veroval.ecg-samples.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/veroval/veroval.ecg-transfer.d.ts +35 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/veroval/veroval.ecg-transfer.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/types/custom-case-spec.d.ts +30 -0
- package/lib/typescript/module/src/modules/bt-management/types/custom-case-spec.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/types/custom-field-encoding.d.ts +7 -1
- package/lib/typescript/module/src/modules/bt-management/types/custom-field-encoding.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/types/dependent-result-handler-params.d.ts +7 -0
- package/lib/typescript/module/src/modules/bt-management/types/dependent-result-handler-params.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/types/device-command.d.ts +9 -0
- package/lib/typescript/module/src/modules/bt-management/types/device-command.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/types/device-measurement-map.d.ts +2 -0
- package/lib/typescript/module/src/modules/bt-management/types/device-measurement-map.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/types/integrated-devices.d.ts +3 -1
- package/lib/typescript/module/src/modules/bt-management/types/integrated-devices.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/types/parsing-case.d.ts +8 -0
- package/lib/typescript/module/src/modules/bt-management/types/parsing-case.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/utils/create-custom-field-parser.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/utils/parse-measurement.d.ts +4 -1
- package/lib/typescript/module/src/modules/bt-management/utils/parse-measurement.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/utils/reject-custom-reading.d.ts +15 -0
- package/lib/typescript/module/src/modules/bt-management/utils/reject-custom-reading.d.ts.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.rejectCustomReading = exports.discardedReadingError = void 0;
|
|
7
|
+
/** The reading that was thrown away, and why, so a decoding fault can be diagnosed. */
|
|
8
|
+
const discardedReadingError = (deviceId, reason, parsedData) => new Error(`Custom device "${deviceId}": ${reason}. The reading was discarded (decoded ${JSON.stringify(parsedData)}).`);
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Why a decoded property is not a reading, or nothing when it is.
|
|
12
|
+
*
|
|
13
|
+
* The checks are the last thing between a misread frame and a clinical record, so each one
|
|
14
|
+
* says what was wrong rather than returning a bare false: a property the measurement does
|
|
15
|
+
* not have is a declaration mistake, a value that is not a finite number is a frame shorter
|
|
16
|
+
* than the declaration expects, and a value outside the envelope is a decoding fault
|
|
17
|
+
* wearing the shape of a reading.
|
|
18
|
+
*/
|
|
19
|
+
exports.discardedReadingError = discardedReadingError;
|
|
20
|
+
const rejectCustomReading = (fields, measurementTypeKey, name, value) => {
|
|
21
|
+
const field = fields.get(`${measurementTypeKey}:${name}`);
|
|
22
|
+
if (!field) {
|
|
23
|
+
return `decoded "${name}", which is not declared for ${measurementTypeKey}`;
|
|
24
|
+
}
|
|
25
|
+
if (typeof value !== "number" || !Number.isFinite(value)) {
|
|
26
|
+
return `could not decode ${name}; the frame was shorter than the declaration expects`;
|
|
27
|
+
}
|
|
28
|
+
if (value < field.min || value > field.max) {
|
|
29
|
+
return `decoded ${name} = ${value} ${field.unit}, outside the accepted range ${field.min}-${field.max} ${field.unit}`;
|
|
30
|
+
}
|
|
31
|
+
return undefined;
|
|
32
|
+
};
|
|
33
|
+
exports.rejectCustomReading = rejectCustomReading;
|
|
34
|
+
//# sourceMappingURL=reject-custom-reading.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["discardedReadingError","deviceId","reason","parsedData","Error","JSON","stringify","exports","rejectCustomReading","fields","measurementTypeKey","name","value","field","get","Number","isFinite","min","max","unit","undefined"],"sourceRoot":"../../../../../src","sources":["modules/bt-management/utils/reject-custom-reading.ts"],"mappings":";;;;;;AAEA;AACA,MAAMA,qBAAqB,GAAGA,CAC5BC,QAAgB,EAChBC,MAAc,EACdC,UAAmB,KAEnB,IAAIC,KAAK,CACP,kBAAkBH,QAAQ,MAAMC,MAAM,wCAAwCG,IAAI,CAACC,SAAS,CAACH,UAAU,CAAC,IAC1G,CAAC;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AARAI,OAAA,CAAAP,qBAAA,GAAAA,qBAAA;AASA,MAAMQ,mBAAmB,GAAGA,CAC1BC,MAAgD,EAChDC,kBAA0B,EAC1BC,IAAY,EACZC,KAAc,KACS;EACvB,MAAMC,KAAK,GAAGJ,MAAM,CAACK,GAAG,CAAC,GAAGJ,kBAAkB,IAAIC,IAAI,EAAE,CAAC;EAEzD,IAAI,CAACE,KAAK,EAAE;IACV,OAAO,YAAYF,IAAI,gCAAgCD,kBAAkB,EAAE;EAC7E;EAEA,IAAI,OAAOE,KAAK,KAAK,QAAQ,IAAI,CAACG,MAAM,CAACC,QAAQ,CAACJ,KAAK,CAAC,EAAE;IACxD,OAAO,oBAAoBD,IAAI,sDAAsD;EACvF;EAEA,IAAIC,KAAK,GAAGC,KAAK,CAACI,GAAG,IAAIL,KAAK,GAAGC,KAAK,CAACK,GAAG,EAAE;IAC1C,OAAO,WAAWP,IAAI,MAAMC,KAAK,IAAIC,KAAK,CAACM,IAAI,gCAAgCN,KAAK,CAACI,GAAG,IAAIJ,KAAK,CAACK,GAAG,IAAIL,KAAK,CAACM,IAAI,EAAE;EACvH;EAEA,OAAOC,SAAS;AAClB,CAAC;AAACb,OAAA,CAAAC,mBAAA,GAAAA,mBAAA","ignoreList":[]}
|
|
@@ -24,6 +24,8 @@ export const DEVICE_INSTRUCTION_PDFS = {
|
|
|
24
24
|
[IntegratedDevices.CMED]: "",
|
|
25
25
|
[IntegratedDevices.SP80B]: "",
|
|
26
26
|
[IntegratedDevices.S5]: "",
|
|
27
|
-
[IntegratedDevices.BGM]: ""
|
|
27
|
+
[IntegratedDevices.BGM]: "",
|
|
28
|
+
[IntegratedDevices.VEROVAL_DUO_CONTROL]: "",
|
|
29
|
+
[IntegratedDevices.VEROVAL_ECG]: ""
|
|
28
30
|
};
|
|
29
31
|
//# sourceMappingURL=device-instruction-pdfs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["IntegratedDevices","pdfBaseUrl","DEVICE_INSTRUCTION_PDFS","BP2","F4","SPO2","PC60WF","ALIVE_COR","COSINUSS","AOJ20A","TAIDOC_GLUCOSE","GLUCOCHECK","CLEVERTEMP","FORATEMP","ANDESFITTEMP","FORA_SCALE","BC01","RPM_SCALE","CMED","SP80B","S5","BGM"],"sourceRoot":"../../../../../src","sources":["modules/bt-device/constants/device-instruction-pdfs.ts"],"mappings":";;AAAA,SAASA,iBAAiB,QAAQ,8BAAqB;;AAEvD;AACA;AACA,MAAMC,UAAU,GACd,2EAA2E;AAE7E,OAAO,MAAMC,uBAA0D,GAAG;EACxE,CAACF,iBAAiB,CAACG,GAAG,GAAG,GAAGF,UAAU,yBAAyB;EAC/D,CAACD,iBAAiB,CAACI,EAAE,GAAG,GAAGH,UAAU,yBAAyB;EAC9D,CAACD,iBAAiB,CAACK,IAAI,GAAG,GAAGJ,UAAU,yBAAyB;EAChE,CAACD,iBAAiB,CAACM,MAAM,GAAG,GAAGL,UAAU,2BAA2B;EACpE,CAACD,iBAAiB,CAACO,SAAS,GAAG,GAAGN,UAAU,sBAAsB;EAClE,CAACD,iBAAiB,CAACQ,QAAQ,GAAG,GAAGP,UAAU,sBAAsB;EACjE,CAACD,iBAAiB,CAACS,MAAM,GAAG,GAAGR,UAAU,oBAAoB;EAC7D,CAACD,iBAAiB,CAACU,cAAc,GAAG,GAAGT,UAAU,oBAAoB;EACrE,CAACD,iBAAiB,CAACW,UAAU,GAAG,GAAGV,UAAU,iBAAiB;EAC9D,CAACD,iBAAiB,CAACY,UAAU,GAAG,GAAGX,UAAU,oBAAoB;EACjE,CAACD,iBAAiB,CAACa,QAAQ,GAAG,GAAGZ,UAAU,gBAAgB;EAC3D,CAACD,iBAAiB,CAACc,YAAY,GAAG,GAAGb,UAAU,oBAAoB;EACnE,CAACD,iBAAiB,CAACe,UAAU,GAAG,GAAGd,UAAU,gBAAgB;EAC7D,CAACD,iBAAiB,CAACgB,IAAI,GAAG,GAAGf,UAAU,YAAY;EACnD,CAACD,iBAAiB,CAACiB,SAAS,GAAG,GAAGhB,UAAU,wBAAwB;EACpE,CAACD,iBAAiB,CAACkB,IAAI,GAAG,EAAE;EAC5B,CAAClB,iBAAiB,CAACmB,KAAK,GAAG,EAAE;EAC7B,CAACnB,iBAAiB,CAACoB,EAAE,GAAG,EAAE;EAC1B,CAACpB,iBAAiB,CAACqB,GAAG,GAAG;
|
|
1
|
+
{"version":3,"names":["IntegratedDevices","pdfBaseUrl","DEVICE_INSTRUCTION_PDFS","BP2","F4","SPO2","PC60WF","ALIVE_COR","COSINUSS","AOJ20A","TAIDOC_GLUCOSE","GLUCOCHECK","CLEVERTEMP","FORATEMP","ANDESFITTEMP","FORA_SCALE","BC01","RPM_SCALE","CMED","SP80B","S5","BGM","VEROVAL_DUO_CONTROL","VEROVAL_ECG"],"sourceRoot":"../../../../../src","sources":["modules/bt-device/constants/device-instruction-pdfs.ts"],"mappings":";;AAAA,SAASA,iBAAiB,QAAQ,8BAAqB;;AAEvD;AACA;AACA,MAAMC,UAAU,GACd,2EAA2E;AAE7E,OAAO,MAAMC,uBAA0D,GAAG;EACxE,CAACF,iBAAiB,CAACG,GAAG,GAAG,GAAGF,UAAU,yBAAyB;EAC/D,CAACD,iBAAiB,CAACI,EAAE,GAAG,GAAGH,UAAU,yBAAyB;EAC9D,CAACD,iBAAiB,CAACK,IAAI,GAAG,GAAGJ,UAAU,yBAAyB;EAChE,CAACD,iBAAiB,CAACM,MAAM,GAAG,GAAGL,UAAU,2BAA2B;EACpE,CAACD,iBAAiB,CAACO,SAAS,GAAG,GAAGN,UAAU,sBAAsB;EAClE,CAACD,iBAAiB,CAACQ,QAAQ,GAAG,GAAGP,UAAU,sBAAsB;EACjE,CAACD,iBAAiB,CAACS,MAAM,GAAG,GAAGR,UAAU,oBAAoB;EAC7D,CAACD,iBAAiB,CAACU,cAAc,GAAG,GAAGT,UAAU,oBAAoB;EACrE,CAACD,iBAAiB,CAACW,UAAU,GAAG,GAAGV,UAAU,iBAAiB;EAC9D,CAACD,iBAAiB,CAACY,UAAU,GAAG,GAAGX,UAAU,oBAAoB;EACjE,CAACD,iBAAiB,CAACa,QAAQ,GAAG,GAAGZ,UAAU,gBAAgB;EAC3D,CAACD,iBAAiB,CAACc,YAAY,GAAG,GAAGb,UAAU,oBAAoB;EACnE,CAACD,iBAAiB,CAACe,UAAU,GAAG,GAAGd,UAAU,gBAAgB;EAC7D,CAACD,iBAAiB,CAACgB,IAAI,GAAG,GAAGf,UAAU,YAAY;EACnD,CAACD,iBAAiB,CAACiB,SAAS,GAAG,GAAGhB,UAAU,wBAAwB;EACpE,CAACD,iBAAiB,CAACkB,IAAI,GAAG,EAAE;EAC5B,CAAClB,iBAAiB,CAACmB,KAAK,GAAG,EAAE;EAC7B,CAACnB,iBAAiB,CAACoB,EAAE,GAAG,EAAE;EAC1B,CAACpB,iBAAiB,CAACqB,GAAG,GAAG,EAAE;EAC3B,CAACrB,iBAAiB,CAACsB,mBAAmB,GAAG,EAAE;EAC3C,CAACtB,iBAAiB,CAACuB,WAAW,GAAG;AACnC,CAAC","ignoreList":[]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
import { IntegratedDevices } from "../types/integrated-devices.js";
|
|
4
|
-
export const integratedDevicesMap = new Map([[/^BP2 \d{4}$/, IntegratedDevices.BP2], [/^F4$/, IntegratedDevices.F4], [/^Oxyfit \d{4}$/, IntegratedDevices.SPO2], [/^OxySmart \d{4}$/, IntegratedDevices.PC60WF], [/^AOJ-20A$/, IntegratedDevices.AOJ20A], [/^TAIDOC TD4216(?: \w+)?$/, IntegratedDevices.TAIDOC_GLUCOSE], [/^GlucoCheck Gold$/, IntegratedDevices.GLUCOCHECK], [/^FORA IR20$/, IntegratedDevices.FORATEMP], [/^TEMP$/, IntegratedDevices.ANDESFITTEMP], [/^two$/, IntegratedDevices.COSINUSS], [/^cmed$/, IntegratedDevices.CMED], [/^BC01\d{4}$/, IntegratedDevices.BC01], [/^FORA W550$/, IntegratedDevices.FORA_SCALE], [/^GBS-2012-B$/, IntegratedDevices.RPM_SCALE], [/^TAIDOC TD1107$/, IntegratedDevices.CLEVERTEMP], [/^PULMO80BEXPGC\d{6}$/, IntegratedDevices.SP80B], [/^Le S5$/, IntegratedDevices.S5], [/^TeleBGM Gen1 BLE$/, IntegratedDevices.BGM]]);
|
|
4
|
+
export const integratedDevicesMap = new Map([[/^BP2 \d{4}$/, IntegratedDevices.BP2], [/^F4$/, IntegratedDevices.F4], [/^Oxyfit \d{4}$/, IntegratedDevices.SPO2], [/^OxySmart \d{4}$/, IntegratedDevices.PC60WF], [/^AOJ-20A$/, IntegratedDevices.AOJ20A], [/^TAIDOC TD4216(?: \w+)?$/, IntegratedDevices.TAIDOC_GLUCOSE], [/^GlucoCheck Gold$/, IntegratedDevices.GLUCOCHECK], [/^FORA IR20$/, IntegratedDevices.FORATEMP], [/^TEMP$/, IntegratedDevices.ANDESFITTEMP], [/^two$/, IntegratedDevices.COSINUSS], [/^cmed$/, IntegratedDevices.CMED], [/^BC01\d{4}$/, IntegratedDevices.BC01], [/^FORA W550$/, IntegratedDevices.FORA_SCALE], [/^GBS-2012-B$/, IntegratedDevices.RPM_SCALE], [/^TAIDOC TD1107$/, IntegratedDevices.CLEVERTEMP], [/^PULMO80BEXPGC\d{6}$/, IntegratedDevices.SP80B], [/^Le S5$/, IntegratedDevices.S5], [/^TeleBGM Gen1 BLE$/, IntegratedDevices.BGM], [/^Veroval duo control$/i, IntegratedDevices.VEROVAL_DUO_CONTROL], [/^Veroval ECG$/i, IntegratedDevices.VEROVAL_ECG]]);
|
|
5
5
|
//# sourceMappingURL=integrated-devices-map.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["IntegratedDevices","integratedDevicesMap","Map","BP2","F4","SPO2","PC60WF","AOJ20A","TAIDOC_GLUCOSE","GLUCOCHECK","FORATEMP","ANDESFITTEMP","COSINUSS","CMED","BC01","FORA_SCALE","RPM_SCALE","CLEVERTEMP","SP80B","S5","BGM"],"sourceRoot":"../../../../../src","sources":["modules/bt-management/constants/integrated-devices-map.ts"],"mappings":";;AAAA,SAASA,iBAAiB,QAAQ,gCAA6B;AAE/D,OAAO,MAAMC,oBAAoB,GAAG,IAAIC,GAAG,CAA4B,CACrE,CAAC,aAAa,EAAEF,iBAAiB,CAACG,GAAG,CAAC,EACtC,CAAC,MAAM,EAAEH,iBAAiB,CAACI,EAAE,CAAC,EAC9B,CAAC,gBAAgB,EAAEJ,iBAAiB,CAACK,IAAI,CAAC,EAC1C,CAAC,kBAAkB,EAAEL,iBAAiB,CAACM,MAAM,CAAC,EAC9C,CAAC,WAAW,EAAEN,iBAAiB,CAACO,MAAM,CAAC,EACvC,CAAC,0BAA0B,EAAEP,iBAAiB,CAACQ,cAAc,CAAC,EAC9D,CAAC,mBAAmB,EAAER,iBAAiB,CAACS,UAAU,CAAC,EACnD,CAAC,aAAa,EAAET,iBAAiB,CAACU,QAAQ,CAAC,EAC3C,CAAC,QAAQ,EAAEV,iBAAiB,CAACW,YAAY,CAAC,EAC1C,CAAC,OAAO,EAAEX,iBAAiB,CAACY,QAAQ,CAAC,EACrC,CAAC,QAAQ,EAAEZ,iBAAiB,CAACa,IAAI,CAAC,EAClC,CAAC,aAAa,EAAEb,iBAAiB,CAACc,IAAI,CAAC,EACvC,CAAC,aAAa,EAAEd,iBAAiB,CAACe,UAAU,CAAC,EAC7C,CAAC,cAAc,EAAEf,iBAAiB,CAACgB,SAAS,CAAC,EAC7C,CAAC,iBAAiB,EAAEhB,iBAAiB,CAACiB,UAAU,CAAC,EACjD,CAAC,sBAAsB,EAAEjB,iBAAiB,CAACkB,KAAK,CAAC,EACjD,CAAC,SAAS,EAAElB,iBAAiB,CAACmB,EAAE,CAAC,EACjC,CAAC,oBAAoB,EAAEnB,iBAAiB,CAACoB,GAAG,CAAC,
|
|
1
|
+
{"version":3,"names":["IntegratedDevices","integratedDevicesMap","Map","BP2","F4","SPO2","PC60WF","AOJ20A","TAIDOC_GLUCOSE","GLUCOCHECK","FORATEMP","ANDESFITTEMP","COSINUSS","CMED","BC01","FORA_SCALE","RPM_SCALE","CLEVERTEMP","SP80B","S5","BGM","VEROVAL_DUO_CONTROL","VEROVAL_ECG"],"sourceRoot":"../../../../../src","sources":["modules/bt-management/constants/integrated-devices-map.ts"],"mappings":";;AAAA,SAASA,iBAAiB,QAAQ,gCAA6B;AAE/D,OAAO,MAAMC,oBAAoB,GAAG,IAAIC,GAAG,CAA4B,CACrE,CAAC,aAAa,EAAEF,iBAAiB,CAACG,GAAG,CAAC,EACtC,CAAC,MAAM,EAAEH,iBAAiB,CAACI,EAAE,CAAC,EAC9B,CAAC,gBAAgB,EAAEJ,iBAAiB,CAACK,IAAI,CAAC,EAC1C,CAAC,kBAAkB,EAAEL,iBAAiB,CAACM,MAAM,CAAC,EAC9C,CAAC,WAAW,EAAEN,iBAAiB,CAACO,MAAM,CAAC,EACvC,CAAC,0BAA0B,EAAEP,iBAAiB,CAACQ,cAAc,CAAC,EAC9D,CAAC,mBAAmB,EAAER,iBAAiB,CAACS,UAAU,CAAC,EACnD,CAAC,aAAa,EAAET,iBAAiB,CAACU,QAAQ,CAAC,EAC3C,CAAC,QAAQ,EAAEV,iBAAiB,CAACW,YAAY,CAAC,EAC1C,CAAC,OAAO,EAAEX,iBAAiB,CAACY,QAAQ,CAAC,EACrC,CAAC,QAAQ,EAAEZ,iBAAiB,CAACa,IAAI,CAAC,EAClC,CAAC,aAAa,EAAEb,iBAAiB,CAACc,IAAI,CAAC,EACvC,CAAC,aAAa,EAAEd,iBAAiB,CAACe,UAAU,CAAC,EAC7C,CAAC,cAAc,EAAEf,iBAAiB,CAACgB,SAAS,CAAC,EAC7C,CAAC,iBAAiB,EAAEhB,iBAAiB,CAACiB,UAAU,CAAC,EACjD,CAAC,sBAAsB,EAAEjB,iBAAiB,CAACkB,KAAK,CAAC,EACjD,CAAC,SAAS,EAAElB,iBAAiB,CAACmB,EAAE,CAAC,EACjC,CAAC,oBAAoB,EAAEnB,iBAAiB,CAACoB,GAAG,CAAC,EAC7C,CAAC,wBAAwB,EAAEpB,iBAAiB,CAACqB,mBAAmB,CAAC,EACjE,CAAC,gBAAgB,EAAErB,iBAAiB,CAACsB,WAAW,CAAC,CAClD,CAAC","ignoreList":[]}
|
|
@@ -36,6 +36,10 @@ export * from "./services/devices/custom/custom.device.js";
|
|
|
36
36
|
export * from "./services/bt-manager.js";
|
|
37
37
|
export * from "./services/custom/define-custom-device.js";
|
|
38
38
|
export * from "./services/devices/standard-gatt/standard-gatt.devices.js";
|
|
39
|
+
export * from "./services/devices/veroval/veroval.bp-monitors.js";
|
|
40
|
+
export * from "./services/devices/veroval/veroval.duo-control-device.js";
|
|
41
|
+
export * from "./services/devices/veroval/veroval.ecg-device.js";
|
|
42
|
+
export * from "./services/devices/veroval/veroval.ecg-samples.js";
|
|
39
43
|
export * from "./services/devices/lepu/lepu.transports.js";
|
|
40
44
|
export * from "./services/devices/aoj/aoj.thermometers.js";
|
|
41
45
|
export * from "./services/devices/viatom/viatom.bp-monitors.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sourceRoot":"../../../../src","sources":["modules/bt-management/index.ts"],"mappings":";;AAAA,cAAc,gCAA6B;AAC3C,cAAc,4BAAyB;AACvC,cAAc,kCAA+B;AAC7C,cAAc,8BAA2B;AACzC,cAAc,6BAA0B;AACxC,cAAc,6BAA0B;AACxC,cAAc,qCAAkC;AAChD,cAAc,6BAA0B;AACxC,cAAc,+BAA4B;AAC1C,cAAc,kCAA+B;AAC7C,cAAc,8BAA2B;AACzC,cAAc,8BAA2B;AACzC,cAAc,6BAA0B;AACxC,cAAc,+BAA4B;AAC1C,cAAc,gCAA6B;AAC3C,cAAc,gCAA6B;AAC3C,cAAc,8BAA2B;AACzC,cAAc,2BAAwB;AACtC,cAAc,uBAAoB;AAClC,cAAc,0BAAuB;AACrC,cAAc,wBAAqB;AACnC,cAAc,0BAAuB;AACrC,cAAc,+BAA4B;AAC1C,cAAc,6BAA0B;AACxC,cAAc,yBAAsB;AACpC,cAAc,0BAAuB;AACrC,cAAc,6BAA0B;AACxC,cAAc,sCAAmC;AACjD,cAAc,4BAAyB;AACvC,cAAc,2BAAwB;AACtC,cAAc,0CAAuC;AAErD,cAAc,yCAAsC;AACpD,cAAc,4CAAyC;AACvD,cAAc,0BAAuB;AACrC,cAAc,2CAAwC;AACtD,cAAc,2DAAwD;AACtE,cAAc,4CAAyC;AACvD,cAAc,4CAAyC;AACvD,cAAc,iDAA8C;AAC5D,cAAc,+CAA4C;AAC1D,cAAc,mDAAgD;AAC9D,cAAc,2CAAwC;AACtD,cAAc,8CAA2C;AACzD,cAAc,4CAAyC;AACvD,cAAc,0CAAuC;AACrD,cAAc,6CAA0C;AACxD,cAAc,+CAA4C;AAC1D,cAAc,+CAA4C;AAE1D,cAAc,0CAAuC;AAErD,cAAc,6BAA0B;AACxC,cAAc,6CAA0C;AACxD,cAAc,oCAAiC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../../src","sources":["modules/bt-management/index.ts"],"mappings":";;AAAA,cAAc,gCAA6B;AAC3C,cAAc,4BAAyB;AACvC,cAAc,kCAA+B;AAC7C,cAAc,8BAA2B;AACzC,cAAc,6BAA0B;AACxC,cAAc,6BAA0B;AACxC,cAAc,qCAAkC;AAChD,cAAc,6BAA0B;AACxC,cAAc,+BAA4B;AAC1C,cAAc,kCAA+B;AAC7C,cAAc,8BAA2B;AACzC,cAAc,8BAA2B;AACzC,cAAc,6BAA0B;AACxC,cAAc,+BAA4B;AAC1C,cAAc,gCAA6B;AAC3C,cAAc,gCAA6B;AAC3C,cAAc,8BAA2B;AACzC,cAAc,2BAAwB;AACtC,cAAc,uBAAoB;AAClC,cAAc,0BAAuB;AACrC,cAAc,wBAAqB;AACnC,cAAc,0BAAuB;AACrC,cAAc,+BAA4B;AAC1C,cAAc,6BAA0B;AACxC,cAAc,yBAAsB;AACpC,cAAc,0BAAuB;AACrC,cAAc,6BAA0B;AACxC,cAAc,sCAAmC;AACjD,cAAc,4BAAyB;AACvC,cAAc,2BAAwB;AACtC,cAAc,0CAAuC;AAErD,cAAc,yCAAsC;AACpD,cAAc,4CAAyC;AACvD,cAAc,0BAAuB;AACrC,cAAc,2CAAwC;AACtD,cAAc,2DAAwD;AACtE,cAAc,mDAAgD;AAC9D,cAAc,0DAAuD;AACrE,cAAc,kDAA+C;AAC7D,cAAc,mDAAgD;AAC9D,cAAc,4CAAyC;AACvD,cAAc,4CAAyC;AACvD,cAAc,iDAA8C;AAC5D,cAAc,+CAA4C;AAC1D,cAAc,mDAAgD;AAC9D,cAAc,2CAAwC;AACtD,cAAc,8CAA2C;AACzD,cAAc,4CAAyC;AACvD,cAAc,0CAAuC;AACrD,cAAc,6CAA0C;AACxD,cAAc,+CAA4C;AAC1D,cAAc,+CAA4C;AAE1D,cAAc,0CAAuC;AAErD,cAAc,6BAA0B;AACxC,cAAc,6CAA0C;AACxD,cAAc,oCAAiC","ignoreList":[]}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { customDeviceError } from "./custom-device-error.js";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* How long a frame of this shape is, which may be longer than the shortest the
|
|
7
|
+
* characteristic emits but never shorter: the selector chose this shape, so its own fields
|
|
8
|
+
* are the ones that have to fit.
|
|
9
|
+
*/
|
|
10
|
+
const assertCaseLength = (id, path, caseSpec, frameMinLengthBytes) => {
|
|
11
|
+
const declared = caseSpec.minLengthBytes;
|
|
12
|
+
if (declared === undefined) {
|
|
13
|
+
return frameMinLengthBytes;
|
|
14
|
+
}
|
|
15
|
+
if (!Number.isInteger(declared) || declared < frameMinLengthBytes) {
|
|
16
|
+
throw customDeviceError(id, `${path}.minLengthBytes`, `is ${String(declared)}; it must be a whole number of bytes no smaller than frame.minLengthBytes (${frameMinLengthBytes})`);
|
|
17
|
+
}
|
|
18
|
+
return declared;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* A frame that is a run of records, and how wide one is.
|
|
23
|
+
*
|
|
24
|
+
* The characteristic has to guarantee at least one whole record, otherwise a declaration
|
|
25
|
+
* whose fields all fit could still never decode anything.
|
|
26
|
+
*/
|
|
27
|
+
const assertRepeatedRecords = (id, path, caseSpec, frameMinLengthBytes) => {
|
|
28
|
+
const declared = caseSpec.repeatedRecords;
|
|
29
|
+
if (!declared) {
|
|
30
|
+
return undefined;
|
|
31
|
+
}
|
|
32
|
+
const from = declared.from ?? 0;
|
|
33
|
+
if (!Number.isInteger(declared.recordBytes) || declared.recordBytes < 1) {
|
|
34
|
+
throw customDeviceError(id, `${path}.repeatedRecords.recordBytes`, `is ${String(declared.recordBytes)}; a record is a whole number of bytes, at least one`);
|
|
35
|
+
}
|
|
36
|
+
if (!Number.isInteger(from) || from < 0) {
|
|
37
|
+
throw customDeviceError(id, `${path}.repeatedRecords.from`, `is ${String(declared.from)}; it must be a byte offset of zero or more`);
|
|
38
|
+
}
|
|
39
|
+
if (from + declared.recordBytes > frameMinLengthBytes) {
|
|
40
|
+
throw customDeviceError(id, `${path}.repeatedRecords`, `needs ${from + declared.recordBytes} bytes for one record, which frame.minLengthBytes (${frameMinLengthBytes}) does not guarantee`);
|
|
41
|
+
}
|
|
42
|
+
return {
|
|
43
|
+
recordBytes: declared.recordBytes,
|
|
44
|
+
from
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
export { assertCaseLength, assertRepeatedRecords };
|
|
48
|
+
//# sourceMappingURL=compile-case-shape.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["customDeviceError","assertCaseLength","id","path","caseSpec","frameMinLengthBytes","declared","minLengthBytes","undefined","Number","isInteger","String","assertRepeatedRecords","repeatedRecords","from","recordBytes"],"sourceRoot":"../../../../../../src","sources":["modules/bt-management/services/custom/compile-case-shape.ts"],"mappings":";;AAEA,SAASA,iBAAiB,QAAQ,0BAAuB;;AAEzD;AACA;AACA;AACA;AACA;AACA,MAAMC,gBAAgB,GAAGA,CACvBC,EAAU,EACVC,IAAY,EACZC,QAAwB,EACxBC,mBAA2B,KAChB;EACX,MAAMC,QAAQ,GAAGF,QAAQ,CAACG,cAAc;EAExC,IAAID,QAAQ,KAAKE,SAAS,EAAE;IAC1B,OAAOH,mBAAmB;EAC5B;EAEA,IAAI,CAACI,MAAM,CAACC,SAAS,CAACJ,QAAQ,CAAC,IAAIA,QAAQ,GAAGD,mBAAmB,EAAE;IACjE,MAAML,iBAAiB,CACrBE,EAAE,EACF,GAAGC,IAAI,iBAAiB,EACxB,MAAMQ,MAAM,CAACL,QAAQ,CAAC,8EAA8ED,mBAAmB,GACzH,CAAC;EACH;EAEA,OAAOC,QAAQ;AACjB,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA,MAAMM,qBAAqB,GAAGA,CAC5BV,EAAU,EACVC,IAAY,EACZC,QAAwB,EACxBC,mBAA2B,KAC2B;EACtD,MAAMC,QAAQ,GAAGF,QAAQ,CAACS,eAAe;EAEzC,IAAI,CAACP,QAAQ,EAAE;IACb,OAAOE,SAAS;EAClB;EAEA,MAAMM,IAAI,GAAGR,QAAQ,CAACQ,IAAI,IAAI,CAAC;EAE/B,IAAI,CAACL,MAAM,CAACC,SAAS,CAACJ,QAAQ,CAACS,WAAW,CAAC,IAAIT,QAAQ,CAACS,WAAW,GAAG,CAAC,EAAE;IACvE,MAAMf,iBAAiB,CACrBE,EAAE,EACF,GAAGC,IAAI,8BAA8B,EACrC,MAAMQ,MAAM,CAACL,QAAQ,CAACS,WAAW,CAAC,qDACpC,CAAC;EACH;EAEA,IAAI,CAACN,MAAM,CAACC,SAAS,CAACI,IAAI,CAAC,IAAIA,IAAI,GAAG,CAAC,EAAE;IACvC,MAAMd,iBAAiB,CACrBE,EAAE,EACF,GAAGC,IAAI,uBAAuB,EAC9B,MAAMQ,MAAM,CAACL,QAAQ,CAACQ,IAAI,CAAC,4CAC7B,CAAC;EACH;EAEA,IAAIA,IAAI,GAAGR,QAAQ,CAACS,WAAW,GAAGV,mBAAmB,EAAE;IACrD,MAAML,iBAAiB,CACrBE,EAAE,EACF,GAAGC,IAAI,kBAAkB,EACzB,SAASW,IAAI,GAAGR,QAAQ,CAACS,WAAW,sDAAsDV,mBAAmB,sBAC/G,CAAC;EACH;EAEA,OAAO;IAAEU,WAAW,EAAET,QAAQ,CAACS,WAAW;IAAED;EAAK,CAAC;AACpD,CAAC;AAED,SAASb,gBAAgB,EAAEW,qBAAqB","ignoreList":[]}
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
import { measurementFieldCatalog } from "../../constants/measurement-field-catalog.js";
|
|
4
4
|
import { CaseType } from "../../types/case-type.js";
|
|
5
5
|
import { assertRequiredFields, compileFields } from "./compile-case-fields.js";
|
|
6
|
+
import { assertCaseLength, assertRepeatedRecords } from "./compile-case-shape.js";
|
|
6
7
|
import { customDeviceError } from "./custom-device-error.js";
|
|
7
8
|
|
|
8
9
|
/**
|
|
@@ -58,6 +59,8 @@ const declaredMeasurements = (id, path, caseSpec, measurementTypeKey) => {
|
|
|
58
59
|
|
|
59
60
|
/** Validates one declared frame shape and turns it into a parsing case. */
|
|
60
61
|
export const compileCustomCase = (id, path, caseSpec, minLengthBytes, fields) => {
|
|
62
|
+
const caseMinLengthBytes = assertCaseLength(id, path, caseSpec, minLengthBytes);
|
|
63
|
+
const repeatedRecords = assertRepeatedRecords(id, path, caseSpec, minLengthBytes);
|
|
61
64
|
const caseType = CASE_TYPES[caseSpec.kind];
|
|
62
65
|
if (!caseType) {
|
|
63
66
|
throw customDeviceError(id, `${path}.kind`, `is "${String(caseSpec.kind)}"; expected ${Object.keys(CASE_TYPES).join(", ")}`);
|
|
@@ -99,7 +102,7 @@ export const compileCustomCase = (id, path, caseSpec, minLengthBytes, fields) =>
|
|
|
99
102
|
|
|
100
103
|
// Every field is checked first, so a misspelt property is reported as the typo it is
|
|
101
104
|
// rather than as the required property it failed to satisfy.
|
|
102
|
-
parseDefinitions.push(...compileFields(id, measurementPath, measurement.fields, key,
|
|
105
|
+
parseDefinitions.push(...compileFields(id, measurementPath, measurement.fields, key, repeatedRecords?.recordBytes ?? caseMinLengthBytes, fields, names));
|
|
103
106
|
assertRequiredFields(id, measurementPath, measurement.fields, key);
|
|
104
107
|
measurements.push({
|
|
105
108
|
measurementTypeKey: key,
|
|
@@ -112,7 +115,10 @@ export const compileCustomCase = (id, path, caseSpec, minLengthBytes, fields) =>
|
|
|
112
115
|
caseValue: String(caseSpec.selector ?? "").toLowerCase(),
|
|
113
116
|
parseDefinitions,
|
|
114
117
|
description: caseSpec.description,
|
|
115
|
-
measurements
|
|
118
|
+
measurements,
|
|
119
|
+
...(repeatedRecords ? {
|
|
120
|
+
repeatedRecords
|
|
121
|
+
} : {})
|
|
116
122
|
};
|
|
117
123
|
};
|
|
118
124
|
//# sourceMappingURL=compile-custom-case.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["measurementFieldCatalog","CaseType","assertRequiredFields","compileFields","customDeviceError","CASE_TYPES","result","DEPENDENT","stream","STREAM","idle","OTHER","assertMeasurementTypeKey","id","path","caseSpec","key","measurementTypeKey","undefined","kind","Object","keys","join","declaredMeasurements","additional","additionalMeasurements","Array","isArray","measurement","fields","map","index","compileCustomCase","minLengthBytes","caseType","String","declared","length","caseValue","selector","toLowerCase","parseDefinitions","description","names","Set","measurements","forEach","measurementPath","push","fieldNames","field","name"],"sourceRoot":"../../../../../../src","sources":["modules/bt-management/services/custom/compile-custom-case.ts"],"mappings":";;AAEA,SAASA,uBAAuB,QAAQ,8CAA2C;AACnF,SAASC,QAAQ,QAAQ,0BAAuB;AAQhD,SACEC,oBAAoB,EACpBC,aAAa,QACR,0BAAuB;AAC9B,SAASC,iBAAiB,QAAQ,0BAAuB;;AAEzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,UAAoD,GAAG;EAC3DC,MAAM,
|
|
1
|
+
{"version":3,"names":["measurementFieldCatalog","CaseType","assertRequiredFields","compileFields","assertCaseLength","assertRepeatedRecords","customDeviceError","CASE_TYPES","result","DEPENDENT","stream","STREAM","idle","OTHER","assertMeasurementTypeKey","id","path","caseSpec","key","measurementTypeKey","undefined","kind","Object","keys","join","declaredMeasurements","additional","additionalMeasurements","Array","isArray","measurement","fields","map","index","compileCustomCase","minLengthBytes","caseMinLengthBytes","repeatedRecords","caseType","String","declared","length","caseValue","selector","toLowerCase","parseDefinitions","description","names","Set","measurements","forEach","measurementPath","push","recordBytes","fieldNames","field","name"],"sourceRoot":"../../../../../../src","sources":["modules/bt-management/services/custom/compile-custom-case.ts"],"mappings":";;AAEA,SAASA,uBAAuB,QAAQ,8CAA2C;AACnF,SAASC,QAAQ,QAAQ,0BAAuB;AAQhD,SACEC,oBAAoB,EACpBC,aAAa,QACR,0BAAuB;AAC9B,SACEC,gBAAgB,EAChBC,qBAAqB,QAChB,yBAAsB;AAC7B,SAASC,iBAAiB,QAAQ,0BAAuB;;AAEzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,UAAoD,GAAG;EAC3DC,MAAM,EAAEP,QAAQ,CAACQ,SAAS;EAC1BC,MAAM,EAAET,QAAQ,CAACU,MAAM;EACvBC,IAAI,EAAEX,QAAQ,CAACY;AACjB,CAAC;AAED,MA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H,MAAM,CAACtB,QAAQ,CAAC0B,QAAQ,IAAI,EAAE,CAAC,CAACC,WAAW,CAAC,CAAC;IACxDC,gBAAgB;IAChBC,WAAW,EAAE7B,QAAQ,CAAC6B,WAAW;IACjCG,YAAY;IACZ,IAAIZ,eAAe,GAAG;MAAEA;IAAgB,CAAC,GAAG,CAAC,CAAC;EAChD,CAAC;AACH,CAAC","ignoreList":[]}
|
|
@@ -16,6 +16,9 @@ const assertByteIndexes = (id, path, field, minLengthBytes) => {
|
|
|
16
16
|
throw customDeviceError(id, `${path}.byteIndexes`, "reads the same byte twice");
|
|
17
17
|
}
|
|
18
18
|
const encoding = field.encoding ?? "uint";
|
|
19
|
+
if (encoding === "ascii" && field.byteOrder === "little") {
|
|
20
|
+
throw customDeviceError(id, `${path}.byteOrder`, 'is "little" on an "ascii" field; decimal digits read left to right, so reversing them would turn 120 into 21');
|
|
21
|
+
}
|
|
19
22
|
const required = WIDTHS[encoding];
|
|
20
23
|
if (required !== undefined && indexes.length !== required) {
|
|
21
24
|
throw customDeviceError(id, `${path}.encoding`, `"${encoding}" needs exactly ${required} bytes, but ${indexes.length} byte index(es) are declared`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["measurementFieldCatalog","customDeviceError","MAX_INTEGER_BYTES","WIDTHS","sfloat","float","assertByteIndexes","id","path","field","minLengthBytes","indexes","byteIndexes","Array","isArray","length","some","i","Number","isInteger","Set","size","encoding","required","undefined","outOfFrame","filter","assertArithmetic","scale","isFinite","offset","decimals","compileCustomField","measurementTypeKey","catalog","known","name","Object","keys","join","unit","min","max","
|
|
1
|
+
{"version":3,"names":["measurementFieldCatalog","customDeviceError","MAX_INTEGER_BYTES","WIDTHS","sfloat","float","assertByteIndexes","id","path","field","minLengthBytes","indexes","byteIndexes","Array","isArray","length","some","i","Number","isInteger","Set","size","encoding","byteOrder","required","undefined","outOfFrame","filter","assertArithmetic","scale","isFinite","offset","decimals","compileCustomField","measurementTypeKey","catalog","known","name","Object","keys","join","unit","min","max","reverse"],"sourceRoot":"../../../../../../src","sources":["modules/bt-management/services/custom/compile-custom-field.ts"],"mappings":";;AAEA,SAASA,uBAAuB,QAAQ,8CAA2C;AAInF,SAASC,iBAAiB,QAAQ,0BAAuB;AAEzD,MAAMC,iBAAiB,GAAG,CAAC;AAE3B,MAAMC,MAAgE,GAAG;EACvEC,MAAM,EAAE,CAAC;EACTC,KAAK,EAAE;AACT,CAAC;AAED,MAAMC,iBAAiB,GAAGA,CACxBC,EAAU,EACVC,IAAY,EACZC,KAAsB,EACtBC,cAAsB,KACb;EACT,MAAMC,OAAO,GAAGF,KAAK,CAACG,WAAW;EAEjC,IACE,CAACC,KAAK,CAACC,OAAO,CAACH,OAAO,CAAC,IACvBA,OAAO,CAACI,MAAM,KAAK,CAAC,IACpBJ,OAAO,CAACK,IAAI,CAAEC,CAAC,IAAK,CAACC,MAAM,CAACC,SAAS,CAACF,CAAC,CAAC,IAAIA,CAAC,GAAG,CAAC,CAAC,EAClD;IACA,MAAMhB,iBAAiB,CACrBM,EAAE,EACF,GAAGC,IAAI,cAAc,EACrB,0EACF,CAAC;EACH;EAEA,IAAI,IAAIY,GAAG,CAACT,OAAO,CAAC,CAACU,IAAI,KAAKV,OAAO,CAACI,MAAM,EAAE;IAC5C,MAAMd,iBAAiB,CACrBM,EAAE,EACF,GAAGC,IAAI,cAAc,EACrB,2BACF,CAAC;EACH;EAEA,MAAMc,QAAQ,GAAGb,KAAK,CAACa,QAAQ,IAAI,MAAM;EAEzC,IAAIA,QAAQ,KAAK,OAAO,IAAIb,KAAK,CAACc,SAAS,KAAK,QAAQ,EAAE;IACxD,MAAMtB,iBAAiB,CACrBM,EAAE,EACF,GAAGC,IAAI,YAAY,EACnB,8GACF,CAAC;EACH;EAEA,MAAMgB,QAAQ,GAAGrB,MAAM,CAACmB,QAAQ,CAAC;EAEjC,IAAIE,QAAQ,KAAKC,SAAS,IAAId,OAAO,CAACI,MAAM,KAAKS,QAAQ,EAAE;IACzD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QAAQ,CAACY,GAAG,CAAC,IAAI,CAACxB,MAAM,CAACY,QAAQ,CAACa,GAAG,CAAC,IAAID,GAAG,IAAIC,GAAG,EAAE;IAChE,MAAM1C,iBAAiB,CACrBM,EAAE,EACF,GAAGC,IAAI,EAAE,EACT,gBAAgBkC,GAAG,YAAYC,GAAG,yBACpC,CAAC;EACH;EAEA,IAAID,GAAG,GAAGN,KAAK,CAACM,GAAG,IAAIC,GAAG,GAAGP,KAAK,CAACO,GAAG,EAAE;IACtC,MAAM1C,iBAAiB,CACrBM,EAAE,EACF,GAAGC,IAAI,EAAE,EACT,YAAYkC,GAAG,IAAIC,GAAG,IAAIP,KAAK,CAACK,IAAI,6CAA6ChC,KAAK,CAAC4B,IAAI,KAAKD,KAAK,CAACM,GAAG,IAAIN,KAAK,CAACO,GAAG,IAAIP,KAAK,CAACK,IAAI,GACtI,CAAC;EACH;EAEA,MAAM9B,OAAO,GAAG,CAAC,GAAGF,KAAK,CAACG,WAAW,CAAC;EAEtC,OAAO;IACLyB,IAAI,EAAE5B,KAAK,CAAC4B,IAAI;IAChBzB,WAAW,EAAEH,KAAK,CAACc,SAAS,KAAK,QAAQ,GAAGZ,OAAO,CAACiC,OAAO,CAAC,CAAC,GAAGjC,OAAO;IACvEW,QAAQ,EAAEb,KAAK,CAACa,QAAQ,IAAI,MAAM;IAClCO,KAAK,EAAEpB,KAAK,CAACoB,KAAK,IAAI,CAAC;IACvBE,MAAM,EAAEtB,KAAK,CAACsB,MAAM,IAAI,CAAC;IACzBC,QAAQ,EAAEvB,KAAK,CAACuB,QAAQ;IACxBS,IAAI,EAAEL,KAAK,CAACK,IAAI;IAChBC,GAAG;IACHC;EACF,CAAC;AACH,CAAC","ignoreList":[]}
|
|
@@ -8,6 +8,8 @@ import { BP2Device } from "./devices/bp2/bp2.device.js";
|
|
|
8
8
|
import { CustomDevice } from "./devices/custom/custom.device.js";
|
|
9
9
|
import { F4Device } from "./devices/f4/f4.device.js";
|
|
10
10
|
import { SPO2Device } from "./devices/spo/spo2.device.js";
|
|
11
|
+
import { VerovalDuoControlDevice } from "./devices/veroval/veroval.duo-control-device.js";
|
|
12
|
+
import { VerovalEcgDevice } from "./devices/veroval/veroval.ecg-device.js";
|
|
11
13
|
|
|
12
14
|
/**
|
|
13
15
|
* The built-in names the SDK can actually build.
|
|
@@ -20,7 +22,9 @@ const DEVICE_CLASSES = {
|
|
|
20
22
|
[IntegratedDevices.BP2]: BP2Device,
|
|
21
23
|
[IntegratedDevices.F4]: F4Device,
|
|
22
24
|
[IntegratedDevices.PC60WF]: SPO2Device,
|
|
23
|
-
[IntegratedDevices.BC01]: BC01Device
|
|
25
|
+
[IntegratedDevices.BC01]: BC01Device,
|
|
26
|
+
[IntegratedDevices.VEROVAL_DUO_CONTROL]: VerovalDuoControlDevice,
|
|
27
|
+
[IntegratedDevices.VEROVAL_ECG]: VerovalEcgDevice
|
|
24
28
|
};
|
|
25
29
|
const collectCustomDevices = acceptedDevices => {
|
|
26
30
|
const customDevices = new Map();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["integratedDevicesMap","IntegratedDevices","isCustomDeviceDefinition","BC01Device","BP2Device","CustomDevice","F4Device","SPO2Device","DEVICE_CLASSES","BP2","F4","PC60WF","BC01","collectCustomDevices","acceptedDevices","customDevices","Map","matchers","Set","forEach","entry","index","Error","has","id","nameMatch","source","set","add","DeviceCreator","deviceNameCache","CACHE_MAX_SIZE","constructor","acceptedDeviceNames","getDeviceName","foundName","undefined","get","matched","matchDeviceName","cacheDeviceName","createDevice","params","String","deviceName","trim","device","name","custom","deviceClass","Object","keys","join","destroy","clear","regex","deviceType","test","some","values","size","firstKey","next","value","delete"],"sourceRoot":"../../../../../src","sources":["modules/bt-management/services/device-creator.ts"],"mappings":";;AAAA,SAASA,oBAAoB,QAAQ,wCAAqC;AAM1E,SAASC,iBAAiB,QAAQ,gCAA6B;AAC/D,SAASC,wBAAwB,QAAQ,yCAAsC;AAE/E,SAASC,UAAU,QAAQ,+BAA4B;AACvD,SAASC,SAAS,QAAQ,6BAA0B;AAEpD,SAASC,YAAY,QAAQ,mCAAgC;AAC7D,SAASC,QAAQ,QAAQ,2BAAwB;AACjD,SAASC,UAAU,QAAQ,8BAA2B;;
|
|
1
|
+
{"version":3,"names":["integratedDevicesMap","IntegratedDevices","isCustomDeviceDefinition","BC01Device","BP2Device","CustomDevice","F4Device","SPO2Device","VerovalDuoControlDevice","VerovalEcgDevice","DEVICE_CLASSES","BP2","F4","PC60WF","BC01","VEROVAL_DUO_CONTROL","VEROVAL_ECG","collectCustomDevices","acceptedDevices","customDevices","Map","matchers","Set","forEach","entry","index","Error","has","id","nameMatch","source","set","add","DeviceCreator","deviceNameCache","CACHE_MAX_SIZE","constructor","acceptedDeviceNames","getDeviceName","foundName","undefined","get","matched","matchDeviceName","cacheDeviceName","createDevice","params","String","deviceName","trim","device","name","custom","deviceClass","Object","keys","join","destroy","clear","regex","deviceType","test","some","values","size","firstKey","next","value","delete"],"sourceRoot":"../../../../../src","sources":["modules/bt-management/services/device-creator.ts"],"mappings":";;AAAA,SAASA,oBAAoB,QAAQ,wCAAqC;AAM1E,SAASC,iBAAiB,QAAQ,gCAA6B;AAC/D,SAASC,wBAAwB,QAAQ,yCAAsC;AAE/E,SAASC,UAAU,QAAQ,+BAA4B;AACvD,SAASC,SAAS,QAAQ,6BAA0B;AAEpD,SAASC,YAAY,QAAQ,mCAAgC;AAC7D,SAASC,QAAQ,QAAQ,2BAAwB;AACjD,SAASC,UAAU,QAAQ,8BAA2B;AACtD,SAASC,uBAAuB,QAAQ,iDAA8C;AACtF,SAASC,gBAAgB,QAAQ,yCAAsC;;AAEvE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,cAAc,GAAG;EACrB,CAACT,iBAAiB,CAACU,GAAG,GAAGP,SAAS;EAClC,CAACH,iBAAiB,CAACW,EAAE,GAAGN,QAAQ;EAChC,CAACL,iBAAiB,CAACY,MAAM,GAAGN,UAAU;EACtC,CAACN,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AS,EAAE;QAC1B,IAAI,CAACN,eAAe,CAACkC,MAAM,CAACH,QAAQ,CAAC;MACvC;IACF;IAEA,IAAI,CAAC/B,eAAe,CAACH,GAAG,CAACiB,UAAU,EAAEY,UAAU,CAAC;EAClD;AACF","ignoreList":[]}
|
|
@@ -87,6 +87,20 @@ export class BTCommandWriter {
|
|
|
87
87
|
}
|
|
88
88
|
};
|
|
89
89
|
|
|
90
|
+
/**
|
|
91
|
+
* Writes one chunk the way the characteristic accepts writes.
|
|
92
|
+
*
|
|
93
|
+
* A with-response write to a characteristic that only supports write-without-response
|
|
94
|
+
* fails outright, so the command says which it is rather than the transport guessing.
|
|
95
|
+
*/
|
|
96
|
+
writeTo = async (command, value) => {
|
|
97
|
+
if (command.withoutResponse) {
|
|
98
|
+
await this.device.writeCharacteristicWithoutResponseForService(command.serviceUuid, command.characteristicUuid, value);
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
await this.device.writeCharacteristicWithResponseForService(command.serviceUuid, command.characteristicUuid, value);
|
|
102
|
+
};
|
|
103
|
+
|
|
90
104
|
/**
|
|
91
105
|
* Splits a frame into writes the link will carry whole.
|
|
92
106
|
*
|
|
@@ -116,7 +130,7 @@ export class BTCommandWriter {
|
|
|
116
130
|
if (!isConnected) {
|
|
117
131
|
return false;
|
|
118
132
|
}
|
|
119
|
-
await this.
|
|
133
|
+
await this.writeTo(command, hexToBase64(chunk.join("")));
|
|
120
134
|
return true;
|
|
121
135
|
} catch (error) {
|
|
122
136
|
sentryLogger("error", "DEVICE: Error sending command", {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["slog","sentryLogger","hexToBase64","MAX_WRITE_ATTEMPTS","DEFAULT_ATT_MTU","ATT_WRITE_HEADER_BYTES","BTCommandWriter","pendingWrites","Promise","resolve","mtu","constructor","device","onError","useNegotiatedMtu","Number","isInteger","reset","send","commands","then","writeInOrder","catch","error","command","writeCommand","chunk","chunksOf","frame","written","writeChunk","size","Math","max","chunks","start","length","push","slice","attempt","isConnected","
|
|
1
|
+
{"version":3,"names":["slog","sentryLogger","hexToBase64","MAX_WRITE_ATTEMPTS","DEFAULT_ATT_MTU","ATT_WRITE_HEADER_BYTES","BTCommandWriter","pendingWrites","Promise","resolve","mtu","constructor","device","onError","useNegotiatedMtu","Number","isInteger","reset","send","commands","then","writeInOrder","catch","error","command","writeCommand","chunk","chunksOf","frame","written","writeChunk","writeTo","value","withoutResponse","writeCharacteristicWithoutResponseForService","serviceUuid","characteristicUuid","writeCharacteristicWithResponseForService","size","Math","max","chunks","start","length","push","slice","attempt","isConnected","join","Error","message","deviceName","name"],"sourceRoot":"../../../../../../src","sources":["modules/bt-management/services/devices/bt-command-writer.ts"],"mappings":";;AAEA,SAASA,IAAI,QAAQ,iCAA8B;AACnD,SAASC,YAAY,QAAQ,yCAAsC;AAEnE,SAASC,WAAW,QAAQ,+BAA4B;AAExD,MAAMC,kBAAkB,GAAG,CAAC;;AAE5B;AACA,MAAMC,eAAe,GAAG,EAAE;;AAE1B;AACA,MAAMC,sBAAsB,GAAG,CAAC;;AAEhC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,eAAe,CAAC;EACnBC,aAAa,GAAkBC,OAAO,CAACC,OAAO,CAAC,CAAC;EAChDC,GAAG,GAAGN,eAAe;EAEtBO,WAAWA,CACCC,MAAc,EACdC,OAA2C,EAC5D;IAAA,KAFiBD,MAAc,GAAdA,MAAc;IAAA,KACdC,OAA2C,GAA3CA,OAA2C;EAC3D;;EAEH;AACF;AACA;AACA;AACA;AACA;AACA;EACSC,gBAAgB,GAAIJ,GAAY,IAAW;IAChD,IAAI,OAAOA,GAAG,KAAK,QAAQ,IAAIK,MAAM,CAACC,SAAS,CAACN,GAAG,CAAC,IAAIA,GAAG,GAAG,IAAI,CAACA,GAAG,EAAE;MACtE,IAAI,CAACA,GAAG,GAAGA,GAAG;IAChB;EACF,CAAC;;EAED;EACOO,KAAK,GAAGA,CAAA,KAAY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E;UAClCH,IAAI,CAACuB,KAAK,EAAE,8CAA8C,EAAE;YAC1D4B,UAAU,EAAE,IAAI,CAACvC,MAAM,CAACwC;UAC1B,CAAC,CAAC;QACJ;MACF;IACF;IAEA,OAAO,KAAK;EACd,CAAC;AACH","ignoreList":[]}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
import { sentryLogger } from "../../../../helpers/utils/sentry-logger.js";
|
|
3
4
|
import { LepuCommandBuilder } from "../lepu/lepu.command-builder.js";
|
|
4
5
|
import { LepuIdentityGate } from "../lepu/lepu.identity-gate.js";
|
|
5
6
|
|
|
@@ -16,7 +17,24 @@ const DEFAULT_START_BYTE = "a5";
|
|
|
16
17
|
* answers on the one it is addressed with, so the list matters for reading and its head for
|
|
17
18
|
* writing.
|
|
18
19
|
*/
|
|
19
|
-
|
|
20
|
+
/**
|
|
21
|
+
* Records what the device said it was.
|
|
22
|
+
*
|
|
23
|
+
* The model number is logged because it is the only place one exists: the vendor's SDK
|
|
24
|
+
* never reads the field back, so a declaration written without it is completed by
|
|
25
|
+
* connecting once and reading this line.
|
|
26
|
+
*/
|
|
27
|
+
const recordLepuIdentity = (deviceData, info) => {
|
|
28
|
+
deviceData.sn = info.serialNumber;
|
|
29
|
+
sentryLogger("info", "BT_MANAGER: Device identified itself", {
|
|
30
|
+
deviceId: deviceData.id,
|
|
31
|
+
deviceName: deviceData.name,
|
|
32
|
+
deviceType: info.deviceType,
|
|
33
|
+
branchCode: info.branchCode,
|
|
34
|
+
protocolMaxLength: info.protocolMaxLength
|
|
35
|
+
});
|
|
36
|
+
};
|
|
37
|
+
const createLepuSequencer = (lepu, report) => new LepuIdentityGate({
|
|
20
38
|
write: {
|
|
21
39
|
serviceUuid: lepu.write.serviceUuid,
|
|
22
40
|
characteristicUuid: lepu.write.characteristicUuid
|
|
@@ -29,4 +47,5 @@ export const createLepuSequencer = (lepu, report) => new LepuIdentityGate({
|
|
|
29
47
|
onIdentified: report.onIdentified,
|
|
30
48
|
onRefused: report.onRefused
|
|
31
49
|
});
|
|
50
|
+
export { createLepuSequencer, recordLepuIdentity };
|
|
32
51
|
//# sourceMappingURL=custom-lepu-sequencer.js.map
|
package/lib/module/modules/bt-management/services/devices/custom/custom-lepu-sequencer.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["LepuCommandBuilder","LepuIdentityGate","DEFAULT_START_BYTE","createLepuSequencer","lepu","report","write","serviceUuid","characteristicUuid","builder","startBytes","expectedDeviceTypes","pollCommand","undefined","onIdentified","onRefused"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/custom/custom-lepu-sequencer.ts"],"mappings":";;
|
|
1
|
+
{"version":3,"names":["sentryLogger","LepuCommandBuilder","LepuIdentityGate","DEFAULT_START_BYTE","recordLepuIdentity","deviceData","info","sn","serialNumber","deviceId","id","deviceName","name","deviceType","branchCode","protocolMaxLength","createLepuSequencer","lepu","report","write","serviceUuid","characteristicUuid","builder","startBytes","expectedDeviceTypes","pollCommand","undefined","onIdentified","onRefused"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/custom/custom-lepu-sequencer.ts"],"mappings":";;AAAA,SAASA,YAAY,QAAQ,4CAAyC;AAItE,SAASC,kBAAkB,QAAQ,iCAA8B;AAEjE,SAASC,gBAAgB,QAAQ,+BAA4B;;AAE7D;AACA,MAAMC,kBAAkB,GAAG,IAAI;AAO/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,kBAAkB,GAAGA,CACzBC,UAAsB,EACtBC,IAAoB,KACX;EACTD,UAAU,CAACE,EAAE,GAAGD,IAAI,CAACE,YAAY;EAEjCR,YAAY,CAAC,MAAM,EAAE,sCAAsC,EAAE;IAC3DS,QAAQ,EAAEJ,UAAU,CAACK,EAAE;IACvBC,UAAU,EAAEN,UAAU,CAACO,IAAI;IAC3BC,UAAU,EAAEP,IAAI,CAACO,UAAU;IAC3BC,UAAU,EAAER,IAAI,CAACQ,UAAU;IAC3BC,iBAAiB,EAAET,IAAI,CAACS;EAC1B,CAAC,CAAC;AACJ,CAAC;AAED,MAAMC,mBAAmB,GAAGA,CAC1BC,IAAoB,EACpBC,MAAsB,KAEtB,IAAIhB,gBAAgB,CAAC;EACnBiB,KAAK,EAAE;IACLC,WAAW,EAAEH,IAAI,CAACE,KAAK,CAACC,WAAW;IACnCC,kBAAkB,EAAEJ,IAAI,CAACE,KAAK,CAACE;EACjC,CAAC;EACDC,OAAO,EAAE,IAAIrB,kBAAkB,CAACgB,IAAI,CAACM,UAAU,CAAC,CAAC,CAAC,IAAIpB,kBAAkB,CAAC;EACzEqB,mBAAmB,EAAEP,IAAI,CAACO,mBAAmB;EAC7C,IAAIP,IAAI,CAACQ,WAAW,KAAKC,SAAS,GAAG,CAAC,CAAC,GAAG;IAAED,WAAW,EAAER,IAAI,CAACQ;EAAY,CAAC,CAAC;EAC5EE,YAAY,EAAET,MAAM,CAACS,YAAY;EACjCC,SAAS,EAAEV,MAAM,CAACU;AACpB,CAAC,CAAC;AAEJ,SAASZ,mBAAmB,EAAEZ,kBAAkB","ignoreList":[]}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import { sentryLogger } from "../../../../helpers/utils/sentry-logger.js";
|
|
4
3
|
import { CaseType } from "../../../types/case-type.js";
|
|
5
4
|
import { createFrameValidator } from "../../../utils/create-frame-validator.js";
|
|
5
|
+
import { parseMeasurement } from "../../../utils/parse-measurement.js";
|
|
6
|
+
import { discardedReadingError, rejectCustomReading } from "../../../utils/reject-custom-reading.js";
|
|
6
7
|
import { BTManagedDevice } from "../bt-managed-device.js";
|
|
7
8
|
import { LepuFrameReader } from "../lepu/lepu.frame-reader.js";
|
|
8
|
-
import { createLepuSequencer } from "./custom-lepu-sequencer.js";
|
|
9
|
+
import { createLepuSequencer, recordLepuIdentity } from "./custom-lepu-sequencer.js";
|
|
9
10
|
/**
|
|
10
11
|
* Runs a device registered with defineCustomDevice.
|
|
11
12
|
*
|
|
@@ -49,29 +50,7 @@ export class CustomDevice extends BTManagedDevice {
|
|
|
49
50
|
onRefused: this.onIdentityRefused
|
|
50
51
|
});
|
|
51
52
|
}
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
* Records what the device said it was.
|
|
55
|
-
*
|
|
56
|
-
* The model number is logged because it is the only place one exists: the vendor's SDK
|
|
57
|
-
* never reads the field back, so a declaration written without it is completed by
|
|
58
|
-
* connecting once and reading this line.
|
|
59
|
-
*/
|
|
60
|
-
onIdentified = info => {
|
|
61
|
-
this.deviceData.sn = info.serialNumber;
|
|
62
|
-
sentryLogger("info", "BT_MANAGER: Device identified itself", {
|
|
63
|
-
deviceId: this.deviceData.id,
|
|
64
|
-
deviceName: this.deviceData.name,
|
|
65
|
-
deviceType: info.deviceType,
|
|
66
|
-
branchCode: info.branchCode,
|
|
67
|
-
protocolMaxLength: info.protocolMaxLength
|
|
68
|
-
});
|
|
69
|
-
};
|
|
70
|
-
|
|
71
|
-
/**
|
|
72
|
-
* Nothing is sent to a device that could not be identified, because the same opcode means
|
|
73
|
-
* different things on different models in this family.
|
|
74
|
-
*/
|
|
53
|
+
onIdentified = info => recordLepuIdentity(this.deviceData, info);
|
|
75
54
|
onIdentityRefused = reason => {
|
|
76
55
|
this.onError?.(new Error(`Custom device "${this.definition.id}" was not addressed: ${reason}.`));
|
|
77
56
|
};
|
|
@@ -90,7 +69,7 @@ export class CustomDevice extends BTManagedDevice {
|
|
|
90
69
|
*/
|
|
91
70
|
handleDependentResult = data => {
|
|
92
71
|
try {
|
|
93
|
-
this.
|
|
72
|
+
this.reportFrame(data);
|
|
94
73
|
} catch (error) {
|
|
95
74
|
this.onError?.(error);
|
|
96
75
|
}
|
|
@@ -111,6 +90,26 @@ export class CustomDevice extends BTManagedDevice {
|
|
|
111
90
|
return;
|
|
112
91
|
}
|
|
113
92
|
|
|
93
|
+
/**
|
|
94
|
+
* Reports what the frame carried, which may be more than one reading.
|
|
95
|
+
*
|
|
96
|
+
* A device handing over its stored history answers one request with every record it
|
|
97
|
+
* holds, back to back. Those were taken at different times and are separate readings, so
|
|
98
|
+
* each record is decoded and reported on its own. A trailing part-record is ignored: half
|
|
99
|
+
* a record is not a reading.
|
|
100
|
+
*/
|
|
101
|
+
reportFrame(data) {
|
|
102
|
+
const repeated = data.parsingCase.repeatedRecords;
|
|
103
|
+
if (!repeated || !data.frame) {
|
|
104
|
+
this.report(data.parsedData, data.parsingCase);
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
const records = Math.floor((data.frame.length - repeated.from) / repeated.recordBytes);
|
|
108
|
+
for (let record = 0; record < records; record++) {
|
|
109
|
+
this.report(parseMeasurement(data.frame, data.parsingCase, repeated.from + record * repeated.recordBytes), data.parsingCase);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
114
113
|
/**
|
|
115
114
|
* Reports every reading the frame carried.
|
|
116
115
|
*
|
|
@@ -125,11 +124,14 @@ export class CustomDevice extends BTManagedDevice {
|
|
|
125
124
|
report(parsedData, parsingCase) {
|
|
126
125
|
const measurements = parsingCase.measurements ?? [];
|
|
127
126
|
if (measurements.length === 0) {
|
|
128
|
-
this.
|
|
127
|
+
this.discard("a result frame carries no measurement type", parsedData);
|
|
129
128
|
return;
|
|
130
129
|
}
|
|
131
130
|
measurements.forEach(measurement => this.reportMeasurement(parsedData, measurement));
|
|
132
131
|
}
|
|
132
|
+
discard(reason, parsedData) {
|
|
133
|
+
this.onError?.(discardedReadingError(this.definition.id, reason, parsedData));
|
|
134
|
+
}
|
|
133
135
|
reportMeasurement(parsedData, measurement) {
|
|
134
136
|
const reading = {
|
|
135
137
|
caseType: parsedData.caseType,
|
|
@@ -138,28 +140,12 @@ export class CustomDevice extends BTManagedDevice {
|
|
|
138
140
|
measurement.fieldNames.forEach(name => {
|
|
139
141
|
reading[name] = parsedData[name];
|
|
140
142
|
});
|
|
141
|
-
const rejection = measurement.fieldNames.map(name => this.
|
|
143
|
+
const rejection = measurement.fieldNames.map(name => rejectCustomReading(this.definition.fields, measurement.measurementTypeKey, name, reading[name])).find(message => message !== undefined);
|
|
142
144
|
if (rejection) {
|
|
143
|
-
this.
|
|
145
|
+
this.discard(rejection, reading);
|
|
144
146
|
return;
|
|
145
147
|
}
|
|
146
148
|
this.onResult?.(reading);
|
|
147
149
|
}
|
|
148
|
-
reject(measurementTypeKey, name, value) {
|
|
149
|
-
const field = this.definition.fields.get(`${measurementTypeKey}:${name}`);
|
|
150
|
-
if (!field) {
|
|
151
|
-
return `decoded "${name}", which is not declared for ${measurementTypeKey}`;
|
|
152
|
-
}
|
|
153
|
-
if (typeof value !== "number" || !Number.isFinite(value)) {
|
|
154
|
-
return `could not decode ${name}; the frame was shorter than the declaration expects`;
|
|
155
|
-
}
|
|
156
|
-
if (value < field.min || value > field.max) {
|
|
157
|
-
return `decoded ${name} = ${value} ${field.unit}, outside the accepted range ${field.min}-${field.max} ${field.unit}`;
|
|
158
|
-
}
|
|
159
|
-
return undefined;
|
|
160
|
-
}
|
|
161
|
-
fail(reason, parsedData) {
|
|
162
|
-
this.onError?.(new Error(`Custom device "${this.definition.id}": ${reason}. The reading was discarded (decoded ${JSON.stringify(parsedData)}).`));
|
|
163
|
-
}
|
|
164
150
|
}
|
|
165
151
|
//# sourceMappingURL=custom.device.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["CaseType","createFrameValidator","parseMeasurement","discardedReadingError","rejectCustomReading","BTManagedDevice","LepuFrameReader","createLepuSequencer","recordLepuIdentity","CustomDevice","validators","Map","constructor","device","params","definition","mainServices","stuckDataTimeout","preferredMtu","undefined","declareLepuProtocol","frames","forEach","frame","uuid","set","lepu","frameReader","startBytes","createCommandSequencer","onIdentified","onRefused","onIdentityRefused","info","deviceData","reason","onError","Error","id","validatePackage","pkg","validate","get","String","toLowerCase","handleDependentResult","data","reportFrame","error","parsingCase","caseType","OTHER","handleSuccessResult","repeated","repeatedRecords","report","parsedData","records","Math","floor","length","from","recordBytes","record","measurements","discard","measurement","reportMeasurement","reading","measurementTypeKey","fieldNames","name","rejection","map","fields","find","message","onResult"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/custom/custom.device.ts"],"mappings":";;AAEA,SAASA,QAAQ,QAAQ,6BAA0B;AAUnD,SAASC,oBAAoB,QAAQ,0CAAuC;AAC5E,SAASC,gBAAgB,QAAQ,qCAAkC;AACnE,SACEC,qBAAqB,EACrBC,mBAAmB,QACd,yCAAsC;AAC7C,SAASC,eAAe,QAAQ,yBAAsB;AAEtD,SAASC,eAAe,QAAQ,8BAA2B;AAE3D,SACEC,mBAAmB,EACnBC,kBAAkB,QACb,4BAAyB;AAKhC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,YAAY,SAASJ,eAAe,CAAiB;EAM/CK,UAAU,GAAG,IAAIC,GAAG,CAAqC,CAAC;EAE3EC,WAAWA,CACTC,MAAc,EACdC,MAA0C,EAC1CC,UAAkC,EAClC;IACA,KAAK,CAACF,MAAM,EAAEC,MAAM,CAAC;IAErB,IAAI,CAACC,UAAU,GAAGA,UAAU;IAC5B,IAAI,CAACC,YAAY,GAAGD,UAAU,CAACC,YAAY;IAC3C,IAAI,CAACC,gBAAgB,GAAGF,UAAU,CAACE,gBAAgB;IAEnD,IAAIF,UAAU,CAACG,YAAY,KAAKC,SAAS,EAAE;MACzC,IAAI,CAACD,YAAY,GAAGH,UAAU,CAACG,YAAY;IAC7C;IAEA,IAAI,CAACE,mBAAmB,CAACL,UAAU,CAAC;IAEpCA,UAAU,CAACM,MAAM,CAACC,OAAO,CAAC,CAACC,KAAK,EAAEC,IAAI,KAAK;MACzC,IAAI,CAACd,UAAU,CAACe,GAAG,CAACD,IAAI,EAAEvB,oBAAoB,CAACsB,KAAK,CAAC,CAAC;IACx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