@ovok/native 0.4.8 → 0.4.9

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.
Files changed (47) hide show
  1. package/lib/commonjs/modules/bt-management/services/bt-manager.js +15 -13
  2. package/lib/commonjs/modules/bt-management/services/bt-manager.js.map +1 -1
  3. package/lib/commonjs/modules/bt-management/services/device-creator.js +7 -1
  4. package/lib/commonjs/modules/bt-management/services/device-creator.js.map +1 -1
  5. package/lib/commonjs/modules/bt-management/services/devices/bc01/bc01-command-sequencer.js +184 -0
  6. package/lib/commonjs/modules/bt-management/services/devices/bc01/bc01-command-sequencer.js.map +1 -0
  7. package/lib/commonjs/modules/bt-management/services/devices/bc01/bc01-frame-parser.js +114 -0
  8. package/lib/commonjs/modules/bt-management/services/devices/bc01/bc01-frame-parser.js.map +1 -0
  9. package/lib/commonjs/modules/bt-management/services/devices/bc01/bc01.device.js +113 -51
  10. package/lib/commonjs/modules/bt-management/services/devices/bc01/bc01.device.js.map +1 -1
  11. package/lib/commonjs/modules/bt-management/services/devices/bc01/bc01.main-services.js +41 -77
  12. package/lib/commonjs/modules/bt-management/services/devices/bc01/bc01.main-services.js.map +1 -1
  13. package/lib/module/modules/bt-management/services/bt-manager.js +15 -13
  14. package/lib/module/modules/bt-management/services/bt-manager.js.map +1 -1
  15. package/lib/module/modules/bt-management/services/device-creator.js +7 -1
  16. package/lib/module/modules/bt-management/services/device-creator.js.map +1 -1
  17. package/lib/module/modules/bt-management/services/devices/bc01/bc01-command-sequencer.js +180 -0
  18. package/lib/module/modules/bt-management/services/devices/bc01/bc01-command-sequencer.js.map +1 -0
  19. package/lib/module/modules/bt-management/services/devices/bc01/bc01-frame-parser.js +110 -0
  20. package/lib/module/modules/bt-management/services/devices/bc01/bc01-frame-parser.js.map +1 -0
  21. package/lib/module/modules/bt-management/services/devices/bc01/bc01.device.js +113 -51
  22. package/lib/module/modules/bt-management/services/devices/bc01/bc01.device.js.map +1 -1
  23. package/lib/module/modules/bt-management/services/devices/bc01/bc01.main-services.js +41 -77
  24. package/lib/module/modules/bt-management/services/devices/bc01/bc01.main-services.js.map +1 -1
  25. package/lib/typescript/commonjs/src/modules/bt-management/services/bt-manager.d.ts +0 -1
  26. package/lib/typescript/commonjs/src/modules/bt-management/services/bt-manager.d.ts.map +1 -1
  27. package/lib/typescript/commonjs/src/modules/bt-management/services/device-creator.d.ts.map +1 -1
  28. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bc01/bc01-command-sequencer.d.ts +53 -0
  29. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bc01/bc01-command-sequencer.d.ts.map +1 -0
  30. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bc01/bc01-frame-parser.d.ts +53 -0
  31. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bc01/bc01-frame-parser.d.ts.map +1 -0
  32. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bc01/bc01.device.d.ts +33 -13
  33. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bc01/bc01.device.d.ts.map +1 -1
  34. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bc01/bc01.main-services.d.ts +11 -17
  35. package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bc01/bc01.main-services.d.ts.map +1 -1
  36. package/lib/typescript/module/src/modules/bt-management/services/bt-manager.d.ts +0 -1
  37. package/lib/typescript/module/src/modules/bt-management/services/bt-manager.d.ts.map +1 -1
  38. package/lib/typescript/module/src/modules/bt-management/services/device-creator.d.ts.map +1 -1
  39. package/lib/typescript/module/src/modules/bt-management/services/devices/bc01/bc01-command-sequencer.d.ts +53 -0
  40. package/lib/typescript/module/src/modules/bt-management/services/devices/bc01/bc01-command-sequencer.d.ts.map +1 -0
  41. package/lib/typescript/module/src/modules/bt-management/services/devices/bc01/bc01-frame-parser.d.ts +53 -0
  42. package/lib/typescript/module/src/modules/bt-management/services/devices/bc01/bc01-frame-parser.d.ts.map +1 -0
  43. package/lib/typescript/module/src/modules/bt-management/services/devices/bc01/bc01.device.d.ts +33 -13
  44. package/lib/typescript/module/src/modules/bt-management/services/devices/bc01/bc01.device.d.ts.map +1 -1
  45. package/lib/typescript/module/src/modules/bt-management/services/devices/bc01/bc01.main-services.d.ts +11 -17
  46. package/lib/typescript/module/src/modules/bt-management/services/devices/bc01/bc01.main-services.d.ts.map +1 -1
  47. package/package.json +1 -1
@@ -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 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.
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. If the device does not push a result frame within that window the
20
- * data-processor times out and the driver surfaces "device unreachable".
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
- * 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.
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
- private checkIfHasError;
50
+ protected handleSuccessResult(): void | boolean;
51
+ private reportUrsRecord;
32
52
  }
33
53
  //# sourceMappingURL=bc01.device.d.ts.map
@@ -1 +1 @@
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"}
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 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.
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) 0xFF01 — CCCD 0x2902 must be written 01 00 to enable
11
- * Write (command) 0xFF02 — RESET / SET_UNIT / REQUEST_HISTORY
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
- * 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).
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;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,eAAO,MAAM,gBAAgB,EAAE,QAAQ,EAuFtC,CAAC"}
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"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ovok/native",
3
- "version": "0.4.8",
3
+ "version": "0.4.9",
4
4
  "description": "React native component sdk for OVOK",
5
5
  "source": "./src/index.tsx",
6
6
  "main": "./lib/commonjs/index.js",