@ovok/native 0.4.10 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +667 -8
- package/lib/commonjs/modules/bt-management/services/bt-manager.js +13 -15
- package/lib/commonjs/modules/bt-management/services/bt-manager.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/device-creator.js +1 -7
- package/lib/commonjs/modules/bt-management/services/device-creator.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/devices/bc01/bc01.device.js +51 -113
- package/lib/commonjs/modules/bt-management/services/devices/bc01/bc01.device.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/devices/bc01/bc01.main-services.js +77 -41
- package/lib/commonjs/modules/bt-management/services/devices/bc01/bc01.main-services.js.map +1 -1
- package/lib/module/modules/bt-management/services/bt-manager.js +13 -15
- package/lib/module/modules/bt-management/services/bt-manager.js.map +1 -1
- package/lib/module/modules/bt-management/services/device-creator.js +1 -7
- package/lib/module/modules/bt-management/services/device-creator.js.map +1 -1
- package/lib/module/modules/bt-management/services/devices/bc01/bc01.device.js +51 -113
- package/lib/module/modules/bt-management/services/devices/bc01/bc01.device.js.map +1 -1
- package/lib/module/modules/bt-management/services/devices/bc01/bc01.main-services.js +77 -41
- package/lib/module/modules/bt-management/services/devices/bc01/bc01.main-services.js.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/bt-manager.d.ts +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/bt-manager.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/bc01/bc01.device.d.ts +13 -33
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bc01/bc01.device.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bc01/bc01.main-services.d.ts +17 -11
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bc01/bc01.main-services.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/bt-manager.d.ts +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/bt-manager.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/bc01/bc01.device.d.ts +13 -33
- package/lib/typescript/module/src/modules/bt-management/services/devices/bc01/bc01.device.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/devices/bc01/bc01.main-services.d.ts +17 -11
- package/lib/typescript/module/src/modules/bt-management/services/devices/bc01/bc01.main-services.d.ts.map +1 -1
- package/package.json +13 -12
- package/lib/commonjs/modules/bt-management/services/devices/bc01/bc01-command-sequencer.js +0 -184
- package/lib/commonjs/modules/bt-management/services/devices/bc01/bc01-command-sequencer.js.map +0 -1
- package/lib/commonjs/modules/bt-management/services/devices/bc01/bc01-frame-parser.js +0 -114
- package/lib/commonjs/modules/bt-management/services/devices/bc01/bc01-frame-parser.js.map +0 -1
- package/lib/module/modules/bt-management/services/devices/bc01/bc01-command-sequencer.js +0 -180
- package/lib/module/modules/bt-management/services/devices/bc01/bc01-command-sequencer.js.map +0 -1
- package/lib/module/modules/bt-management/services/devices/bc01/bc01-frame-parser.js +0 -110
- package/lib/module/modules/bt-management/services/devices/bc01/bc01-frame-parser.js.map +0 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bc01/bc01-command-sequencer.d.ts +0 -53
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bc01/bc01-command-sequencer.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bc01/bc01-frame-parser.d.ts +0 -53
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bc01/bc01-frame-parser.d.ts.map +0 -1
- package/lib/typescript/module/src/modules/bt-management/services/devices/bc01/bc01-command-sequencer.d.ts +0 -53
- package/lib/typescript/module/src/modules/bt-management/services/devices/bc01/bc01-command-sequencer.d.ts.map +0 -1
- package/lib/typescript/module/src/modules/bt-management/services/devices/bc01/bc01-frame-parser.d.ts +0 -53
- package/lib/typescript/module/src/modules/bt-management/services/devices/bc01/bc01-frame-parser.d.ts.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Linking","Platform","ScanMode","State","slog","sentryLogger","DeviceCreator","BTManager","MAX_DEVICES","devices","Map","eventSubscriptions","constructor","bleManager","acceptedDevices","deviceCreator","destroy","stopScan","stateChangeListener","remove","undefined","onErrorCallback","onDeviceFoundCallback","onResultCallback","onDeviceStatusChangedCallback","forEach","device","clear","startScan","onStateChange","state","PoweredOn","index","indexOf","splice","startDeviceScan","scanMode","Balanced","onScanResult","OS","sendIntent","push","stopDeviceScan","sub","onDeviceFound","callback","onError","onDeviceStatusChanged","onResult","error","Error","message","
|
|
1
|
+
{"version":3,"names":["Linking","Platform","ScanMode","State","slog","sentryLogger","DeviceCreator","BTManager","MAX_DEVICES","devices","Map","eventSubscriptions","lastScanTimestamp","constructor","bleManager","acceptedDevices","deviceCreator","destroy","stopScan","stateChangeListener","remove","undefined","onErrorCallback","onDeviceFoundCallback","onResultCallback","onDeviceStatusChangedCallback","forEach","device","clear","startScan","Date","now","onStateChange","state","PoweredOn","index","indexOf","splice","startDeviceScan","scanMode","Balanced","onScanResult","OS","sendIntent","enable","push","stopDeviceScan","sub","onDeviceFound","callback","onError","onDeviceStatusChanged","onResult","error","Error","message","name","has","id","deviceName","getDeviceName","size","deviceId","currentSize","deviceClass","createDevice","bind","onDeviceDisconnected","removeDeviceFromFoundedDevices","set","get","delete"],"sourceRoot":"../../../../../src","sources":["modules/bt-management/services/bt-manager.ts"],"mappings":";;AAAA;AACA,SAASA,OAAO,EAAEC,QAAQ,QAAQ,cAAc;AAChD,SAIEC,QAAQ,EACRC,KAAK,QAEA,sBAAsB;AAE7B,SAASC,IAAI,QAAQ,wBAAe;AACpC,SAASC,YAAY,QAAQ,sCAAmC;AAOhE,SAASC,aAAa,QAA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BAAgB,EAAE0C,IAAI,CAAC,IAAI,CAAC;QAC3CC,oBAAoB,EAAEA,CAAA,KAAM;UAC1B,IAAI,CAACtC,SAAS,CAAC,CAAC;UAChB,IAAI,CAACuC,8BAA8B,EAAEF,IAAI,CAAC,IAAI,CAAC,CAACvC,MAAM,CAAC+B,EAAE,CAAC;QAC5D;MACF,CAAC,CAAC;MAEF,IAAI,CAACjD,OAAO,CAAC4D,GAAG,CAAC1C,MAAM,CAAC+B,EAAE,EAAEM,WAAW,CAAC;MAExC,IAAI,CAACzC,qBAAqB,GAAGyC,WAAW,EAAE,IAAI,CAAC;IACjD,CAAC,CAAC,OAAOX,KAAK,EAAE;MACdhD,YAAY,CAAC,OAAO,EAAE,mCAAmC,EAAE;QACzDgD,KAAK,EAAEA,KAAK,YAAYC,KAAK,GAAGD,KAAK,CAACE,OAAO,GAAGF,KAAK;QACrDS,QAAQ,EAAEnC,MAAM,EAAE+B,EAAE;QACpBC,UAAU,EAAEhC,MAAM,EAAE6B;MACtB,CAAC,CAAC;MACFpD,IAAI,CAACiD,KAAK,EAAE,mCAAmC,EAAE;QAC/CA,KAAK;QACLS,QAAQ,EAAEnC,MAAM,EAAE+B,EAAE;QACpBC,UAAU,EAAEhC,MAAM,EAAE6B;MACtB,CAAC,CAAC;IACJ;EACF,CAAC;EAEOY,8BAA8B,GAAIN,QAAgB,IAAK;IAC7DzD,YAAY,CACV,MAAM,EACN,2EAA2E,EAC3E;MACEyD,QAAQ;MACRH,UAAU,EAAE,IAAI,CAAClD,OAAO,CAAC6D,GAAG,CAACR,QAAQ,CAAC,EAAEnC,MAAM,EAAE6B;IAClD,CACF,CAAC;IACD,IAAI,CAAC/C,OAAO,CAAC8D,MAAM,CAACT,QAAQ,CAAC;EAC/B,CAAC;AACH","ignoreList":[]}
|
|
@@ -74,13 +74,7 @@ export class DeviceCreator {
|
|
|
74
74
|
if (!params.device) {
|
|
75
75
|
throw new Error("Device is required");
|
|
76
76
|
}
|
|
77
|
-
|
|
78
|
-
/**
|
|
79
|
-
* On iOS the peripheral's `name` is null in scan callbacks until it is connected —
|
|
80
|
-
* `localName` carries the advertised name instead. Accept either so a scan-time
|
|
81
|
-
* `createDevice` call for a real iOS ad is not rejected before it can connect.
|
|
82
|
-
*/
|
|
83
|
-
if (!params.device.name?.trim() && !params.device.localName?.trim()) {
|
|
77
|
+
if (!params.device.name?.trim()) {
|
|
84
78
|
throw new Error("Device name is required");
|
|
85
79
|
}
|
|
86
80
|
if (!params.device.id) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["integratedDevicesMap","IntegratedDevices","isCustomDeviceDefinition","BC01Device","BP2Device","CustomDevice","F4Device","SPO2Device","VerovalDuoControlDevice","VerovalEcgDevice","DEVICE_CLASSES","BP2","F4","PC60WF","BC01","VEROVAL_DUO_CONTROL","VEROVAL_ECG","collectCustomDevices","acceptedDevices","customDevices","Map","matchers","Set","forEach","entry","index","Error","has","id","nameMatch","source","set","add","DeviceCreator","deviceNameCache","CACHE_MAX_SIZE","constructor","acceptedDeviceNames","getDeviceName","foundName","undefined","get","matched","matchDeviceName","cacheDeviceName","createDevice","params","String","deviceName","trim","device","name","
|
|
1
|
+
{"version":3,"names":["integratedDevicesMap","IntegratedDevices","isCustomDeviceDefinition","BC01Device","BP2Device","CustomDevice","F4Device","SPO2Device","VerovalDuoControlDevice","VerovalEcgDevice","DEVICE_CLASSES","BP2","F4","PC60WF","BC01","VEROVAL_DUO_CONTROL","VEROVAL_ECG","collectCustomDevices","acceptedDevices","customDevices","Map","matchers","Set","forEach","entry","index","Error","has","id","nameMatch","source","set","add","DeviceCreator","deviceNameCache","CACHE_MAX_SIZE","constructor","acceptedDeviceNames","getDeviceName","foundName","undefined","get","matched","matchDeviceName","cacheDeviceName","createDevice","params","String","deviceName","trim","device","name","custom","deviceClass","Object","keys","join","destroy","clear","regex","deviceType","test","some","values","size","firstKey","next","value","delete"],"sourceRoot":"../../../../../src","sources":["modules/bt-management/services/device-creator.ts"],"mapp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I,IAAKA,IAAI,KAAKS,UAAU,CAAC,EAC5D;QACA,OAAOA,UAAU;MACnB;IACF;IAEA,KAAK,MAAMR,MAAM,IAAI,IAAI,CAACjC,aAAa,CAAC4C,MAAM,CAAC,CAAC,EAAE;MAChD,IAAIX,MAAM,CAACvB,SAAS,CAACgC,IAAI,CAACb,UAAU,CAAC,EAAE;QACrC,OAAOI,MAAM,CAACxB,EAAE;MAClB;IACF;IAEA,OAAOY,SAAS;EAClB,CAAC;EAEOI,eAAeA,CACrBI,UAAkB,EAClBY,UAA4B,EACtB;IACN;IACA,IAAI,IAAI,CAAC1B,eAAe,CAAC8B,IAAI,IAAI,IAAI,CAAC7B,cAAc,EAAE;MACpD,MAAM8B,QAAQ,GAAG,IAAI,CAAC/B,eAAe,CAACqB,IAAI,CAAC,CAAC,CAACW,IAAI,CAAC,CAAC,CAACC,KAAK;MAEzD,IAAIF,QAAQ,KAAKzB,SAAS,EAAE;QAC1B,IAAI,CAACN,eAAe,CAACkC,MAAM,CAACH,QAAQ,CAAC;MACvC;IACF;IAEA,IAAI,CAAC/B,eAAe,CAACH,GAAG,CAACiB,UAAU,EAAEY,UAAU,CAAC;EAClD;AACF","ignoreList":[]}
|
|
@@ -1,43 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import { MeasurementTypeKey } from "@ovok/core";
|
|
4
3
|
import { CaseType } from "../../../types/case-type.js";
|
|
5
|
-
import { hexToByte } from "../../../utils/hex-to-byte.js";
|
|
6
4
|
import { BTManagedDevice } from "../bt-managed-device.js";
|
|
7
|
-
import { Bc01CommandSequencer } from "./bc01-command-sequencer.js";
|
|
8
|
-
import { BC01_ANALYTE_ORDER, parseBc01Record } from "./bc01-frame-parser.js";
|
|
9
5
|
import { bc01MainServices } from "./bc01.main-services.js";
|
|
10
6
|
|
|
11
|
-
/** Minimum bytes a complete frame carries, keyed by its opening opcode. */
|
|
12
|
-
const BC01_FRAME_MIN_LENGTH = {
|
|
13
|
-
0xf0: 2,
|
|
14
|
-
// ACK
|
|
15
|
-
0xf2: 8,
|
|
16
|
-
// Version reply (variable — 8 is the minimum PHMS reads before answering)
|
|
17
|
-
0xf3: 3,
|
|
18
|
-
// Time-sync ack
|
|
19
|
-
0xe0: 7,
|
|
20
|
-
// Record-count reply
|
|
21
|
-
0xe1: 16,
|
|
22
|
-
// Stored URS record
|
|
23
|
-
0xe2: 16,
|
|
24
|
-
// Paginated URS record
|
|
25
|
-
0xe3: 3,
|
|
26
|
-
// Finish
|
|
27
|
-
0xe4: 36,
|
|
28
|
-
// Quantitative record (optional path)
|
|
29
|
-
0xe5: 36 // Quantitative record (optional path)
|
|
30
|
-
};
|
|
31
|
-
|
|
32
7
|
/**
|
|
33
8
|
* Contec BC401 (BC01) urine analyzer driver.
|
|
34
9
|
*
|
|
35
|
-
* The BC401 is a
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
* documented in `bc01-command-sequencer.ts`. Every record arrives as one
|
|
40
|
-
* 16-byte E1/E2 frame on 0xFF02.
|
|
10
|
+
* The BC401 is a single-shot device: the patient dips a URS-7 strip, presses
|
|
11
|
+
* the button, and the device pushes exactly one result frame on 0xFF01. There
|
|
12
|
+
* is no streaming state, no per-tick updates, and no measurement session to
|
|
13
|
+
* open — the device auto-starts on button press.
|
|
41
14
|
*/
|
|
42
15
|
export class BC01Device extends BTManagedDevice {
|
|
43
16
|
onStreamStart = () => {};
|
|
@@ -45,101 +18,66 @@ export class BC01Device extends BTManagedDevice {
|
|
|
45
18
|
|
|
46
19
|
/**
|
|
47
20
|
* 90 s covers the maximum firmware-side reagent-pad settle time on a URS-7
|
|
48
|
-
* strip
|
|
49
|
-
*
|
|
50
|
-
* times out and the driver surfaces "device unreachable".
|
|
21
|
+
* strip. If the device does not push a result frame within that window the
|
|
22
|
+
* data-processor times out and the driver surfaces "device unreachable".
|
|
51
23
|
*/
|
|
52
24
|
stuckDataTimeout = 90_000;
|
|
53
|
-
constructor(device, params) {
|
|
54
|
-
super(device, params);
|
|
55
|
-
|
|
56
|
-
/**
|
|
57
|
-
* The BC401 answers one command with one frame and picks the next command
|
|
58
|
-
* by the first byte of that frame. The sequencer walks reset → version →
|
|
59
|
-
* set-time → count → records, and acknowledges the last record of every
|
|
60
|
-
* set. The parent's default `pollingSequencerFor` would only re-send the
|
|
61
|
-
* declared reset forever, which the firmware ignores after the first one.
|
|
62
|
-
*/
|
|
63
|
-
this.createCommandSequencer = () => new Bc01CommandSequencer({
|
|
64
|
-
write: {
|
|
65
|
-
serviceUuid: bc01MainServices[0].uuid,
|
|
66
|
-
characteristicUuid: bc01MainServices[0].writeUuid.uuid
|
|
67
|
-
},
|
|
68
|
-
onRefused: reason => this.onError?.(new Error(`BC401 handshake: ${reason}`))
|
|
69
|
-
});
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
/**
|
|
73
|
-
* Returns true once the notification buffer holds a complete BC401 frame,
|
|
74
|
-
* classified by its opening opcode. Anything else — a heartbeat opcode we
|
|
75
|
-
* do not recognise, or a partial buffer — is held back until enough bytes
|
|
76
|
-
* arrive to make sense of it. There is no aa55 header on this hardware.
|
|
77
|
-
*/
|
|
78
25
|
validatePackage = pkg => {
|
|
79
|
-
|
|
26
|
+
pkg = pkg.map(b => b.toLowerCase());
|
|
27
|
+
let headIndex = -1;
|
|
28
|
+
for (let i = 0; i < pkg.length - 1; i++) {
|
|
29
|
+
if (pkg[i] === "aa" && pkg[i + 1] === "55") {
|
|
30
|
+
headIndex = i;
|
|
31
|
+
break;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
if (headIndex === -1) {
|
|
80
35
|
return false;
|
|
81
36
|
}
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
37
|
+
if (headIndex > 0) {
|
|
38
|
+
pkg = pkg.slice(headIndex);
|
|
39
|
+
}
|
|
40
|
+
if (pkg.length < 5) {
|
|
85
41
|
return false;
|
|
86
42
|
}
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
* The parsing model declares every E1/E2 frame as `DEPENDENT`, so this hook
|
|
92
|
-
* runs for each record. We decode the raw bytes here — the packed 3-bits-per
|
|
93
|
-
* -pad layout is not expressible in the declaration parser — and report the
|
|
94
|
-
* reading directly through `onResult`. The frame is then handed back as
|
|
95
|
-
* `OTHER` so the state machine does not report it a second time and does
|
|
96
|
-
* not dedupe consecutive records that happen to share the same opcode.
|
|
97
|
-
*/
|
|
98
|
-
handleDependentResult = data => {
|
|
99
|
-
if (data.frame) {
|
|
100
|
-
this.reportUrsRecord(data.frame);
|
|
43
|
+
const lengthByte = parseInt(pkg[2] ?? "0", 16) || 0;
|
|
44
|
+
const totalLen = 3 + lengthByte;
|
|
45
|
+
if (pkg.length < totalLen) {
|
|
46
|
+
return false;
|
|
101
47
|
}
|
|
102
|
-
return
|
|
103
|
-
...data,
|
|
104
|
-
parsingCase: {
|
|
105
|
-
...data.parsingCase,
|
|
106
|
-
caseType: CaseType.OTHER
|
|
107
|
-
}
|
|
108
|
-
};
|
|
48
|
+
return true;
|
|
109
49
|
};
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
* Nothing to do here for the BC401. Every reading arrives through the
|
|
113
|
-
* dependent-result path, and the state machine sees only the `OTHER`-typed
|
|
114
|
-
* echo we return from `handleDependentResult`.
|
|
115
|
-
*/
|
|
116
|
-
handleSuccessResult() {
|
|
117
|
-
return;
|
|
118
|
-
}
|
|
119
|
-
reportUrsRecord(frame) {
|
|
120
|
-
const parsed = parseBc01Record(frame);
|
|
121
|
-
if (!parsed) {
|
|
50
|
+
handleSuccessResult(successResult) {
|
|
51
|
+
if (successResult.caseType !== CaseType.RESULT) {
|
|
122
52
|
return;
|
|
123
53
|
}
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
54
|
+
if (!successResult.measurementTypeKey) {
|
|
55
|
+
this.onError?.(new Error(`Measurement type is undefined for case ${successResult.caseType}`));
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
this.handleUrinalysisResult(successResult);
|
|
59
|
+
}
|
|
60
|
+
handleUrinalysisResult(successResult) {
|
|
61
|
+
const error = this.checkIfHasError(successResult);
|
|
62
|
+
if (error) {
|
|
63
|
+
this.onError?.(error);
|
|
133
64
|
return;
|
|
134
65
|
}
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
66
|
+
this.onResult?.(successResult);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* A well-formed frame with all analyte fields still undefined means the
|
|
71
|
+
* device produced an empty read — typically a strip inserted upside down or
|
|
72
|
+
* removed before the reagent-pad timer completed.
|
|
73
|
+
*/
|
|
74
|
+
checkIfHasError(successResult) {
|
|
75
|
+
const analytes = ["uro", "bld", "bil", "ket", "glu", "pro", "ph", "nit", "leu", "sg", "vc"];
|
|
76
|
+
const hasAnyReading = analytes.some(key => successResult[key] !== undefined);
|
|
77
|
+
if (!hasAnyReading) {
|
|
78
|
+
return "feedback-messages.measurement.disturb-detected-error";
|
|
79
|
+
}
|
|
80
|
+
return undefined;
|
|
143
81
|
}
|
|
144
82
|
}
|
|
145
83
|
//# sourceMappingURL=bc01.device.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["CaseType","BTManagedDevice","bc01MainServices","BC01Device","onStreamStart","mainServices","stuckDataTimeout","validatePackage","pkg","map","b","toLowerCase","headIndex","i","length","slice","lengthByte","parseInt","totalLen","handleSuccessResult","successResult","caseType","RESULT","measurementTypeKey","onError","Error","handleUrinalysisResult","error","checkIfHasError","onResult","analytes","hasAnyReading","some","key","undefined"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/bc01/bc01.device.ts"],"mappings":";;A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IAAI;EACb,CAAC;EAESC,mBAAmBA,CAC3BC,aAEC,EACe;IAChB,IAAIA,aAAa,CAACC,QAAQ,KAAKrB,QAAQ,CAACsB,MAAM,EAAE;MAC9C;IACF;IAEA,IAAI,CAACF,aAAa,CAACG,kBAAkB,EAAE;MACrC,IAAI,CAACC,OAAO,GACV,IAAIC,KAAK,CACP,0CAA0CL,aAAa,CAACC,QAAQ,EAClE,CACF,CAAC;MAED;IACF;IAEA,IAAI,CAACK,sBAAsB,CAACN,aAAa,CAAC;EAC5C;EAEQM,sBAAsBA,CAC5BN,aAA+D,EACzD;IACN,MAAMO,KAAK,GAAG,IAAI,CAACC,eAAe,CAACR,aAAa,CAAC;IAEjD,IAAIO,KAAK,EAAE;MACT,IAAI,CAACH,OAAO,GAAGG,KAAK,CAAC;MAErB;IACF;IAEA,IAAI,CAACE,QAAQ,GAAGT,aAAa,CAAC;EAChC;;EAEA;AACF;AACA;AACA;AACA;EACUQ,eAAeA,CACrBR,aAA+D,EAC3C;IACpB,MAAMU,QAA8C,GAAG,CACrD,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,EACL,IAAI,EACJ,KAAK,EACL,KAAK,EACL,IAAI,EACJ,IAAI,CACL;IAED,MAAMC,aAAa,GAAGD,QAAQ,CAACE,IAAI,CAChCC,GAAG,IAAKb,aAAa,CAACa,GAAG,CAAC,KAAKC,SAClC,CAAC;IAED,IAAI,CAACH,aAAa,EAAE;MAClB,OAAO,sDAAsD;IAC/D;IAEA,OAAOG,SAAS;EAClB;AACF","ignoreList":[]}
|
|
@@ -5,57 +5,93 @@ import { CaseType } from "../../../types/case-type.js";
|
|
|
5
5
|
/**
|
|
6
6
|
* Contec BC401 (a.k.a. BC01) urine analyzer — GATT profile.
|
|
7
7
|
*
|
|
8
|
-
* The BC401 uses Contec's proprietary FF12 service, shared across their
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* in `bc01-command-sequencer.ts`.
|
|
8
|
+
* The BC401 uses Contec's proprietary FF12 service, shared across their consumer
|
|
9
|
+
* medical devices. A single result notification carries a 7-parameter URS-7
|
|
10
|
+
* strip readout expanded into eleven analyte values on the wire.
|
|
12
11
|
*
|
|
13
12
|
* Service 0xFF12
|
|
14
|
-
* Notify (result)
|
|
15
|
-
* Write (command)
|
|
13
|
+
* Notify (result) 0xFF01 — CCCD 0x2902 must be written 01 00 to enable
|
|
14
|
+
* Write (command) 0xFF02 — RESET / SET_UNIT / REQUEST_HISTORY
|
|
16
15
|
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
16
|
+
* Wire layout of a result frame (Contec URS-7 firmware ≥ 1.2.x):
|
|
17
|
+
* [0..1] header "aa 55" — Contec sentinel
|
|
18
|
+
* [2] length byte after header
|
|
19
|
+
* [3] command "a1" == RESULT_URS7
|
|
20
|
+
* [4] strip type "07" == 7-panel
|
|
21
|
+
* [5..15] values one byte per analyte, encoding the discrete
|
|
22
|
+
* level index into diagnosticResults[key]
|
|
23
|
+
* [16] checksum xor over [2..15]
|
|
24
|
+
*
|
|
25
|
+
* Byte positions calibrated against PHMS 3.0.03 Android app; older firmware
|
|
26
|
+
* (< 1.2.x) uses a different command byte and is not supported by this driver
|
|
27
|
+
* (the validator will reject those frames).
|
|
22
28
|
*/
|
|
23
29
|
export const bc01MainServices = [{
|
|
24
30
|
uuid: "0000ff12-0000-1000-8000-00805f9b34fb",
|
|
25
|
-
/**
|
|
26
|
-
* PHMS 3.0.03 writes `[0x80, 0x00]` to 0xFF01 the moment its GATT
|
|
27
|
-
* subscription is up — decompiled at L1/f.java:694 ("发送复位命令" — "send
|
|
28
|
-
* reset command"). The device answers nothing until this reset lands. The
|
|
29
|
-
* `Bc01CommandSequencer` returns the same reset from `initialCommands()`
|
|
30
|
-
* so the SDK sends it whether or not the polling default is in play.
|
|
31
|
-
*/
|
|
32
|
-
writeUuid: {
|
|
33
|
-
uuid: "0000ff01-0000-1000-8000-00805f9b34fb",
|
|
34
|
-
mainCommandUuid: "8000"
|
|
35
|
-
},
|
|
36
31
|
monitorUuids: [{
|
|
37
|
-
uuid: "
|
|
38
|
-
/**
|
|
39
|
-
* We key on the first byte only. A `DEPENDENT` case fires
|
|
40
|
-
* `handleDependentResult` in the driver, which runs the real decoder
|
|
41
|
-
* (`parseBc01Record`) against the raw frame bytes and calls
|
|
42
|
-
* `onResult` directly. The parsing case itself carries no field
|
|
43
|
-
* definitions — the packed 3-bits-per-pad layout is not expressible
|
|
44
|
-
* with the ordinary declaration parser and would need the vendor's
|
|
45
|
-
* own decoding table pinned in a declaration to be so.
|
|
46
|
-
*/
|
|
32
|
+
uuid: "0000ff01-0000-1000-8000-00805f9b34fb",
|
|
47
33
|
parsingModel: {
|
|
48
|
-
caseValuePosition: [0],
|
|
34
|
+
caseValuePosition: [0, 1, 3, 4],
|
|
49
35
|
cases: [{
|
|
50
36
|
measurementTypeKey: MeasurementTypeKey.uricAcid,
|
|
51
|
-
caseType: CaseType.
|
|
52
|
-
caseValue: "
|
|
53
|
-
parseDefinitions: [
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
37
|
+
caseType: CaseType.RESULT,
|
|
38
|
+
caseValue: "aa55a107",
|
|
39
|
+
parseDefinitions: [{
|
|
40
|
+
name: "uro",
|
|
41
|
+
parseType: "number",
|
|
42
|
+
byteIndexes: [5],
|
|
43
|
+
parseReference: 16
|
|
44
|
+
}, {
|
|
45
|
+
name: "bld",
|
|
46
|
+
parseType: "number",
|
|
47
|
+
byteIndexes: [6],
|
|
48
|
+
parseReference: 16
|
|
49
|
+
}, {
|
|
50
|
+
name: "bil",
|
|
51
|
+
parseType: "number",
|
|
52
|
+
byteIndexes: [7],
|
|
53
|
+
parseReference: 16
|
|
54
|
+
}, {
|
|
55
|
+
name: "ket",
|
|
56
|
+
parseType: "number",
|
|
57
|
+
byteIndexes: [8],
|
|
58
|
+
parseReference: 16
|
|
59
|
+
}, {
|
|
60
|
+
name: "glu",
|
|
61
|
+
parseType: "number",
|
|
62
|
+
byteIndexes: [9],
|
|
63
|
+
parseReference: 16
|
|
64
|
+
}, {
|
|
65
|
+
name: "pro",
|
|
66
|
+
parseType: "number",
|
|
67
|
+
byteIndexes: [10],
|
|
68
|
+
parseReference: 16
|
|
69
|
+
}, {
|
|
70
|
+
name: "ph",
|
|
71
|
+
parseType: "number",
|
|
72
|
+
byteIndexes: [11],
|
|
73
|
+
parseReference: 16
|
|
74
|
+
}, {
|
|
75
|
+
name: "nit",
|
|
76
|
+
parseType: "number",
|
|
77
|
+
byteIndexes: [12],
|
|
78
|
+
parseReference: 16
|
|
79
|
+
}, {
|
|
80
|
+
name: "leu",
|
|
81
|
+
parseType: "number",
|
|
82
|
+
byteIndexes: [13],
|
|
83
|
+
parseReference: 16
|
|
84
|
+
}, {
|
|
85
|
+
name: "sg",
|
|
86
|
+
parseType: "number",
|
|
87
|
+
byteIndexes: [14],
|
|
88
|
+
parseReference: 16
|
|
89
|
+
}, {
|
|
90
|
+
name: "vc",
|
|
91
|
+
parseType: "number",
|
|
92
|
+
byteIndexes: [15],
|
|
93
|
+
parseReference: 16
|
|
94
|
+
}]
|
|
59
95
|
}]
|
|
60
96
|
}
|
|
61
97
|
}]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["MeasurementTypeKey","CaseType","bc01MainServices","uuid","
|
|
1
|
+
{"version":3,"names":["MeasurementTypeKey","CaseType","bc01MainServices","uuid","monitorUuids","parsingModel","caseValuePosition","cases","measurementTypeKey","uricAcid","caseType","RESULT","caseValue","parseDefinitions","name","parseType","byteIndexes","parseReference"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/bc01/bc01.main-services.ts"],"mappings":";;AAAA,SAASA,kBAAkB,QAAQ,YAAY;AAE/C,SAASC,QAAQ,QAAQ,6BAA0B;AAGnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAC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WAAW,EAAE,CAAC,EAAE,CAAC;UACjBC,cAAc,EAAE;QAClB,CAAC,EACD;UACEH,IAAI,EAAE,KAAK;UACXC,SAAS,EAAE,QAAQ;UACnBC,WAAW,EAAE,CAAC,EAAE,CAAC;UACjBC,cAAc,EAAE;QAClB,CAAC,EACD;UACEH,IAAI,EAAE,KAAK;UACXC,SAAS,EAAE,QAAQ;UACnBC,WAAW,EAAE,CAAC,EAAE,CAAC;UACjBC,cAAc,EAAE;QAClB,CAAC,EACD;UACEH,IAAI,EAAE,IAAI;UACVC,SAAS,EAAE,QAAQ;UACnBC,WAAW,EAAE,CAAC,EAAE,CAAC;UACjBC,cAAc,EAAE;QAClB,CAAC,EACD;UACEH,IAAI,EAAE,IAAI;UACVC,SAAS,EAAE,QAAQ;UACnBC,WAAW,EAAE,CAAC,EAAE,CAAC;UACjBC,cAAc,EAAE;QAClB,CAAC;MAEL,CAAC;IAEL;EACF,CAAC;AAEL,CAAC,CACF","ignoreList":[]}
|
|
@@ -13,6 +13,7 @@ export declare class BTManager<T extends readonly AcceptedDevice[]> {
|
|
|
13
13
|
private stateChangeListener;
|
|
14
14
|
private eventSubscriptions;
|
|
15
15
|
private deviceCreator;
|
|
16
|
+
private lastScanTimestamp;
|
|
16
17
|
constructor(bleManager: BleManager, acceptedDevices: T);
|
|
17
18
|
destroy: () => void;
|
|
18
19
|
startScan: () => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bt-manager.d.ts","sourceRoot":"","sources":["../../../../../../../src/modules/bt-management/services/bt-manager.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,UAAU,EAKX,MAAM,sBAAsB,CAAC;AAI9B,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,0BAA0B,EAAE,MAAM,wCAAwC,CAAC;AACpF,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,C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S,SAAS,EACrC,MAAM,EAAE,kBAAkB,CAAC,CAAC,CAAC,GAC5B,eAAe,CAAC,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"device-creator.d.ts","sourceRoot":"","sources":["../../../../../../../src/modules/bt-management/services/device-creator.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AAEnE,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAMrD,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AA6D9D,qBAAa,aAAa,CAAC,CAAC,SAAS,SAAS,cAAc,EAAE;IAKhD,OAAO,CAAC,QAAQ,CAAC,mBAAmB;IAJhD,OAAO,CAAC,eAAe,CAAuC;IAC9D,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAO;IACtC,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAsC;gBAEvC,mBAAmB,EAAE,CAAC;IAI5C,aAAa,GAAI,WAAW,MAAM,KAAG,WAAW,CAAC,CAAC,CAAC,GAAG,SAAS,CAkBpE;IAEK,YAAY,CAAC,CAAC,SAAS,SAAS,EACrC,MAAM,EAAE,kBAAkB,CAAC,CAAC,CAAC,GAC5B,eAAe,CAAC,CAAC,CAAC;IAmCd,OAAO,aAEZ;IAEF;;;OAGG;IACH,OAAO,CAAC,eAAe,CAmBrB;IAEF,OAAO,CAAC,eAAe;CAexB"}
|
package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bc01/bc01.device.d.ts
CHANGED
|
@@ -1,53 +1,33 @@
|
|
|
1
|
-
import { Device } from "react-native-ble-plx";
|
|
2
|
-
import { CreateDeviceParams } from "../../../types/create-device-params";
|
|
3
|
-
import { DependentResultHandlerParams } from "../../../types/dependent-result-handler-params";
|
|
4
1
|
import { MeasurementTypeForDevices } from "../../../types/device-measurement-map";
|
|
5
2
|
import { IntegratedDevices } from "../../../types/integrated-devices";
|
|
3
|
+
import { MeasurementWithCaseType } from "../../../types/measurement-with-case-type";
|
|
6
4
|
import { IService } from "../../../types/service.type";
|
|
7
5
|
import { BTManagedDevice } from "../bt-managed-device";
|
|
8
6
|
/**
|
|
9
7
|
* Contec BC401 (BC01) urine analyzer driver.
|
|
10
8
|
*
|
|
11
|
-
* The BC401 is a
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
* documented in `bc01-command-sequencer.ts`. Every record arrives as one
|
|
16
|
-
* 16-byte E1/E2 frame on 0xFF02.
|
|
9
|
+
* The BC401 is a single-shot device: the patient dips a URS-7 strip, presses
|
|
10
|
+
* the button, and the device pushes exactly one result frame on 0xFF01. There
|
|
11
|
+
* is no streaming state, no per-tick updates, and no measurement session to
|
|
12
|
+
* open — the device auto-starts on button press.
|
|
17
13
|
*/
|
|
18
14
|
export declare class BC01Device extends BTManagedDevice<IntegratedDevices.BC01> {
|
|
19
15
|
protected onStreamStart: () => void;
|
|
20
16
|
protected mainServices: IService[];
|
|
21
17
|
/**
|
|
22
18
|
* 90 s covers the maximum firmware-side reagent-pad settle time on a URS-7
|
|
23
|
-
* strip
|
|
24
|
-
*
|
|
25
|
-
* times out and the driver surfaces "device unreachable".
|
|
19
|
+
* strip. If the device does not push a result frame within that window the
|
|
20
|
+
* data-processor times out and the driver surfaces "device unreachable".
|
|
26
21
|
*/
|
|
27
22
|
protected stuckDataTimeout: number;
|
|
28
|
-
constructor(device: Device, params: CreateDeviceParams<IntegratedDevices.BC01>);
|
|
29
|
-
/**
|
|
30
|
-
* Returns true once the notification buffer holds a complete BC401 frame,
|
|
31
|
-
* classified by its opening opcode. Anything else — a heartbeat opcode we
|
|
32
|
-
* do not recognise, or a partial buffer — is held back until enough bytes
|
|
33
|
-
* arrive to make sense of it. There is no aa55 header on this hardware.
|
|
34
|
-
*/
|
|
35
23
|
protected validatePackage: (pkg: string[]) => boolean;
|
|
24
|
+
protected handleSuccessResult(successResult: MeasurementWithCaseType<MeasurementTypeForDevices<[IntegratedDevices.BC01]>>): void | boolean;
|
|
25
|
+
private handleUrinalysisResult;
|
|
36
26
|
/**
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
* reading directly through `onResult`. The frame is then handed back as
|
|
41
|
-
* `OTHER` so the state machine does not report it a second time and does
|
|
42
|
-
* not dedupe consecutive records that happen to share the same opcode.
|
|
43
|
-
*/
|
|
44
|
-
protected handleDependentResult: (data: DependentResultHandlerParams<MeasurementTypeForDevices<[IntegratedDevices.BC01]>>) => DependentResultHandlerParams<MeasurementTypeForDevices<[IntegratedDevices.BC01]>>;
|
|
45
|
-
/**
|
|
46
|
-
* Nothing to do here for the BC401. Every reading arrives through the
|
|
47
|
-
* dependent-result path, and the state machine sees only the `OTHER`-typed
|
|
48
|
-
* echo we return from `handleDependentResult`.
|
|
27
|
+
* A well-formed frame with all analyte fields still undefined means the
|
|
28
|
+
* device produced an empty read — typically a strip inserted upside down or
|
|
29
|
+
* removed before the reagent-pad timer completed.
|
|
49
30
|
*/
|
|
50
|
-
|
|
51
|
-
private reportUrsRecord;
|
|
31
|
+
private checkIfHasError;
|
|
52
32
|
}
|
|
53
33
|
//# sourceMappingURL=bc01.device.d.ts.map
|
package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bc01/bc01.device.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bc01.device.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/modules/bt-management/services/devices/bc01/bc01.device.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"bc01.device.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/modules/bt-management/services/devices/bc01/bc01.device.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,yBAAyB,EAAE,MAAM,uCAAuC,CAAC;AAClF,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AACtE,OAAO,EAAE,uBAAuB,EAAE,MAAM,2CAA2C,CAAC;AACpF,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAIvD;;;;;;;GAOG;AACH,qBAAa,UAAW,SAAQ,eAAe,CAAC,iBAAiB,CAAC,IAAI,CAAC;IACrE,SAAS,CAAC,aAAa,EAAE,MAAM,IAAI,CAAY;IAE/C,SAAS,CAAC,YAAY,EAAE,QAAQ,EAAE,CAAoB;IAEtD;;;;OAIG;IACH,SAAS,CAAC,gBAAgB,SAAU;IAEpC,SAAS,CAAC,eAAe,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,OAAO,CAgCnD;IAEF,SAAS,CAAC,mBAAmB,CAC3B,aAAa,EAAE,uBAAuB,CACpC,yBAAyB,CAAC,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC,CACpD,GACA,IAAI,GAAG,OAAO;IAkBjB,OAAO,CAAC,sBAAsB;IAc9B;;;;OAIG;IACH,OAAO,CAAC,eAAe;CA2BxB"}
|
|
@@ -2,20 +2,26 @@ import { IService } from "../../../types/service.type";
|
|
|
2
2
|
/**
|
|
3
3
|
* Contec BC401 (a.k.a. BC01) urine analyzer — GATT profile.
|
|
4
4
|
*
|
|
5
|
-
* The BC401 uses Contec's proprietary FF12 service, shared across their
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* in `bc01-command-sequencer.ts`.
|
|
5
|
+
* The BC401 uses Contec's proprietary FF12 service, shared across their consumer
|
|
6
|
+
* medical devices. A single result notification carries a 7-parameter URS-7
|
|
7
|
+
* strip readout expanded into eleven analyte values on the wire.
|
|
9
8
|
*
|
|
10
9
|
* Service 0xFF12
|
|
11
|
-
* Notify (result)
|
|
12
|
-
* Write (command)
|
|
10
|
+
* Notify (result) 0xFF01 — CCCD 0x2902 must be written 01 00 to enable
|
|
11
|
+
* Write (command) 0xFF02 — RESET / SET_UNIT / REQUEST_HISTORY
|
|
13
12
|
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
13
|
+
* Wire layout of a result frame (Contec URS-7 firmware ≥ 1.2.x):
|
|
14
|
+
* [0..1] header "aa 55" — Contec sentinel
|
|
15
|
+
* [2] length byte after header
|
|
16
|
+
* [3] command "a1" == RESULT_URS7
|
|
17
|
+
* [4] strip type "07" == 7-panel
|
|
18
|
+
* [5..15] values one byte per analyte, encoding the discrete
|
|
19
|
+
* level index into diagnosticResults[key]
|
|
20
|
+
* [16] checksum xor over [2..15]
|
|
21
|
+
*
|
|
22
|
+
* Byte positions calibrated against PHMS 3.0.03 Android app; older firmware
|
|
23
|
+
* (< 1.2.x) uses a different command byte and is not supported by this driver
|
|
24
|
+
* (the validator will reject those frames).
|
|
19
25
|
*/
|
|
20
26
|
export declare const bc01MainServices: IService[];
|
|
21
27
|
//# sourceMappingURL=bc01.main-services.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bc01.main-services.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/modules/bt-management/services/devices/bc01/bc01.main-services.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAEvD
|
|
1
|
+
{"version":3,"file":"bc01.main-services.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/modules/bt-management/services/devices/bc01/bc01.main-services.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAEvD;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,eAAO,MAAM,gBAAgB,EAAE,QAAQ,EAuFtC,CAAC"}
|