@ovok/native 0.4.8 → 0.4.10
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 +8 -667
- package/lib/commonjs/modules/bt-management/services/bt-manager.js +15 -13
- package/lib/commonjs/modules/bt-management/services/bt-manager.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/device-creator.js +7 -1
- package/lib/commonjs/modules/bt-management/services/device-creator.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/devices/bc01/bc01-command-sequencer.js +184 -0
- package/lib/commonjs/modules/bt-management/services/devices/bc01/bc01-command-sequencer.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/devices/bc01/bc01-frame-parser.js +114 -0
- package/lib/commonjs/modules/bt-management/services/devices/bc01/bc01-frame-parser.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/devices/bc01/bc01.device.js +113 -51
- 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 +41 -77
- 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 +15 -13
- package/lib/module/modules/bt-management/services/bt-manager.js.map +1 -1
- package/lib/module/modules/bt-management/services/device-creator.js +7 -1
- package/lib/module/modules/bt-management/services/device-creator.js.map +1 -1
- package/lib/module/modules/bt-management/services/devices/bc01/bc01-command-sequencer.js +180 -0
- package/lib/module/modules/bt-management/services/devices/bc01/bc01-command-sequencer.js.map +1 -0
- package/lib/module/modules/bt-management/services/devices/bc01/bc01-frame-parser.js +110 -0
- package/lib/module/modules/bt-management/services/devices/bc01/bc01-frame-parser.js.map +1 -0
- package/lib/module/modules/bt-management/services/devices/bc01/bc01.device.js +113 -51
- 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 +41 -77
- 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 +0 -1
- 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-command-sequencer.d.ts +53 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bc01/bc01-command-sequencer.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bc01/bc01-frame-parser.d.ts +53 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bc01/bc01-frame-parser.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bc01/bc01.device.d.ts +33 -13
- 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 +11 -17
- 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 +0 -1
- 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-command-sequencer.d.ts +53 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/bc01/bc01-command-sequencer.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/bc01/bc01-frame-parser.d.ts +53 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/bc01/bc01-frame-parser.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/bc01/bc01.device.d.ts +33 -13
- 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 +11 -17
- package/lib/typescript/module/src/modules/bt-management/services/devices/bc01/bc01.main-services.d.ts.map +1 -1
- package/package.json +1 -1
package/lib/typescript/module/src/modules/bt-management/services/devices/bc01/bc01.device.d.ts
CHANGED
|
@@ -1,33 +1,53 @@
|
|
|
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";
|
|
1
4
|
import { MeasurementTypeForDevices } from "../../../types/device-measurement-map";
|
|
2
5
|
import { IntegratedDevices } from "../../../types/integrated-devices";
|
|
3
|
-
import { MeasurementWithCaseType } from "../../../types/measurement-with-case-type";
|
|
4
6
|
import { IService } from "../../../types/service.type";
|
|
5
7
|
import { BTManagedDevice } from "../bt-managed-device";
|
|
6
8
|
/**
|
|
7
9
|
* Contec BC401 (BC01) urine analyzer driver.
|
|
8
10
|
*
|
|
9
|
-
* The BC401 is a
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
11
|
+
* The BC401 is a memory device, not a live stream: every measurement the
|
|
12
|
+
* patient takes is written to onboard 500-slot flash the moment the strip
|
|
13
|
+
* finishes reacting, and the app pulls stored records over BLE only after the
|
|
14
|
+
* host walks the reset → version → set-time → count → get-records handshake
|
|
15
|
+
* documented in `bc01-command-sequencer.ts`. Every record arrives as one
|
|
16
|
+
* 16-byte E1/E2 frame on 0xFF02.
|
|
13
17
|
*/
|
|
14
18
|
export declare class BC01Device extends BTManagedDevice<IntegratedDevices.BC01> {
|
|
15
19
|
protected onStreamStart: () => void;
|
|
16
20
|
protected mainServices: IService[];
|
|
17
21
|
/**
|
|
18
22
|
* 90 s covers the maximum firmware-side reagent-pad settle time on a URS-7
|
|
19
|
-
* strip
|
|
20
|
-
*
|
|
23
|
+
* strip and leaves headroom for a bulk memory dump of every stored record.
|
|
24
|
+
* If the device does not push a frame within that window the data processor
|
|
25
|
+
* times out and the driver surfaces "device unreachable".
|
|
21
26
|
*/
|
|
22
27
|
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
|
+
*/
|
|
23
35
|
protected validatePackage: (pkg: string[]) => boolean;
|
|
24
|
-
protected handleSuccessResult(successResult: MeasurementWithCaseType<MeasurementTypeForDevices<[IntegratedDevices.BC01]>>): void | boolean;
|
|
25
|
-
private handleUrinalysisResult;
|
|
26
36
|
/**
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
37
|
+
* The parsing model declares every E1/E2 frame as `DEPENDENT`, so this hook
|
|
38
|
+
* runs for each record. We decode the raw bytes here — the packed 3-bits-per
|
|
39
|
+
* -pad layout is not expressible in the declaration parser — and report the
|
|
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`.
|
|
30
49
|
*/
|
|
31
|
-
|
|
50
|
+
protected handleSuccessResult(): void | boolean;
|
|
51
|
+
private reportUrsRecord;
|
|
32
52
|
}
|
|
33
53
|
//# sourceMappingURL=bc01.device.d.ts.map
|
package/lib/typescript/module/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":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAI9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AACzE,OAAO,EAAE,4BAA4B,EAAE,MAAM,gDAAgD,CAAC;AAC9F,OAAO,EAAE,yBAAyB,EAAE,MAAM,uCAAuC,CAAC;AAClF,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AAEtE,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAEvD,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAmBvD;;;;;;;;;GASG;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;;;;;OAKG;IACH,SAAS,CAAC,gBAAgB,SAAU;gBAExB,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,kBAAkB,CAAC,iBAAiB,CAAC,IAAI,CAAC;IAqB9E;;;;;OAKG;IACH,SAAS,CAAC,eAAe,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,OAAO,CAanD;IAEF;;;;;;;OAOG;IACH,SAAS,CAAC,qBAAqB,GAC7B,MAAM,4BAA4B,CAChC,yBAAyB,CAAC,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC,CACpD,KACA,4BAA4B,CAC7B,yBAAyB,CAAC,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC,CACpD,CASC;IAEF;;;;OAIG;IACH,SAAS,CAAC,mBAAmB,IAAI,IAAI,GAAG,OAAO;IAI/C,OAAO,CAAC,eAAe;CAqCxB"}
|
|
@@ -2,26 +2,20 @@ 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
|
-
* medical devices.
|
|
7
|
-
*
|
|
5
|
+
* The BC401 uses Contec's proprietary FF12 service, shared across their
|
|
6
|
+
* consumer medical devices. Every stored URS-7 measurement is pushed as a
|
|
7
|
+
* 16-byte record on 0xFF02 after the host has walked the handshake documented
|
|
8
|
+
* in `bc01-command-sequencer.ts`.
|
|
8
9
|
*
|
|
9
10
|
* Service 0xFF12
|
|
10
|
-
* Notify (result)
|
|
11
|
-
* Write (command)
|
|
11
|
+
* Notify (result) 0xFF02 — CCCD 0x2902 must be written 01 00 to enable
|
|
12
|
+
* Write (command) 0xFF01 — RESET / SET_TIME / GET_COUNT / GET_RECORDS
|
|
12
13
|
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
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).
|
|
14
|
+
* On the wire a stored URS record opens with 0xE1 (single) or 0xE2 (paginated).
|
|
15
|
+
* The remaining fifteen bytes carry the flags nibble, timestamp, seven bytes of
|
|
16
|
+
* packed 3-bit analyte indices, and a checksum. `bc01-frame-parser.ts` decodes
|
|
17
|
+
* them; this file just declares the GATT surface and hands every E1/E2 frame
|
|
18
|
+
* to the driver's dependent-result path so the parser can run.
|
|
25
19
|
*/
|
|
26
20
|
export declare const bc01MainServices: IService[];
|
|
27
21
|
//# 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;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,gBAAgB,EAAE,QAAQ,EAgDtC,CAAC"}
|