@ovok/native 1.17.0-dev.2303 → 1.17.0-dev.2305
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/android/src/main/java/com/ovok/sdk/backgroundsync/OvokBackgroundSyncPackage.java +2 -0
- package/android/src/main/java/com/ovok/sdk/pairing/OvokPairingAgentModule.java +85 -0
- package/lib/commonjs/modules/next/bluetooth/adapters/android-pairing-agent.js +25 -0
- package/lib/commonjs/modules/next/bluetooth/adapters/android-pairing-agent.js.map +1 -0
- package/lib/commonjs/modules/next/bluetooth/core/bluetooth.js +6 -1
- package/lib/commonjs/modules/next/bluetooth/core/bluetooth.js.map +1 -1
- package/lib/commonjs/modules/next/bluetooth/core/device-link.js +16 -0
- package/lib/commonjs/modules/next/bluetooth/core/device-link.js.map +1 -1
- package/lib/commonjs/modules/next/bluetooth/core/ports.js +2 -0
- package/lib/commonjs/modules/next/bluetooth/core/ports.js.map +1 -1
- package/lib/commonjs/modules/next/bluetooth/create-bluetooth.js +2 -0
- package/lib/commonjs/modules/next/bluetooth/create-bluetooth.js.map +1 -1
- package/lib/commonjs/modules/next/bluetooth/families/built-in.js +3 -2
- package/lib/commonjs/modules/next/bluetooth/families/built-in.js.map +1 -1
- package/lib/commonjs/modules/next/bluetooth/families/clarity-recobro/bgx.js +16 -0
- package/lib/commonjs/modules/next/bluetooth/families/clarity-recobro/bgx.js.map +1 -0
- package/lib/commonjs/modules/next/bluetooth/families/clarity-recobro/clarity-recobro.js +17 -0
- package/lib/commonjs/modules/next/bluetooth/families/clarity-recobro/clarity-recobro.js.map +1 -0
- package/lib/commonjs/modules/next/bluetooth/families/clarity-recobro/frame.js +52 -0
- package/lib/commonjs/modules/next/bluetooth/families/clarity-recobro/frame.js.map +1 -0
- package/lib/commonjs/modules/next/bluetooth/families/clarity-recobro/models.js +22 -0
- package/lib/commonjs/modules/next/bluetooth/families/clarity-recobro/models.js.map +1 -0
- package/lib/commonjs/modules/next/bluetooth/families/clarity-recobro/monitor.js +173 -0
- package/lib/commonjs/modules/next/bluetooth/families/clarity-recobro/monitor.js.map +1 -0
- package/lib/commonjs/modules/next/bluetooth/families/clarity-recobro/protocol.js +59 -0
- package/lib/commonjs/modules/next/bluetooth/families/clarity-recobro/protocol.js.map +1 -0
- package/lib/module/modules/next/bluetooth/adapters/android-pairing-agent.js +21 -0
- package/lib/module/modules/next/bluetooth/adapters/android-pairing-agent.js.map +1 -0
- package/lib/module/modules/next/bluetooth/core/bluetooth.js +6 -1
- package/lib/module/modules/next/bluetooth/core/bluetooth.js.map +1 -1
- package/lib/module/modules/next/bluetooth/core/device-link.js +16 -0
- package/lib/module/modules/next/bluetooth/core/device-link.js.map +1 -1
- package/lib/module/modules/next/bluetooth/core/ports.js +2 -0
- package/lib/module/modules/next/bluetooth/core/ports.js.map +1 -1
- package/lib/module/modules/next/bluetooth/create-bluetooth.js +2 -0
- package/lib/module/modules/next/bluetooth/create-bluetooth.js.map +1 -1
- package/lib/module/modules/next/bluetooth/families/built-in.js +3 -2
- package/lib/module/modules/next/bluetooth/families/built-in.js.map +1 -1
- package/lib/module/modules/next/bluetooth/families/clarity-recobro/bgx.js +14 -0
- package/lib/module/modules/next/bluetooth/families/clarity-recobro/bgx.js.map +1 -0
- package/lib/module/modules/next/bluetooth/families/clarity-recobro/clarity-recobro.js +9 -0
- package/lib/module/modules/next/bluetooth/families/clarity-recobro/clarity-recobro.js.map +1 -0
- package/lib/module/modules/next/bluetooth/families/clarity-recobro/frame.js +48 -0
- package/lib/module/modules/next/bluetooth/families/clarity-recobro/frame.js.map +1 -0
- package/lib/module/modules/next/bluetooth/families/clarity-recobro/models.js +20 -0
- package/lib/module/modules/next/bluetooth/families/clarity-recobro/models.js.map +1 -0
- package/lib/module/modules/next/bluetooth/families/clarity-recobro/monitor.js +169 -0
- package/lib/module/modules/next/bluetooth/families/clarity-recobro/monitor.js.map +1 -0
- package/lib/module/modules/next/bluetooth/families/clarity-recobro/protocol.js +56 -0
- package/lib/module/modules/next/bluetooth/families/clarity-recobro/protocol.js.map +1 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/android-pairing-agent.d.ts +8 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/android-pairing-agent.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/core/bluetooth-options.d.ts +3 -1
- package/lib/typescript/commonjs/src/modules/next/bluetooth/core/bluetooth-options.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/next/bluetooth/core/bluetooth.d.ts +2 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/core/bluetooth.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/next/bluetooth/core/device-deps.d.ts +3 -1
- package/lib/typescript/commonjs/src/modules/next/bluetooth/core/device-deps.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/next/bluetooth/core/device-link.d.ts +6 -1
- package/lib/typescript/commonjs/src/modules/next/bluetooth/core/device-link.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/next/bluetooth/core/ports.d.ts +6 -1
- package/lib/typescript/commonjs/src/modules/next/bluetooth/core/ports.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/next/bluetooth/create-bluetooth.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/next/bluetooth/families/built-in.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/next/bluetooth/families/clarity-recobro/bgx.d.ts +8 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/families/clarity-recobro/bgx.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/families/clarity-recobro/clarity-recobro.d.ts +6 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/families/clarity-recobro/clarity-recobro.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/families/clarity-recobro/frame.d.ts +10 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/families/clarity-recobro/frame.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/families/clarity-recobro/models.d.ts +7 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/families/clarity-recobro/models.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/families/clarity-recobro/monitor.d.ts +16 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/families/clarity-recobro/monitor.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/families/clarity-recobro/protocol.d.ts +6 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/families/clarity-recobro/protocol.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/next/bluetooth/adapters/android-pairing-agent.d.ts +8 -0
- package/lib/typescript/module/src/modules/next/bluetooth/adapters/android-pairing-agent.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/next/bluetooth/core/bluetooth-options.d.ts +3 -1
- package/lib/typescript/module/src/modules/next/bluetooth/core/bluetooth-options.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/next/bluetooth/core/bluetooth.d.ts +2 -0
- package/lib/typescript/module/src/modules/next/bluetooth/core/bluetooth.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/next/bluetooth/core/device-deps.d.ts +3 -1
- package/lib/typescript/module/src/modules/next/bluetooth/core/device-deps.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/next/bluetooth/core/device-link.d.ts +6 -1
- package/lib/typescript/module/src/modules/next/bluetooth/core/device-link.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/next/bluetooth/core/ports.d.ts +6 -1
- package/lib/typescript/module/src/modules/next/bluetooth/core/ports.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/next/bluetooth/create-bluetooth.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/next/bluetooth/families/built-in.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/next/bluetooth/families/clarity-recobro/bgx.d.ts +8 -0
- package/lib/typescript/module/src/modules/next/bluetooth/families/clarity-recobro/bgx.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/next/bluetooth/families/clarity-recobro/clarity-recobro.d.ts +6 -0
- package/lib/typescript/module/src/modules/next/bluetooth/families/clarity-recobro/clarity-recobro.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/next/bluetooth/families/clarity-recobro/frame.d.ts +10 -0
- package/lib/typescript/module/src/modules/next/bluetooth/families/clarity-recobro/frame.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/next/bluetooth/families/clarity-recobro/models.d.ts +7 -0
- package/lib/typescript/module/src/modules/next/bluetooth/families/clarity-recobro/models.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/next/bluetooth/families/clarity-recobro/monitor.d.ts +16 -0
- package/lib/typescript/module/src/modules/next/bluetooth/families/clarity-recobro/monitor.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/next/bluetooth/families/clarity-recobro/protocol.d.ts +6 -0
- package/lib/typescript/module/src/modules/next/bluetooth/families/clarity-recobro/protocol.d.ts.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { frameOf, skipOf, WAIT } from "../frame-tools/frame-stream.js";
|
|
4
|
+
|
|
5
|
+
/** Every frame starts with these two bytes. */
|
|
6
|
+
const SYNC = [0x55, 0xaa];
|
|
7
|
+
|
|
8
|
+
/** The sync and the length byte; the length counts the bytes after it. */
|
|
9
|
+
const HEADER_BYTES = 3;
|
|
10
|
+
|
|
11
|
+
/** The monitor's own app drops longer frames, so a longer one means a false sync. */
|
|
12
|
+
const MAX_FRAME_BYTES = 80;
|
|
13
|
+
const syncAt = (held, at) => SYNC.every((byte, offset) => held[at + offset] === byte);
|
|
14
|
+
const firstSync = held => {
|
|
15
|
+
for (let at = 0; at + SYNC.length <= held.length; at += 1) {
|
|
16
|
+
if (syncAt(held, at)) {
|
|
17
|
+
return at;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
return -1;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Cuts `55 AA L` frames. They carry no checksum the monitor's own app checks; it trusts a frame once the next frame's
|
|
25
|
+
* sync follows it, and so does this.
|
|
26
|
+
*/
|
|
27
|
+
const recobroFraming = held => {
|
|
28
|
+
const start = firstSync(held);
|
|
29
|
+
if (start !== 0) {
|
|
30
|
+
return start > 0 ? skipOf(start) : held.length > 1 ? skipOf(held.length - 1) : WAIT;
|
|
31
|
+
}
|
|
32
|
+
if (held.length < HEADER_BYTES) {
|
|
33
|
+
return WAIT;
|
|
34
|
+
}
|
|
35
|
+
const length = HEADER_BYTES + (held[2] ?? 0);
|
|
36
|
+
if (length > MAX_FRAME_BYTES) {
|
|
37
|
+
return skipOf(1);
|
|
38
|
+
}
|
|
39
|
+
if (held.length < length + SYNC.length) {
|
|
40
|
+
return WAIT;
|
|
41
|
+
}
|
|
42
|
+
return syncAt(held, length) ? frameOf(length) : skipOf(1);
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
/** The bytes after the length, where the frame counter, the module flags and the module blocks are. */
|
|
46
|
+
const bodyOf = frame => frame.subarray(HEADER_BYTES);
|
|
47
|
+
export { bodyOf, recobroFraming };
|
|
48
|
+
//# sourceMappingURL=frame.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["frameOf","skipOf","WAIT","SYNC","HEADER_BYTES","MAX_FRAME_BYTES","syncAt","held","at","every","byte","offset","firstSync","length","recobroFraming","start","bodyOf","frame","subarray"],"sourceRoot":"../../../../../../../src","sources":["modules/next/bluetooth/families/clarity-recobro/frame.ts"],"mappings":";;AAAA,SAASA,OAAO,EAAWC,MAAM,EAAEC,IAAI,QAAQ,gCAA6B;;AAE5E;AACA,MAAMC,IAAI,GAAG,CAAC,IAAI,EAAE,IAAI,CAAU;;AAElC;AACA,MAAMC,YAAY,GAAG,CAAC;;AAEtB;AACA,MAAMC,eAAe,GAAG,EAAE;AAE1B,MAAMC,MAAM,GAAGA,CAACC,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;AACA,MAAMe,MAAM,GAAIC,KAAiB,IAAiBA,KAAK,CAACC,QAAQ,CAACd,YAAY,CAAC;AAE9E,SAASY,MAAM,EAAEF,cAAc","ignoreList":[]}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { modelRows } from "../sig/model-row.js";
|
|
4
|
+
import { BGX_SERVICE } from "./bgx.js";
|
|
5
|
+
import { RECOBRO } from "./protocol.js";
|
|
6
|
+
|
|
7
|
+
/** The passkey every Recobro's BLE bridge asks for; the device never shows it. */
|
|
8
|
+
const RECOBRO_PASSKEY = "821687";
|
|
9
|
+
const recobroRow = modelRows(RECOBRO.id, ["heart_rate", "oxygen_saturation", "blood_pressure", "respiration_rate", "temperature"]);
|
|
10
|
+
|
|
11
|
+
/** Clarity Medical's monitors in COMM mode BLE; in Bluetooth Classic mode they need an SPP link this SDK does not open. */
|
|
12
|
+
const CLARITY_RECOBRO_MODELS = [recobroRow("Clarity Medical", "Recobro Vigile", ["REC*"], {
|
|
13
|
+
services: [BGX_SERVICE],
|
|
14
|
+
pin: {
|
|
15
|
+
kind: "fixed",
|
|
16
|
+
value: RECOBRO_PASSKEY
|
|
17
|
+
}
|
|
18
|
+
})];
|
|
19
|
+
export { CLARITY_RECOBRO_MODELS, RECOBRO_PASSKEY };
|
|
20
|
+
//# sourceMappingURL=models.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["modelRows","BGX_SERVICE","RECOBRO","RECOBRO_PASSKEY","recobroRow","id","CLARITY_RECOBRO_MODELS","services","pin","kind","value"],"sourceRoot":"../../../../../../../src","sources":["modules/next/bluetooth/families/clarity-recobro/models.ts"],"mappings":";;AACA,SAASA,SAAS,QAAQ,qBAAkB;AAE5C,SAASC,WAAW,QAAQ,UAAO;AACnC,SAASC,OAAO,QAAQ,eAAY;;AAEpC;AACA,MAAMC,eAAe,GAAG,QAAQ;AAEhC,MAAMC,UAAU,GAAGJ,SAAS,CAACE,OAAO,CAACG,EAAE,EAAE,CAAC,YAAY,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,aAAa,CAAC,CAAC;;AAElI;AACA,MAAMC,sBAA8C,GAAG,CACrDF,UAAU,CAAC,iBAAiB,EAAE,gBAAgB,EAAE,CAAC,MAAM,CAAC,EAAE;EACxDG,QAAQ,EAAE,CAACN,WAAW,CAAC;EACvBO,GAAG,EAAE;IAAEC,IAAI,EAAE,OAAO;IAAEC,KAAK,EAAEP;EAAgB;AAC/C,CAAC,CAAC,CACH;AAED,SAASG,sBAAsB,EAAEH,eAAe","ignoreList":[]}
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { u16le } from "../../codec/bytes.js";
|
|
4
|
+
/** Body bytes before the module blocks: the frame counter, the 16-bit module flags, and one byte the app skips. */
|
|
5
|
+
const BLOCKS_AT = 4;
|
|
6
|
+
const COUNTER_AT = 0;
|
|
7
|
+
const FLAGS_AT = 1;
|
|
8
|
+
|
|
9
|
+
/** The module blocks in flag-bit order, with their sizes; each present block follows the ones before it. */
|
|
10
|
+
const ECG = {
|
|
11
|
+
bit: 1,
|
|
12
|
+
bytes: 16,
|
|
13
|
+
commitAt: 26
|
|
14
|
+
};
|
|
15
|
+
const SPO2 = {
|
|
16
|
+
bit: 2,
|
|
17
|
+
bytes: 4,
|
|
18
|
+
commitAt: 9
|
|
19
|
+
};
|
|
20
|
+
const NIBP = {
|
|
21
|
+
bit: 3,
|
|
22
|
+
bytes: 5,
|
|
23
|
+
commitAt: 7
|
|
24
|
+
};
|
|
25
|
+
const IBP1 = {
|
|
26
|
+
bit: 4,
|
|
27
|
+
bytes: 5
|
|
28
|
+
};
|
|
29
|
+
const IBP2 = {
|
|
30
|
+
bit: 5,
|
|
31
|
+
bytes: 5
|
|
32
|
+
};
|
|
33
|
+
const BLOCKS_IN_ORDER = [ECG, SPO2, NIBP, IBP1, IBP2];
|
|
34
|
+
|
|
35
|
+
/** Where the ECG module keeps its slow values. */
|
|
36
|
+
const HEART_RATE_SLOT = 0;
|
|
37
|
+
const RESPIRATION_SLOT = 2;
|
|
38
|
+
const TEMPERATURE_SLOT = 4;
|
|
39
|
+
const PROBES_SLOT = 8;
|
|
40
|
+
const HEART_RATE_EXTRA_SLOT = 21;
|
|
41
|
+
const FIRST_PROBE_OFF = 0x01;
|
|
42
|
+
const TENTHS = 10;
|
|
43
|
+
|
|
44
|
+
/** Where the SpO2 module keeps its slow values. */
|
|
45
|
+
const PULSE_SLOT = 0;
|
|
46
|
+
const SPO2_SLOT = 1;
|
|
47
|
+
const PERFUSION_SLOT = 2;
|
|
48
|
+
const HUNDREDTHS = 100;
|
|
49
|
+
|
|
50
|
+
/** Where the NIBP module keeps its slow values. */
|
|
51
|
+
const NIBP_PULSE_SLOT = 0;
|
|
52
|
+
const SYSTOLIC_SLOT = 1;
|
|
53
|
+
const DIASTOLIC_SLOT = 2;
|
|
54
|
+
const MEAN_SLOT = 3;
|
|
55
|
+
const NIBP_STATUS_SLOT = 4;
|
|
56
|
+
const NIBP_RESULT_READY = 0x01;
|
|
57
|
+
const perMinute = value => ({
|
|
58
|
+
value,
|
|
59
|
+
unit: "/min"
|
|
60
|
+
});
|
|
61
|
+
const percent = value => ({
|
|
62
|
+
value,
|
|
63
|
+
unit: "%"
|
|
64
|
+
});
|
|
65
|
+
const mmHg = value => ({
|
|
66
|
+
value,
|
|
67
|
+
unit: "mm[Hg]"
|
|
68
|
+
});
|
|
69
|
+
const celsius = value => ({
|
|
70
|
+
value,
|
|
71
|
+
unit: "Cel"
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
/** The monitor sends 0 for a value it has not measured. */
|
|
75
|
+
const whenMeasured = (raw, quantity) => raw > 0 ? quantity(raw) : undefined;
|
|
76
|
+
const isPresent = (flags, bit) => (flags & 1 << bit) !== 0;
|
|
77
|
+
|
|
78
|
+
/** Where a module's block starts: after every lower-bit block the frame carries. */
|
|
79
|
+
const blockAt = (flags, bit) => BLOCKS_AT + BLOCKS_IN_ORDER.filter(block => block.bit < bit && isPresent(flags, block.bit)).reduce((sum, block) => sum + block.bytes, 0);
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* One module's slow values: each frame brings one byte, kept at the slot the frame counter names. They are whole once
|
|
83
|
+
* every slot before `commitAt` arrived in order since the counter last passed 0, which a dropped frame breaks.
|
|
84
|
+
*/
|
|
85
|
+
class SlowSlots {
|
|
86
|
+
next = -1;
|
|
87
|
+
constructor(commitAt) {
|
|
88
|
+
this.commitAt = commitAt;
|
|
89
|
+
this.slots = Array.from({
|
|
90
|
+
length: commitAt
|
|
91
|
+
}, () => 0);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/** Keeps the byte, and hands back every slot when this frame is the module's commit point after a whole cycle. */
|
|
95
|
+
take(counter, byte) {
|
|
96
|
+
if (counter === 0) {
|
|
97
|
+
this.next = 0;
|
|
98
|
+
}
|
|
99
|
+
if (counter < this.commitAt) {
|
|
100
|
+
this.next = counter === this.next ? counter + 1 : -1;
|
|
101
|
+
this.slots[counter] = byte;
|
|
102
|
+
return null;
|
|
103
|
+
}
|
|
104
|
+
const whole = counter === this.commitAt && this.next === this.commitAt;
|
|
105
|
+
this.next = -1;
|
|
106
|
+
return whole ? [...this.slots] : null;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
const slotAt = (slots, at) => slots[at] ?? 0;
|
|
110
|
+
const ecgValues = slots => {
|
|
111
|
+
const probeOff = (slotAt(slots, PROBES_SLOT) & FIRST_PROBE_OFF) !== 0;
|
|
112
|
+
const temperature = probeOff ? undefined : whenMeasured(slotAt(slots, TEMPERATURE_SLOT) | slotAt(slots, TEMPERATURE_SLOT + 1) << 8, tenths => celsius(tenths / TENTHS));
|
|
113
|
+
return {
|
|
114
|
+
// The monitor's own app adds the second slot to the first rather than shifting it.
|
|
115
|
+
heart_rate: whenMeasured(slotAt(slots, HEART_RATE_SLOT) + slotAt(slots, HEART_RATE_EXTRA_SLOT), perMinute),
|
|
116
|
+
respiration_rate: whenMeasured(slotAt(slots, RESPIRATION_SLOT), perMinute),
|
|
117
|
+
body_temperature: temperature
|
|
118
|
+
};
|
|
119
|
+
};
|
|
120
|
+
const spo2Values = slots => ({
|
|
121
|
+
spo2: whenMeasured(slotAt(slots, SPO2_SLOT), percent),
|
|
122
|
+
pulse_rate: whenMeasured(slotAt(slots, PULSE_SLOT), perMinute),
|
|
123
|
+
perfusion_index: whenMeasured(slotAt(slots, PERFUSION_SLOT) | slotAt(slots, PERFUSION_SLOT + 1) << 8, hundredths => percent(hundredths / HUNDREDTHS))
|
|
124
|
+
});
|
|
125
|
+
const nibpValues = slots => (slotAt(slots, NIBP_STATUS_SLOT) & NIBP_RESULT_READY) === 0 ? {} : {
|
|
126
|
+
systolic: whenMeasured(slotAt(slots, SYSTOLIC_SLOT), mmHg),
|
|
127
|
+
diastolic: whenMeasured(slotAt(slots, DIASTOLIC_SLOT), mmHg),
|
|
128
|
+
mean_arterial_pressure: whenMeasured(slotAt(slots, MEAN_SLOT), mmHg),
|
|
129
|
+
pulse_rate: whenMeasured(slotAt(slots, NIBP_PULSE_SLOT), perMinute)
|
|
130
|
+
};
|
|
131
|
+
const measuredOnly = values => Object.fromEntries(Object.entries(values).filter(([, quantity]) => quantity !== undefined));
|
|
132
|
+
const sameResult = (a, b) => a.systolic?.value === b.systolic?.value && a.diastolic?.value === b.diastolic?.value && a.mean_arterial_pressure?.value === b.mean_arterial_pressure?.value;
|
|
133
|
+
|
|
134
|
+
/** Turns frame bodies into the values each module commits, about once per 67-frame counter cycle. */
|
|
135
|
+
class RecobroMonitor {
|
|
136
|
+
ecg = new SlowSlots(ECG.commitAt);
|
|
137
|
+
spo2 = new SlowSlots(SPO2.commitAt);
|
|
138
|
+
nibp = new SlowSlots(NIBP.commitAt);
|
|
139
|
+
lastBloodPressure = {};
|
|
140
|
+
|
|
141
|
+
/** The values this frame completes, empty for most frames. */
|
|
142
|
+
valuesOf(body) {
|
|
143
|
+
const counter = body[COUNTER_AT] ?? 0;
|
|
144
|
+
const flags = u16le(body, FLAGS_AT);
|
|
145
|
+
return measuredOnly({
|
|
146
|
+
...this.module(body, counter, flags, ECG, this.ecg, ecgValues),
|
|
147
|
+
...this.module(body, counter, flags, SPO2, this.spo2, spo2Values),
|
|
148
|
+
...this.bloodPressure(this.module(body, counter, flags, NIBP, this.nibp, nibpValues))
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
module(body, counter, flags, block, slots, valuesOf) {
|
|
152
|
+
if (!isPresent(flags, block.bit)) {
|
|
153
|
+
return {};
|
|
154
|
+
}
|
|
155
|
+
const whole = slots.take(counter, body[blockAt(flags, block.bit)] ?? 0);
|
|
156
|
+
return whole ? valuesOf(whole) : {};
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
/** A finished measurement stays in the slots for later cycles, so it counts once until a different one arrives. */
|
|
160
|
+
bloodPressure(values) {
|
|
161
|
+
if (values.systolic === undefined || sameResult(values, this.lastBloodPressure)) {
|
|
162
|
+
return {};
|
|
163
|
+
}
|
|
164
|
+
this.lastBloodPressure = values;
|
|
165
|
+
return values;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
export { RecobroMonitor };
|
|
169
|
+
//# sourceMappingURL=monitor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["u16le","BLOCKS_AT","COUNTER_AT","FLAGS_AT","ECG","bit","bytes","commitAt","SPO2","NIBP","IBP1","IBP2","BLOCKS_IN_ORDER","HEART_RATE_SLOT","RESPIRATION_SLOT","TEMPERATURE_SLOT","PROBES_SLOT","HEART_RATE_EXTRA_SLOT","FIRST_PROBE_OFF","TENTHS","PULSE_SLOT","SPO2_SLOT","PERFUSION_SLOT","HUNDREDTHS","NIBP_PULSE_SLOT","SYSTOLIC_SLOT","DIASTOLIC_SLOT","MEAN_SLOT","NIBP_STATUS_SLOT","NIBP_RESULT_READY","perMinute","value","unit","percent","mmHg","celsius","whenMeasured","raw","quantity","undefined","isPresent","flags","blockAt","filter","block","reduce","sum","SlowSlots","next","constructor","slots","Array","from","length","take","counter","byte","whole","slotAt","at","ecgValues","probeOff","temperature","tenths","heart_rate","respiration_rate","body_temperature","spo2Values","spo2","pulse_rate","perfusion_index","hundredths","nibpValues","systolic","diastolic","mean_arterial_pressure","measuredOnly","values","Object","fromEntries","entries","sameResult","a","b","RecobroMonitor","ecg","nibp","lastBloodPressure","valuesOf","body","module","bloodPressure"],"sourceRoot":"../../../../../../../src","sources":["modules/next/bluetooth/families/clarity-recobro/monitor.ts"],"mappings":";;AAAA,SAASA,KAAK,QAAQ,sBAAmB;AAGzC;AACA,MAAMC,SAAS,GAAG,CAAC;AACnB,MAAMC,UAAU,GAAG,CAAC;AACpB,MAAMC,QAAQ,GAAG,CAAC;;AAElB;AACA,MAAMC,GAAG,GAAG;EAAEC,GAAG,EAAE,CAAC;EAAEC,KAAK,EAAE,EAAE;EAAEC,QAAQ,EAAE;AAAG,CAAC;AAC/C,MAAMC,IAAI,GAAG;EAAEH,GAAG,EAAE,CAAC;EAAEC,KAAK,EAAE,CAAC;EAAEC,QAAQ,EAAE;AAAE,CAAC;AAC9C,MAAME,IAAI,GAAG;EAAEJ,GAAG,EAAE,CAAC;EAAEC,KAAK,EAAE,CAAC;EAAEC,QAAQ,EAAE;AAAE,CAAC;AAC9C,MAAMG,IAAI,GAAG;EAAEL,GAAG,EAAE,CAAC;EAAEC,KAAK,EAAE;AAAE,CAAC;AACjC,MAAMK,IAAI,GAAG;EAAEN,GAAG,EAAE,CAAC;EAAEC,KAAK,EAAE;AAAE,CAAC;AACjC,MAAMM,eAAe,GAAG,CAACR,GAAG,EAAEI,IAAI,EAAEC,IAAI,EAAEC,IAAI,EAAEC,IAAI,CAAU;;AAE9D;AACA,MAAME,eAAe,GAAG,CAAC;AACzB,MAAMC,gBAAgB,GAAG,CAAC;AAC1B,MAAMC,gBAAgB,GAAG,CAAC;AAC1B,MAAMC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
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { FrameStream } from "../frame-tools/frame-stream.js";
|
|
4
|
+
import { untilAborted } from "../sig/waiting.js";
|
|
5
|
+
import { BGX_MODE, BGX_SERVICE, BGX_STREAM_OUT } from "./bgx.js";
|
|
6
|
+
import { bodyOf, recobroFraming } from "./frame.js";
|
|
7
|
+
import { RecobroMonitor } from "./monitor.js";
|
|
8
|
+
/** The BGX answers nothing on an unencrypted link, so reading its mode is where the phone pairs and proves it did. */
|
|
9
|
+
const open = async ({
|
|
10
|
+
link,
|
|
11
|
+
now
|
|
12
|
+
}) => {
|
|
13
|
+
await link.read(BGX_SERVICE, BGX_MODE);
|
|
14
|
+
return {
|
|
15
|
+
link,
|
|
16
|
+
now
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
/** The monitor streams by itself once paired; its receive notifications stay off, which keeps the BGX's plain flow control. */
|
|
21
|
+
const live = async ({
|
|
22
|
+
link,
|
|
23
|
+
now
|
|
24
|
+
}, onFrame, signal) => {
|
|
25
|
+
const frames = new FrameStream(recobroFraming);
|
|
26
|
+
const monitor = new RecobroMonitor();
|
|
27
|
+
const stop = await link.subscribe(BGX_SERVICE, BGX_STREAM_OUT, bytes => {
|
|
28
|
+
frames.push(bytes).forEach(frame => {
|
|
29
|
+
const values = monitor.valuesOf(bodyOf(frame));
|
|
30
|
+
if (Object.keys(values).length > 0) {
|
|
31
|
+
onFrame({
|
|
32
|
+
values: {
|
|
33
|
+
at: now(),
|
|
34
|
+
values,
|
|
35
|
+
deviceFlags: []
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
});
|
|
41
|
+
try {
|
|
42
|
+
await untilAborted(signal);
|
|
43
|
+
} finally {
|
|
44
|
+
stop();
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
/** The Recobro streams its monitor data through the BGX bridge once paired. */
|
|
49
|
+
const RECOBRO = {
|
|
50
|
+
id: "clarity/recobro",
|
|
51
|
+
services: [BGX_SERVICE],
|
|
52
|
+
open,
|
|
53
|
+
live
|
|
54
|
+
};
|
|
55
|
+
export { RECOBRO };
|
|
56
|
+
//# sourceMappingURL=protocol.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["FrameStream","untilAborted","BGX_MODE","BGX_SERVICE","BGX_STREAM_OUT","bodyOf","recobroFraming","RecobroMonitor","open","link","now","read","live","onFrame","signal","frames","monitor","stop","subscribe","bytes","push","forEach","frame","values","valuesOf","Object","keys","length","at","deviceFlags","RECOBRO","id","services"],"sourceRoot":"../../../../../../../src","sources":["modules/next/bluetooth/families/clarity-recobro/protocol.ts"],"mappings":";;AAEA,SAASA,WAAW,QAAQ,gCAA6B;AACzD,SAASC,YAAY,QAAQ,mBAAgB;AAE7C,SAASC,QAAQ,EAAEC,WAAW,EAAEC,cAAc,QAAQ,UAAO;AAC7D,SAASC,MAAM,EAAEC,cAAc,QAAQ,YAAS;AAChD,SAASC,cAAc,QAAQ,cAAW;AAI1C;AACA,MAAMC,IAAI,GAAG,MAAAA,CAAO;EAAEC,IAAI;EAAEC;AAAqB,CAAC,KAA0B;EAC1E,MAAMD,IAAI,CAACE,IAAI,CAACR,WAAW,EAAED,QAAQ,CAAC;EAEtC,OAAO;IAAEO,IAAI;IAAEC;EAAI,CAAC;AACtB,CAAC;;AAED;AACA,MAAME,IAAI,GAAG,MAAAA,CAAO;EAAEH,IAAI;EAAEC;AAAgB,CAAC,EAAEG,OAAmC,EAAEC,MAAmB,KAAoB;EACzH,MAAMC,MAAM,GAAG,IAAIf,WAAW,CAACM,cAAc,CAAC;EAC9C,MAAMU,OAAO,GAAG,IAAIT,cAAc,CAAC,CAAC;EAEpC,MAAMU,IAAI,GAAG,MAAMR,IAAI,CAACS,SAAS,CAACf,WAAW,EAAEC,cAAc,EAAGe,KAAK,IAAK;IACxEJ,MAAM,CAACK,IAAI,CAACD,KAAK,CAAC,CAACE,OAAO,CAAEC,KAAK,IAAK;MACpC,MAAMC,MAAM,GAAGP,OAAO,CAACQ,QAAQ,CAACnB,MAAM,CAACiB,KAAK,CAAC,CAAC;MAE9C,IAAIG,MAAM,CAACC,IAAI,CAACH,MAAM,CAAC,CAACI,MAAM,GAAG,CAAC,EAAE;QAClCd,OAAO,CAAC;UAAEU,MAAM,EAAE;YAAEK,EAAE,EAAElB,GAAG,CAAC,CAAC;YAAEa,MAAM;YAAEM,WAAW,EAAE;UAAG;QAAE,CAAC,CAAC;MAC7D;IACF,CAAC,CAAC;EACJ,CAAC,CAAC;EAEF,IAAI;IACF,MAAM5B,YAAY,CAACa,MAAM,CAAC;EAC5B,CAAC,SAAS;IACRG,IAAI,CAAC,CAAC;EACR;AACF,CAAC;;AAED;AACA,MAAMa,OAAmC,GAAG;EAC1CC,EAAE,EAAE,iBAAiB;EACrBC,QAAQ,EAAE,CAAC7B,WAAW,CAAC;EACvBK,IAAI;EACJI;AACF,CAAC;AAED,SAASkB,OAAO","ignoreList":[]}
|
package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/android-pairing-agent.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { PairingAgent } from "../core/ports";
|
|
2
|
+
/**
|
|
3
|
+
* Enters a model's fixed PIN when Android asks for it, as the device makers' own apps do.
|
|
4
|
+
* `undefined` on iOS, where only the user can answer the system prompt, and without the native module.
|
|
5
|
+
*/
|
|
6
|
+
declare const androidPairingAgent: () => PairingAgent | undefined;
|
|
7
|
+
export { androidPairingAgent };
|
|
8
|
+
//# sourceMappingURL=android-pairing-agent.d.ts.map
|
package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/android-pairing-agent.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"android-pairing-agent.d.ts","sourceRoot":"","sources":["../../../../../../../../src/modules/next/bluetooth/adapters/android-pairing-agent.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAO7C;;;GAGG;AACH,QAAA,MAAM,mBAAmB,QAAO,YAAY,GAAG,SAc9C,CAAC;AAEF,OAAO,EAAE,mBAAmB,EAAE,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { DeviceModel } from "./catalog";
|
|
2
2
|
import { OutboxWatch } from "./outbox-watch";
|
|
3
|
-
import { AdapterState, AppLifecycle, BleCentral, BluetoothPermission, BluetoothPermissions, KeepAlive, Logger, PairedDeviceStore, ReadingSink } from "./ports";
|
|
3
|
+
import { AdapterState, AppLifecycle, BleCentral, BluetoothPermission, BluetoothPermissions, KeepAlive, Logger, PairedDeviceStore, PairingAgent, ReadingSink } from "./ports";
|
|
4
4
|
import { DeviceProtocol } from "./protocol";
|
|
5
5
|
/** The ports and data `Bluetooth` runs on; each platform entry point fills them in. */
|
|
6
6
|
type BluetoothOptions = {
|
|
@@ -12,6 +12,8 @@ type BluetoothOptions = {
|
|
|
12
12
|
sink: ReadingSink;
|
|
13
13
|
/** The OS permission prompts. */
|
|
14
14
|
permissions: BluetoothPermissions;
|
|
15
|
+
/** Enters a model's fixed PIN for the user; without one, the user types it into the system prompt. */
|
|
16
|
+
pairingAgent?: PairingAgent;
|
|
15
17
|
/** The models to identify, usually the built-in ones. */
|
|
16
18
|
models: readonly DeviceModel[];
|
|
17
19
|
/** The protocols that talk to them; a model whose protocol is missing is `unsupported` here. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bluetooth-options.d.ts","sourceRoot":"","sources":["../../../../../../../../src/modules/next/bluetooth/core/bluetooth-options.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EACL,YAAY,EACZ,YAAY,EACZ,UAAU,EACV,mBAAmB,EACnB,oBAAoB,EACpB,SAAS,EACT,MAAM,EACN,iBAAiB,EACjB,WAAW,EACZ,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE5C,uFAAuF;AACvF,KAAK,gBAAgB,GAAG;IAEtB,gCAAgC;IAChC,OAAO,EAAE,UAAU,CAAC;IAEpB,qCAAqC;IACrC,KAAK,EAAE,iBAAiB,CAAC;IAEzB,gCAAgC;IAChC,IAAI,EAAE,WAAW,CAAC;IAElB,iCAAiC;IACjC,WAAW,EAAE,oBAAoB,CAAC;IAElC,yDAAyD;IACzD,MAAM,EAAE,SAAS,WAAW,EAAE,CAAC;IAE/B,gGAAgG;IAChG,SAAS,EAAE,SAAS,cAAc,EAAE,CAAC;IAErC,4CAA4C;IAC5C,GAAG,CAAC,EAAE,MAAM,IAAI,CAAC;IAEjB,qDAAqD;IACrD,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB,8CAA8C;IAC9C,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB,gEAAgE;IAChE,SAAS,CAAC,EAAE,YAAY,CAAC;IAEzB,sFAAsF;IACtF,SAAS,CAAC,EAAE,SAAS,CAAC;IAEtB,mIAAmI;IACnI,MAAM,CAAC,EAAE,WAAW,CAAC;IAErB,qHAAqH;IACrH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF,mEAAmE;AACnE,KAAK,eAAe,GAAG;IAErB,mCAAmC;IACnC,KAAK,EAAE,YAAY,CAAC;IAEpB,kCAAkC;IAClC,UAAU,EAAE,mBAAmB,CAAC;CACjC,CAAC;AAEF,sCAAsC;AACtC,KAAK,eAAe,GAAG;IAErB,oLAAoL;IACpL,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF,YAAY,EAAE,eAAe,EAAE,gBAAgB,EAAE,eAAe,EAAE,CAAC"}
|
|
1
|
+
{"version":3,"file":"bluetooth-options.d.ts","sourceRoot":"","sources":["../../../../../../../../src/modules/next/bluetooth/core/bluetooth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C;CACjC,CAAC;AAEF,sCAAsC;AACtC,KAAK,eAAe,GAAG;IAErB,oLAAoL;IACpL,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF,YAAY,EAAE,eAAe,EAAE,gBAAgB,EAAE,eAAe,EAAE,CAAC"}
|
|
@@ -36,6 +36,8 @@ declare class Bluetooth {
|
|
|
36
36
|
requestPermission: () => Promise<BluetoothPermission>;
|
|
37
37
|
/** Opens the system settings, the only place a `blocked` permission can be granted. */
|
|
38
38
|
openSettings: () => Promise<void>;
|
|
39
|
+
/** The PIN to show the user while `model` pairs, because the system prompt asks for it and this platform cannot enter it; `null` otherwise. */
|
|
40
|
+
pinToEnter: (model: DeviceModel) => string | null;
|
|
39
41
|
/** Whether this runtime has the protocol and the radio a model needs. */
|
|
40
42
|
runnable: (model: DeviceModel) => boolean;
|
|
41
43
|
/** Scans for the devices the selector names; identifies against the whole catalog, then filters. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bluetooth.d.ts","sourceRoot":"","sources":["../../../../../../../../src/modules/next/bluetooth/core/bluetooth.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACzF,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AACjE,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAS/C,OAAO,EAAmC,mBAAmB,EAAiD,MAAM,SAAS,CAAC;AAE9H,OAAO,EAAc,eAAe,EAAE,MAAM,eAAe,CAAC;AAM5D,4FAA4F;AAC5F,cAAM,SAAS;IAsBM,OAAO,CAAC,QAAQ,CAAC,OAAO;IArB3C,qEAAqE;IACrE,SAAgB,OAAO,EAAE,OAAO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AO,CAAC,YAAY;IASpB,OAAO,CAAC,cAAc;IActB,OAAO,CAAC,OAAO,CAAkD;IAEjE,OAAO,CAAC,UAAU,CAIhB;IAEF,OAAO,CAAC,UAAU;IAIlB,qGAAqG;IACrG,OAAO,CAAC,OAAO,CAQb;IAEF,OAAO,CAAC,SAAS;IAKjB,OAAO,CAAC,gBAAgB;IASxB,OAAO,CAAC,YAAY;CAKrB;AAED,OAAO,EAAE,SAAS,EAAE,CAAC;AACrB,YAAY,EAAE,eAAe,EAAE,gBAAgB,EAAE,eAAe,EAAE,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DeviceModel } from "./catalog";
|
|
2
|
-
import { BleCentral, Logger, PairedDeviceStore, ReadingSink } from "./ports";
|
|
2
|
+
import { BleCentral, Logger, PairedDeviceStore, PairingAgent, ReadingSink } from "./ports";
|
|
3
3
|
import { DeviceProtocol } from "./protocol";
|
|
4
4
|
/** What a `Device` runs on. */
|
|
5
5
|
type DeviceDeps = {
|
|
@@ -9,6 +9,8 @@ type DeviceDeps = {
|
|
|
9
9
|
store: PairedDeviceStore;
|
|
10
10
|
/** Where the device's live recording is saved; a device without one only shows what it streams. */
|
|
11
11
|
sink?: ReadingSink;
|
|
12
|
+
/** Enters the model's fixed PIN while a link opens; without one, the user types it. */
|
|
13
|
+
pairingAgent?: PairingAgent;
|
|
12
14
|
now: () => Date;
|
|
13
15
|
logger: Logger;
|
|
14
16
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"device-deps.d.ts","sourceRoot":"","sources":["../../../../../../../../src/modules/next/bluetooth/core/device-deps.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"device-deps.d.ts","sourceRoot":"","sources":["../../../../../../../../src/modules/next/bluetooth/core/device-deps.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,iBAAiB,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAC3F,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE5C,+BAA+B;AAC/B,KAAK,UAAU,GAAG;IAChB,KAAK,EAAE,WAAW,CAAC;IACnB,QAAQ,EAAE,cAAc,CAAC;IACzB,OAAO,EAAE,UAAU,CAAC;IACpB,KAAK,EAAE,iBAAiB,CAAC;IAEzB,mGAAmG;IACnG,IAAI,CAAC,EAAE,WAAW,CAAC;IAEnB,uFAAuF;IACvF,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,GAAG,EAAE,MAAM,IAAI,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,YAAY,EAAE,UAAU,EAAE,CAAC"}
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import { Advertisement } from "./advertisement";
|
|
2
|
+
import { DeviceModel } from "./catalog";
|
|
2
3
|
import { ConnectionState } from "./device-snapshot";
|
|
3
4
|
import { PairedDevice } from "./paired-device";
|
|
4
|
-
import { BleCentral, Logger } from "./ports";
|
|
5
|
+
import { BleCentral, Logger, PairingAgent } from "./ports";
|
|
5
6
|
import { DeviceProtocol, DeviceSecret } from "./protocol";
|
|
6
7
|
type LinkDeps = {
|
|
8
|
+
model: Pick<DeviceModel, "pin">;
|
|
7
9
|
protocol: DeviceProtocol;
|
|
8
10
|
central: BleCentral;
|
|
11
|
+
pairingAgent?: PairingAgent;
|
|
9
12
|
now: () => Date;
|
|
10
13
|
logger: Logger;
|
|
11
14
|
};
|
|
@@ -33,6 +36,8 @@ declare class DeviceLink {
|
|
|
33
36
|
pair(connection: unknown): Promise<void>;
|
|
34
37
|
close(): Promise<void>;
|
|
35
38
|
private openLink;
|
|
39
|
+
/** Bonding happens while the link opens, so the platform enters a fixed PIN only until the connect steps end. */
|
|
40
|
+
private expectPin;
|
|
36
41
|
/** Identify, clock, battery: what every new link runs before any action. */
|
|
37
42
|
private connectSteps;
|
|
38
43
|
/** The battery level only informs, so a device that cannot report it still connects; a refused identify still ends the link. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"device-link.d.ts","sourceRoot":"","sources":["../../../../../../../../src/modules/next/bluetooth/core/device-link.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD,OAAO,EAA2B,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACxE,OAAO,EAAE,UAAU,EAAY,MAAM,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"device-link.d.ts","sourceRoot":"","sources":["../../../../../../../../src/modules/next/bluetooth/core/device-link.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD,OAAO,EAA2B,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACxE,OAAO,EAAE,UAAU,EAAY,MAAM,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACrE,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAI1D,KAAK,QAAQ,GAAG;IACd,KAAK,EAAE,IAAI,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC;IAChC,QAAQ,EAAE,cAAc,CAAC;IACzB,OAAO,EAAE,UAAU,CAAC;IACpB,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,GAAG,EAAE,MAAM,IAAI,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAIF,KAAK,aAAa,GAAG;IACnB,OAAO,EAAE,CAAC,KAAK,EAAE,eAAe,KAAK,IAAI,CAAC;IAE1C,qDAAqD;IACrD,WAAW,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC,YAAY,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9D,SAAS,EAAE,MAAM,IAAI,CAAC;IAEtB,6EAA6E;IAC7E,MAAM,EAAE,YAAY,CAAC;IAErB,iGAAiG;IACjG,aAAa,EAAE,MAAM,aAAa,GAAG,SAAS,CAAC;CAChD,CAAC;AAEF,2GAA2G;AAC3G,cAAM,UAAU;IAIK,OAAO,CAAC,QAAQ,CAAC,OAAO;IAAU,OAAO,CAAC,QAAQ,CAAC,IAAI;IAAY,OAAO,CAAC,QAAQ,CAAC,SAAS;IAHhH,OAAO,CAAC,IAAI,CAAuB;IACnC,OAAO,CAAC,OAAO,CAAgC;gBAEX,OAAO,EAAE,MAAM,EAAmB,IAAI,EAAE,QAAQ,EAAmB,SAAS,EAAE,aAAa;IAE/H,6EAA6E;IAChE,UAAU,CAAC,KAAK,GAAE,eAA8B,GAAG,OAAO,CAAC,OAAO,CAAC;IAYhF,qHAAqH;IACxG,IAAI,CAAC,UAAU,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IAOxC,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;YAcrB,QAAQ;IAuCtB,iHAAiH;IACjH,OAAO,CAAC,SAAS;IAUjB,4EAA4E;YAC9D,YAAY;IAmB1B,gIAAgI;YAClH,SAAS;IAUvB,OAAO,CAAC,OAAO;IASf,OAAO,CAAC,MAAM;CAMf;AAED,OAAO,EAAE,UAAU,EAAE,CAAC"}
|
|
@@ -56,6 +56,11 @@ interface BleCentral {
|
|
|
56
56
|
/** Opens a GATT connection to the device at `address`. */
|
|
57
57
|
connect(address: string): Promise<GattLink>;
|
|
58
58
|
}
|
|
59
|
+
/** Answers the system's pairing prompt with a PIN, on a platform that lets an app do so. */
|
|
60
|
+
interface PairingAgent {
|
|
61
|
+
/** Enters `pin` when the device at `address` asks for one, until the returned release is called. */
|
|
62
|
+
expectPin(address: string, pin: string): () => void;
|
|
63
|
+
}
|
|
59
64
|
/** The OS permission prompts Bluetooth needs. */
|
|
60
65
|
interface BluetoothPermissions {
|
|
61
66
|
/** The current permission, without prompting. */
|
|
@@ -113,5 +118,5 @@ declare const alwaysForeground: AppLifecycle;
|
|
|
113
118
|
/** A platform where nothing extra keeps the process alive. */
|
|
114
119
|
declare const noKeepAlive: KeepAlive;
|
|
115
120
|
export { alwaysForeground, noKeepAlive, silentLogger };
|
|
116
|
-
export type { AdapterState, AppLifecycle, AppVisibility, BleCentral, BluetoothPermission, BluetoothPermissions, ChooserFilter, GattLink, KeepAlive, LogContext, Logger, PairedDeviceStore, ReadingSink, SaveOutcome, ScanFilter, ScanHandlers, };
|
|
121
|
+
export type { AdapterState, AppLifecycle, AppVisibility, BleCentral, BluetoothPermission, BluetoothPermissions, ChooserFilter, GattLink, KeepAlive, LogContext, Logger, PairedDeviceStore, PairingAgent, ReadingSink, SaveOutcome, ScanFilter, ScanHandlers, };
|
|
117
122
|
//# sourceMappingURL=ports.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ports.d.ts","sourceRoot":"","sources":["../../../../../../../../src/modules/next/bluetooth/core/ports.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,sEAAsE;AACtE,KAAK,YAAY,GAAG,SAAS,GAAG,IAAI,GAAG,KAAK,GAAG,cAAc,GAAG,aA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etooth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"create-bluetooth.d.ts","sourceRoot":"","sources":["../../../../../../../src/modules/next/bluetooth/create-bluetooth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAMzC,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAGrD,OAAO,EAAE,cAAc,EAAmB,MAAM,8BAA8B,CAAC;AAG/E,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAkB/D,oGAAoG;AACpG,KAAK,sBAAsB,GAAG;IAE5B,kDAAkD;IAClD,IAAI,EAAE,cAAc,CAAC;IAErB,2HAA2H;IAC3H,QAAQ,CAAC,EAAE,QAAQ,CAAC;IAEpB,wDAAwD;IACxD,OAAO,EAAE,WAAW,CAAC;CACtB,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;AAE9B;;;GAGG;AACH,QAAA,MAAM,eAAe,GAAI,2CAA2C,sBAAsB,KAAG,SAgB5F,CAAC;AAEF,OAAO,EAAE,eAAe,EAAE,CAAC;AAC3B,YAAY,EAAE,sBAAsB,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"built-in.d.ts","sourceRoot":"","sources":["../../../../../../../../src/modules/next/bluetooth/families/built-in.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"built-in.d.ts","sourceRoot":"","sources":["../../../../../../../../src/modules/next/bluetooth/families/built-in.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAuFlD,6FAA6F;AAC7F,QAAA,MAAM,eAAe,EAAE,SAAS,WAAW,EAoFzC,CAAC;AAEH,6CAA6C;AAC7C,QAAA,MAAM,kBAAkB,EAAE,SAAS,cAAc,EAoFhD,CAAC;AAEF,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/** The Silicon Labs BGX13 Xpress Streaming Service the Recobro streams through. */
|
|
2
|
+
declare const BGX_SERVICE: string;
|
|
3
|
+
/** The BGX's transmit characteristic: the device's byte stream, as notifications. */
|
|
4
|
+
declare const BGX_STREAM_OUT: string;
|
|
5
|
+
/** The BGX's stream mode; it answers only once the link is paired and encrypted. */
|
|
6
|
+
declare const BGX_MODE: string;
|
|
7
|
+
export { BGX_MODE, BGX_SERVICE, BGX_STREAM_OUT };
|
|
8
|
+
//# sourceMappingURL=bgx.d.ts.map
|
package/lib/typescript/commonjs/src/modules/next/bluetooth/families/clarity-recobro/bgx.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bgx.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/modules/next/bluetooth/families/clarity-recobro/bgx.ts"],"names":[],"mappings":"AAEA,mFAAmF;AACnF,QAAA,MAAM,WAAW,QAAmD,CAAC;AAErE,qFAAqF;AACrF,QAAA,MAAM,cAAc,QAAmD,CAAC;AAExE,oFAAoF;AACpF,QAAA,MAAM,QAAQ,QAAmD,CAAC;AAElE,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,cAAc,EAAE,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { DeviceProtocol } from "../../core/protocol";
|
|
2
|
+
import { CLARITY_RECOBRO_MODELS } from "./models";
|
|
3
|
+
/** The protocols of Clarity Medical's Recobro monitors. */
|
|
4
|
+
declare const CLARITY_RECOBRO_PROTOCOLS: readonly DeviceProtocol[];
|
|
5
|
+
export { CLARITY_RECOBRO_MODELS, CLARITY_RECOBRO_PROTOCOLS };
|
|
6
|
+
//# sourceMappingURL=clarity-recobro.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clarity-recobro.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/modules/next/bluetooth/families/clarity-recobro/clarity-recobro.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAErD,OAAO,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAGlD,2DAA2D;AAC3D,QAAA,MAAM,yBAAyB,EAAE,SAAS,cAAc,EAAc,CAAC;AAEvE,OAAO,EAAE,sBAAsB,EAAE,yBAAyB,EAAE,CAAC"}
|
package/lib/typescript/commonjs/src/modules/next/bluetooth/families/clarity-recobro/frame.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Framing } from "../frame-tools/frame-stream";
|
|
2
|
+
/**
|
|
3
|
+
* Cuts `55 AA L` frames. They carry no checksum the monitor's own app checks; it trusts a frame once the next frame's
|
|
4
|
+
* sync follows it, and so does this.
|
|
5
|
+
*/
|
|
6
|
+
declare const recobroFraming: Framing;
|
|
7
|
+
/** The bytes after the length, where the frame counter, the module flags and the module blocks are. */
|
|
8
|
+
declare const bodyOf: (frame: Uint8Array) => Uint8Array;
|
|
9
|
+
export { bodyOf, recobroFraming };
|
|
10
|
+
//# sourceMappingURL=frame.d.ts.map
|
package/lib/typescript/commonjs/src/modules/next/bluetooth/families/clarity-recobro/frame.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"frame.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/modules/next/bluetooth/families/clarity-recobro/frame.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,OAAO,EAAgB,MAAM,6BAA6B,CAAC;AAuB7E;;;GAGG;AACH,QAAA,MAAM,cAAc,EAAE,OAoBrB,CAAC;AAEF,uGAAuG;AACvG,QAAA,MAAM,MAAM,GAAI,OAAO,UAAU,KAAG,UAA0C,CAAC;AAE/E,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,CAAC"}
|
package/lib/typescript/commonjs/src/modules/next/bluetooth/families/clarity-recobro/models.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { DeviceModel } from "../../core/catalog";
|
|
2
|
+
/** The passkey every Recobro's BLE bridge asks for; the device never shows it. */
|
|
3
|
+
declare const RECOBRO_PASSKEY = "821687";
|
|
4
|
+
/** Clarity Medical's monitors in COMM mode BLE; in Bluetooth Classic mode they need an SPP link this SDK does not open. */
|
|
5
|
+
declare const CLARITY_RECOBRO_MODELS: readonly DeviceModel[];
|
|
6
|
+
export { CLARITY_RECOBRO_MODELS, RECOBRO_PASSKEY };
|
|
7
|
+
//# sourceMappingURL=models.d.ts.map
|
package/lib/typescript/commonjs/src/modules/next/bluetooth/families/clarity-recobro/models.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/modules/next/bluetooth/families/clarity-recobro/models.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAMjD,kFAAkF;AAClF,QAAA,MAAM,eAAe,WAAW,CAAC;AAIjC,2HAA2H;AAC3H,QAAA,MAAM,sBAAsB,EAAE,SAAS,WAAW,EAKjD,CAAC;AAEF,OAAO,EAAE,sBAAsB,EAAE,eAAe,EAAE,CAAC"}
|
package/lib/typescript/commonjs/src/modules/next/bluetooth/families/clarity-recobro/monitor.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { LiveValues } from "../../core/reading";
|
|
2
|
+
type Values = LiveValues["values"];
|
|
3
|
+
/** Turns frame bodies into the values each module commits, about once per 67-frame counter cycle. */
|
|
4
|
+
declare class RecobroMonitor {
|
|
5
|
+
private readonly ecg;
|
|
6
|
+
private readonly spo2;
|
|
7
|
+
private readonly nibp;
|
|
8
|
+
private lastBloodPressure;
|
|
9
|
+
/** The values this frame completes, empty for most frames. */
|
|
10
|
+
valuesOf(body: Uint8Array): Values;
|
|
11
|
+
private module;
|
|
12
|
+
/** A finished measurement stays in the slots for later cycles, so it counts once until a different one arrives. */
|
|
13
|
+
private bloodPressure;
|
|
14
|
+
}
|
|
15
|
+
export { RecobroMonitor };
|
|
16
|
+
//# sourceMappingURL=monitor.d.ts.map
|
package/lib/typescript/commonjs/src/modules/next/bluetooth/families/clarity-recobro/monitor.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"monitor.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/modules/next/bluetooth/families/clarity-recobro/monitor.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAY,MAAM,oBAAoB,CAAC;AAsC1D,KAAK,MAAM,GAAG,UAAU,CAAC,QAAQ,CAAC,CAAC;AAqFnC,qGAAqG;AACrG,cAAM,cAAc;IAClB,OAAO,CAAC,QAAQ,CAAC,GAAG,CAA+B;IACnD,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAgC;IACrD,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAgC;IACrD,OAAO,CAAC,iBAAiB,CAAc;IAEvC,8DAA8D;IACvD,QAAQ,CAAC,IAAI,EAAE,UAAU,GAAG,MAAM;IAWzC,OAAO,CAAC,MAAM;IAiBd,mHAAmH;IACnH,OAAO,CAAC,aAAa;CAQtB;AAED,OAAO,EAAE,cAAc,EAAE,CAAC"}
|
package/lib/typescript/commonjs/src/modules/next/bluetooth/families/clarity-recobro/protocol.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { DeviceProtocol, ProtocolContext } from "../../core/protocol";
|
|
2
|
+
type Connection = Pick<ProtocolContext, "link" | "now">;
|
|
3
|
+
/** The Recobro streams its monitor data through the BGX bridge once paired. */
|
|
4
|
+
declare const RECOBRO: DeviceProtocol<Connection>;
|
|
5
|
+
export { RECOBRO };
|
|
6
|
+
//# sourceMappingURL=protocol.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"protocol.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/modules/next/bluetooth/families/clarity-recobro/protocol.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAStE,KAAK,UAAU,GAAG,IAAI,CAAC,eAAe,EAAE,MAAM,GAAG,KAAK,CAAC,CAAC;AA+BxD,+EAA+E;AAC/E,QAAA,MAAM,OAAO,EAAE,cAAc,CAAC,UAAU,CAKvC,CAAC;AAEF,OAAO,EAAE,OAAO,EAAE,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { PairingAgent } from "../core/ports";
|
|
2
|
+
/**
|
|
3
|
+
* Enters a model's fixed PIN when Android asks for it, as the device makers' own apps do.
|
|
4
|
+
* `undefined` on iOS, where only the user can answer the system prompt, and without the native module.
|
|
5
|
+
*/
|
|
6
|
+
declare const androidPairingAgent: () => PairingAgent | undefined;
|
|
7
|
+
export { androidPairingAgent };
|
|
8
|
+
//# sourceMappingURL=android-pairing-agent.d.ts.map
|
package/lib/typescript/module/src/modules/next/bluetooth/adapters/android-pairing-agent.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"android-pairing-agent.d.ts","sourceRoot":"","sources":["../../../../../../../../src/modules/next/bluetooth/adapters/android-pairing-agent.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAO7C;;;GAGG;AACH,QAAA,MAAM,mBAAmB,QAAO,YAAY,GAAG,SAc9C,CAAC;AAEF,OAAO,EAAE,mBAAmB,EAAE,CAAC"}
|