@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
package/lib/commonjs/modules/bt-management/services/devices/veroval/veroval.duo-control-device.js
ADDED
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.VerovalDuoControlDevice = void 0;
|
|
7
|
+
var _core = require("@ovok/core");
|
|
8
|
+
var _defineCustomDevice = require("../../custom/define-custom-device.js");
|
|
9
|
+
var _customDevice = require("../custom/custom.device.js");
|
|
10
|
+
var _sentinelFrameReader = require("../sentinel-frame-reader.js");
|
|
11
|
+
var _verovalDuoControlSequencer = require("./veroval.duo-control-sequencer.js");
|
|
12
|
+
const SERVICE = "5d4b8aa6-a26a-4a1b-99f5-cd4473c786e3";
|
|
13
|
+
const NOTIFY = "5d4b8aa6-a26a-4a1b-99f5-cd4473c786e4";
|
|
14
|
+
const WRITE = "5d4b8aa6-a26a-4a1b-99f5-cd4473c786e5";
|
|
15
|
+
const STX = "02";
|
|
16
|
+
const ETX = "03";
|
|
17
|
+
const ACK = "06";
|
|
18
|
+
const NAK = "15";
|
|
19
|
+
|
|
20
|
+
/** One stored measurement, as the device writes it: twenty-six characters. */
|
|
21
|
+
const RECORD_BYTES = 26;
|
|
22
|
+
|
|
23
|
+
/** A reply opens by echoing the four-character command it answers. */
|
|
24
|
+
const TAG_BYTES = 4;
|
|
25
|
+
|
|
26
|
+
/** `?MDR`, the reply carrying stored records. */
|
|
27
|
+
const DATA_REPLY = "3f4d4452";
|
|
28
|
+
|
|
29
|
+
/** `?MRN`, the reply carrying a record count. The sequencer reads it; no reading comes of it. */
|
|
30
|
+
const COUNT_REPLY = "3f4d524e";
|
|
31
|
+
|
|
32
|
+
/** Two memories of a hundred records each, plus the echo, with room to spare. */
|
|
33
|
+
const MAX_REPLY_BYTES = 8_192;
|
|
34
|
+
|
|
35
|
+
/** The device sleeps between measurements, so it is given a while to answer. */
|
|
36
|
+
const STUCK_TIMEOUT_MS = 120_000;
|
|
37
|
+
const asciiField = (name, from, unit) => ({
|
|
38
|
+
name,
|
|
39
|
+
byteIndexes: [from, from + 1, from + 2],
|
|
40
|
+
encoding: "ascii",
|
|
41
|
+
unit
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* The record layout, read from HARTMANN's own application.
|
|
46
|
+
*
|
|
47
|
+
* Offsets are relative to a record, and every field is decimal digits written as text. The
|
|
48
|
+
* timestamp at the front of each record is not declared: the SDK stamps a reading when it
|
|
49
|
+
* arrives, and a stored record's own clock would need the device's timezone to be
|
|
50
|
+
* meaningful.
|
|
51
|
+
*/
|
|
52
|
+
const duoControlDefinition = (0, _defineCustomDevice.defineCustomDevice)({
|
|
53
|
+
id: "veroval-duo-control",
|
|
54
|
+
nameMatch: /^Veroval duo control$/i,
|
|
55
|
+
stuckDataTimeoutMs: STUCK_TIMEOUT_MS,
|
|
56
|
+
services: [{
|
|
57
|
+
uuid: SERVICE,
|
|
58
|
+
monitor: [{
|
|
59
|
+
uuid: NOTIFY,
|
|
60
|
+
frame: {
|
|
61
|
+
minLengthBytes: TAG_BYTES + RECORD_BYTES
|
|
62
|
+
},
|
|
63
|
+
caseSelectorBytes: [0, 1, 2, 3],
|
|
64
|
+
cases: [{
|
|
65
|
+
selector: DATA_REPLY,
|
|
66
|
+
kind: "result",
|
|
67
|
+
measurementTypeKey: _core.MeasurementTypeKey.bloodPressure,
|
|
68
|
+
description: "Stored measurements, one record each",
|
|
69
|
+
repeatedRecords: {
|
|
70
|
+
recordBytes: RECORD_BYTES,
|
|
71
|
+
from: TAG_BYTES
|
|
72
|
+
},
|
|
73
|
+
fields: [asciiField("systolic", 11, "mmHg"), asciiField("diastolic", 14, "mmHg"), asciiField("heartRate", 17, "bpm")]
|
|
74
|
+
}, {
|
|
75
|
+
selector: COUNT_REPLY,
|
|
76
|
+
kind: "idle",
|
|
77
|
+
description: "How many records a memory holds"
|
|
78
|
+
}]
|
|
79
|
+
}]
|
|
80
|
+
}]
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* The Veroval duo control.
|
|
85
|
+
*
|
|
86
|
+
* A device class rather than a declaration, because reading it is a conversation: the two
|
|
87
|
+
* user memories are asked in turn, and the device answers with bare control bytes as often
|
|
88
|
+
* as with payload. The decoding is still declared - the class supplies the framing and the
|
|
89
|
+
* walk, and nothing else.
|
|
90
|
+
*
|
|
91
|
+
* Readings are stored measurements, not live ones. The device hands over its history when
|
|
92
|
+
* asked, so what arrives was taken before the connection and may be days old.
|
|
93
|
+
*/
|
|
94
|
+
class VerovalDuoControlDevice extends _customDevice.CustomDevice {
|
|
95
|
+
constructor(device, params) {
|
|
96
|
+
super(device, params, duoControlDefinition);
|
|
97
|
+
this.frameReader = new _sentinelFrameReader.SentinelFrameReader({
|
|
98
|
+
start: STX,
|
|
99
|
+
terminator: ETX,
|
|
100
|
+
maxFrameBytes: MAX_REPLY_BYTES,
|
|
101
|
+
standaloneBytes: [ACK, NAK]
|
|
102
|
+
});
|
|
103
|
+
this.createCommandSequencer = () => new _verovalDuoControlSequencer.VerovalDuoControlSequencer({
|
|
104
|
+
write: {
|
|
105
|
+
serviceUuid: SERVICE,
|
|
106
|
+
characteristicUuid: WRITE
|
|
107
|
+
},
|
|
108
|
+
onRefused: reason => this.onError?.(new Error(`Veroval duo control: ${reason}.`))
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
exports.VerovalDuoControlDevice = VerovalDuoControlDevice;
|
|
113
|
+
//# sourceMappingURL=veroval.duo-control-device.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_core","require","_defineCustomDevice","_customDevice","_sentinelFrameReader","_verovalDuoControlSequencer","SERVICE","NOTIFY","WRITE","STX","ETX","ACK","NAK","RECORD_BYTES","TAG_BYTES","DATA_REPLY","COUNT_REPLY","MAX_REPLY_BYTES","STUCK_TIMEOUT_MS","asciiField","name","from","unit","byteIndexes","encoding","duoControlDefinition","defineCustomDevice","id","nameMatch","stuckDataTimeoutMs","services","uuid","monitor","frame","minLengthBytes","caseSelectorBytes","cases","selector","kind","measurementTypeKey","MeasurementTypeKey","bloodPressure","description","repeatedRecords","recordBytes","fields","VerovalDuoControlDevice","CustomDevice","constructor","device","params","frameReader","SentinelFrameReader","start","terminator","maxFrameBytes","standaloneBytes","createCommandSequencer","VerovalDuoControlSequencer","write","serviceUuid","characteristicUuid","onRefused","reason","onError","Error","exports"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/veroval/veroval.duo-control-device.ts"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AAKA,IAAAC,mBAAA,GAAAD,OAAA;AACA,IAAAE,aAAA,GAAAF,OAAA;AACA,IAAAG,oBAAA,GAAAH,OAAA;AAEA,IAAAI,2BAAA,GAAAJ,OAAA;AAEA,MAAMK,OAAO,GAAG,sCAAsC;AACtD,MAAMC,MAAM,GAAG,sCAAsC;AACrD,MAAMC,KAAK,GAAG,sCAAsC;AAEpD,MAAMC,GAAG,GAAG,IAAI;AAChB,MAAMC,GAAG,GAAG,IAAI;AAChB,MAAMC,GAAG,GAAG,IAAI;AAChB,MAAMC,GAAG,GAAG,IAAI;;AAEhB;AACA,MAAMC,YAAY,GAAG,EAAE;;AAEvB;AACA,MAAMC,SAAS,GAAG,CAAC;;AAEnB;AACA,MAAMC,UAAU,GAAG,UAAU;;AAE7B;AACA,MAAMC,WAAW,GAAG,UAAU;;AAE9B;AACA,MAAMC,eAAe,GAAG,KAAK;;AAE7B;AACA,MAAMC,gBAAgB,GAAG,OAAO;AAEhC,MAAMC,UAAU,GAAGA,CAACC,IAAY,EAAEC,IAAY,EAAEC,IAAY,MAAM;EAChEF,IAAI;EACJG,WAAW,EAAE,CAACF,IAAI,EAAEA,IAAI,GAAG,CAAC,EAAEA,IAAI,GAAG,CAAC,CAAC;EACvCG,QAAQ,EAAE,OAAgB;EAC1BF;AACF,CAAC,CAA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AmB,CAAC;MACzCC,KAAK,EAAE5C,GAAG;MACV6C,UAAU,EAAE5C,GAAG;MACf6C,aAAa,EAAEtC,eAAe;MAC9BuC,eAAe,EAAE,CAAC7C,GAAG,EAAEC,GAAG;IAC5B,CAAC,CAAC;IAEF,IAAI,CAAC6C,sBAAsB,GAAG,MAC5B,IAAIC,sDAA0B,CAAC;MAC7BC,KAAK,EAAE;QAAEC,WAAW,EAAEtD,OAAO;QAAEuD,kBAAkB,EAAErD;MAAM,CAAC;MAC1DsD,SAAS,EAAGC,MAAM,IAChB,IAAI,CAACC,OAAO,GAAG,IAAIC,KAAK,CAAC,wBAAwBF,MAAM,GAAG,CAAC;IAC/D,CAAC,CAAC;EACN;AACF;AAACG,OAAA,CAAApB,uBAAA,GAAAA,uBAAA","ignoreList":[]}
|
package/lib/commonjs/modules/bt-management/services/devices/veroval/veroval.duo-control-sequencer.js
ADDED
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.VerovalDuoControlSequencer = void 0;
|
|
7
|
+
var _hexToByte = require("../../../utils/hex-to-byte.js");
|
|
8
|
+
/** The control bytes of the serial protocol this device speaks over BLE. */
|
|
9
|
+
const ACK = 0x06;
|
|
10
|
+
const NAK = 0x15;
|
|
11
|
+
const ENQ = "05";
|
|
12
|
+
|
|
13
|
+
/** The device holds two user memories, and each is asked for a count and then its data. */
|
|
14
|
+
const STEPS = ["?MRN1", "?MDR1A", "?MRN2", "?MDR2A"];
|
|
15
|
+
|
|
16
|
+
/** A reply echoes the four-character command it answers, after the byte the reader strips. */
|
|
17
|
+
const TAG_FROM = 0;
|
|
18
|
+
const TAG_BYTES = 4;
|
|
19
|
+
const COUNT_BYTES = 3;
|
|
20
|
+
const ASCII_ZERO = 0x30;
|
|
21
|
+
const ASCII_NINE = 0x39;
|
|
22
|
+
const asciiOf = (frame, from, count) => frame.slice(from, from + count).map(byte => String.fromCharCode((0, _hexToByte.hexToByte)(byte))).join("");
|
|
23
|
+
const asciiNumberOf = (frame, from, count) => {
|
|
24
|
+
const codes = frame.slice(from, from + count).map(byte => (0, _hexToByte.hexToByte)(byte));
|
|
25
|
+
if (codes.length !== count || codes.some(code => code < ASCII_ZERO || code > ASCII_NINE)) {
|
|
26
|
+
return undefined;
|
|
27
|
+
}
|
|
28
|
+
return Number(codes.map(code => code - ASCII_ZERO).join(""));
|
|
29
|
+
};
|
|
30
|
+
const asciiCommand = (write, text) => ({
|
|
31
|
+
...write,
|
|
32
|
+
frame: [...text].map(character => character.charCodeAt(0).toString(16).padStart(2, "0")),
|
|
33
|
+
withoutResponse: true
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Walks the Veroval duo control through its stored history.
|
|
38
|
+
*
|
|
39
|
+
* The device answers one request at a time and holds two user memories, so the exchange is
|
|
40
|
+
* a fixed walk: ask user one how many records it has, read them, then user two. A memory
|
|
41
|
+
* that reports none is skipped rather than read.
|
|
42
|
+
*
|
|
43
|
+
* Two of its replies are not payload at all. A bare `ACK` means the device has more to send
|
|
44
|
+
* and is waiting to be asked, which is what `ENQ` does - so an acknowledgement provokes an
|
|
45
|
+
* enquiry rather than advancing the walk. A bare `NAK` is a refusal and ends it.
|
|
46
|
+
*
|
|
47
|
+
* Everything here is derived from HARTMANN's own application. The one part that is an
|
|
48
|
+
* inference rather than a reading is `ENQ` as flow control: the app writes it on receiving
|
|
49
|
+
* `ACK`, which is what that pair means in the serial protocol this is descended from, but
|
|
50
|
+
* the pacing was not observed on hardware.
|
|
51
|
+
*/
|
|
52
|
+
class VerovalDuoControlSequencer {
|
|
53
|
+
step = 0;
|
|
54
|
+
isDone = false;
|
|
55
|
+
constructor(params) {
|
|
56
|
+
this.params = params;
|
|
57
|
+
}
|
|
58
|
+
initialCommands = () => [this.commandFor(0)];
|
|
59
|
+
nextCommand = frame => {
|
|
60
|
+
if (this.isDone) {
|
|
61
|
+
return undefined;
|
|
62
|
+
}
|
|
63
|
+
if (frame.length === 1) {
|
|
64
|
+
return this.answerControlByte((0, _hexToByte.hexToByte)(frame[0] ?? "0"));
|
|
65
|
+
}
|
|
66
|
+
const tag = asciiOf(frame, TAG_FROM, TAG_BYTES);
|
|
67
|
+
if (tag === "?MRN") {
|
|
68
|
+
return this.answerCount(frame);
|
|
69
|
+
}
|
|
70
|
+
return tag === "?MDR" ? this.advance() : undefined;
|
|
71
|
+
};
|
|
72
|
+
answerControlByte = code => {
|
|
73
|
+
if (code === ACK) {
|
|
74
|
+
return [asciiCommandFromHex(this.params.write, ENQ)];
|
|
75
|
+
}
|
|
76
|
+
if (code === NAK) {
|
|
77
|
+
return this.stop("the device refused the request");
|
|
78
|
+
}
|
|
79
|
+
return undefined;
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* A memory reporting no records is skipped. Asking for the data of an empty memory is a
|
|
84
|
+
* request the device answers with nothing, which would stall the walk on its own reply.
|
|
85
|
+
*/
|
|
86
|
+
answerCount = frame => {
|
|
87
|
+
const count = asciiNumberOf(frame, TAG_BYTES, COUNT_BYTES);
|
|
88
|
+
if (count === undefined) {
|
|
89
|
+
return this.stop("the device answered a record count that was not a number");
|
|
90
|
+
}
|
|
91
|
+
return count > 0 ? this.advance() : this.skipMemory();
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
/** Past this memory's data command, to the next memory's count. */
|
|
95
|
+
skipMemory = () => {
|
|
96
|
+
this.step += 1;
|
|
97
|
+
return this.advance();
|
|
98
|
+
};
|
|
99
|
+
advance = () => {
|
|
100
|
+
this.step += 1;
|
|
101
|
+
if (this.step >= STEPS.length) {
|
|
102
|
+
this.isDone = true;
|
|
103
|
+
return undefined;
|
|
104
|
+
}
|
|
105
|
+
return [this.commandFor(this.step)];
|
|
106
|
+
};
|
|
107
|
+
stop = reason => {
|
|
108
|
+
this.isDone = true;
|
|
109
|
+
this.params.onRefused(reason);
|
|
110
|
+
return undefined;
|
|
111
|
+
};
|
|
112
|
+
commandFor = step => asciiCommand(this.params.write, STEPS[step] ?? "");
|
|
113
|
+
}
|
|
114
|
+
exports.VerovalDuoControlSequencer = VerovalDuoControlSequencer;
|
|
115
|
+
const asciiCommandFromHex = (write, hex) => ({
|
|
116
|
+
...write,
|
|
117
|
+
frame: [hex],
|
|
118
|
+
withoutResponse: true
|
|
119
|
+
});
|
|
120
|
+
//# sourceMappingURL=veroval.duo-control-sequencer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_hexToByte","require","ACK","NAK","ENQ","STEPS","TAG_FROM","TAG_BYTES","COUNT_BYTES","ASCII_ZERO","ASCII_NINE","asciiOf","frame","from","count","slice","map","byte","String","fromCharCode","hexToByte","join","asciiNumberOf","codes","length","some","code","undefined","Number","asciiCommand","write","text","character","charCodeAt","toString","padStart","withoutResponse","VerovalDuoControlSequencer","step","isDone","constructor","params","initialCommands","commandFor","nextCommand","answerControlByte","tag","answerCount","advance","asciiCommandFromHex","stop","skipMemory","reason","onRefused","exports","hex"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/veroval/veroval.duo-control-sequencer.ts"],"mappings":";;;;;;AAEA,IAAAA,UAAA,GAAAC,OAAA;AAEA;AACA,MAAMC,GAAG,GAAG,IAAI;AAChB,MAAMC,GAAG,GAAG,IAAI;AAChB,MAAMC,GAAG,GAAG,IAAI;;AAEhB;AACA,MAAMC,KAAK,GAAG,CAAC,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,CAAU;;AAE7D;AACA,MAAMC,QAAQ,GAAG,CAAC;AAClB,MAAMC,SAAS,GAAG,CAAC;AACnB,MAAMC,WAAW,GAAG,CAAC;AACrB,MAAMC,UAAU,GAAG,IAAI;AACvB,MAAMC,UAAU,GAAG,IAAI;AAEvB,MAAMC,OAAO,GAAGA,CAACC,KAAwB,EAAEC,IAAY,EAAEC,KAAa,KACpEF,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,KAAK,GAAG,CAAC,GAAG,IAAI,CAACkC,OAAO,CAAC,CAAC,GAAG,IAAI,CAACG,UAAU,CAAC,CAAC;EACvD,CAAC;;EAED;EACQA,UAAU,GAAGA,CAAA,KAA4C;IAC/D,IAAI,CAACb,IAAI,IAAI,CAAC;IAEd,OAAO,IAAI,CAACU,OAAO,CAAC,CAAC;EACvB,CAAC;EAEOA,OAAO,GAAGA,CAAA,KAA4C;IAC5D,IAAI,CAACV,IAAI,IAAI,CAAC;IAEd,IAAI,IAAI,CAACA,IAAI,IAAIjC,KAAK,CAACmB,MAAM,EAAE;MAC7B,IAAI,CAACe,MAAM,GAAG,IAAI;MAElB,OAAOZ,SAAS;IAClB;IAEA,OAAO,CAAC,IAAI,CAACgB,UAAU,CAAC,IAAI,CAACL,IAAI,CAAC,CAAC;EACrC,CAAC;EAEOY,IAAI,GAAIE,MAAc,IAAgB;IAC5C,IAAI,CAACb,MAAM,GAAG,IAAI;IAClB,IAAI,CAACE,MAAM,CAACY,SAAS,CAACD,MAAM,CAAC;IAE7B,OAAOzB,SAAS;EAClB,CAAC;EAEOgB,UAAU,GAAIL,IAAY,IAChCT,YAAY,CAAC,IAAI,CAACY,MAAM,CAACX,KAAK,EAAEzB,KAAK,CAACiC,IAAI,CAAC,IAAI,EAAE,CAAC;AACtD;AAACgB,OAAA,CAAAjB,0BAAA,GAAAA,0BAAA;AAED,MAAMY,mBAAmB,GAAGA,CAC1BnB,KAAmC,EACnCyB,GAAW,MACQ;EAAE,GAAGzB,KAAK;EAAElB,KAAK,EAAE,CAAC2C,GAAG,CAAC;EAAEnB,eAAe,EAAE;AAAK,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.VerovalEcgDevice = void 0;
|
|
7
|
+
var _core = require("@ovok/core");
|
|
8
|
+
var _caseType = require("../../../types/case-type.js");
|
|
9
|
+
var _btManagedDevice = require("../bt-managed-device.js");
|
|
10
|
+
var _verovalEcgSamples = require("./veroval.ecg-samples.js");
|
|
11
|
+
var _verovalEcgTransfer = require("./veroval.ecg-transfer.js");
|
|
12
|
+
const SERVICE = "0000a000-0000-1000-8000-00805f9b34fb";
|
|
13
|
+
|
|
14
|
+
/** Requests go to one characteristic and every reply arrives on the other. */
|
|
15
|
+
const CONTROL_POINT = "00002a37-0000-1000-8000-00805f9b34fb";
|
|
16
|
+
const NOTIFY = "00002a36-0000-1000-8000-00805f9b34fb";
|
|
17
|
+
|
|
18
|
+
/** A recording is thirty-four seconds, and the device waits on a person before sending it. */
|
|
19
|
+
const STUCK_TIMEOUT_MS = 180_000;
|
|
20
|
+
const PREFERRED_MTU = 247;
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Every notification matches this, and none of them is a measurement.
|
|
24
|
+
*
|
|
25
|
+
* The transfer assembles the recording itself and reports it once, so the parser is given a
|
|
26
|
+
* case that matches anything and decodes nothing. Without it each of the five hundred odd
|
|
27
|
+
* packets would be logged as a frame nothing declared.
|
|
28
|
+
*/
|
|
29
|
+
const acceptEverything = {
|
|
30
|
+
caseValuePosition: [],
|
|
31
|
+
cases: [{
|
|
32
|
+
caseValue: "",
|
|
33
|
+
caseType: _caseType.CaseType.OTHER,
|
|
34
|
+
parseDefinitions: [],
|
|
35
|
+
description: "A packet of a download, assembled by the transfer"
|
|
36
|
+
}]
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* The Veroval ECG.
|
|
41
|
+
*
|
|
42
|
+
* Reading it is a download rather than a decode, so the whole recording is assembled before
|
|
43
|
+
* anything is reported: thirty-four seconds of samples at 128 Hz, two bytes each, converted
|
|
44
|
+
* to millivolts with the device's own calibration.
|
|
45
|
+
*
|
|
46
|
+
* The vendor's app plots a thirty-second window of this with a baseline-wander filter
|
|
47
|
+
* applied. That is a display transform, not calibration, so it is deliberately not
|
|
48
|
+
* reproduced here - what is reported is what the device recorded.
|
|
49
|
+
*/
|
|
50
|
+
class VerovalEcgDevice extends _btManagedDevice.BTManagedDevice {
|
|
51
|
+
stuckDataTimeout = STUCK_TIMEOUT_MS;
|
|
52
|
+
preferredMtu = PREFERRED_MTU;
|
|
53
|
+
onStreamStart = undefined;
|
|
54
|
+
mainServices = [{
|
|
55
|
+
uuid: SERVICE,
|
|
56
|
+
monitorUuids: [{
|
|
57
|
+
uuid: NOTIFY,
|
|
58
|
+
parsingModel: acceptEverything
|
|
59
|
+
}]
|
|
60
|
+
}];
|
|
61
|
+
validatePackage = () => true;
|
|
62
|
+
createCommandSequencer = () => new _verovalEcgTransfer.VerovalEcgTransfer({
|
|
63
|
+
write: {
|
|
64
|
+
serviceUuid: SERVICE,
|
|
65
|
+
characteristicUuid: CONTROL_POINT
|
|
66
|
+
},
|
|
67
|
+
onRecording: this.reportRecording
|
|
68
|
+
});
|
|
69
|
+
constructor(device, params) {
|
|
70
|
+
super(device, params);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/** Nothing is reported per packet; the transfer reports the recording when it is whole. */
|
|
74
|
+
handleSuccessResult() {
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
reportRecording = bytes => {
|
|
78
|
+
const diagramPoints = (0, _verovalEcgSamples.decodeVerovalEcgSamples)(bytes);
|
|
79
|
+
if (diagramPoints.length === 0) {
|
|
80
|
+
this.onError?.(new Error("Veroval ECG: the recording held no samples."));
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
this.onResult?.({
|
|
84
|
+
measurementTypeKey: _core.MeasurementTypeKey.ecg,
|
|
85
|
+
caseType: _caseType.CaseType.RESULT,
|
|
86
|
+
diagramPoints,
|
|
87
|
+
duration: diagramPoints.length / _verovalEcgSamples.VEROVAL_ECG_SAMPLE_RATE_HZ
|
|
88
|
+
});
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
exports.VerovalEcgDevice = VerovalEcgDevice;
|
|
92
|
+
//# sourceMappingURL=veroval.ecg-device.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_core","require","_caseType","_btManagedDevice","_verovalEcgSamples","_verovalEcgTransfer","SERVICE","CONTROL_POINT","NOTIFY","STUCK_TIMEOUT_MS","PREFERRED_MTU","acceptEverything","caseValuePosition","cases","caseValue","caseType","CaseType","OTHER","parseDefinitions","description","VerovalEcgDevice","BTManagedDevice","stuckDataTimeout","preferredMtu","onStreamStart","undefined","mainServices","uuid","monitorUuids","parsingModel","validatePackage","createCommandSequencer","VerovalEcgTransfer","write","serviceUuid","characteristicUuid","onRecording","reportRecording","constructor","device","params","handleSuccessResult","bytes","diagramPoints","decodeVerovalEcgSamples","length","onError","Error","onResult","measurementTypeKey","MeasurementTypeKey","ecg","RESULT","duration","VEROVAL_ECG_SAMPLE_RATE_HZ","exports"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/veroval/veroval.ecg-device.ts"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AAGA,IAAAC,SAAA,GAAAD,OAAA;AAIA,IAAAE,gBAAA,GAAAF,OAAA;AAEA,IAAAG,kBAAA,GAAAH,OAAA;AAIA,IAAAI,mBAAA,GAAAJ,OAAA;AAEA,MAAMK,OAAO,GAAG,sCAAsC;;AAEtD;AACA,MAAMC,aAAa,GAAG,sCAAsC;AAC5D,MAAMC,MAAM,GAAG,sCAAsC;;AAErD;AACA,MAAMC,gBAAgB,GAAG,OAAO;AAEhC,MAAMC,aAAa,GAAG,GAAG;;AAEzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,gBAAgB,GAAG;EACvBC,iBAAiB,EAAE,EAAE;EACrBC,KAAK,EAAE,CACL;IACEC,SAAS,EAAE,EAAE;IACbC,QAAQ,EAAEC,kBAAQ,CAACC,KAAK;IACxBC,gBAAgB,EAAE,EAAE;IACpBC,WAAW,EAAE;EACf,CAAC;AAEL,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@@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.decodeVerovalEcgSamples = exports.VEROVAL_ECG_SAMPLE_RATE_HZ = exports.DEFAULT_CALIBRATION = void 0;
|
|
7
|
+
var _hexToByte = require("../../../utils/hex-to-byte.js");
|
|
8
|
+
const SAMPLE_BYTES = 2;
|
|
9
|
+
const BYTE_BITS = 8;
|
|
10
|
+
const SIGN_BIT = 0x8000;
|
|
11
|
+
const SIGNED_16_RANGE = 0x10000;
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* How fast the device samples.
|
|
15
|
+
*
|
|
16
|
+
* Not taken on trust: the vendor's own plotting step works out to two two-hundred-and-fifty
|
|
17
|
+
* sixths of a second, and its transfer is thirty-four segments of sixteen packets of sixteen
|
|
18
|
+
* bytes - which is 256 bytes, 128 samples, one second per segment. Both say 128 Hz.
|
|
19
|
+
*/
|
|
20
|
+
const VEROVAL_ECG_SAMPLE_RATE_HZ = exports.VEROVAL_ECG_SAMPLE_RATE_HZ = 128;
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* The calibration the recording is read with.
|
|
24
|
+
*
|
|
25
|
+
* This is the EDF convention - a linear map from counts onto a physical range - and the
|
|
26
|
+
* device states its own in the header it sends before the curve. These are the values the
|
|
27
|
+
* vendor's app falls back to, and are what the SDK uses until a header supplies otherwise:
|
|
28
|
+
* the full signed sixteen-bit range spans plus or minus 27.68 mV.
|
|
29
|
+
*/
|
|
30
|
+
const DEFAULT_CALIBRATION = exports.DEFAULT_CALIBRATION = {
|
|
31
|
+
physicalMinimumMicrovolts: -27_680,
|
|
32
|
+
physicalMaximumMicrovolts: 27_680,
|
|
33
|
+
digitalMinimum: -32_768,
|
|
34
|
+
digitalMaximum: 32_767
|
|
35
|
+
};
|
|
36
|
+
const MICROVOLTS_PER_MILLIVOLT = 1000;
|
|
37
|
+
/** Samples are two bytes, most significant first, and signed. */
|
|
38
|
+
const signedSampleAt = (bytes, index) => {
|
|
39
|
+
const raw = (0, _hexToByte.hexToByte)(bytes[index] ?? "0") << BYTE_BITS | (0, _hexToByte.hexToByte)(bytes[index + 1] ?? "0");
|
|
40
|
+
return raw & SIGN_BIT ? raw - SIGNED_16_RANGE : raw;
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Turns the bytes of a recording into millivolts.
|
|
45
|
+
*
|
|
46
|
+
* A trailing odd byte is ignored: half a sample is not a sample. The conversion is the
|
|
47
|
+
* device's own, applied as it states it rather than reduced to a single factor, so a header
|
|
48
|
+
* that reports a different range still decodes correctly.
|
|
49
|
+
*/
|
|
50
|
+
const decodeVerovalEcgSamples = (bytes, calibration = DEFAULT_CALIBRATION) => {
|
|
51
|
+
const physicalRange = calibration.physicalMaximumMicrovolts - calibration.physicalMinimumMicrovolts;
|
|
52
|
+
const digitalRange = calibration.digitalMaximum - calibration.digitalMinimum;
|
|
53
|
+
const samples = [];
|
|
54
|
+
if (digitalRange === 0) {
|
|
55
|
+
return samples;
|
|
56
|
+
}
|
|
57
|
+
for (let index = 0; index + 1 < bytes.length; index += SAMPLE_BYTES) {
|
|
58
|
+
const counts = signedSampleAt(bytes, index) - calibration.digitalMinimum;
|
|
59
|
+
samples.push((counts * physicalRange / digitalRange + calibration.physicalMinimumMicrovolts) / MICROVOLTS_PER_MILLIVOLT);
|
|
60
|
+
}
|
|
61
|
+
return samples;
|
|
62
|
+
};
|
|
63
|
+
exports.decodeVerovalEcgSamples = decodeVerovalEcgSamples;
|
|
64
|
+
//# sourceMappingURL=veroval.ecg-samples.js.map
|
package/lib/commonjs/modules/bt-management/services/devices/veroval/veroval.ecg-samples.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_hexToByte","require","SAMPLE_BYTES","BYTE_BITS","SIGN_BIT","SIGNED_16_RANGE","VEROVAL_ECG_SAMPLE_RATE_HZ","exports","DEFAULT_CALIBRATION","physicalMinimumMicrovolts","physicalMaximumMicrovolts","digitalMinimum","digitalMaximum","MICROVOLTS_PER_MILLIVOLT","signedSampleAt","bytes","index","raw","hexToByte","decodeVerovalEcgSamples","calibration","physicalRange","digitalRange","samples","length","counts","push"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/veroval/veroval.ecg-samples.ts"],"mappings":";;;;;;AAAA,IAAAA,UAAA,GAAAC,OAAA;AAEA,MAAMC,YAAY,GAAG,CAAC;AACtB,MAAMC,SAAS,GAAG,CAAC;AACnB,MAAMC,QAAQ,GAAG,MAAM;AACvB,MAAMC,eAAe,GAAG,OAAO;;AAE/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,0BAA0B,GAAAC,OAAA,CAAAD,0BAAA,GAAG,GAAG;;AAEtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAME,mBAAmB,GAAAD,OAAA,CAAAC,mBAAA,GAAG;EAC1BC,yBAAyB,EAAE,CAAC,MAAM;EAClCC,yBAAyB,EAAE,MAAM;EACjCC,cAAc,EAAE,CAAC,MAAM;EACvBC,cAAc,EAAE;AAClB,CAAU;AAEV,MAAMC,wBAAwB,GAAG,IAAI;AASrC;AACA,MAAMC,cAAc,GAAGA,CAACC,KAAwB,EAAEC,KAAa,KAAa;EAC1E,MAAMC,GAAG,GACN,IAAAC,oBAAS,EAACH,KAAK,CAACC,KAAK,CAAC,IAAI,GAAG,CAAC,IAAIb,SAAS,GAC5C,IAAAe,oBAAS,EAACH,KAAK,CAACC,KAAK,GAAG,CAAC,CAAC,IAAI,GAAG,CAAC;EAEpC,OAAOC,GAAG,GAAGb,QAAQ,GAAGa,GAAG,GAAGZ,eAAe,GAAGY,GAAG;AACrD,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAME,uBAAuB,GAAGA,CAC9BJ,KAAwB,EACxBK,WAA2B,GAAGZ,mBAAmB,KACpC;EACb,MAAMa,aAAa,GACjBD,WAAW,CAACV,yBAAyB,GAAGU,WAAW,CAACX,yBAAyB;EAE/E,MAAMa,YAAY,GAAGF,WAAW,CAACR,cAAc,GAAGQ,WAAW,CAACT,cAAc;EAC5E,MAAMY,OAAiB,GAAG,EAAE;EAE5B,IAAID,YAAY,KAAK,CAAC,EAAE;IACtB,OAAOC,OAAO;EAChB;EAEA,KAAK,IAAIP,KAAK,GAAG,CAAC,EAAEA,KAAK,GAAG,CAAC,GAAGD,KAAK,CAACS,MAAM,EAAER,KAAK,IAAId,YAAY,EAAE;IACnE,MAAMuB,MAAM,GAAGX,cAAc,CAACC,KAAK,EAAEC,KAAK,CAAC,GAAGI,WAAW,CAACT,cAAc;IAExEY,OAAO,CAACG,IAAI,CACV,CAAED,MAAM,GAAGJ,aAAa,GAAIC,YAAY,GACtCF,WAAW,CAACX,yBAAyB,IACrCI,wBACJ,CAAC;EACH;EAEA,OAAOU,OAAO;AAChB,CAAC;AAAChB,OAAA,CAAAY,uBAAA,GAAAA,uBAAA","ignoreList":[]}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.VerovalEcgTransfer = void 0;
|
|
7
|
+
/** Every request is a fixed twenty-byte packet, zero filled but for its group and command. */
|
|
8
|
+
const PACKET_BYTES = 20;
|
|
9
|
+
const GROUP_INDEX = 1;
|
|
10
|
+
const COMMAND_INDEX = 2;
|
|
11
|
+
const PARAMETER_INDEX = 3;
|
|
12
|
+
const DOWNLOAD_GROUP = 4;
|
|
13
|
+
const DOWNLOAD_MODE = 1;
|
|
14
|
+
const DOWNLOAD_HEADER = 2;
|
|
15
|
+
const DOWNLOAD_RAW = 3;
|
|
16
|
+
|
|
17
|
+
/** The transfer's shape, from the vendor's own device table. */
|
|
18
|
+
const PAYLOAD_FROM = 4;
|
|
19
|
+
const PAYLOAD_BYTES = 16;
|
|
20
|
+
const HEADER_PACKETS = 5;
|
|
21
|
+
const PACKETS_PER_SEGMENT = 16;
|
|
22
|
+
const SEGMENTS = 34;
|
|
23
|
+
const BYTE_MASK = 0xff;
|
|
24
|
+
const BYTE_BITS = 8;
|
|
25
|
+
const toHex = byte => (byte & BYTE_MASK).toString(16).padStart(2, "0");
|
|
26
|
+
const packet = (write, command, parameters = []) => {
|
|
27
|
+
const bytes = new Array(PACKET_BYTES).fill(0);
|
|
28
|
+
bytes[GROUP_INDEX] = DOWNLOAD_GROUP;
|
|
29
|
+
bytes[COMMAND_INDEX] = command;
|
|
30
|
+
parameters.forEach((value, index) => {
|
|
31
|
+
bytes[PARAMETER_INDEX + index] = value;
|
|
32
|
+
});
|
|
33
|
+
return {
|
|
34
|
+
...write,
|
|
35
|
+
frame: bytes.map(toHex)
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
const segmentParameters = segment => [segment & BYTE_MASK, segment >> BYTE_BITS & BYTE_MASK, segment >> BYTE_BITS * 2 & BYTE_MASK];
|
|
39
|
+
/**
|
|
40
|
+
* Downloads a recording from the Veroval ECG.
|
|
41
|
+
*
|
|
42
|
+
* The exchange is a fixed walk rather than a conversation: ask for the download mode, then
|
|
43
|
+
* the header, then each second of the recording in turn. The device answers each request
|
|
44
|
+
* with a known number of twenty-byte packets, sixteen payload bytes each, so the transfer is
|
|
45
|
+
* paced by counting them - which is how the vendor's own app paces it, and is the only thing
|
|
46
|
+
* that distinguishes one phase's packets from another's.
|
|
47
|
+
*
|
|
48
|
+
* A recording is thirty-four seconds at 128 Hz. Nothing is reported until all of it has
|
|
49
|
+
* arrived: a partial ECG that looked whole would be worse than none, and the count is what
|
|
50
|
+
* says it is whole.
|
|
51
|
+
*/
|
|
52
|
+
class VerovalEcgTransfer {
|
|
53
|
+
phase = "mode";
|
|
54
|
+
packets = 0;
|
|
55
|
+
segment = 0;
|
|
56
|
+
recording = [];
|
|
57
|
+
constructor(params) {
|
|
58
|
+
this.params = params;
|
|
59
|
+
}
|
|
60
|
+
initialCommands = () => [packet(this.params.write, DOWNLOAD_MODE)];
|
|
61
|
+
nextCommand = frame => {
|
|
62
|
+
if (this.phase === "done") {
|
|
63
|
+
return undefined;
|
|
64
|
+
}
|
|
65
|
+
if (this.phase === "mode") {
|
|
66
|
+
this.phase = "header";
|
|
67
|
+
this.packets = 0;
|
|
68
|
+
return [packet(this.params.write, DOWNLOAD_HEADER)];
|
|
69
|
+
}
|
|
70
|
+
this.packets += 1;
|
|
71
|
+
if (this.phase === "header") {
|
|
72
|
+
return this.packets < HEADER_PACKETS ? undefined : this.requestSegment(0);
|
|
73
|
+
}
|
|
74
|
+
this.recording.push(...frame.slice(PAYLOAD_FROM, PAYLOAD_FROM + PAYLOAD_BYTES));
|
|
75
|
+
return this.packets < PACKETS_PER_SEGMENT ? undefined : this.finishSegment();
|
|
76
|
+
};
|
|
77
|
+
finishSegment = () => {
|
|
78
|
+
this.segment += 1;
|
|
79
|
+
if (this.segment < SEGMENTS) {
|
|
80
|
+
return this.requestSegment(this.segment);
|
|
81
|
+
}
|
|
82
|
+
this.phase = "done";
|
|
83
|
+
this.params.onRecording(this.recording);
|
|
84
|
+
return undefined;
|
|
85
|
+
};
|
|
86
|
+
requestSegment = segment => {
|
|
87
|
+
this.phase = "raw";
|
|
88
|
+
this.packets = 0;
|
|
89
|
+
this.segment = segment;
|
|
90
|
+
return [packet(this.params.write, DOWNLOAD_RAW, segmentParameters(segment))];
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
exports.VerovalEcgTransfer = VerovalEcgTransfer;
|
|
94
|
+
//# sourceMappingURL=veroval.ecg-transfer.js.map
|
package/lib/commonjs/modules/bt-management/services/devices/veroval/veroval.ecg-transfer.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["PACKET_BYTES","GROUP_INDEX","COMMAND_INDEX","PARAMETER_INDEX","DOWNLOAD_GROUP","DOWNLOAD_MODE","DOWNLOAD_HEADER","DOWNLOAD_RAW","PAYLOAD_FROM","PAYLOAD_BYTES","HEADER_PACKETS","PACKETS_PER_SEGMENT","SEGMENTS","BYTE_MASK","BYTE_BITS","toHex","byte","toString","padStart","packet","write","command","parameters","bytes","Array","fill","forEach","value","index","frame","map","segmentParameters","segment","VerovalEcgTransfer","phase","packets","recording","constructor","params","initialCommands","nextCommand","undefined","requestSegment","push","slice","finishSegment","onRecording","exports"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/veroval/veroval.ecg-transfer.ts"],"mappings":";;;;;;AAGA;AACA,MAAMA,YAAY,GAAG,EAAE;AACvB,MAAMC,WAAW,GAAG,CAAC;AACrB,MAAMC,aAAa,GAAG,CAAC;AACvB,MAAMC,eAAe,GAAG,CAAC;AAEzB,MAAMC,cAAc,GAAG,CAAC;AACxB,MAAMC,aAAa,GAAG,CAAC;AACvB,MAAMC,eAAe,GAAG,CAAC;AACzB,MAAMC,YAAY,GAAG,CAAC;;AAEtB;AACA,MAAMC,YAAY,GAAG,CAAC;AACtB,MAAMC,aAAa,GAAG,EAAE;AACxB,MAAMC,cAAc,GAAG,CAAC;AACxB,MAAMC,mBAAmB,GAAG,EAAE;AAC9B,MAAMC,QAAQ,GAAG,EAAE;AAEnB,MAAMC,SAAS,GAAG,IAAI;AACtB,MAAMC,SAAS,GAAG,CAAC;AAEnB,MAAMC,KAAK,GAAIC,IAAY,IACzB,CAACA,IAAI,GAAGH,SAAS,EAAEI,QAAQ,CAAC,EAAE,CAAC,CAACC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC;AAElD,MAAMC,MAAM,GAAGA,CACbC,KAAmC,EACnCC,OAAe,EACfC,UAA6B,GAAG,EAAE,KAChB;EAClB,MAAMC,KAAK,GAAG,IAAIC,KAAK,CAASxB,YAAY,CAAC,CAACyB,IAAI,CAAC,CAAC,CAAC;EAErDF,KAAK,CAACtB,WAAW,CAAC,GAAGG,cAAc;EACnCmB,KAAK,CAACrB,aAAa,CAAC,GAAGmB,O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O,IAAI,CAACC,OAAO,GAAGzB,cAAc,GAAG+B,SAAS,GAAG,IAAI,CAACC,cAAc,CAAC,CAAC,CAAC;IAC3E;IAEA,IAAI,CAACN,SAAS,CAACO,IAAI,CACjB,GAAGd,KAAK,CAACe,KAAK,CAACpC,YAAY,EAAEA,YAAY,GAAGC,aAAa,CAC3D,CAAC;IAED,OAAO,IAAI,CAAC0B,OAAO,GAAGxB,mBAAmB,GACrC8B,SAAS,GACT,IAAI,CAACI,aAAa,CAAC,CAAC;EAC1B,CAAC;EAEOA,aAAa,GAAGA,CAAA,KAA4C;IAClE,IAAI,CAACb,OAAO,IAAI,CAAC;IAEjB,IAAI,IAAI,CAACA,OAAO,GAAGpB,QAAQ,EAAE;MAC3B,OAAO,IAAI,CAAC8B,cAAc,CAAC,IAAI,CAACV,OAAO,CAAC;IAC1C;IAEA,IAAI,CAACE,KAAK,GAAG,MAAM;IACnB,IAAI,CAACI,MAAM,CAACQ,WAAW,CAAC,IAAI,CAACV,SAAS,CAAC;IAEvC,OAAOK,SAAS;EAClB,CAAC;EAEOC,cAAc,GAAIV,OAAe,IAA+B;IACtE,IAAI,CAACE,KAAK,GAAG,KAAK;IAClB,IAAI,CAACC,OAAO,GAAG,CAAC;IAChB,IAAI,CAACH,OAAO,GAAGA,OAAO;IAEtB,OAAO,CACLb,MAAM,CAAC,IAAI,CAACmB,MAAM,CAAClB,KAAK,EAAEb,YAAY,EAAEwB,iBAAiB,CAACC,OAAO,CAAC,CAAC,CACpE;EACH,CAAC;AACH;AAACe,OAAA,CAAAd,kBAAA,GAAAA,kBAAA","ignoreList":[]}
|
|
@@ -24,6 +24,8 @@ let IntegratedDevices = exports.IntegratedDevices = /*#__PURE__*/function (Integ
|
|
|
24
24
|
IntegratedDevices["S5"] = "Le S5";
|
|
25
25
|
IntegratedDevices["ALIVE_COR"] = "alivecor";
|
|
26
26
|
IntegratedDevices["BGM"] = "BGM";
|
|
27
|
+
IntegratedDevices["VEROVAL_DUO_CONTROL"] = "Veroval duo control";
|
|
28
|
+
IntegratedDevices["VEROVAL_ECG"] = "Veroval ECG";
|
|
27
29
|
return IntegratedDevices;
|
|
28
30
|
}({});
|
|
29
31
|
//# sourceMappingURL=integrated-devices.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["IntegratedDevices","exports"],"sourceRoot":"../../../../../src","sources":["modules/bt-management/types/integrated-devices.ts"],"mappings":";;;;;;IAAYA,iBAAiB,GAAAC,OAAA,CAAAD,iBAAA,0BAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAA,OAAjBA,iBAAiB;AAAA","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["IntegratedDevices","exports"],"sourceRoot":"../../../../../src","sources":["modules/bt-management/types/integrated-devices.ts"],"mappings":";;;;;;IAAYA,iBAAiB,GAAAC,OAAA,CAAAD,iBAAA,0BAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAA,OAAjBA,iBAAiB;AAAA","ignoreList":[]}
|
|
@@ -6,7 +6,28 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.createCustomFieldParser = void 0;
|
|
7
7
|
var _decodeMedicalFloat = require("./decode-medical-float.js");
|
|
8
8
|
const HEX_ONLY = /^[0-9a-f]+$/;
|
|
9
|
+
const ASCII_ZERO = 0x30;
|
|
10
|
+
const ASCII_NINE = 0x39;
|
|
11
|
+
const HEX_BYTE = /../g;
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Reads bytes that are decimal digits written as characters, not a number.
|
|
15
|
+
*
|
|
16
|
+
* A byte outside "0"-"9" makes the whole field undefined rather than being skipped: these
|
|
17
|
+
* records are fixed width and a non-digit means the field was not what the declaration
|
|
18
|
+
* says it is, so decoding the rest of it would report a number built from part of a value.
|
|
19
|
+
*/
|
|
20
|
+
const fromAsciiDigits = hex => {
|
|
21
|
+
const codes = (hex.match(HEX_BYTE) ?? []).map(byte => parseInt(byte, 16));
|
|
22
|
+
if (codes.length === 0 || codes.some(code => code < ASCII_ZERO || code > ASCII_NINE)) {
|
|
23
|
+
return undefined;
|
|
24
|
+
}
|
|
25
|
+
return Number(codes.map(code => code - ASCII_ZERO).join(""));
|
|
26
|
+
};
|
|
9
27
|
const toRaw = (hex, field) => {
|
|
28
|
+
if (field.encoding === "ascii") {
|
|
29
|
+
return fromAsciiDigits(hex);
|
|
30
|
+
}
|
|
10
31
|
const raw = parseInt(hex, 16);
|
|
11
32
|
const bits = hex.length * 4;
|
|
12
33
|
if (field.encoding === "int") {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_decodeMedicalFloat","require","HEX_ONLY","
|
|
1
|
+
{"version":3,"names":["_decodeMedicalFloat","require","HEX_ONLY","ASCII_ZERO","ASCII_NINE","HEX_BYTE","fromAsciiDigits","hex","codes","match","map","byte","parseInt","length","some","code","undefined","Number","join","toRaw","field","encoding","raw","bits","sign","decodeMedicalFloat","createCustomFieldParser","assembledHex","toLowerCase","byteIndexes","test","isFinite","value","scale","offset","decimals","factor","Math","round","exports"],"sourceRoot":"../../../../../src","sources":["modules/bt-management/utils/create-custom-field-parser.ts"],"mappings":";;;;;;AAEA,IAAAA,mBAAA,GAAAC,OAAA;AAEA,MAAMC,QAAQ,GAAG,aAAa;AAE9B,MAAMC,UAAU,GAAG,IAAI;AACvB,MAAMC,UAAU,GAAG,IAAI;AACvB,MAAMC,QAAQ,GAAG,KAAK;;AAEtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,eAAe,GAAIC,GAAW,IAAyB;EAC3D,MAAMC,KAAK,GAAG,CAACD,GAAG,CAACE,KAAK,CAACJ,QAAQ,CAAC,IAAI,EAAE,EAAEK,GAAG,CAAEC,IAAI,IAAKC,QAAQ,CAACD,IAAI,EAAE,EAAE,CAAC,CAAC;EAE3E,IACEH,KAAK,CAACK,MAAM,KAAK,CAAC,IAClBL,KAAK,CAACM,IAAI,CAAEC,IAAI,IAAKA,IAAI,GAAGZ,UAAU,IAAIY,IAAI,GAAGX,UAAU,CAAC,EAC5D;IACA,OAAOY,SAAS;EAClB;EAEA,OAAOC,MAAM,CAACT,KAAK,CAACE,GAAG,CAAEK,IAAI,IAAKA,IAAI,GAAGZ,UAAU,CAAC,CAACe,IAAI,CAAC,EAAE,CAAC,CAAC;AAChE,CAAC;AAED,MAAMC,KAAK,GAAGA,CACZZ,GAAW,EACXa,KAA0B,KACH;EACvB,IAAIA,KAAK,CAACC,QAAQ,KAAK,OAAO,EAAE;IAC9B,OAAOf,eAAe,CAACC,GAAG,CAAC;EAC7B;EAEA,MAAMe,GAAG,GAAGV,QAAQ,CAACL,GAAG,EAAE,EAAE,CAAC;EAC7B,MAAMgB,IAAI,GAAGhB,GAAG,CAACM,MAAM,GAAG,CAAC;EAE3B,IAAIO,KAAK,CAACC,QAAQ,KAAK,KAAK,EAAE;IAC5B,MAAMG,IAAI,GAAG,CAAC,KAAKD,IAAI,GAAG,CAAC,CAAC;IAE5B,OAAOD,G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K,CAACN,KAAK,GAAGI,MAAM,CAAC,GAAGA,MAAM;AAC5C,CAAC;AAACG,OAAA,CAAAb,uBAAA,GAAAA,uBAAA","ignoreList":[]}
|
|
@@ -4,10 +4,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.parseMeasurement = void 0;
|
|
7
|
-
|
|
7
|
+
/**
|
|
8
|
+
* @param byteOffset added to every declared index, for a frame that repeats one record.
|
|
9
|
+
*/
|
|
10
|
+
const parseMeasurement = (measurementInHex, parsingCase, byteOffset = 0) => {
|
|
8
11
|
const parserDefinitions = parsingCase.parseDefinitions;
|
|
9
12
|
const result = parserDefinitions.reduce((acc, parserDefinition) => {
|
|
10
|
-
const parsingValue = getFullValueForMeasurementProperty(measurementInHex, parserDefinition);
|
|
13
|
+
const parsingValue = getFullValueForMeasurementProperty(measurementInHex, parserDefinition, byteOffset);
|
|
11
14
|
if (parserDefinition.customParserDefinition) {
|
|
12
15
|
acc[parserDefinition.name] = parserDefinition.customParserDefinition(parsingValue);
|
|
13
16
|
} else {
|
|
@@ -23,15 +26,15 @@ const parseMeasurement = (measurementInHex, parsingCase) => {
|
|
|
23
26
|
return measurement;
|
|
24
27
|
};
|
|
25
28
|
|
|
26
|
-
/** Example: We received message ["1A","02", "00", "50"]. Value for weight is on indexes 2,3. Which means we need to combine 2nd and 3rd indexes to get result
|
|
27
|
-
* This method will combine them and return string "0050".
|
|
28
|
-
* Indexes should be written in ParseDeinition
|
|
29
|
+
/** Example: We received message ["1A","02", "00", "50"]. Value for weight is on indexes 2,3. Which means we need to combine 2nd and 3rd indexes to get result
|
|
30
|
+
* This method will combine them and return string "0050".
|
|
31
|
+
* Indexes should be written in ParseDeinition
|
|
29
32
|
*/
|
|
30
33
|
exports.parseMeasurement = parseMeasurement;
|
|
31
|
-
const getFullValueForMeasurementProperty = (messageInHex, parseDefinition) => {
|
|
34
|
+
const getFullValueForMeasurementProperty = (messageInHex, parseDefinition, byteOffset) => {
|
|
32
35
|
let valuesInString = "";
|
|
33
36
|
for (let i = 0; i < parseDefinition.byteIndexes.length; i++) {
|
|
34
|
-
valuesInString += messageInHex[parseDefinition.byteIndexes[i]
|
|
37
|
+
valuesInString += messageInHex[(parseDefinition.byteIndexes[i] ?? 0) + byteOffset];
|
|
35
38
|
}
|
|
36
39
|
return valuesInString;
|
|
37
40
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["parseMeasurement","measurementInHex","parsingCase","parserDefinitions","parseDefinitions","result","reduce","acc","parserDefinition","parsingValue","getFullValueForMeasurementProperty","customParserDefinition","name","parseInt","measurement","measurementTypeKey","caseType","exports","messageInHex","parseDefinition","valuesInString","i","byteIndexes","length"],"sourceRoot":"../../../../../src","sources":["modules/bt-management/utils/parse-measurement.ts"],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"names":["parseMeasurement","measurementInHex","parsingCase","byteOffset","parserDefinitions","parseDefinitions","result","reduce","acc","parserDefinition","parsingValue","getFullValueForMeasurementProperty","customParserDefinition","name","parseInt","measurement","measurementTypeKey","caseType","exports","messageInHex","parseDefinition","valuesInString","i","byteIndexes","length"],"sourceRoot":"../../../../../src","sources":["modules/bt-management/utils/parse-measurement.ts"],"mappings":";;;;;;AAMA;AACA;AACA;AACO,MAAMA,gBAAgB,GAAGA,CAC9BC,gBAA0B,EAC1BC,WAAwB,EACxBC,UAAU,GAAG,CAAC,KAC2B;EACzC,MAAMC,iBAAiB,GAAGF,WAAW,CAACG,gBAAgB;EAEtD,MAAMC,MAAM,GAAGF,iBAAiB,CAACG,MAAM,CACrC,CAACC,GAAG,EAAEC,gBAAgB,KAAK;IACzB,MAAMC,YAAY,GAAGC,kCAAkC,CACrDV,gBAAgB,EAChBQ,gBAAgB,EAChBN,UACF,CAAC;IAED,IAAIM,gBAAgB,CAACG,sBAAsB,EAAE;MAC3CJ,GAAG,CAACC,gBAAgB,CAACI,IAAI,CAAC,GACxBJ,gBAAgB,CAACG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