@ovok/native 1.6.43 → 1.6.45
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 +8 -1
- package/lib/commonjs/modules/bt-device/constants/device-instruction-pdfs.js.map +1 -1
- package/lib/commonjs/modules/bt-device/constants/supported-devices.js +41 -0
- package/lib/commonjs/modules/bt-device/constants/supported-devices.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/services/background-sync/background-service-uuids.js +3 -0
- package/lib/commonjs/modules/bt-management/services/background-sync/background-service-uuids.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/device-creator.js +15 -1
- package/lib/commonjs/modules/bt-management/services/device-creator.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/devices/f4/f4.device.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/devices/f5/f5-scale.device.js +46 -0
- package/lib/commonjs/modules/bt-management/services/devices/f5/f5-scale.device.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/devices/f5/f5-scale.protocol.js +79 -0
- package/lib/commonjs/modules/bt-management/services/devices/f5/f5-scale.protocol.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/devices/f5/f5-scale.sequencer.js +37 -0
- package/lib/commonjs/modules/bt-management/services/devices/f5/f5-scale.sequencer.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/devices/viatom/bioland.bgm.device.js +50 -0
- package/lib/commonjs/modules/bt-management/services/devices/viatom/bioland.bgm.device.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/devices/viatom/bioland.bgm.protocol.js +115 -0
- package/lib/commonjs/modules/bt-management/services/devices/viatom/bioland.bgm.protocol.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/devices/viatom/bioland.bgm.sequencer.js +58 -0
- package/lib/commonjs/modules/bt-management/services/devices/viatom/bioland.bgm.sequencer.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/devices/viatom/poctor.m3102.device.js +41 -0
- package/lib/commonjs/modules/bt-management/services/devices/viatom/poctor.m3102.device.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/devices/viatom/poctor.m3102.protocol.js +61 -0
- package/lib/commonjs/modules/bt-management/services/devices/viatom/poctor.m3102.protocol.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/devices/viatom/poctor.m3102.sequencer.js +41 -0
- package/lib/commonjs/modules/bt-management/services/devices/viatom/poctor.m3102.sequencer.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/devices/viatom/viatom.bpm188.device.js +50 -0
- package/lib/commonjs/modules/bt-management/services/devices/viatom/viatom.bpm188.device.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/devices/viatom/viatom.bpm188.protocol.js +141 -0
- package/lib/commonjs/modules/bt-management/services/devices/viatom/viatom.bpm188.protocol.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/devices/viatom/viatom.bpm188.sequencer.js +76 -0
- package/lib/commonjs/modules/bt-management/services/devices/viatom/viatom.bpm188.sequencer.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/devices/viatom/viatom.pc100.device.js +50 -0
- package/lib/commonjs/modules/bt-management/services/devices/viatom/viatom.pc100.device.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/devices/viatom/viatom.pc100.protocol.js +149 -0
- package/lib/commonjs/modules/bt-management/services/devices/viatom/viatom.pc100.protocol.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/devices/viatom/viatom.pc100.sequencer.js +81 -0
- package/lib/commonjs/modules/bt-management/services/devices/viatom/viatom.pc100.sequencer.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/devices/viatom/viatom.pc300.device.js +50 -0
- package/lib/commonjs/modules/bt-management/services/devices/viatom/viatom.pc300.device.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/devices/viatom/viatom.pc300.protocol.js +228 -0
- package/lib/commonjs/modules/bt-management/services/devices/viatom/viatom.pc300.protocol.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/devices/viatom/viatom.pc300.sequencer.js +122 -0
- package/lib/commonjs/modules/bt-management/services/devices/viatom/viatom.pc300.sequencer.js.map +1 -0
- package/lib/commonjs/modules/bt-management/types/integrated-devices.js +7 -0
- package/lib/commonjs/modules/bt-management/types/integrated-devices.js.map +1 -1
- package/lib/module/modules/bt-device/constants/device-instruction-pdfs.js +8 -1
- package/lib/module/modules/bt-device/constants/device-instruction-pdfs.js.map +1 -1
- package/lib/module/modules/bt-device/constants/supported-devices.js +41 -0
- package/lib/module/modules/bt-device/constants/supported-devices.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/services/background-sync/background-service-uuids.js +3 -0
- package/lib/module/modules/bt-management/services/background-sync/background-service-uuids.js.map +1 -1
- package/lib/module/modules/bt-management/services/device-creator.js +15 -1
- package/lib/module/modules/bt-management/services/device-creator.js.map +1 -1
- package/lib/module/modules/bt-management/services/devices/f4/f4.device.js.map +1 -1
- package/lib/module/modules/bt-management/services/devices/f5/f5-scale.device.js +41 -0
- package/lib/module/modules/bt-management/services/devices/f5/f5-scale.device.js.map +1 -0
- package/lib/module/modules/bt-management/services/devices/f5/f5-scale.protocol.js +71 -0
- package/lib/module/modules/bt-management/services/devices/f5/f5-scale.protocol.js.map +1 -0
- package/lib/module/modules/bt-management/services/devices/f5/f5-scale.sequencer.js +32 -0
- package/lib/module/modules/bt-management/services/devices/f5/f5-scale.sequencer.js.map +1 -0
- package/lib/module/modules/bt-management/services/devices/viatom/bioland.bgm.device.js +45 -0
- package/lib/module/modules/bt-management/services/devices/viatom/bioland.bgm.device.js.map +1 -0
- package/lib/module/modules/bt-management/services/devices/viatom/bioland.bgm.protocol.js +106 -0
- package/lib/module/modules/bt-management/services/devices/viatom/bioland.bgm.protocol.js.map +1 -0
- package/lib/module/modules/bt-management/services/devices/viatom/bioland.bgm.sequencer.js +53 -0
- package/lib/module/modules/bt-management/services/devices/viatom/bioland.bgm.sequencer.js.map +1 -0
- package/lib/module/modules/bt-management/services/devices/viatom/poctor.m3102.device.js +36 -0
- package/lib/module/modules/bt-management/services/devices/viatom/poctor.m3102.device.js.map +1 -0
- package/lib/module/modules/bt-management/services/devices/viatom/poctor.m3102.protocol.js +55 -0
- package/lib/module/modules/bt-management/services/devices/viatom/poctor.m3102.protocol.js.map +1 -0
- package/lib/module/modules/bt-management/services/devices/viatom/poctor.m3102.sequencer.js +36 -0
- package/lib/module/modules/bt-management/services/devices/viatom/poctor.m3102.sequencer.js.map +1 -0
- package/lib/module/modules/bt-management/services/devices/viatom/viatom.bpm188.device.js +45 -0
- package/lib/module/modules/bt-management/services/devices/viatom/viatom.bpm188.device.js.map +1 -0
- package/lib/module/modules/bt-management/services/devices/viatom/viatom.bpm188.protocol.js +130 -0
- package/lib/module/modules/bt-management/services/devices/viatom/viatom.bpm188.protocol.js.map +1 -0
- package/lib/module/modules/bt-management/services/devices/viatom/viatom.bpm188.sequencer.js +71 -0
- package/lib/module/modules/bt-management/services/devices/viatom/viatom.bpm188.sequencer.js.map +1 -0
- package/lib/module/modules/bt-management/services/devices/viatom/viatom.pc100.device.js +45 -0
- package/lib/module/modules/bt-management/services/devices/viatom/viatom.pc100.device.js.map +1 -0
- package/lib/module/modules/bt-management/services/devices/viatom/viatom.pc100.protocol.js +136 -0
- package/lib/module/modules/bt-management/services/devices/viatom/viatom.pc100.protocol.js.map +1 -0
- package/lib/module/modules/bt-management/services/devices/viatom/viatom.pc100.sequencer.js +76 -0
- package/lib/module/modules/bt-management/services/devices/viatom/viatom.pc100.sequencer.js.map +1 -0
- package/lib/module/modules/bt-management/services/devices/viatom/viatom.pc300.device.js +45 -0
- package/lib/module/modules/bt-management/services/devices/viatom/viatom.pc300.device.js.map +1 -0
- package/lib/module/modules/bt-management/services/devices/viatom/viatom.pc300.protocol.js +209 -0
- package/lib/module/modules/bt-management/services/devices/viatom/viatom.pc300.protocol.js.map +1 -0
- package/lib/module/modules/bt-management/services/devices/viatom/viatom.pc300.sequencer.js +117 -0
- package/lib/module/modules/bt-management/services/devices/viatom/viatom.pc300.sequencer.js.map +1 -0
- package/lib/module/modules/bt-management/types/device-measurement-map.js.map +1 -1
- package/lib/module/modules/bt-management/types/integrated-devices.js +7 -0
- package/lib/module/modules/bt-management/types/integrated-devices.js.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-device/constants/device-instruction-pdfs.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-device/constants/supported-devices.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/services/background-sync/background-service-uuids.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/f4/f4.device.d.ts +5 -3
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/f4/f4.device.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/f5/f5-scale.device.d.ts +16 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/f5/f5-scale.device.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/f5/f5-scale.protocol.d.ts +21 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/f5/f5-scale.protocol.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/f5/f5-scale.sequencer.d.ts +22 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/f5/f5-scale.sequencer.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/viatom/bioland.bgm.device.d.ts +16 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/viatom/bioland.bgm.device.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/viatom/bioland.bgm.protocol.d.ts +26 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/viatom/bioland.bgm.protocol.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/viatom/bioland.bgm.sequencer.d.ts +24 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/viatom/bioland.bgm.sequencer.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/viatom/poctor.m3102.device.d.ts +15 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/viatom/poctor.m3102.device.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/viatom/poctor.m3102.protocol.d.ts +16 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/viatom/poctor.m3102.protocol.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/viatom/poctor.m3102.sequencer.d.ts +17 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/viatom/poctor.m3102.sequencer.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/viatom/viatom.bpm188.device.d.ts +16 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/viatom/viatom.bpm188.device.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/viatom/viatom.bpm188.protocol.d.ts +36 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/viatom/viatom.bpm188.protocol.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/viatom/viatom.bpm188.sequencer.d.ts +26 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/viatom/viatom.bpm188.sequencer.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/viatom/viatom.pc100.device.d.ts +16 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/viatom/viatom.pc100.device.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/viatom/viatom.pc100.protocol.d.ts +43 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/viatom/viatom.pc100.protocol.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/viatom/viatom.pc100.sequencer.d.ts +26 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/viatom/viatom.pc100.sequencer.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/viatom/viatom.pc300.device.d.ts +16 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/viatom/viatom.pc300.device.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/viatom/viatom.pc300.protocol.d.ts +73 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/viatom/viatom.pc300.protocol.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/viatom/viatom.pc300.sequencer.d.ts +25 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/viatom/viatom.pc300.sequencer.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/types/device-measurement-map.d.ts +8 -1
- 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 +8 -1
- package/lib/typescript/commonjs/src/modules/bt-management/types/integrated-devices.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-device/constants/device-instruction-pdfs.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-device/constants/supported-devices.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/services/background-sync/background-service-uuids.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/f4/f4.device.d.ts +5 -3
- package/lib/typescript/module/src/modules/bt-management/services/devices/f4/f4.device.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/devices/f5/f5-scale.device.d.ts +16 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/f5/f5-scale.device.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/f5/f5-scale.protocol.d.ts +21 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/f5/f5-scale.protocol.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/f5/f5-scale.sequencer.d.ts +22 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/f5/f5-scale.sequencer.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/viatom/bioland.bgm.device.d.ts +16 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/viatom/bioland.bgm.device.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/viatom/bioland.bgm.protocol.d.ts +26 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/viatom/bioland.bgm.protocol.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/viatom/bioland.bgm.sequencer.d.ts +24 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/viatom/bioland.bgm.sequencer.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/viatom/poctor.m3102.device.d.ts +15 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/viatom/poctor.m3102.device.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/viatom/poctor.m3102.protocol.d.ts +16 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/viatom/poctor.m3102.protocol.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/viatom/poctor.m3102.sequencer.d.ts +17 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/viatom/poctor.m3102.sequencer.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/viatom/viatom.bpm188.device.d.ts +16 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/viatom/viatom.bpm188.device.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/viatom/viatom.bpm188.protocol.d.ts +36 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/viatom/viatom.bpm188.protocol.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/viatom/viatom.bpm188.sequencer.d.ts +26 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/viatom/viatom.bpm188.sequencer.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/viatom/viatom.pc100.device.d.ts +16 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/viatom/viatom.pc100.device.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/viatom/viatom.pc100.protocol.d.ts +43 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/viatom/viatom.pc100.protocol.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/viatom/viatom.pc100.sequencer.d.ts +26 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/viatom/viatom.pc100.sequencer.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/viatom/viatom.pc300.device.d.ts +16 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/viatom/viatom.pc300.device.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/viatom/viatom.pc300.protocol.d.ts +73 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/viatom/viatom.pc300.protocol.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/viatom/viatom.pc300.sequencer.d.ts +25 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/viatom/viatom.pc300.sequencer.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/types/device-measurement-map.d.ts +8 -1
- 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 +8 -1
- package/lib/typescript/module/src/modules/bt-management/types/integrated-devices.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.Bpm188Sequencer = void 0;
|
|
7
|
+
var _core = require("@ovok/core");
|
|
8
|
+
var _caseType = require("../../../types/case-type.js");
|
|
9
|
+
var _viatomBpm188Protocol = require("./viatom.bpm188.protocol.js");
|
|
10
|
+
const command = (write, frame) => ({
|
|
11
|
+
...write,
|
|
12
|
+
frame,
|
|
13
|
+
withoutResponse: true
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
/** Drives the BPM-188 info -> clock -> two-user history exchange. */
|
|
17
|
+
class Bpm188Sequencer {
|
|
18
|
+
phase = "info";
|
|
19
|
+
endedUsers = new Set();
|
|
20
|
+
constructor(params) {
|
|
21
|
+
this.params = params;
|
|
22
|
+
}
|
|
23
|
+
initialCommands = () => this.remember(this.write((0, _viatomBpm188Protocol.bpm188GetInfo)()));
|
|
24
|
+
isHistoryTransfer = () => true;
|
|
25
|
+
isNormalDisconnect = () => this.phase === "done";
|
|
26
|
+
commandTimeoutMs = () => this.phase === "done" ? undefined : 5_000;
|
|
27
|
+
onCommandTimeout = () => {
|
|
28
|
+
this.phase = "done";
|
|
29
|
+
return {
|
|
30
|
+
terminal: true
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
nextCommand = frame => {
|
|
34
|
+
const response = (0, _viatomBpm188Protocol.decodeBpm188Response)(frame);
|
|
35
|
+
if (!response || this.phase === "done") {
|
|
36
|
+
return undefined;
|
|
37
|
+
}
|
|
38
|
+
if (this.phase === "info") {
|
|
39
|
+
this.phase = "sync";
|
|
40
|
+
return this.remember(this.write((0, _viatomBpm188Protocol.bpm188SyncTime)(this.params.now?.())));
|
|
41
|
+
}
|
|
42
|
+
if (this.phase === "sync") {
|
|
43
|
+
this.phase = "records";
|
|
44
|
+
return this.remember(this.write((0, _viatomBpm188Protocol.bpm188GetRecords)()));
|
|
45
|
+
}
|
|
46
|
+
if (response.type === _viatomBpm188Protocol.Bpm188MessageType.records || response.type === _viatomBpm188Protocol.Bpm188MessageType.recordsEnd) {
|
|
47
|
+
const record = (0, _viatomBpm188Protocol.parseBpm188Record)(response.content);
|
|
48
|
+
if (record) {
|
|
49
|
+
this.params.onResult({
|
|
50
|
+
caseType: _caseType.CaseType.RESULT,
|
|
51
|
+
measurementTypeKey: _core.MeasurementTypeKey.bloodPressure,
|
|
52
|
+
systolic: record.systolic,
|
|
53
|
+
diastolic: record.diastolic,
|
|
54
|
+
heartRate: record.heartRate,
|
|
55
|
+
recordedAt: record.recordedAt
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
if (response.type === _viatomBpm188Protocol.Bpm188MessageType.recordsEnd) {
|
|
59
|
+
const userId = record?.userId ?? response.content[6];
|
|
60
|
+
if (userId !== undefined) {
|
|
61
|
+
this.endedUsers.add(typeof userId === "number" ? userId : Number.parseInt(userId, 16));
|
|
62
|
+
}
|
|
63
|
+
if (this.endedUsers.has(0) && this.endedUsers.has(1)) {
|
|
64
|
+
this.phase = "done";
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
return undefined;
|
|
69
|
+
};
|
|
70
|
+
write = frame => command(this.params.write, frame);
|
|
71
|
+
remember = next => {
|
|
72
|
+
return [next];
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
exports.Bpm188Sequencer = Bpm188Sequencer;
|
|
76
|
+
//# sourceMappingURL=viatom.bpm188.sequencer.js.map
|
package/lib/commonjs/modules/bt-management/services/devices/viatom/viatom.bpm188.sequencer.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_core","require","_caseType","_viatomBpm188Protocol","command","write","frame","withoutResponse","Bpm188Sequencer","phase","endedUsers","Set","constructor","params","initialCommands","remember","bpm188GetInfo","isHistoryTransfer","isNormalDisconnect","commandTimeoutMs","undefined","onCommandTimeout","terminal","nextCommand","response","decodeBpm188Response","bpm188SyncTime","now","bpm188GetRecords","type","Bpm188MessageType","records","recordsEnd","record","parseBpm188Record","content","onResult","caseType","CaseType","RESULT","measurementTypeKey","MeasurementTypeKey","bloodPressure","systolic","diastolic","heartRate","recordedAt","userId","add","Number","parseInt","has","next","exports"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/viatom/viatom.bpm188.sequencer.ts"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AAEA,IAAAC,SAAA,GAAAD,OAAA;AAQA,IAAAE,qBAAA,GAAAF,OAAA;AAiBA,MAAMG,OAAO,GAAGA,CACdC,KAAmC,EACnCC,KAAwB,MACL;EAAE,GAAGD,KAAK;EAAEC,KAAK;EAAEC,eAAe,EAAE;AAAK,CAAC,CAAC;;AAEhE;AACO,MAAMC,eAAe,CAA6B;EAC/CC,KAAK,GAAyC,MAAM;EAC3CC,UAAU,GAAG,IAAIC,GAAG,CAAS,CAAC;EAExCC,WAAWA,CAAkBC,MAA6B,EAAE;IAAA,KAA/BA,MAA6B,GAA7BA,MAA6B;EAAG;EAE7DC,eAAe,GAAGA,CAAA,KACvB,IAAI,CAACC,QAAQ,CAAC,IAAI,CAACV,KAAK,CAAC,IAAAW,mCAAa,EAAC,CAAC,CAAC,CAAC;EAErCC,iBAAiB,GAAGA,CAAA,KAAe,IAAI;EAEvCC,kBAAkB,GAAGA,CAAA,KAAe,IAAI,CAACT,KAAK,KAAK,MAAM;EAEzDU,gBAAgB,GAAGA,CAAA,KACxB,IAAI,CAACV,KAAK,KAAK,MAAM,GAAGW,SAAS,GAAG,KAAK;EAEpCC,gBAAgB,GAAGA,CAAA,KAA4B;IACpD,IAAI,CAACZ,K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AAItB,QAAQ,CAACK,IAAI,KAAKC,uCAAiB,CAACE,UAAU,EAAE;QAClD,MAAMe,MAAM,GAAGd,MAAM,EAAEc,MAAM,IAAIvB,QAAQ,CAACW,OAAO,CAAC,CAAC,CAAC;QAEpD,IAAIY,MAAM,KAAK3B,SAAS,EAAE;UACxB,IAAI,CAACV,UAAU,CAACsC,GAAG,CACjB,OAAOD,MAAM,KAAK,QAAQ,GACtBA,MAAM,GACNE,MAAM,CAACC,QAAQ,CAACH,MAAM,EAAE,EAAE,CAChC,CAAC;QACH;QAEA,IAAI,IAAI,CAACrC,UAAU,CAACyC,GAAG,CAAC,CAAC,CAAC,IAAI,IAAI,CAACzC,UAAU,CAACyC,GAAG,CAAC,CAAC,CAAC,EAAE;UACpD,IAAI,CAAC1C,KAAK,GAAG,MAAM;QACrB;MACF;IACF;IAEA,OAAOW,SAAS;EAClB,CAAC;EAEOf,KAAK,GAAIC,KAAwB,IACvCF,OAAO,CAAC,IAAI,CAACS,MAAM,CAACR,KAAK,EAAEC,KAAK,CAAC;EAE3BS,QAAQ,GAAIqC,IAAmB,IAA+B;IACpE,OAAO,CAACA,IAAI,CAAC;EACf,CAAC;AACH;AAACC,OAAA,CAAA7C,eAAA,GAAAA,eAAA","ignoreList":[]}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.pc100MainServices = exports.Pc100Device = void 0;
|
|
7
|
+
var _btManagedDevice = require("../bt-managed-device.js");
|
|
8
|
+
var _viatomPc100Protocol = require("./viatom.pc100.protocol.js");
|
|
9
|
+
var _viatomPc100Sequencer = require("./viatom.pc100.sequencer.js");
|
|
10
|
+
/* eslint-disable import/group-exports */
|
|
11
|
+
|
|
12
|
+
const acceptNothing = {
|
|
13
|
+
caseValuePosition: [],
|
|
14
|
+
cases: []
|
|
15
|
+
};
|
|
16
|
+
const pc100MainServices = exports.pc100MainServices = [{
|
|
17
|
+
uuid: _viatomPc100Protocol.PC100_SERVICE,
|
|
18
|
+
monitorUuids: [{
|
|
19
|
+
uuid: _viatomPc100Protocol.PC100_NOTIFY,
|
|
20
|
+
parsingModel: acceptNothing
|
|
21
|
+
}],
|
|
22
|
+
writeUuid: {
|
|
23
|
+
uuid: _viatomPc100Protocol.PC100_WRITE,
|
|
24
|
+
mainCommandUuid: "aa55"
|
|
25
|
+
}
|
|
26
|
+
}];
|
|
27
|
+
|
|
28
|
+
/** Viatom PC-100 spot-check monitor over the FFF0 AA55 protocol. */
|
|
29
|
+
class Pc100Device extends _btManagedDevice.BTManagedDevice {
|
|
30
|
+
mainServices = pc100MainServices;
|
|
31
|
+
stuckDataTimeout = 60_000;
|
|
32
|
+
onStreamStart = undefined;
|
|
33
|
+
preferredMtu = 247;
|
|
34
|
+
constructor(device, params) {
|
|
35
|
+
super(device, params);
|
|
36
|
+
this.frameReader = new _viatomPc100Protocol.Pc100FrameReader();
|
|
37
|
+
this.createCommandSequencer = () => new _viatomPc100Sequencer.Pc100Sequencer({
|
|
38
|
+
write: {
|
|
39
|
+
serviceUuid: _viatomPc100Protocol.PC100_SERVICE,
|
|
40
|
+
characteristicUuid: _viatomPc100Protocol.PC100_WRITE
|
|
41
|
+
},
|
|
42
|
+
onResult: result => this.onResult?.(result)
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
handleSuccessResult() {
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
exports.Pc100Device = Pc100Device;
|
|
50
|
+
//# sourceMappingURL=viatom.pc100.device.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_btManagedDevice","require","_viatomPc100Protocol","_viatomPc100Sequencer","acceptNothing","caseValuePosition","cases","pc100MainServices","exports","uuid","PC100_SERVICE","monitorUuids","PC100_NOTIFY","parsingModel","writeUuid","PC100_WRITE","mainCommandUuid","Pc100Device","BTManagedDevice","mainServices","stuckDataTimeout","onStreamStart","undefined","preferredMtu","constructor","device","params","frameReader","Pc100FrameReader","createCommandSequencer","Pc100Sequencer","write","serviceUuid","characteristicUuid","onResult","result","handleSuccessResult"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/viatom/viatom.pc100.device.ts"],"mappings":";;;;;;AASA,IAAAA,gBAAA,GAAAC,OAAA;AAEA,IAAAC,oBAAA,GAAAD,OAAA;AAMA,IAAAE,qBAAA,GAAAF,OAAA;AAjBA;;AAmBA,MAAMG,aAAa,GAAG;EAAEC,iBAAiB,EAAE,EAAE;EAAEC,KAAK,EAAE;AAAG,CAAC;AAEnD,MAAMC,iBAA6B,GAAAC,OAAA,CAAAD,iBAAA,GAAG,CAC3C;EACEE,IAAI,EAAEC,kCAAa;EACnBC,YAAY,EAAE,CAAC;IAAEF,IAAI,EAAEG,iCAAY;IAAEC,YAAY,EAAET;EAAc,CAAC,CAAC;EACnEU,SAAS,EAAE;IACTL,IAAI,EAAEM,gCAAW;IACjBC,eAAe,EAAE;EACnB;AACF,CAAC,CACF;;AAED;AACO,MAAMC,WAAW,SAASC,gCAAe,CAA0B;EAC9DC,YAAY,GAAGZ,iBAAiB;EAChCa,gBAAgB,GAAG,MAAM;EACzBC,aAAa,GAAGC,SAAS;EAChBC,YAAY,GAAG,GAAG;EAE9BC,WAAWA,CAChBC,MAAc,EACdC,MAAmD,EACnD;IACA,KAAK,CAACD,MAAM,EAAEC,MAAM,CAAC;IACrB,IAAI,CAACC,WAAW,GAAG,IAAIC,qCAAgB,CAAC,CAAC;IACzC,IAAI,CAACC,sBAAsB,GAAG,MAC5B,IAAIC,oCAAc,CAAC;MACjBC,KAAK,EAAE;QACLC,WAAW,EAAEtB,kCAAa;QAC1BuB,kBAAkB,EAAElB;MACtB,CAAC;MACDmB,QAAQ,EAAGC,MAAM,IACf,IAAI,CAACD,QAAQ,GACXC,MAGF;IACJ,CAAC,CAAC;EACN;EAEUC,mBAAmBA,CAAA,EAAS;IACpC;EACF;AACF;AAAC5B,OAAA,CAAAS,WAAA,GAAAA,WAAA","ignoreList":[]}
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.pc100Handshake = exports.pc100GetDeviceInfo = exports.pc100GetDeviceId = exports.pc100GetBloodPressureResult = exports.pc100Command = exports.parsePc100BloodPressureResult = exports.parsePc100BloodOxygenResult = exports.decodePc100Response = exports.Pc100FrameReader = exports.Pc100Command = exports.PC100_WRITE = exports.PC100_SERVICE = exports.PC100_NOTIFY = void 0;
|
|
7
|
+
var _frameReadStatus = require("../../../types/frame-read-status.js");
|
|
8
|
+
var _calculateCrc8Pc = require("../../../utils/calculate-crc-8-pc.js");
|
|
9
|
+
var _hexToByte = require("../../../utils/hex-to-byte.js");
|
|
10
|
+
/* eslint-disable import/group-exports */
|
|
11
|
+
|
|
12
|
+
const PC100_SERVICE = exports.PC100_SERVICE = "0000fff0-0000-1000-8000-00805f9b34fb";
|
|
13
|
+
const PC100_WRITE = exports.PC100_WRITE = "0000fff2-0000-1000-8000-00805f9b34fb";
|
|
14
|
+
const PC100_NOTIFY = exports.PC100_NOTIFY = "0000fff1-0000-1000-8000-00805f9b34fb";
|
|
15
|
+
const Pc100Command = exports.Pc100Command = {
|
|
16
|
+
handshake: 0xff,
|
|
17
|
+
deviceId: 0xff,
|
|
18
|
+
deviceInfo: 0x51,
|
|
19
|
+
bloodPressureResult: 0x43,
|
|
20
|
+
bloodOxygenParameters: 0x53
|
|
21
|
+
};
|
|
22
|
+
const byte = value => (value & 0xff).toString(16).padStart(2, "0");
|
|
23
|
+
|
|
24
|
+
/** Builds the PC-100 AA55 frame used by Pc100BleCmd. */
|
|
25
|
+
const pc100Command = (command, type, payload = []) => {
|
|
26
|
+
const frame = ["aa", "55", byte(command), byte(payload.length + 2), byte(type), ...payload, "00"];
|
|
27
|
+
frame[frame.length - 1] = byte((0, _calculateCrc8Pc.calculateCrc8Pc)(frame));
|
|
28
|
+
return frame;
|
|
29
|
+
};
|
|
30
|
+
exports.pc100Command = pc100Command;
|
|
31
|
+
const pc100Handshake = () => pc100Command(Pc100Command.handshake, 0x01);
|
|
32
|
+
exports.pc100Handshake = pc100Handshake;
|
|
33
|
+
const pc100GetDeviceId = () => pc100Command(Pc100Command.deviceId, 0x10);
|
|
34
|
+
exports.pc100GetDeviceId = pc100GetDeviceId;
|
|
35
|
+
const pc100GetDeviceInfo = () => pc100Command(Pc100Command.deviceInfo, 0x01);
|
|
36
|
+
exports.pc100GetDeviceInfo = pc100GetDeviceInfo;
|
|
37
|
+
const pc100GetBloodPressureResult = () => pc100Command(Pc100Command.bloodPressureResult, 0x01);
|
|
38
|
+
exports.pc100GetBloodPressureResult = pc100GetBloodPressureResult;
|
|
39
|
+
const decodePc100Response = bytes => {
|
|
40
|
+
if ((0, _hexToByte.hexToByte)(bytes[0] ?? "00") !== 0xaa || (0, _hexToByte.hexToByte)(bytes[1] ?? "00") !== 0x55) {
|
|
41
|
+
return undefined;
|
|
42
|
+
}
|
|
43
|
+
const length = (0, _hexToByte.hexToByte)(bytes[3] ?? "00");
|
|
44
|
+
const expectedLength = length + 4;
|
|
45
|
+
if (length < 2 || bytes.length < expectedLength) {
|
|
46
|
+
return undefined;
|
|
47
|
+
}
|
|
48
|
+
const frame = bytes.slice(0, expectedLength);
|
|
49
|
+
if ((0, _hexToByte.hexToByte)(frame.at(-1) ?? "00") !== (0, _calculateCrc8Pc.calculateCrc8Pc)(frame)) {
|
|
50
|
+
return undefined;
|
|
51
|
+
}
|
|
52
|
+
return {
|
|
53
|
+
command: (0, _hexToByte.hexToByte)(frame[2] ?? "00"),
|
|
54
|
+
type: (0, _hexToByte.hexToByte)(frame[4] ?? "00"),
|
|
55
|
+
content: frame.slice(5, -1)
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
exports.decodePc100Response = decodePc100Response;
|
|
59
|
+
const parsePc100BloodPressureResult = content => {
|
|
60
|
+
if (content.length < 5) {
|
|
61
|
+
return undefined;
|
|
62
|
+
}
|
|
63
|
+
const first = (0, _hexToByte.hexToByte)(content[0] ?? "00");
|
|
64
|
+
const systolic = (first & 0x7f) << 8 | (0, _hexToByte.hexToByte)(content[1] ?? "00");
|
|
65
|
+
const diastolic = (0, _hexToByte.hexToByte)(content[3] ?? "00");
|
|
66
|
+
const heartRate = (0, _hexToByte.hexToByte)(content[4] ?? "00");
|
|
67
|
+
if (systolic < 20 || systolic > 300 || diastolic < 10 || diastolic > 200 || heartRate < 20 || heartRate > 300) {
|
|
68
|
+
return undefined;
|
|
69
|
+
}
|
|
70
|
+
return {
|
|
71
|
+
systolic,
|
|
72
|
+
diastolic,
|
|
73
|
+
heartRate,
|
|
74
|
+
irregularHeartbeat: (first & 0x80) !== 0
|
|
75
|
+
};
|
|
76
|
+
};
|
|
77
|
+
exports.parsePc100BloodPressureResult = parsePc100BloodPressureResult;
|
|
78
|
+
const parsePc100BloodOxygenResult = content => {
|
|
79
|
+
if (content.length < 5) {
|
|
80
|
+
return undefined;
|
|
81
|
+
}
|
|
82
|
+
const bloodOxygen = (0, _hexToByte.hexToByte)(content[0] ?? "00");
|
|
83
|
+
const pulseRate = (0, _hexToByte.hexToByte)(content[1] ?? "00") | (0, _hexToByte.hexToByte)(content[2] ?? "00") << 8;
|
|
84
|
+
const perfusionIndex = (0, _hexToByte.hexToByte)(content[3] ?? "00");
|
|
85
|
+
const state = (0, _hexToByte.hexToByte)(content[4] ?? "00");
|
|
86
|
+
if (bloodOxygen < 50 || bloodOxygen > 100 || pulseRate < 20 || pulseRate > 300 || (state & 0x02) === 0) {
|
|
87
|
+
return undefined;
|
|
88
|
+
}
|
|
89
|
+
return {
|
|
90
|
+
bloodOxygen,
|
|
91
|
+
pulseRate,
|
|
92
|
+
perfusionIndex
|
|
93
|
+
};
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
/** Reads split and concatenated PC-100 AA55 frames. */
|
|
97
|
+
exports.parsePc100BloodOxygenResult = parsePc100BloodOxygenResult;
|
|
98
|
+
class Pc100FrameReader {
|
|
99
|
+
readFrame(buffer) {
|
|
100
|
+
const start = this.findStart(buffer);
|
|
101
|
+
if (start < 0) {
|
|
102
|
+
return {
|
|
103
|
+
status: _frameReadStatus.FrameReadStatus.INCOMPLETE,
|
|
104
|
+
consumedBytes: Math.max(0, buffer.length - 1)
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
if (start + 4 > buffer.length) {
|
|
108
|
+
return {
|
|
109
|
+
status: _frameReadStatus.FrameReadStatus.INCOMPLETE,
|
|
110
|
+
consumedBytes: start
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
const length = (0, _hexToByte.hexToByte)(buffer[start + 3] ?? "00") + 4;
|
|
114
|
+
if (length < 6) {
|
|
115
|
+
return {
|
|
116
|
+
status: _frameReadStatus.FrameReadStatus.CORRUPT,
|
|
117
|
+
consumedBytes: start + 1
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
if (start + length > buffer.length) {
|
|
121
|
+
return {
|
|
122
|
+
status: _frameReadStatus.FrameReadStatus.INCOMPLETE,
|
|
123
|
+
consumedBytes: start
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
const frame = buffer.slice(start, start + length);
|
|
127
|
+
if ((0, _hexToByte.hexToByte)(frame.at(-1) ?? "00") !== (0, _calculateCrc8Pc.calculateCrc8Pc)(frame)) {
|
|
128
|
+
return {
|
|
129
|
+
status: _frameReadStatus.FrameReadStatus.CORRUPT,
|
|
130
|
+
consumedBytes: start + 1
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
return {
|
|
134
|
+
status: _frameReadStatus.FrameReadStatus.COMPLETE,
|
|
135
|
+
consumedBytes: start + length,
|
|
136
|
+
frame
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
findStart = buffer => {
|
|
140
|
+
for (let index = 0; index + 1 < buffer.length; index += 1) {
|
|
141
|
+
if ((0, _hexToByte.hexToByte)(buffer[index] ?? "00") === 0xaa && (0, _hexToByte.hexToByte)(buffer[index + 1] ?? "00") === 0x55) {
|
|
142
|
+
return index;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
return -1;
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
exports.Pc100FrameReader = Pc100FrameReader;
|
|
149
|
+
//# sourceMappingURL=viatom.pc100.protocol.js.map
|
package/lib/commonjs/modules/bt-management/services/devices/viatom/viatom.pc100.protocol.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_frameReadStatus","require","_calculateCrc8Pc","_hexToByte","PC100_SERVICE","exports","PC100_WRITE","PC100_NOTIFY","Pc100Command","handshake","deviceId","deviceInfo","bloodPressureResult","bloodOxygenParameters","byte","value","toString","padStart","pc100Command","command","type","payload","frame","length","calculateCrc8Pc","pc100Handshake","pc100GetDeviceId","pc100GetDeviceInfo","pc100GetBloodPressureResult","decodePc100Response","bytes","hexToByte","undefined","expectedLength","slice","at","content","parsePc100BloodPressureResult","first","systolic","diastolic","heartRate","irregularHeartbeat","parsePc100BloodOxygenResult","bloodOxygen","pulseRate","perfusionIndex","state","Pc100FrameReader","readFrame","buffer","start","findStart","status","FrameReadStatus","INCOMPLETE","consumedBytes","Math","max","CORRUPT","COMPLETE","index"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/viatom/viatom.pc100.protocol.ts"],"mappings":";;;;;;AAGA,IAAAA,gBAAA,GAAAC,OAAA;AAEA,IAAAC,gBAAA,GAAAD,OAAA;AACA,IAAAE,UAAA,GAAAF,OAAA;AANA;;AAQO,MAAMG,aAAa,GAAAC,OAAA,CAAAD,aAAA,GAAG,sCAAsC;AAC5D,MAAME,WAAW,GAAAD,OAAA,CAAAC,WAAA,GAAG,sCAAsC;AAC1D,MAAMC,YAAY,GAAAF,OAAA,CAAAE,YAAA,GAAG,sCAAs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ACC,UAAU;QAAEC,aAAa,EAAEL;MAAM,CAAC;IACrE;IAEA,MAAM7B,KAAK,GAAG4B,MAAM,CAAChB,KAAK,CAACiB,KAAK,EAAEA,KAAK,GAAG5B,MAAM,CAAC;IAEjD,IAAI,IAAAQ,oBAAS,EAACT,KAAK,CAACa,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,KAAK,IAAAX,gCAAe,EAACF,KAAK,CAAC,EAAE;MAC9D,OAAO;QAAE+B,MAAM,EAAEC,gCAAe,CAACK,OAAO;QAAEH,aAAa,EAAEL,KAAK,GAAG;MAAE,CAAC;IACtE;IAEA,OAAO;MACLE,MAAM,EAAEC,gCAAe,CAACM,QAAQ;MAChCJ,aAAa,EAAEL,KAAK,GAAG5B,MAAM;MAC7BD;IACF,CAAC;EACH;EAEQ8B,SAAS,GAAIF,MAAyB,IAAa;IACzD,KAAK,IAAIW,KAAK,GAAG,CAAC,EAAEA,KAAK,GAAG,CAAC,GAAGX,MAAM,CAAC3B,MAAM,EAAEsC,KAAK,IAAI,CAAC,EAAE;MACzD,IACE,IAAA9B,oBAAS,EAACmB,MAAM,CAACW,KAAK,CAAC,IAAI,IAAI,CAAC,KAAK,IAAI,IACzC,IAAA9B,oBAAS,EAACmB,MAAM,CAACW,KAAK,GAAG,CAAC,CAAC,IAAI,IAAI,CAAC,KAAK,IAAI,EAC7C;QACA,OAAOA,KAAK;MACd;IACF;IAEA,OAAO,CAAC,CAAC;EACX,CAAC;AACH;AAACxD,OAAA,CAAA2C,gBAAA,GAAAA,gBAAA","ignoreList":[]}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.Pc100Sequencer = void 0;
|
|
7
|
+
var _core = require("@ovok/core");
|
|
8
|
+
var _caseType = require("../../../types/case-type.js");
|
|
9
|
+
var _viatomPc100Protocol = require("./viatom.pc100.protocol.js");
|
|
10
|
+
const command = (write, frame) => ({
|
|
11
|
+
...write,
|
|
12
|
+
frame,
|
|
13
|
+
withoutResponse: true
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
/** Reads the last PC-100 BP result and accepts live oxygen frames when present. */
|
|
17
|
+
class Pc100Sequencer {
|
|
18
|
+
phase = "handshake";
|
|
19
|
+
constructor(params) {
|
|
20
|
+
this.params = params;
|
|
21
|
+
}
|
|
22
|
+
initialCommands = () => [this.write((0, _viatomPc100Protocol.pc100Handshake)())];
|
|
23
|
+
isNormalDisconnect = () => this.phase === "done";
|
|
24
|
+
commandTimeoutMs = () => this.phase === "done" ? undefined : 5_000;
|
|
25
|
+
nextCommand = frame => {
|
|
26
|
+
const response = (0, _viatomPc100Protocol.decodePc100Response)(frame);
|
|
27
|
+
if (!response) {
|
|
28
|
+
return undefined;
|
|
29
|
+
}
|
|
30
|
+
const recordedAt = this.params.now?.() ?? new Date();
|
|
31
|
+
if (response.command === _viatomPc100Protocol.Pc100Command.bloodOxygenParameters) {
|
|
32
|
+
const result = (0, _viatomPc100Protocol.parsePc100BloodOxygenResult)(response.content);
|
|
33
|
+
if (result) {
|
|
34
|
+
this.params.onResult({
|
|
35
|
+
caseType: _caseType.CaseType.RESULT,
|
|
36
|
+
measurementTypeKey: _core.MeasurementTypeKey.bloodOxygenPulseRate,
|
|
37
|
+
...result,
|
|
38
|
+
recordedAt
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
return undefined;
|
|
42
|
+
}
|
|
43
|
+
if (this.phase === "handshake" && response.command === 0xff) {
|
|
44
|
+
this.phase = "device-id";
|
|
45
|
+
return [this.write((0, _viatomPc100Protocol.pc100GetDeviceId)())];
|
|
46
|
+
}
|
|
47
|
+
if (this.phase === "device-id" && response.command === 0xff) {
|
|
48
|
+
this.phase = "info";
|
|
49
|
+
return [this.write((0, _viatomPc100Protocol.pc100GetDeviceInfo)())];
|
|
50
|
+
}
|
|
51
|
+
if (this.phase === "info" && response.command === _viatomPc100Protocol.Pc100Command.deviceInfo) {
|
|
52
|
+
this.phase = "result";
|
|
53
|
+
return [this.write((0, _viatomPc100Protocol.pc100GetBloodPressureResult)())];
|
|
54
|
+
}
|
|
55
|
+
if (this.phase === "result" && response.command === _viatomPc100Protocol.Pc100Command.bloodPressureResult && response.type === 1) {
|
|
56
|
+
const result = (0, _viatomPc100Protocol.parsePc100BloodPressureResult)(response.content);
|
|
57
|
+
if (result) {
|
|
58
|
+
this.params.onResult({
|
|
59
|
+
caseType: _caseType.CaseType.RESULT,
|
|
60
|
+
measurementTypeKey: _core.MeasurementTypeKey.bloodPressure,
|
|
61
|
+
systolic: result.systolic,
|
|
62
|
+
diastolic: result.diastolic,
|
|
63
|
+
heartRate: result.heartRate,
|
|
64
|
+
irregularHeartbeat: result.irregularHeartbeat,
|
|
65
|
+
recordedAt
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
this.phase = "done";
|
|
69
|
+
}
|
|
70
|
+
return undefined;
|
|
71
|
+
};
|
|
72
|
+
onCommandTimeout = () => {
|
|
73
|
+
this.phase = "done";
|
|
74
|
+
return {
|
|
75
|
+
terminal: true
|
|
76
|
+
};
|
|
77
|
+
};
|
|
78
|
+
write = frame => command(this.params.write, frame);
|
|
79
|
+
}
|
|
80
|
+
exports.Pc100Sequencer = Pc100Sequencer;
|
|
81
|
+
//# sourceMappingURL=viatom.pc100.sequencer.js.map
|
package/lib/commonjs/modules/bt-management/services/devices/viatom/viatom.pc100.sequencer.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_core","require","_caseType","_viatomPc100Protocol","command","write","frame","withoutResponse","Pc100Sequencer","phase","constructor","params","initialCommands","pc100Handshake","isNormalDisconnect","commandTimeoutMs","undefined","nextCommand","response","decodePc100Response","recordedAt","now","Date","Pc100Command","bloodOxygenParameters","result","parsePc100BloodOxygenResult","content","onResult","caseType","CaseType","RESULT","measurementTypeKey","MeasurementTypeKey","bloodOxygenPulseRate","pc100GetDeviceId","pc100GetDeviceInfo","deviceInfo","pc100GetBloodPressureResult","bloodPressureResult","type","parsePc100BloodPressureResult","bloodPressure","systolic","diastolic","heartRate","irregularHeartbeat","onCommandTimeout","terminal","exports"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/viatom/viatom.pc100.sequencer.ts"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AAMA,IAAAC,SAAA,GAAAD,OAAA;AAKA,IAAAE,oBAAA,GAAAF,OAAA;AAqBA,MAAMG,OAAO,GAAGA,CACdC,KAAmC,EACnCC,KAAwB,MACL;EAAE,GAAGD,KAAK;EAAEC,KAAK;EAAEC,eAAe,EAAE;AAAK,CAAC,CAAC;;AAEhE;AACO,MAAMC,cAAc,CAA6B;EAC9CC,KAAK,GAAe,WAAW;EAEhCC,WAAWA,CAAkBC,MAA4B,EAAE;IAAA,KAA9BA,MAA4B,GAA5BA,MAA4B;EAAG;EAE5DC,eAAe,GAAGA,CAAA,KAAgC,CACvD,IAAI,CAACP,KAAK,CAAC,IAAAQ,mCAAc,EAAC,CAAC,CAAC,CAC7B;EAEMC,kBAAkB,GAAGA,CAAA,KAAe,IAAI,CAACL,KAAK,KAAK,MAAM;EAEzDM,gBAAgB,GAAGA,CAAA,KACxB,IAAI,CAACN,KAAK,KAAK,MAAM,GAAGO,SAAS,GAAG,KAAK;EAEpCC,WAAW,GAChBX,KAAwB,IACiB;IACzC,MAAMY,QAAQ,GAAG,IAAAC,wCAAmB,EAACb,KAAK,CAAC;IAE3C,IAAI,CAACY,QAAQ,EAAE;MACb,OAAOF,SAAS;IAClB;IAEA,MAAMI,UAAU,GAAG,IAAI,CAACT,MAAM,CAACU,GAAG,GAAG,CAAC,IAAI,IAAIC,IAAI,CAAC,CAAC;IAEpD,IAAIJ,QAAQ,CAACd,OAAO,KAAKmB,iCAAY,CAACC,qBAAqB,EAAE;MAC3D,MAAMC,MAAM,GAAG,IAAAC,gDAA2B,E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AAQ,EAAEC,kBAAQ,CAACC,MAAM;UACzBC,kBAAkB,EAAEC,wBAAkB,CAACS,aAAa;UACpDC,QAAQ,EAAElB,MAAM,CAACkB,QAAQ;UACzBC,SAAS,EAAEnB,MAAM,CAACmB,SAAS;UAC3BC,SAAS,EAAEpB,MAAM,CAACoB,SAAS;UAC3BC,kBAAkB,EAAErB,MAAM,CAACqB,kBAAkB;UAC7C1B;QACF,CAAC,CAAC;MACJ;MAEA,IAAI,CAACX,KAAK,GAAG,MAAM;IACrB;IAEA,OAAOO,SAAS;EAClB,CAAC;EAEM+B,gBAAgB,GAAGA,CAAA,KAAM;IAC9B,IAAI,CAACtC,KAAK,GAAG,MAAM;IAEnB,OAAO;MAAEuC,QAAQ,EAAE;IAAK,CAAC;EAC3B,CAAC;EAEO3C,KAAK,GAAIC,KAAwB,IACvCF,OAAO,CAAC,IAAI,CAACO,MAAM,CAACN,KAAK,EAAEC,KAAK,CAAC;AACrC;AAAC2C,OAAA,CAAAzC,cAAA,GAAAA,cAAA","ignoreList":[]}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.pc300MainServices = exports.Pc300Device = void 0;
|
|
7
|
+
var _btManagedDevice = require("../bt-managed-device.js");
|
|
8
|
+
var _viatomPc300Protocol = require("./viatom.pc300.protocol.js");
|
|
9
|
+
var _viatomPc300Sequencer = require("./viatom.pc300.sequencer.js");
|
|
10
|
+
/* eslint-disable import/group-exports */
|
|
11
|
+
|
|
12
|
+
const acceptNothing = {
|
|
13
|
+
caseValuePosition: [],
|
|
14
|
+
cases: []
|
|
15
|
+
};
|
|
16
|
+
const pc300MainServices = exports.pc300MainServices = [{
|
|
17
|
+
uuid: _viatomPc300Protocol.PC300_SERVICE,
|
|
18
|
+
monitorUuids: [{
|
|
19
|
+
uuid: _viatomPc300Protocol.PC300_NOTIFY,
|
|
20
|
+
parsingModel: acceptNothing
|
|
21
|
+
}],
|
|
22
|
+
writeUuid: {
|
|
23
|
+
uuid: _viatomPc300Protocol.PC300_WRITE,
|
|
24
|
+
mainCommandUuid: "aa55"
|
|
25
|
+
}
|
|
26
|
+
}];
|
|
27
|
+
|
|
28
|
+
/** Viatom PC-300/PC-200 spot-check family over the FFF0 AA55 protocol. */
|
|
29
|
+
class Pc300Device extends _btManagedDevice.BTManagedDevice {
|
|
30
|
+
mainServices = pc300MainServices;
|
|
31
|
+
stuckDataTimeout = 60_000;
|
|
32
|
+
onStreamStart = undefined;
|
|
33
|
+
preferredMtu = 247;
|
|
34
|
+
constructor(device, params) {
|
|
35
|
+
super(device, params);
|
|
36
|
+
this.frameReader = new _viatomPc300Protocol.Pc300FrameReader();
|
|
37
|
+
this.createCommandSequencer = () => new _viatomPc300Sequencer.Pc300Sequencer({
|
|
38
|
+
write: {
|
|
39
|
+
serviceUuid: _viatomPc300Protocol.PC300_SERVICE,
|
|
40
|
+
characteristicUuid: _viatomPc300Protocol.PC300_WRITE
|
|
41
|
+
},
|
|
42
|
+
onResult: result => this.onResult?.(result)
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
handleSuccessResult() {
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
exports.Pc300Device = Pc300Device;
|
|
50
|
+
//# sourceMappingURL=viatom.pc300.device.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_btManagedDevice","require","_viatomPc300Protocol","_viatomPc300Sequencer","acceptNothing","caseValuePosition","cases","pc300MainServices","exports","uuid","PC300_SERVICE","monitorUuids","PC300_NOTIFY","parsingModel","writeUuid","PC300_WRITE","mainCommandUuid","Pc300Device","BTManagedDevice","mainServices","stuckDataTimeout","onStreamStart","undefined","preferredMtu","constructor","device","params","frameReader","Pc300FrameReader","createCommandSequencer","Pc300Sequencer","write","serviceUuid","characteristicUuid","onResult","result","handleSuccessResult"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/viatom/viatom.pc300.device.ts"],"mappings":";;;;;;AASA,IAAAA,gBAAA,GAAAC,OAAA;AAEA,IAAAC,oBAAA,GAAAD,OAAA;AAMA,IAAAE,qBAAA,GAAAF,OAAA;AAjBA;;AAmBA,MAAMG,aAAa,GAAG;EAAEC,iBAAiB,EAAE,EAAE;EAAEC,KAAK,EAAE;AAAG,CAAC;AAEnD,MAAMC,iBAA6B,GAAAC,OAAA,CAAAD,iBAAA,GAAG,CAC3C;EACEE,IAAI,EAAEC,kCAAa;EACnBC,YAAY,EAAE,CAAC;IAAEF,IAAI,EAAEG,iCAAY;IAAEC,YAAY,EAAET;EAAc,CAAC,CAAC;EACnEU,SAAS,EAAE;IACTL,IAAI,EAAEM,gCAAW;IACjBC,eAAe,EAAE;EACnB;AACF,CAAC,CACF;;AAED;AACO,MAAMC,WAAW,SAASC,gCAAe,CAA0B;EAC9DC,YAAY,GAAGZ,iBAAiB;EAChCa,gBAAgB,GAAG,MAAM;EACzBC,aAAa,GAAGC,SAAS;EAChBC,YAAY,GAAG,GAAG;EAE9BC,WAAWA,CAChBC,MAAc,EACdC,MAAmD,EACnD;IACA,KAAK,CAACD,MAAM,EAAEC,MAAM,CAAC;IACrB,IAAI,CAACC,WAAW,GAAG,IAAIC,qCAAgB,CAAC,CAAC;IACzC,IAAI,CAACC,sBAAsB,GAAG,MAC5B,IAAIC,oCAAc,CAAC;MACjBC,KAAK,EAAE;QACLC,WAAW,EAAEtB,kCAAa;QAC1BuB,kBAAkB,EAAElB;MACtB,CAAC;MACDmB,QAAQ,EAAGC,MAAM,IACf,IAAI,CAACD,QAAQ,GACXC,MAGF;IACJ,CAAC,CAAC;EACN;EAEUC,mBAAmBA,CAAA,EAAS;IACpC;EACF;AACF;AAAC5B,OAAA,CAAAS,WAAA,GAAAA,WAAA","ignoreList":[]}
|