@ovok/native 1.17.0-dev.2215 → 1.17.0-dev.2219
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commonjs/modules/next/bluetooth/adapters/android-foreground-service.js +58 -5
- package/lib/commonjs/modules/next/bluetooth/adapters/android-foreground-service.js.map +1 -1
- package/lib/commonjs/modules/next/bluetooth/adapters/ecg-measurements.js +25 -0
- package/lib/commonjs/modules/next/bluetooth/adapters/ecg-measurements.js.map +1 -0
- package/lib/commonjs/modules/next/bluetooth/adapters/live-supersession.js +62 -0
- package/lib/commonjs/modules/next/bluetooth/adapters/live-supersession.js.map +1 -0
- package/lib/commonjs/modules/next/bluetooth/adapters/ovok-outbox-watch.js +42 -0
- package/lib/commonjs/modules/next/bluetooth/adapters/ovok-outbox-watch.js.map +1 -0
- package/lib/commonjs/modules/next/bluetooth/adapters/ovok-reading-sink.js +97 -96
- package/lib/commonjs/modules/next/bluetooth/adapters/ovok-reading-sink.js.map +1 -1
- package/lib/commonjs/modules/next/bluetooth/adapters/reading-source-id.js +33 -0
- package/lib/commonjs/modules/next/bluetooth/adapters/reading-source-id.js.map +1 -0
- package/lib/commonjs/modules/next/bluetooth/adapters/reading-values.js +38 -0
- package/lib/commonjs/modules/next/bluetooth/adapters/reading-values.js.map +1 -0
- package/lib/commonjs/modules/next/bluetooth/adapters/series-saving.js +101 -0
- package/lib/commonjs/modules/next/bluetooth/adapters/series-saving.js.map +1 -0
- package/lib/commonjs/modules/next/bluetooth/adapters/sqlite-database.js +24 -0
- package/lib/commonjs/modules/next/bluetooth/adapters/sqlite-database.js.map +1 -0
- package/lib/commonjs/modules/next/bluetooth/adapters/sqlite-outbox-rows.js +65 -0
- package/lib/commonjs/modules/next/bluetooth/adapters/sqlite-outbox-rows.js.map +1 -0
- package/lib/commonjs/modules/next/bluetooth/adapters/sqlite-outbox-schema.js +53 -0
- package/lib/commonjs/modules/next/bluetooth/adapters/sqlite-outbox-schema.js.map +1 -0
- package/lib/commonjs/modules/next/bluetooth/adapters/sqlite-outbox-store.js +82 -0
- package/lib/commonjs/modules/next/bluetooth/adapters/sqlite-outbox-store.js.map +1 -0
- package/lib/commonjs/modules/next/bluetooth/adapters/storage-paired-devices.js +1 -0
- package/lib/commonjs/modules/next/bluetooth/adapters/storage-paired-devices.js.map +1 -1
- package/lib/commonjs/modules/next/bluetooth/core/bluetooth.js +9 -3
- package/lib/commonjs/modules/next/bluetooth/core/bluetooth.js.map +1 -1
- package/lib/commonjs/modules/next/bluetooth/core/device-deps.js +6 -0
- package/lib/commonjs/modules/next/bluetooth/core/device-deps.js.map +1 -0
- package/lib/commonjs/modules/next/bluetooth/core/device-snapshot.js +3 -1
- package/lib/commonjs/modules/next/bluetooth/core/device-snapshot.js.map +1 -1
- package/lib/commonjs/modules/next/bluetooth/core/device.js +19 -6
- package/lib/commonjs/modules/next/bluetooth/core/device.js.map +1 -1
- package/lib/commonjs/modules/next/bluetooth/core/live-ledger.js +54 -0
- package/lib/commonjs/modules/next/bluetooth/core/live-ledger.js.map +1 -0
- package/lib/commonjs/modules/next/bluetooth/core/measuring-watch.js +45 -0
- package/lib/commonjs/modules/next/bluetooth/core/measuring-watch.js.map +1 -0
- package/lib/commonjs/modules/next/bluetooth/core/outbox-watch.js +17 -0
- package/lib/commonjs/modules/next/bluetooth/core/outbox-watch.js.map +1 -0
- package/lib/commonjs/modules/next/bluetooth/core/paired-device.js +1 -0
- package/lib/commonjs/modules/next/bluetooth/core/paired-device.js.map +1 -1
- package/lib/commonjs/modules/next/bluetooth/core/ports.js.map +1 -1
- package/lib/commonjs/modules/next/bluetooth/core/reading-log.js +89 -7
- package/lib/commonjs/modules/next/bluetooth/core/reading-log.js.map +1 -1
- package/lib/commonjs/modules/next/bluetooth/core/series-slots.js +94 -0
- package/lib/commonjs/modules/next/bluetooth/core/series-slots.js.map +1 -0
- package/lib/commonjs/modules/next/bluetooth/core/stream-recorder.js +219 -0
- package/lib/commonjs/modules/next/bluetooth/core/stream-recorder.js.map +1 -0
- package/lib/commonjs/modules/next/bluetooth/core/waveform-segments.js +110 -0
- package/lib/commonjs/modules/next/bluetooth/core/waveform-segments.js.map +1 -0
- package/lib/commonjs/modules/next/bluetooth/create-bluetooth.js +19 -11
- package/lib/commonjs/modules/next/bluetooth/create-bluetooth.js.map +1 -1
- package/lib/commonjs/modules/next/bluetooth/index.js +9 -1
- package/lib/commonjs/modules/next/bluetooth/index.js.map +1 -1
- package/lib/commonjs/modules/next/bluetooth/shared.js +14 -0
- package/lib/commonjs/modules/next/bluetooth/shared.js.map +1 -1
- package/lib/commonjs/modules/next/bluetooth/web/create-web-bluetooth.js +2 -0
- package/lib/commonjs/modules/next/bluetooth/web/create-web-bluetooth.js.map +1 -1
- package/lib/module/modules/next/bluetooth/adapters/android-foreground-service.js +59 -6
- package/lib/module/modules/next/bluetooth/adapters/android-foreground-service.js.map +1 -1
- package/lib/module/modules/next/bluetooth/adapters/ecg-measurements.js +22 -0
- package/lib/module/modules/next/bluetooth/adapters/ecg-measurements.js.map +1 -0
- package/lib/module/modules/next/bluetooth/adapters/live-supersession.js +59 -0
- package/lib/module/modules/next/bluetooth/adapters/live-supersession.js.map +1 -0
- package/lib/module/modules/next/bluetooth/adapters/ovok-outbox-watch.js +38 -0
- package/lib/module/modules/next/bluetooth/adapters/ovok-outbox-watch.js.map +1 -0
- package/lib/module/modules/next/bluetooth/adapters/ovok-reading-sink.js +76 -75
- package/lib/module/modules/next/bluetooth/adapters/ovok-reading-sink.js.map +1 -1
- package/lib/module/modules/next/bluetooth/adapters/reading-source-id.js +27 -0
- package/lib/module/modules/next/bluetooth/adapters/reading-source-id.js.map +1 -0
- package/lib/module/modules/next/bluetooth/adapters/reading-values.js +33 -0
- package/lib/module/modules/next/bluetooth/adapters/reading-values.js.map +1 -0
- package/lib/module/modules/next/bluetooth/adapters/series-saving.js +94 -0
- package/lib/module/modules/next/bluetooth/adapters/series-saving.js.map +1 -0
- package/lib/module/modules/next/bluetooth/adapters/sqlite-database.js +20 -0
- package/lib/module/modules/next/bluetooth/adapters/sqlite-database.js.map +1 -0
- package/lib/module/modules/next/bluetooth/adapters/sqlite-outbox-rows.js +59 -0
- package/lib/module/modules/next/bluetooth/adapters/sqlite-outbox-rows.js.map +1 -0
- package/lib/module/modules/next/bluetooth/adapters/sqlite-outbox-schema.js +49 -0
- package/lib/module/modules/next/bluetooth/adapters/sqlite-outbox-schema.js.map +1 -0
- package/lib/module/modules/next/bluetooth/adapters/sqlite-outbox-store.js +79 -0
- package/lib/module/modules/next/bluetooth/adapters/sqlite-outbox-store.js.map +1 -0
- package/lib/module/modules/next/bluetooth/adapters/storage-paired-devices.js +1 -0
- package/lib/module/modules/next/bluetooth/adapters/storage-paired-devices.js.map +1 -1
- package/lib/module/modules/next/bluetooth/core/bluetooth.js +9 -3
- package/lib/module/modules/next/bluetooth/core/bluetooth.js.map +1 -1
- package/lib/module/modules/next/bluetooth/core/device-deps.js +4 -0
- package/lib/module/modules/next/bluetooth/core/device-deps.js.map +1 -0
- package/lib/module/modules/next/bluetooth/core/device-snapshot.js +3 -1
- package/lib/module/modules/next/bluetooth/core/device-snapshot.js.map +1 -1
- package/lib/module/modules/next/bluetooth/core/device.js +19 -6
- package/lib/module/modules/next/bluetooth/core/device.js.map +1 -1
- package/lib/module/modules/next/bluetooth/core/live-ledger.js +50 -0
- package/lib/module/modules/next/bluetooth/core/live-ledger.js.map +1 -0
- package/lib/module/modules/next/bluetooth/core/measuring-watch.js +41 -0
- package/lib/module/modules/next/bluetooth/core/measuring-watch.js.map +1 -0
- package/lib/module/modules/next/bluetooth/core/outbox-watch.js +14 -0
- package/lib/module/modules/next/bluetooth/core/outbox-watch.js.map +1 -0
- package/lib/module/modules/next/bluetooth/core/paired-device.js +1 -0
- package/lib/module/modules/next/bluetooth/core/paired-device.js.map +1 -1
- package/lib/module/modules/next/bluetooth/core/ports.js.map +1 -1
- package/lib/module/modules/next/bluetooth/core/reading-log.js +89 -7
- package/lib/module/modules/next/bluetooth/core/reading-log.js.map +1 -1
- package/lib/module/modules/next/bluetooth/core/series-slots.js +90 -0
- package/lib/module/modules/next/bluetooth/core/series-slots.js.map +1 -0
- package/lib/module/modules/next/bluetooth/core/stream-recorder.js +215 -0
- package/lib/module/modules/next/bluetooth/core/stream-recorder.js.map +1 -0
- package/lib/module/modules/next/bluetooth/core/waveform-segments.js +106 -0
- package/lib/module/modules/next/bluetooth/core/waveform-segments.js.map +1 -0
- package/lib/module/modules/next/bluetooth/create-bluetooth.js +19 -11
- package/lib/module/modules/next/bluetooth/create-bluetooth.js.map +1 -1
- package/lib/module/modules/next/bluetooth/index.js +1 -0
- package/lib/module/modules/next/bluetooth/index.js.map +1 -1
- package/lib/module/modules/next/bluetooth/shared.js +2 -0
- package/lib/module/modules/next/bluetooth/shared.js.map +1 -1
- package/lib/module/modules/next/bluetooth/web/create-web-bluetooth.js +2 -0
- package/lib/module/modules/next/bluetooth/web/create-web-bluetooth.js.map +1 -1
- package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/android-foreground-service.d.ts +17 -4
- package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/android-foreground-service.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/ecg-measurements.d.ts +6 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/ecg-measurements.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/live-supersession.d.ts +9 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/live-supersession.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/ovok-outbox-watch.d.ts +8 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/ovok-outbox-watch.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/ovok-reading-sink.d.ts +9 -3
- package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/ovok-reading-sink.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/reading-source-id.d.ts +9 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/reading-source-id.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/reading-values.d.ts +9 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/reading-values.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/series-saving.d.ts +28 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/series-saving.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/sqlite-database.d.ts +23 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/sqlite-database.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/sqlite-outbox-rows.d.ts +29 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/sqlite-outbox-rows.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/sqlite-outbox-schema.d.ts +6 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/sqlite-outbox-schema.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/sqlite-outbox-store.d.ts +38 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/sqlite-outbox-store.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/storage-paired-devices.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/next/bluetooth/core/bluetooth-options.d.ts +3 -0
- 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.map +1 -1
- package/lib/typescript/commonjs/src/modules/next/bluetooth/core/device-deps.d.ts +16 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/core/device-deps.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/core/device-snapshot.d.ts +5 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/core/device-snapshot.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/next/bluetooth/core/device.d.ts +6 -13
- package/lib/typescript/commonjs/src/modules/next/bluetooth/core/device.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/next/bluetooth/core/live-ledger.d.ts +13 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/core/live-ledger.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/core/measuring-watch.d.ts +17 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/core/measuring-watch.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/core/outbox-watch.d.ts +27 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/core/outbox-watch.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/core/paired-device.d.ts +3 -1
- package/lib/typescript/commonjs/src/modules/next/bluetooth/core/paired-device.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/next/bluetooth/core/ports.d.ts +3 -2
- package/lib/typescript/commonjs/src/modules/next/bluetooth/core/ports.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/next/bluetooth/core/reading-log.d.ts +25 -6
- package/lib/typescript/commonjs/src/modules/next/bluetooth/core/reading-log.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/next/bluetooth/core/reading.d.ts +16 -1
- package/lib/typescript/commonjs/src/modules/next/bluetooth/core/reading.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/next/bluetooth/core/series-slots.d.ts +35 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/core/series-slots.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/core/stream-recorder.d.ts +58 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/core/stream-recorder.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/core/waveform-segments.d.ts +26 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/core/waveform-segments.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/create-bluetooth.d.ts +3 -2
- package/lib/typescript/commonjs/src/modules/next/bluetooth/create-bluetooth.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/next/bluetooth/index.d.ts +4 -1
- package/lib/typescript/commonjs/src/modules/next/bluetooth/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/next/bluetooth/shared.d.ts +5 -1
- package/lib/typescript/commonjs/src/modules/next/bluetooth/shared.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/next/bluetooth/web/create-web-bluetooth.d.ts +3 -2
- package/lib/typescript/commonjs/src/modules/next/bluetooth/web/create-web-bluetooth.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/next/bluetooth/adapters/android-foreground-service.d.ts +17 -4
- package/lib/typescript/module/src/modules/next/bluetooth/adapters/android-foreground-service.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/next/bluetooth/adapters/ecg-measurements.d.ts +6 -0
- package/lib/typescript/module/src/modules/next/bluetooth/adapters/ecg-measurements.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/next/bluetooth/adapters/live-supersession.d.ts +9 -0
- package/lib/typescript/module/src/modules/next/bluetooth/adapters/live-supersession.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/next/bluetooth/adapters/ovok-outbox-watch.d.ts +8 -0
- package/lib/typescript/module/src/modules/next/bluetooth/adapters/ovok-outbox-watch.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/next/bluetooth/adapters/ovok-reading-sink.d.ts +9 -3
- package/lib/typescript/module/src/modules/next/bluetooth/adapters/ovok-reading-sink.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/next/bluetooth/adapters/reading-source-id.d.ts +9 -0
- package/lib/typescript/module/src/modules/next/bluetooth/adapters/reading-source-id.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/next/bluetooth/adapters/reading-values.d.ts +9 -0
- package/lib/typescript/module/src/modules/next/bluetooth/adapters/reading-values.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/next/bluetooth/adapters/series-saving.d.ts +28 -0
- package/lib/typescript/module/src/modules/next/bluetooth/adapters/series-saving.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/next/bluetooth/adapters/sqlite-database.d.ts +23 -0
- package/lib/typescript/module/src/modules/next/bluetooth/adapters/sqlite-database.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/next/bluetooth/adapters/sqlite-outbox-rows.d.ts +29 -0
- package/lib/typescript/module/src/modules/next/bluetooth/adapters/sqlite-outbox-rows.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/next/bluetooth/adapters/sqlite-outbox-schema.d.ts +6 -0
- package/lib/typescript/module/src/modules/next/bluetooth/adapters/sqlite-outbox-schema.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/next/bluetooth/adapters/sqlite-outbox-store.d.ts +38 -0
- package/lib/typescript/module/src/modules/next/bluetooth/adapters/sqlite-outbox-store.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/next/bluetooth/adapters/storage-paired-devices.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/next/bluetooth/core/bluetooth-options.d.ts +3 -0
- 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.map +1 -1
- package/lib/typescript/module/src/modules/next/bluetooth/core/device-deps.d.ts +16 -0
- package/lib/typescript/module/src/modules/next/bluetooth/core/device-deps.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/next/bluetooth/core/device-snapshot.d.ts +5 -0
- package/lib/typescript/module/src/modules/next/bluetooth/core/device-snapshot.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/next/bluetooth/core/device.d.ts +6 -13
- package/lib/typescript/module/src/modules/next/bluetooth/core/device.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/next/bluetooth/core/live-ledger.d.ts +13 -0
- package/lib/typescript/module/src/modules/next/bluetooth/core/live-ledger.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/next/bluetooth/core/measuring-watch.d.ts +17 -0
- package/lib/typescript/module/src/modules/next/bluetooth/core/measuring-watch.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/next/bluetooth/core/outbox-watch.d.ts +27 -0
- package/lib/typescript/module/src/modules/next/bluetooth/core/outbox-watch.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/next/bluetooth/core/paired-device.d.ts +3 -1
- package/lib/typescript/module/src/modules/next/bluetooth/core/paired-device.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/next/bluetooth/core/ports.d.ts +3 -2
- package/lib/typescript/module/src/modules/next/bluetooth/core/ports.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/next/bluetooth/core/reading-log.d.ts +25 -6
- package/lib/typescript/module/src/modules/next/bluetooth/core/reading-log.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/next/bluetooth/core/reading.d.ts +16 -1
- package/lib/typescript/module/src/modules/next/bluetooth/core/reading.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/next/bluetooth/core/series-slots.d.ts +35 -0
- package/lib/typescript/module/src/modules/next/bluetooth/core/series-slots.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/next/bluetooth/core/stream-recorder.d.ts +58 -0
- package/lib/typescript/module/src/modules/next/bluetooth/core/stream-recorder.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/next/bluetooth/core/waveform-segments.d.ts +26 -0
- package/lib/typescript/module/src/modules/next/bluetooth/core/waveform-segments.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/next/bluetooth/create-bluetooth.d.ts +3 -2
- package/lib/typescript/module/src/modules/next/bluetooth/create-bluetooth.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/next/bluetooth/index.d.ts +4 -1
- package/lib/typescript/module/src/modules/next/bluetooth/index.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/next/bluetooth/shared.d.ts +5 -1
- package/lib/typescript/module/src/modules/next/bluetooth/shared.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/next/bluetooth/web/create-web-bluetooth.d.ts +3 -2
- package/lib/typescript/module/src/modules/next/bluetooth/web/create-web-bluetooth.d.ts.map +1 -1
- package/package.json +7 -3
|
@@ -1,19 +1,50 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
import { Listeners } from "./listeners.js";
|
|
4
|
+
import { noOutboxWatch } from "./outbox-watch.js";
|
|
4
5
|
|
|
5
|
-
/**
|
|
6
|
+
/**
|
|
7
|
+
* `queued` means the reading waits in the outbox, and `saved` that the server has it. `rejected` means the server
|
|
8
|
+
* refused it there; it waits for a resend or a discard. `failed` means the sink threw; a stored record is then
|
|
9
|
+
* released, so the next sync delivers it again.
|
|
10
|
+
*/
|
|
6
11
|
|
|
7
12
|
/** A reading received this session and how its save went. */
|
|
8
13
|
|
|
14
|
+
/** A sink whose save may say which outbox items hold a queued reading. */
|
|
15
|
+
|
|
16
|
+
const receiptOf = outcome => typeof outcome === "string" ? {
|
|
17
|
+
status: outcome
|
|
18
|
+
} : outcome;
|
|
19
|
+
const followsOutbox = ({
|
|
20
|
+
save,
|
|
21
|
+
queueIds
|
|
22
|
+
}) => queueIds !== undefined && queueIds.length > 0 && (save === "queued" || save === "rejected");
|
|
23
|
+
|
|
24
|
+
/** Items the view does not list keep the entry's state: they were discarded, or are another account's. */
|
|
25
|
+
const stateIn = (view, {
|
|
26
|
+
queueIds = [],
|
|
27
|
+
save
|
|
28
|
+
}) => {
|
|
29
|
+
if (queueIds.some(id => view.rejected.has(id))) {
|
|
30
|
+
return "rejected";
|
|
31
|
+
}
|
|
32
|
+
if (queueIds.some(id => view.waiting.has(id))) {
|
|
33
|
+
return "queued";
|
|
34
|
+
}
|
|
35
|
+
return queueIds.every(id => view.sent.has(id)) ? "saved" : save;
|
|
36
|
+
};
|
|
37
|
+
|
|
9
38
|
/** Saves every reading a device delivers, then acknowledges stored records so the device cursor moves on. */
|
|
10
39
|
class ReadingLog {
|
|
11
40
|
list = [];
|
|
12
41
|
changes = new Listeners();
|
|
13
|
-
|
|
42
|
+
stopOutbox = null;
|
|
43
|
+
constructor(sink, logger, now, outbox = noOutboxWatch, kept = 100) {
|
|
14
44
|
this.sink = sink;
|
|
15
45
|
this.logger = logger;
|
|
16
46
|
this.now = now;
|
|
47
|
+
this.outbox = outbox;
|
|
17
48
|
this.kept = kept;
|
|
18
49
|
}
|
|
19
50
|
entries = () => this.list;
|
|
@@ -42,13 +73,23 @@ class ReadingLog {
|
|
|
42
73
|
};
|
|
43
74
|
this.update([...this.list, entry].slice(-this.kept));
|
|
44
75
|
try {
|
|
45
|
-
const
|
|
46
|
-
|
|
76
|
+
const {
|
|
77
|
+
status,
|
|
78
|
+
queueIds
|
|
79
|
+
} = receiptOf(await this.sink.save(reading, device.snapshot()));
|
|
80
|
+
this.patch(id, status === "queued" && queueIds !== undefined ? {
|
|
81
|
+
save: status,
|
|
82
|
+
queueIds
|
|
83
|
+
} : {
|
|
84
|
+
save: status
|
|
85
|
+
});
|
|
47
86
|
if (recordId !== null) {
|
|
48
87
|
await device.acknowledge(recordId);
|
|
49
88
|
}
|
|
50
89
|
} catch {
|
|
51
|
-
this.
|
|
90
|
+
this.patch(id, {
|
|
91
|
+
save: "failed"
|
|
92
|
+
});
|
|
52
93
|
this.logger.error("bluetooth.reading.save-failed", {
|
|
53
94
|
protocol: reading.source.protocolId,
|
|
54
95
|
type: reading.type
|
|
@@ -57,11 +98,52 @@ class ReadingLog {
|
|
|
57
98
|
device.release(recordId);
|
|
58
99
|
}
|
|
59
100
|
}
|
|
101
|
+
this.followOutbox();
|
|
102
|
+
}
|
|
103
|
+
followOutbox() {
|
|
104
|
+
if (this.stopOutbox === null && this.list.some(followsOutbox)) {
|
|
105
|
+
this.stopOutbox = this.outbox.subscribe(view => this.settle(view));
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
settle(view) {
|
|
109
|
+
const before = this.list;
|
|
110
|
+
const after = before.map(entry => {
|
|
111
|
+
const save = followsOutbox(entry) ? stateIn(view, entry) : entry.save;
|
|
112
|
+
return save === entry.save ? entry : {
|
|
113
|
+
...entry,
|
|
114
|
+
save
|
|
115
|
+
};
|
|
116
|
+
});
|
|
117
|
+
const changed = after.filter((entry, index) => entry !== before[index]);
|
|
118
|
+
if (changed.length > 0) {
|
|
119
|
+
this.update(after);
|
|
120
|
+
changed.filter(({
|
|
121
|
+
save
|
|
122
|
+
}) => save === "rejected").forEach(({
|
|
123
|
+
reading
|
|
124
|
+
}) => this.logRejected(reading));
|
|
125
|
+
}
|
|
126
|
+
this.releaseWhenIdle();
|
|
127
|
+
}
|
|
128
|
+
releaseWhenIdle() {
|
|
129
|
+
if (this.stopOutbox !== null && !this.list.some(followsOutbox)) {
|
|
130
|
+
this.stopOutbox();
|
|
131
|
+
this.stopOutbox = null;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
logRejected({
|
|
135
|
+
source,
|
|
136
|
+
type
|
|
137
|
+
}) {
|
|
138
|
+
this.logger.warn("bluetooth.reading.rejected", {
|
|
139
|
+
protocol: source.protocolId,
|
|
140
|
+
type
|
|
141
|
+
});
|
|
60
142
|
}
|
|
61
|
-
|
|
143
|
+
patch(id, change) {
|
|
62
144
|
this.update(this.list.map(entry => entry.id === id ? {
|
|
63
145
|
...entry,
|
|
64
|
-
|
|
146
|
+
...change
|
|
65
147
|
} : entry));
|
|
66
148
|
}
|
|
67
149
|
update(list) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Listeners","ReadingLog","list","changes","constructor","sink","logger","now","kept","entries","subscribe","listener","add","track","device","event","kind","receive","reading","receivedAt","address","recordId","source","
|
|
1
|
+
{"version":3,"names":["Listeners","noOutboxWatch","receiptOf","outcome","status","followsOutbox","save","queueIds","undefined","length","stateIn","view","some","id","rejected","has","waiting","every","sent","ReadingLog","list","changes","stopOutbox","constructor","sink","logger","now","outbox","kept","entries","subscribe","listener","add","track","device","event","kind","receive","reading","receivedAt","address","recordId","source","getTime","entry","update","slice","snapshot","patch","acknowledge","error","protocol","protocolId","type","release","followOutbox","settle","before","after","map","changed","filter","index","forEach","logRejected","releaseWhenIdle","warn","change","emit"],"sourceRoot":"../../../../../../src","sources":["modules/next/bluetooth/core/reading-log.ts"],"mappings":";;AAEA,SAASA,SAAS,QAAQ,gBAAa;AACvC,SAASC,aAAa,QAA8C,mBAAgB;;AAIpF;AACA;AACA;AACA;AACA;;AAGA;;AAmBA;;AAOA,MAAMC,SAAS,GAAIC,OAAkC,IACnD,OAAOA,OAAO,KAAK,QAAQ,GAAG;EAAEC,MAAM,EAAED;AAAQ,CAAC,GAAGA,OAAO;AAE7D,MAAME,aAAa,GAAGA,CAAC;EAAEC,IAAI;EAAEC;AAA0B,CAAC,KACxDA,QAAQ,KAAKC,SAAS,IAAID,QAAQ,CAACE,MAAM,GAAG,CAAC,KAAKH,IAAI,KAAK,QAAQ,IAAIA,IAAI,KAAK,UAAU,CAAC;;AAE7F;AACA,MAAMI,OAAO,GAAGA,CAACC,IAAgB,EAAE;EAAEJ,QAAQ,GAAG,EAAE;EAAED;AAAsB,CAAC,KAAgB;EACzF,IAAIC,QAAQ,CAACK,IAAI,CAAEC,EAAE,IAAKF,IAAI,CAACG,QAAQ,CAACC,GAAG,CAACF,EAAE,CAAC,CAAC,EAAE;IAChD,OAAO,UAAU;EACnB;EAEA,IAAIN,QAAQ,CAACK,IAAI,CAAEC,EAAE,IAAKF,IAAI,CAACK,OAAO,CAACD,GAAG,CAACF,EAAE,CAAC,CAAC,EAAE;IAC/C,OAAO,QAAQ;EACjB;EAEA,OAAON,QAAQ,CAACU,KAAK,CAAEJ,EAAE,IAAKF,IAAI,CAACO,IAAI,CAACH,GAAG,CAACF,EAAE,CAAC,CAAC,GAAG,OAAO,GAAGP,IAAI;AACnE,CAAC;;AAED;AACA,MAAMa,UAAU,C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,QAAQ,EAAET,MAAM,CAACU,UAAU;MAAEC;IAAK,CAAC,CAAC;EACvF;EAEQL,KAAKA,CAACnC,EAAU,EAAEsD,MAAgC,EAAQ;IAChE,IAAI,CAACtB,MAAM,CAAC,IAAI,CAACzB,IAAI,CAACuC,GAAG,CAAEf,KAAK,IAAMA,KAAK,CAAC/B,EAAE,KAAKA,EAAE,GAAG;MAAE,GAAG+B,KAAK;MAAE,GAAGuB;IAAO,CAAC,GAAGvB,KAAM,CAAC,CAAC;EAC5F;EAEQC,MAAMA,CAACzB,IAAgC,EAAQ;IACrD,IAAI,CAACA,IAAI,GAAGA,IAAI;IAChB,IAAI,CAACC,OAAO,CAAC+C,IAAI,CAAChD,IAAI,CAAC;EACzB;AACF;AAEA,SAASD,UAAU","ignoreList":[]}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
const SLOT_MS = 1_000;
|
|
4
|
+
const SLOTS_PER_SERIES = 3_600;
|
|
5
|
+
const IDLE_CLOSE_MS = 15 * 60_000;
|
|
6
|
+
|
|
7
|
+
/** The streamed numbers worth recording as a series, each with the measurement it belongs to. */
|
|
8
|
+
const RECORDED_METRICS = {
|
|
9
|
+
heart_rate: "heart_rate",
|
|
10
|
+
pulse_rate: "oxygen_saturation",
|
|
11
|
+
spo2: "oxygen_saturation",
|
|
12
|
+
perfusion_index: "oxygen_saturation",
|
|
13
|
+
respiration_rate: "respiration_rate",
|
|
14
|
+
body_temperature: "temperature"
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
/** What a series measures. */
|
|
18
|
+
|
|
19
|
+
/** One metric's streamed numbers, one value per second from the second the first one arrived. */
|
|
20
|
+
class SlotSeries {
|
|
21
|
+
values = [];
|
|
22
|
+
changed = true;
|
|
23
|
+
constructor(kind, firstAt) {
|
|
24
|
+
this.kind = kind;
|
|
25
|
+
this.start = Math.floor(firstAt / SLOT_MS) * SLOT_MS;
|
|
26
|
+
this.lastAt = firstAt;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/** Whether a value of `unit` taken at `at` still belongs to this series. */
|
|
30
|
+
takes(unit, at) {
|
|
31
|
+
return unit === this.kind.unit && at >= this.start && at - this.lastAt < IDLE_CLOSE_MS && this.slotOf(at) < SLOTS_PER_SERIES;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/** Puts a value in the second it was taken; of two values in one second the later stays. */
|
|
35
|
+
put(value, at) {
|
|
36
|
+
const slot = this.slotOf(at);
|
|
37
|
+
while (this.values.length <= slot) {
|
|
38
|
+
this.values.push(null);
|
|
39
|
+
}
|
|
40
|
+
this.values[slot] = value;
|
|
41
|
+
this.lastAt = at;
|
|
42
|
+
this.changed = true;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/** Whether no value arrived for as long as a series waits before it closes. */
|
|
46
|
+
isQuiet(now) {
|
|
47
|
+
return now - this.lastAt >= IDLE_CLOSE_MS;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/** Whether values arrived since the last `markSaved`. */
|
|
51
|
+
get unsaved() {
|
|
52
|
+
return this.changed;
|
|
53
|
+
}
|
|
54
|
+
markSaved() {
|
|
55
|
+
this.changed = false;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/** The series as it is now, as a reading to save. */
|
|
59
|
+
reading(origin) {
|
|
60
|
+
const span = this.span();
|
|
61
|
+
return {
|
|
62
|
+
type: this.kind.type,
|
|
63
|
+
takenAt: span.from,
|
|
64
|
+
values: {},
|
|
65
|
+
deviceFlags: [],
|
|
66
|
+
series: {
|
|
67
|
+
metric: this.kind.metric,
|
|
68
|
+
unit: this.kind.unit,
|
|
69
|
+
start: span.from,
|
|
70
|
+
intervalMs: SLOT_MS,
|
|
71
|
+
values: [...this.values]
|
|
72
|
+
},
|
|
73
|
+
live: span,
|
|
74
|
+
source: origin
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
span() {
|
|
78
|
+
return {
|
|
79
|
+
metric: this.kind.metric,
|
|
80
|
+
channel: null,
|
|
81
|
+
from: new Date(this.start),
|
|
82
|
+
to: new Date(this.start + this.values.length * SLOT_MS)
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
slotOf(at) {
|
|
86
|
+
return Math.floor((at - this.start) / SLOT_MS);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
export { RECORDED_METRICS, SlotSeries };
|
|
90
|
+
//# sourceMappingURL=series-slots.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["SLOT_MS","SLOTS_PER_SERIES","IDLE_CLOSE_MS","RECORDED_METRICS","heart_rate","pulse_rate","spo2","perfusion_index","respiration_rate","body_temperature","SlotSeries","values","changed","constructor","kind","firstAt","start","Math","floor","lastAt","takes","unit","at","slotOf","put","value","slot","length","push","isQuiet","now","unsaved","markSaved","reading","origin","span","type","takenAt","from","deviceFlags","series","metric","intervalMs","live","source","channel","Date","to"],"sourceRoot":"../../../../../../src","sources":["modules/next/bluetooth/core/series-slots.ts"],"mappings":";;AAGA,MAAMA,OAAO,GAAG,KAAK;AACrB,MAAMC,gBAAgB,GAAG,KAAK;AAC9B,MAAMC,aAAa,GAAG,EAAE,GAAG,MAAM;;AAEjC;AACA,MAAMC,gBAA8D,GAAG;EACrEC,UAAU,EAAE,YAAY;EACxBC,UAAU,EAAE,mBAAmB;EAC/BC,IAAI,EAAE,mBAAmB;EACzBC,eAAe,EAAE,mBAAmB;EACpCC,gBAAgB,EAAE,kBAAkB;EACpCC,gBAAgB,EAAE;AACpB,CAAC;;AAED;;AAGA;AACA,MAAMC,UAAU,CAAC;EAEEC,MAAM,GAAsB,EAAE;EAEvCC,OAAO,GAAG,IAAI;EAEfC,WAAWA,CAAkBC,IAAgB,EAAEC,OAAe,EAAE;IAAA,KAAnCD,IAAgB,GAAhBA,IAAgB;IAClD,IAAI,CAACE,KAAK,GAAGC,IAAI,CAACC,KAAK,CAACH,OAAO,GAAGf,OAAO,CAAC,GAAGA,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,EAAE,IAAI,CAAC3B,IAAI,CAAC2B,MAAM;QAAEpB,IAAI,EAAE,IAAI,CAACP,IAAI,CAACO,IAAI;QAAEL,KAAK,EAAEmB,IAAI,CAACG,IAAI;QAAEI,UAAU,EAAE1C,OAAO;QAAEW,MAAM,EAAE,CAAC,GAAG,IAAI,CAACA,MAAM;MAAE,CAAC;MAC3HgC,IAAI,EAAER,IAAI;MACVS,MAAM,EAAEV;IACV,CAAC;EACH;EAEQC,IAAIA,CAAA,EAAa;IACvB,OAAO;MACLM,MAAM,EAAE,IAAI,CAAC3B,IAAI,CAAC2B,MAAM;MACxBI,OAAO,EAAE,IAAI;MACbP,IAAI,EAAE,IAAIQ,IAAI,CAAC,IAAI,CAAC9B,KAAK,CAAC;MAC1B+B,EAAE,EAAE,IAAID,IAAI,CAAC,IAAI,CAAC9B,KAAK,GAAG,IAAI,CAACL,MAAM,CAACgB,MAAM,GAAG3B,OAAO;IACxD,CAAC;EACH;EAEQuB,MAAMA,CAACD,EAAU,EAAU;IACjC,OAAOL,IAAI,CAACC,KAAK,CAAC,CAACI,EAAE,GAAG,IAAI,CAACN,KAAK,IAAIhB,OAAO,CAAC;EAChD;AACF;AAEA,SAASG,gBAAgB,EAAEO,UAAU","ignoreList":[]}
|
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { DeviceError } from "./errors.js";
|
|
4
|
+
import { LiveLedger } from "./live-ledger.js";
|
|
5
|
+
import { RECORDED_METRICS, SlotSeries } from "./series-slots.js";
|
|
6
|
+
import { ChannelSegment } from "./waveform-segments.js";
|
|
7
|
+
const MS_PER_SECOND = 1_000;
|
|
8
|
+
const SAVE_OPEN_EVERY_MS = 60_000;
|
|
9
|
+
|
|
10
|
+
/** The device being recorded. */
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Records what one device streams live and saves it through the sink: numbers as series of one-second slots, waveforms
|
|
14
|
+
* as segments of five minutes at the waveform's own sample rate. It does the same for every device.
|
|
15
|
+
*/
|
|
16
|
+
class StreamRecorder {
|
|
17
|
+
open = new Map();
|
|
18
|
+
segments = new Map();
|
|
19
|
+
ledger = new LiveLedger();
|
|
20
|
+
replacing = new Map();
|
|
21
|
+
unsupported = new Set();
|
|
22
|
+
saving = Promise.resolve();
|
|
23
|
+
streaming = false;
|
|
24
|
+
constructor(device, sink, deps) {
|
|
25
|
+
this.device = device;
|
|
26
|
+
this.sink = sink;
|
|
27
|
+
this.deps = deps;
|
|
28
|
+
this.origin = {
|
|
29
|
+
modelId: deps.model.id,
|
|
30
|
+
protocolId: deps.protocol.id,
|
|
31
|
+
address: device.address,
|
|
32
|
+
recordId: null
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/** Records from the device's events: live numbers and samples, and the end of the stream. */
|
|
37
|
+
follow(events) {
|
|
38
|
+
events.add(event => this.observe(event));
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/** Takes one device event: numbers and samples while recording is on, and the end of the stream. */
|
|
42
|
+
observe(event) {
|
|
43
|
+
if (event.kind === "state") {
|
|
44
|
+
this.followStream(event.snapshot.live);
|
|
45
|
+
} else if (event.kind === "live" && this.device.snapshot().record) {
|
|
46
|
+
this.recordNumbers(event.values);
|
|
47
|
+
} else if (event.kind === "waveform" && this.device.snapshot().record) {
|
|
48
|
+
this.recordWaveform(event.waveform);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/** Marks the live recordings a stored record replaces, which the sink removes once it has saved the record. */
|
|
53
|
+
supersede(recordId, record) {
|
|
54
|
+
const spans = this.ledger.inside(record);
|
|
55
|
+
if (spans.length === 0) {
|
|
56
|
+
return record;
|
|
57
|
+
}
|
|
58
|
+
this.replacing.set(recordId, spans);
|
|
59
|
+
return {
|
|
60
|
+
...record,
|
|
61
|
+
supersedes: spans
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/** The record was saved, so the recordings it replaced are gone for good. */
|
|
66
|
+
acknowledged(recordId) {
|
|
67
|
+
this.ledger.remove(this.replacing.get(recordId) ?? []);
|
|
68
|
+
this.replacing.delete(recordId);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/** Saves everything still open, and resolves once every save has finished. */
|
|
72
|
+
close() {
|
|
73
|
+
this.stopTimer();
|
|
74
|
+
[...this.open.keys()].forEach(metric => this.finish(metric));
|
|
75
|
+
this.segments.forEach(segment => segment.flush().forEach(reading => this.saveSettled(reading)));
|
|
76
|
+
this.segments.clear();
|
|
77
|
+
return this.saving;
|
|
78
|
+
}
|
|
79
|
+
followStream(streaming) {
|
|
80
|
+
if (this.streaming && !streaming) {
|
|
81
|
+
void this.close();
|
|
82
|
+
}
|
|
83
|
+
this.streaming = streaming;
|
|
84
|
+
}
|
|
85
|
+
recordNumbers({
|
|
86
|
+
values,
|
|
87
|
+
at
|
|
88
|
+
}) {
|
|
89
|
+
Object.entries(values).forEach(([metric, quantity]) => {
|
|
90
|
+
const type = RECORDED_METRICS[metric];
|
|
91
|
+
if (quantity && type && Number.isFinite(quantity.value) && !this.unsupported.has(metric)) {
|
|
92
|
+
const takenAt = at.getTime();
|
|
93
|
+
this.seriesFor({
|
|
94
|
+
metric,
|
|
95
|
+
type,
|
|
96
|
+
unit: quantity.unit
|
|
97
|
+
}, takenAt).put(quantity.value, takenAt);
|
|
98
|
+
}
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
seriesFor(kind, at) {
|
|
102
|
+
const current = this.open.get(kind.metric);
|
|
103
|
+
if (current?.takes(kind.unit, at)) {
|
|
104
|
+
return current;
|
|
105
|
+
}
|
|
106
|
+
if (current) {
|
|
107
|
+
this.finish(kind.metric);
|
|
108
|
+
}
|
|
109
|
+
const series = new SlotSeries(kind, at);
|
|
110
|
+
this.open.set(kind.metric, series);
|
|
111
|
+
this.timer ??= setInterval(() => this.saveOpenSeries(), SAVE_OPEN_EVERY_MS);
|
|
112
|
+
return series;
|
|
113
|
+
}
|
|
114
|
+
recordWaveform(waveform) {
|
|
115
|
+
if (this.unsupported.has(waveform.metric) || !(waveform.sampleRateHz > 0)) {
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
118
|
+
const arrivedAt = this.deps.now().getTime();
|
|
119
|
+
waveform.channels.forEach((channel, index) => {
|
|
120
|
+
const samples = waveform.samples[index];
|
|
121
|
+
const firstAt = waveform.firstSampleAt?.getTime() ?? arrivedAt - (samples?.length ?? 0) / waveform.sampleRateHz * MS_PER_SECOND;
|
|
122
|
+
if (samples?.length) {
|
|
123
|
+
this.segmentFor(waveform, channel).add(samples, firstAt).forEach(reading => this.saveSettled(reading));
|
|
124
|
+
}
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
segmentFor(waveform, channel) {
|
|
128
|
+
const {
|
|
129
|
+
metric,
|
|
130
|
+
sampleRateHz,
|
|
131
|
+
unit,
|
|
132
|
+
scale
|
|
133
|
+
} = waveform;
|
|
134
|
+
const key = [metric, channel, sampleRateHz, unit, scale].join("|");
|
|
135
|
+
const segment = this.segments.get(key) ?? new ChannelSegment({
|
|
136
|
+
metric,
|
|
137
|
+
channel,
|
|
138
|
+
sampleRateHz,
|
|
139
|
+
unit,
|
|
140
|
+
scale
|
|
141
|
+
}, this.origin);
|
|
142
|
+
this.segments.set(key, segment);
|
|
143
|
+
return segment;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
/** The 60-second save: an open series that grew goes out again under its own name, so the outbox keeps one copy. */
|
|
147
|
+
saveOpenSeries() {
|
|
148
|
+
const now = this.deps.now().getTime();
|
|
149
|
+
[...this.open.entries()].forEach(([metric, series]) => {
|
|
150
|
+
if (series.isQuiet(now)) {
|
|
151
|
+
this.finish(metric);
|
|
152
|
+
} else if (series.unsaved) {
|
|
153
|
+
this.enqueue(series.reading(this.origin), () => undefined);
|
|
154
|
+
series.markSaved();
|
|
155
|
+
}
|
|
156
|
+
});
|
|
157
|
+
if (this.open.size === 0) {
|
|
158
|
+
this.stopTimer();
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
finish(metric) {
|
|
162
|
+
const series = this.open.get(metric);
|
|
163
|
+
this.open.delete(metric);
|
|
164
|
+
if (series) {
|
|
165
|
+
this.saveSettled(series.reading(this.origin));
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
saveSettled(reading) {
|
|
169
|
+
this.enqueue(reading, ({
|
|
170
|
+
live
|
|
171
|
+
}) => {
|
|
172
|
+
if (live) {
|
|
173
|
+
this.ledger.add(live);
|
|
174
|
+
}
|
|
175
|
+
});
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
/** Saves one at a time, in the order they were made. */
|
|
179
|
+
enqueue(reading, onSaved) {
|
|
180
|
+
this.saving = this.saving.then(async () => {
|
|
181
|
+
if (reading.live && this.unsupported.has(reading.live.metric)) {
|
|
182
|
+
return;
|
|
183
|
+
}
|
|
184
|
+
try {
|
|
185
|
+
await this.sink.save(reading, this.device.snapshot());
|
|
186
|
+
onSaved(reading);
|
|
187
|
+
} catch (error) {
|
|
188
|
+
this.failed(reading, error);
|
|
189
|
+
}
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
failed(reading, error) {
|
|
193
|
+
const metric = reading.live?.metric ?? null;
|
|
194
|
+
const protocol = this.origin.protocolId;
|
|
195
|
+
if (error instanceof DeviceError && error.code === "unsupported" && reading.live) {
|
|
196
|
+
this.unsupported.add(reading.live.metric);
|
|
197
|
+
this.deps.logger.warn("bluetooth.stream.unsupported", {
|
|
198
|
+
protocol,
|
|
199
|
+
metric
|
|
200
|
+
});
|
|
201
|
+
} else {
|
|
202
|
+
this.deps.logger.error("bluetooth.stream.save-failed", {
|
|
203
|
+
protocol,
|
|
204
|
+
metric,
|
|
205
|
+
code: error instanceof DeviceError ? error.code : null
|
|
206
|
+
});
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
stopTimer() {
|
|
210
|
+
clearInterval(this.timer);
|
|
211
|
+
this.timer = undefined;
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
export { StreamRecorder };
|
|
215
|
+
//# sourceMappingURL=stream-recorder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["DeviceError","LiveLedger","RECORDED_METRICS","SlotSeries","ChannelSegment","MS_PER_SECOND","SAVE_OPEN_EVERY_MS","StreamRecorder","open","Map","segments","ledger","replacing","unsupported","Set","saving","Promise","resolve","streaming","constructor","device","sink","deps","origin","modelId","model","id","protocolId","protocol","address","recordId","follow","events","add","event","observe","kind","followStream","snapshot","live","record","recordNumbers","values","recordWaveform","waveform","supersede","spans","inside","length","set","supersedes","acknowledged","remove","get","delete","close","stopTimer","keys","forEach","metric","finish","segment","flush","reading","saveSettled","clear","at","Object","entries","quantity","type","Number","isFinite","value","has","takenAt","getTime","seriesFor","unit","put","current","takes","series","timer","setInterval","saveOpenSeries","sampleRateHz","arrivedAt","now","channels","channel","index","samples","firstAt","firstSampleAt","segmentFor","scale","key","join","isQuiet","unsaved","enqueue","undefined","markSaved","size","onSaved","then","save","error","failed","code","logger","warn","clearInterval"],"sourceRoot":"../../../../../../src","sources":["modules/next/bluetooth/core/stream-recorder.ts"],"mappings":";;AAEA,SAASA,WAAW,QAAQ,aAAU;AAEtC,SAASC,UAAU,QAAQ,kBAAe;AAI1C,SAASC,gBAAgB,EAAcC,UAAU,QAAQ,mBAAgB;AACzE,SAASC,cAAc,QAAQ,wBAAqB;AAEpD,MAAMC,aAAa,GAAG,KAAK;AAC3B,MAAMC,kBAAkB,GAAG,MAAM;;AAEjC;;AAYA;AACA;AACA;AACA;AACA,MAAMC,cAAc,CAAC;EACFC,IAAI,GAAG,IAAIC,GAAG,CAAyB,CAAC;EACxCC,QAAQ,GAAG,IAAID,GAAG,CAAyB,CAAC;EAC5CE,MAAM,GAAG,IAAIV,UAAU,CAAC,CAAC;EACzBW,SAAS,GAAG,IAAIH,GAAG,CAA8B,CAAC;EAClDI,WAAW,GAAG,IAAIC,GAAG,CAAqB,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C,CAAC;IAC7E,CAAC,MAAM;MACL,IAAI,CAACrC,IAAI,CAACyF,MAAM,CAACH,KAAK,CAAC,8BAA8B,EAAE;QAAEhF,QAAQ;QAAE+B,MAAM;QAAEmD,IAAI,EAAEF,KAAK,YAAY5G,WAAW,GAAG4G,KAAK,CAACE,IAAI,GAAG;MAAK,CAAC,CAAC;IACtI;EACF;EAEQtD,SAASA,CAAA,EAAS;IACxByD,aAAa,CAAC,IAAI,CAAC9B,KAAK,CAAC;IACzB,IAAI,CAACA,KAAK,GAAGmB,SAAS;EACxB;AACF;AAEA,SAAS/F,cAAc","ignoreList":[]}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
const MS_PER_SECOND = 1_000;
|
|
4
|
+
const SEGMENT_MS = 5 * 60_000;
|
|
5
|
+
|
|
6
|
+
/** Samples that arrive this much later than the ones before them leave a hole, so they start a new segment. */
|
|
7
|
+
const MAX_GAP_MS = 5_000;
|
|
8
|
+
const MEASUREMENT_OF_WAVEFORM = {
|
|
9
|
+
ecg_waveform: "ecg",
|
|
10
|
+
pleth_waveform: "oxygen_saturation"
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
/** What stays the same while one channel of a waveform streams. */
|
|
14
|
+
|
|
15
|
+
/** One channel's samples, collected until they fill five minutes, a gap opens, or the stream ends. */
|
|
16
|
+
class ChannelSegment {
|
|
17
|
+
chunks = [];
|
|
18
|
+
count = 0;
|
|
19
|
+
from = 0;
|
|
20
|
+
constructor(shape, origin) {
|
|
21
|
+
this.shape = shape;
|
|
22
|
+
this.origin = origin;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/** Adds samples whose first was taken at `at`; returns the segments they completed. */
|
|
26
|
+
add(samples, at) {
|
|
27
|
+
const completed = this.count > 0 && at - this.endsAt() > MAX_GAP_MS ? this.flush() : [];
|
|
28
|
+
let rest = samples;
|
|
29
|
+
let restAt = at;
|
|
30
|
+
while (rest.length > 0) {
|
|
31
|
+
const part = rest.subarray(0, this.capacity() - this.count);
|
|
32
|
+
this.append(part, restAt);
|
|
33
|
+
rest = rest.subarray(part.length);
|
|
34
|
+
restAt += this.durationOf(part.length);
|
|
35
|
+
completed.push(...(this.count >= this.capacity() ? this.flush() : []));
|
|
36
|
+
}
|
|
37
|
+
return completed;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/** Hands over what is collected as one reading, none when it is empty. */
|
|
41
|
+
flush() {
|
|
42
|
+
if (this.count === 0) {
|
|
43
|
+
return [];
|
|
44
|
+
}
|
|
45
|
+
const samples = new Int16Array(this.count);
|
|
46
|
+
let filled = 0;
|
|
47
|
+
this.chunks.forEach(chunk => {
|
|
48
|
+
samples.set(chunk, filled);
|
|
49
|
+
filled += chunk.length;
|
|
50
|
+
});
|
|
51
|
+
const reading = this.readingOf(samples);
|
|
52
|
+
this.chunks = [];
|
|
53
|
+
this.count = 0;
|
|
54
|
+
return [reading];
|
|
55
|
+
}
|
|
56
|
+
append(part, at) {
|
|
57
|
+
if (this.count === 0) {
|
|
58
|
+
this.from = at;
|
|
59
|
+
}
|
|
60
|
+
this.chunks.push(part.slice());
|
|
61
|
+
this.count += part.length;
|
|
62
|
+
}
|
|
63
|
+
readingOf(samples) {
|
|
64
|
+
const from = new Date(this.from);
|
|
65
|
+
const {
|
|
66
|
+
metric,
|
|
67
|
+
channel,
|
|
68
|
+
sampleRateHz,
|
|
69
|
+
unit,
|
|
70
|
+
scale
|
|
71
|
+
} = this.shape;
|
|
72
|
+
return {
|
|
73
|
+
type: MEASUREMENT_OF_WAVEFORM[metric],
|
|
74
|
+
takenAt: from,
|
|
75
|
+
values: {},
|
|
76
|
+
deviceFlags: [],
|
|
77
|
+
waveform: {
|
|
78
|
+
metric,
|
|
79
|
+
sampleRateHz,
|
|
80
|
+
unit,
|
|
81
|
+
scale,
|
|
82
|
+
channels: [channel],
|
|
83
|
+
samples: [samples],
|
|
84
|
+
firstSampleAt: from
|
|
85
|
+
},
|
|
86
|
+
live: {
|
|
87
|
+
metric,
|
|
88
|
+
channel,
|
|
89
|
+
from,
|
|
90
|
+
to: new Date(this.endsAt())
|
|
91
|
+
},
|
|
92
|
+
source: this.origin
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
capacity() {
|
|
96
|
+
return Math.round(this.shape.sampleRateHz * SEGMENT_MS / MS_PER_SECOND);
|
|
97
|
+
}
|
|
98
|
+
endsAt() {
|
|
99
|
+
return this.from + this.durationOf(this.count);
|
|
100
|
+
}
|
|
101
|
+
durationOf(samples) {
|
|
102
|
+
return samples / this.shape.sampleRateHz * MS_PER_SECOND;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
export { ChannelSegment };
|
|
106
|
+
//# sourceMappingURL=waveform-segments.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["MS_PER_SECOND","SEGMENT_MS","MAX_GAP_MS","MEASUREMENT_OF_WAVEFORM","ecg_waveform","pleth_waveform","ChannelSegment","chunks","count","from","constructor","shape","origin","add","samples","at","completed","endsAt","flush","rest","restAt","length","part","subarray","capacity","append","durationOf","push","Int16Array","filled","forEach","chunk","set","reading","readingOf","slice","Date","metric","channel","sampleRateHz","unit","scale","type","takenAt","values","deviceFlags","waveform","channels","firstSampleAt","live","to","source","Math","round"],"sourceRoot":"../../../../../../src","sources":["modules/next/bluetooth/core/waveform-segments.ts"],"mappings":";;AAGA,MAAMA,aAAa,GAAG,KAAK;AAC3B,MAAMC,UAAU,GAAG,CAAC,GAAG,MAAM;;AAE7B;AACA,MAAMC,UAAU,GAAG,KAAK;AAExB,MAAMC,uBAAoE,GAAG;EAC3EC,YAAY,EAAE,KAAK;EACnBC,cAAc,EAAE;AAClB,CAAC;;AAED;;AAGA;AACA,MAAMC,cAAc,CAAC;EACXC,MAAM,GAAiB,EAAE;EACzBC,KAAK,GAAG,CAAC;EACTC,IAAI,GAAG,CAAC;EAETC,WAAWA,CAAkBC,KAAmB,EAAmBC,MAAqB,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AAM,EAAE,IAAI,CAACvC;IACf,CAAC;EACH;EAEQY,QAAQA,CAAA,EAAW;IACzB,OAAO4B,IAAI,CAACC,KAAK,CAAE,IAAI,CAAC1C,KAAK,CAAC4B,YAAY,GAAGtC,UAAU,GAAID,aAAa,CAAC;EAC3E;EAEQiB,MAAMA,CAAA,EAAW;IACvB,OAAO,IAAI,CAACR,IAAI,GAAG,IAAI,CAACiB,UAAU,CAAC,IAAI,CAAClB,KAAK,CAAC;EAChD;EAEQkB,UAAUA,CAACZ,OAAe,EAAU;IAC1C,OAAQA,OAAO,GAAG,IAAI,CAACH,KAAK,CAAC4B,YAAY,GAAIvC,aAAa;EAC5D;AACF;AAEA,SAASM,cAAc","ignoreList":[]}
|
|
@@ -4,6 +4,7 @@ import { BleManager } from "react-native-ble-plx";
|
|
|
4
4
|
import { androidForegroundService } from "./adapters/android-foreground-service.js";
|
|
5
5
|
import { blePlxCentral } from "./adapters/ble-plx-central.js";
|
|
6
6
|
import { osBluetoothPermissions } from "./adapters/os-permissions.js";
|
|
7
|
+
import { ovokOutboxWatch } from "./adapters/ovok-outbox-watch.js";
|
|
7
8
|
import { ovokReadingSink } from "./adapters/ovok-reading-sink.js";
|
|
8
9
|
import { reactNativeLifecycle } from "./adapters/react-native-lifecycle.js";
|
|
9
10
|
import { storagePairedDevices } from "./adapters/storage-paired-devices.js";
|
|
@@ -17,16 +18,23 @@ const createBluetooth = ({
|
|
|
17
18
|
ovok,
|
|
18
19
|
storage,
|
|
19
20
|
...overrides
|
|
20
|
-
}) =>
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
}
|
|
21
|
+
}) => {
|
|
22
|
+
const outbox = ovokOutboxWatch(ovok.outbox, overrides.logger);
|
|
23
|
+
return new Bluetooth({
|
|
24
|
+
central: blePlxCentral(new BleManager()),
|
|
25
|
+
store: storagePairedDevices(storage),
|
|
26
|
+
sink: ovokReadingSink(ovok),
|
|
27
|
+
permissions: osBluetoothPermissions(),
|
|
28
|
+
models: BUILT_IN_MODELS,
|
|
29
|
+
protocols: BUILT_IN_PROTOCOLS,
|
|
30
|
+
lifecycle: reactNativeLifecycle(),
|
|
31
|
+
keepAlive: androidForegroundService({}, {
|
|
32
|
+
outbox,
|
|
33
|
+
logger: overrides.logger
|
|
34
|
+
}),
|
|
35
|
+
outbox,
|
|
36
|
+
...overrides
|
|
37
|
+
});
|
|
38
|
+
};
|
|
31
39
|
export { createBluetooth };
|
|
32
40
|
//# sourceMappingURL=create-bluetooth.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["BleManager","androidForegroundService","blePlxCentral","osBluetoothPermissions","ovokReadingSink","reactNativeLifecycle","storagePairedDevices","Bluetooth","BUILT_IN_MODELS","BUILT_IN_PROTOCOLS","createBluetooth","ovok","storage","overrides","central","store","sink","permissions","models","protocols","lifecycle","keepAlive"],"sourceRoot":"../../../../../src","sources":["modules/next/bluetooth/create-bluetooth.ts"],"mappings":";;AACA,SAASA,UAAU,QAAQ,sBAAsB;AAEjD,SAASC,wBAAwB,QAAQ,0CAAuC;AAChF,SAASC,aAAa,QAAQ,+BAA4B;AAC1D,SAASC,sBAAsB,QAAQ,8BAA2B;AAClE,SAASC,eAAe,QAAQ,iCAA8B;AAC9D,SAASC,oBAAoB,QAAQ,sCAAmC;AACxE,SAASC,oBAAoB,QAAQ,sCAAmC;AACxE,SAASC,SAAS,QAA0B,qBAAkB;AAC9D,SAASC,eAAe,EAAEC,kBAAkB,QAAQ,wBAAqB;;AAEzE;;AAUA;AACA,MAAMC,eAAe,GAAGA,CAAC;EAAEC,IAAI;EAAEC,OAAO;EAAE,GAAGC;AAAkC,CAAC,
|
|
1
|
+
{"version":3,"names":["BleManager","androidForegroundService","blePlxCentral","osBluetoothPermissions","ovokOutboxWatch","ovokReadingSink","reactNativeLifecycle","storagePairedDevices","Bluetooth","BUILT_IN_MODELS","BUILT_IN_PROTOCOLS","createBluetooth","ovok","storage","overrides","outbox","logger","central","store","sink","permissions","models","protocols","lifecycle","keepAlive"],"sourceRoot":"../../../../../src","sources":["modules/next/bluetooth/create-bluetooth.ts"],"mappings":";;AACA,SAASA,UAAU,QAAQ,sBAAsB;AAEjD,SAASC,wBAAwB,QAAQ,0CAAuC;AAChF,SAASC,aAAa,QAAQ,+BAA4B;AAC1D,SAASC,sBAAsB,QAAQ,8BAA2B;AAClE,SAASC,eAAe,QAAQ,iCAA8B;AAC9D,SAAyBC,eAAe,QAAQ,iCAA8B;AAC9E,SAASC,oBAAoB,QAAQ,sCAAmC;AACxE,SAASC,oBAAoB,QAAQ,sCAAmC;AACxE,SAASC,SAAS,QAA0B,qBAAkB;AAC9D,SAASC,eAAe,EAAEC,kBAAkB,QAAQ,wBAAqB;;AAEzE;;AAUA;AACA,MAAMC,eAAe,GAAGA,CAAC;EAAEC,IAAI;EAAEC,OAAO;EAAE,GAAGC;AAAkC,CAAC,KAAgB;EAC9F,MAAMC,MAAM,GAAGX,eAAe,CAACQ,IAAI,CAACG,MAAM,EAAED,SAAS,CAACE,MAAM,CAAC;EAE7D,OAAO,IAAIR,SAAS,CAAC;IACnBS,OAAO,EAAEf,aAAa,CAAC,IAAIF,UAAU,CAAC,CAAC,CAAC;IACxCkB,KAAK,EAAEX,oBAAoB,CAACM,OAAO,CAAC;IACpCM,IAAI,EAAEd,eAAe,CAACO,IAAI,CAAC;IAC3BQ,WAAW,EAAEjB,sBAAsB,CAAC,CAAC;IACrCkB,MAAM,EAAEZ,eAAe;IACvBa,SAAS,EAAEZ,kBAAkB;IAC7Ba,SAAS,EAAEjB,oBAAoB,CAAC,CAAC;IACjCkB,SAAS,EAAEvB,wBAAwB,CAAC,CAAC,CAAC,EAAE;MAAEc,MAAM;MAAEC,MAAM,EAAEF,SAAS,CAACE;IAAO,CAAC,CAAC;IAC7ED,MAAM;IACN,GAAGD;EACL,CAAC,CAAC;AACJ,CAAC;AAED,SAASH,eAAe","ignoreList":[]}
|
|
@@ -12,4 +12,5 @@ export { blePlxCentral } from "./adapters/ble-plx-central.js";
|
|
|
12
12
|
export { osBluetoothPermissions } from "./adapters/os-permissions.js";
|
|
13
13
|
export { reactNativeLifecycle } from "./adapters/react-native-lifecycle.js";
|
|
14
14
|
export { createBluetooth } from "./create-bluetooth.js";
|
|
15
|
+
export { SqliteOutboxStore } from "./adapters/sqlite-outbox-store.js";
|
|
15
16
|
//# sourceMappingURL=index.js.map
|