@ovok/native 1.17.0-dev.2213 → 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/ble-plx-central.js +45 -24
- package/lib/commonjs/modules/next/bluetooth/adapters/ble-plx-central.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/adapters/web-bluetooth-central.js +9 -1
- package/lib/commonjs/modules/next/bluetooth/adapters/web-bluetooth-central.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-link.js +2 -1
- package/lib/commonjs/modules/next/bluetooth/core/device-link.js.map +1 -1
- 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/ble-plx-central.js +45 -24
- package/lib/module/modules/next/bluetooth/adapters/ble-plx-central.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/adapters/web-bluetooth-central.js +9 -1
- package/lib/module/modules/next/bluetooth/adapters/web-bluetooth-central.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-link.js +2 -1
- package/lib/module/modules/next/bluetooth/core/device-link.js.map +1 -1
- 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/ble-plx-central.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/adapters/web-bluetooth-central.d.ts +4 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/adapters/web-bluetooth-central.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/ble-plx-central.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/adapters/web-bluetooth-central.d.ts +4 -0
- package/lib/typescript/module/src/modules/next/bluetooth/adapters/web-bluetooth-central.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 +1 @@
|
|
|
1
|
-
{"version":3,"names":["ACTION_MEMBERS","sync","records","fetch","live","setClock","actionsOf","protocol","Object","keys","filter","action","some","members","every","member","undefined","storedFields","record","model","name","lastConnectedAt","lastSyncedAt","lastSyncOutcome","lastReadingAt","battery","identity","autoSync","keepInBackground","initialSnapshot","address","id","vendor","pairedAt","connection","activity","progress","actions","lastSeenAt","rssi","lastError","unacknowledged","deviceStatus","liveEventsOf","values","waveform","kind"],"sourceRoot":"../../../../../../src","sources":["modules/next/bluetooth/core/device-snapshot.ts"],"mappings":";;AAMA;;AAGA;;AAGA;;
|
|
1
|
+
{"version":3,"names":["ACTION_MEMBERS","sync","records","fetch","live","setClock","actionsOf","protocol","Object","keys","filter","action","some","members","every","member","undefined","storedFields","record","model","name","lastConnectedAt","lastSyncedAt","lastSyncOutcome","lastReadingAt","battery","identity","autoSync","keepInBackground","initialSnapshot","address","id","vendor","pairedAt","connection","activity","measuringSince","progress","actions","lastSeenAt","rssi","lastError","unacknowledged","deviceStatus","liveEventsOf","values","waveform","kind"],"sourceRoot":"../../../../../../src","sources":["modules/next/bluetooth/core/device-snapshot.ts"],"mappings":";;AAMA;;AAGA;;AAGA;;AAoGA;;AA+CA;;AAUA;AACA,MAAMA,cAAoF,GAAG;EAC3FC,IAAI,EAAE,CAAC,CAAC,SAAS,EAAE,OAAO,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC;EACzCC,OAAO,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC;EACtBC,KAAK,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC;EAClBC,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC;EAChBC,QAAQ,EAAE,CAAC,CAAC,UAAU,CAAC;AACzB,CAAC;;AAED;AACA,MAAMC,SAAS,GAAIC,QAAwB,IACxCC,MAAM,CAACC,IAAI,CAACT,cAAc,CAAC,CAAoBU,MAAM,CAAEC,MAAM,IAC5DX,cAAc,CAACW,MAAM,CAAC,CAACC,IAAI,CAAEC,OAAO,IAAKA,OAAO,CAACC,KAAK,CAAEC,MAAM,IAAKR,QAAQ,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F;AACA,MAAMC,YAAY,GAAGA,CAAC;EAAEC,MAAM;EAAEC;AAAoB,CAAC,KAAoB,CACvE,IAAID,MAAM,GAAG,CAAC;EAAEE,IAAI,EAAE,MAAe;EAAEF;AAAO,CAAC,CAAC,GAAG,EAAE,CAAC,EACtD,IAAIC,QAAQ,GAAG,CAAC;EAAEC,IAAI,EAAE,UAAmB;EAAED;AAAS,CAAC,CAAC,GAAG,EAAE,CAAC,CAC/D;AAED,SAASxC,SAAS,EAAEuB,eAAe,EAAEe,YAAY,EAAE3B,YAAY","ignoreList":[]}
|
|
@@ -6,7 +6,9 @@ import { initialSnapshot, liveEventsOf, storedFields } from "./device-snapshot.j
|
|
|
6
6
|
import { asDeviceError, DeviceError } from "./errors.js";
|
|
7
7
|
import { Listeners } from "./listeners.js";
|
|
8
8
|
import { LiveStream } from "./live-stream.js";
|
|
9
|
+
import { MeasuringWatch } from "./measuring-watch.js";
|
|
9
10
|
import { HISTORY_CURSOR_IDS, noRecords, readFiles, readHistory } from "./record-reads.js";
|
|
11
|
+
import { StreamRecorder } from "./stream-recorder.js";
|
|
10
12
|
const unsupported = what => new DeviceError("unsupported", `This device has no ${what}`);
|
|
11
13
|
|
|
12
14
|
/** One paired device: it owns the link, queues every action on it, and reconnects when a press needs it. */
|
|
@@ -14,10 +16,15 @@ class Device {
|
|
|
14
16
|
events = new Listeners();
|
|
15
17
|
queue = Promise.resolve();
|
|
16
18
|
unacknowledged = new Set();
|
|
19
|
+
measuring = new MeasuringWatch(measuringSince => this.patch({
|
|
20
|
+
measuringSince
|
|
21
|
+
}), () => this.deps.now());
|
|
17
22
|
liveStream = new LiveStream({
|
|
18
|
-
onRunning: live => this.patch({
|
|
23
|
+
onRunning: live => live ? this.patch({
|
|
19
24
|
live
|
|
20
|
-
}),
|
|
25
|
+
}) : (this.measuring.stop(), this.patch({
|
|
26
|
+
live
|
|
27
|
+
})),
|
|
21
28
|
onError: lastError => this.patch({
|
|
22
29
|
lastError
|
|
23
30
|
})
|
|
@@ -44,6 +51,8 @@ class Device {
|
|
|
44
51
|
},
|
|
45
52
|
advertisement: () => this.latestAdvertisement
|
|
46
53
|
});
|
|
54
|
+
this.recorder = deps.sink && new StreamRecorder(this, deps.sink, deps);
|
|
55
|
+
this.recorder?.follow(this.events);
|
|
47
56
|
}
|
|
48
57
|
|
|
49
58
|
/** The address its record is stored under. */
|
|
@@ -72,7 +81,7 @@ class Device {
|
|
|
72
81
|
/** Sets the device's clock to now. */
|
|
73
82
|
setClock = () => this.run("setClock", connection => this.deps.protocol.setClock?.(connection, this.deps.now()) ?? Promise.reject(unsupported("clock")));
|
|
74
83
|
|
|
75
|
-
/** Starts `live` and `waveform` events, which
|
|
84
|
+
/** Starts `live` and `waveform` events, which the device also records and saves while its `record` setting is on. */
|
|
76
85
|
startLive = () => this.run("live", async connection => this.beginLive(connection));
|
|
77
86
|
|
|
78
87
|
/** Stops the stream and waits until the device has stopped sending. */
|
|
@@ -81,6 +90,7 @@ class Device {
|
|
|
81
90
|
/** Moves the cursor past a record once the app saved it, so the next sync skips it. */
|
|
82
91
|
acknowledge = async recordId => {
|
|
83
92
|
if (this.unacknowledged.delete(recordId)) {
|
|
93
|
+
this.recorder?.acknowledged(recordId);
|
|
84
94
|
await this.addToCursor(recordId);
|
|
85
95
|
}
|
|
86
96
|
};
|
|
@@ -91,7 +101,7 @@ class Device {
|
|
|
91
101
|
this.patch({});
|
|
92
102
|
};
|
|
93
103
|
|
|
94
|
-
/** Changes and stores whether it syncs by itself
|
|
104
|
+
/** Changes and stores whether it syncs by itself, stays connected in the background, and records what it streams. */
|
|
95
105
|
configure = settings => this.updateRecord(settings);
|
|
96
106
|
|
|
97
107
|
/** Stops live, waits for queued actions, then closes the link. */
|
|
@@ -231,7 +241,7 @@ class Device {
|
|
|
231
241
|
this.events.emit({
|
|
232
242
|
kind: "record",
|
|
233
243
|
reading: {
|
|
234
|
-
...decoded,
|
|
244
|
+
...(this.recorder?.supersede(recordId, decoded) ?? decoded),
|
|
235
245
|
source: {
|
|
236
246
|
modelId: model.id,
|
|
237
247
|
protocolId: protocol.id,
|
|
@@ -242,7 +252,10 @@ class Device {
|
|
|
242
252
|
});
|
|
243
253
|
}
|
|
244
254
|
beginLive(connection) {
|
|
245
|
-
const onFrame = frame =>
|
|
255
|
+
const onFrame = frame => {
|
|
256
|
+
this.measuring.frame();
|
|
257
|
+
liveEventsOf(frame).forEach(event => this.events.emit(event));
|
|
258
|
+
};
|
|
246
259
|
this.liveStream.start(signal => this.deps.protocol.live?.(connection, onFrame, signal) ?? Promise.resolve());
|
|
247
260
|
}
|
|
248
261
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["matchingName","DeviceLink","initialSnapshot","liveEventsOf","storedFields","asDeviceError","DeviceError","Listeners","LiveStream","HISTORY_CURSOR_IDS","noRecords","readFiles","readHistory","unsupported","what","Device","events","queue","Promise","resolve","unacknowledged","Set","liveStream","onRunning","live","patch","onError","lastError","constructor","record","deps","latestAdvertisement","snap","model","protocol","link","address","onState","connection","onConnected","fields","updateRecord","lastConnectedAt","now","onDropped","abort","secret","read","write","advertisement","snapshot","stored","subscribe","listener","add","sync","run","syncAll","records","reject","fetch","recordId","fetchRecord","setClock","startLive","beginLive","stopLive","stop","acknowledge","delete","addToCursor","release","configure","settings","disconnect","close","pair","broadcast","seen","ad","lastSeenAt","rssi","name","id","cursor","at","has","deliver","reading","action","work","state","actions","includes","task","then","perform","catch","undefined","activity","progress","result","error","failure","logger","code","summary","syncFiles","syncHistory","lastSyncedAt","lastSyncOutcome","onDevice","known","done","total","filter","some","history","slice","decoded","lastReadingAt","emit","kind","source","modelId","protocolId","onFrame","frame","forEach","event","start","signal","change","store","save","size"],"sourceRoot":"../../../../../../src","sources":["modules/next/bluetooth/core/device.ts"],"mappings":";;AAAA,SAAwBA,YAAY,QAAQ,oBAAiB;AAE7D,SAASC,UAAU,QAAQ,kBAAe;AAC1C,SAKEC,eAAe,EACfC,YAAY,EACZC,YAAY,QAEP,sB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,MAAM,CAAC+B,MAAM,CAAEhC,EAAE,IAAKA,EAAE,KAAKtB,QAAQ,CAAC,EAAEA,QAAQ;IAAE,CAAC,CAAC;EACzG;EAEA,MAAcpB,YAAYA,CAAC2F,MAA6B,EAAiB;IACvE,IAAI,CAACvG,MAAM,GAAG;MAAE,GAAG,IAAI,CAACA,MAAM;MAAE,GAAGuG;IAAO,CAAC;IAC3C,IAAI,CAAC3G,KAAK,CAACrB,YAAY,CAAC,IAAI,CAACyB,MAAM,EAAE,IAAI,CAACC,IAAI,CAACG,KAAK,CAAC,CAAC;IACtD,MAAM,IAAI,CAACH,IAAI,CAACuG,KAAK,CAACC,IAAI,CAAC,IAAI,CAACzG,MAAM,CAAC,CAACoE,KAAK,CAAC,MAAM,IAAI,CAACnE,IAAI,CAAC0E,MAAM,CAACF,KAAK,CAAC,wBAAwB,EAAE;MAAEpE,QAAQ,EAAE,IAAI,CAACJ,IAAI,CAACI,QAAQ,CAACiD;IAAG,CAAC,CAAC,CAAC;EAC5I;EAEQ1D,KAAKA,CAAC2G,MAA+B,EAAQ;IACnD,IAAI,CAACpG,IAAI,GAAG;MAAE,GAAG,IAAI,CAACA,IAAI;MAAE,GAAGoG,MAAM;MAAEhH,cAAc,EAAE,IAAI,CAACA,cAAc,CAACmH;IAAK,CAAC;IACjF,IAAI,CAACvH,MAAM,CAACyG,IAAI,CAAC;MAAEC,IAAI,EAAE,OAAO;MAAExE,QAAQ,EAAE,IAAI,CAAClB;IAAK,CAAC,CAAC;EAC1D;AACF;AAEA,SAASjB,MAAM","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["matchingName","DeviceLink","initialSnapshot","liveEventsOf","storedFields","asDeviceError","DeviceError","Listeners","LiveStream","MeasuringWatch","HISTORY_CURSOR_IDS","noRecords","readFiles","readHistory","StreamRecorder","unsupported","what","Device","events","queue","Promise","resolve","unacknowledged","Set","measuring","measuringSince","patch","deps","now","liveStream","onRunning","live","stop","onError","lastError","constructor","record","latestAdvertisement","snap","model","protocol","link","address","onState","connection","onConnected","fields","updateRecord","lastConnectedAt","onDropped","abort","secret","read","write","advertisement","recorder","sink","follow","snapshot","stored","subscribe","listener","add","sync","run","syncAll","records","reject","fetch","recordId","fetchRecord","setClock","startLive","beginLive","stopLive","acknowledge","delete","acknowledged","addToCursor","release","configure","settings","disconnect","close","pair","broadcast","seen","ad","lastSeenAt","rssi","name","id","cursor","at","has","deliver","reading","action","work","state","actions","includes","task","then","perform","catch","undefined","activity","progress","result","error","failure","logger","code","summary","syncFiles","syncHistory","lastSyncedAt","lastSyncOutcome","onDevice","known","done","total","filter","some","history","slice","decoded","lastReadingAt","emit","kind","supersede","source","modelId","protocolId","onFrame","frame","forEach","event","start","signal","change","store","save","size"],"sourceRoot":"../../../../../../src","sources":["modules/next/bluetooth/core/device.ts"],"mappings":";;AAAA,SAAwBA,YAAY,QAAQ,oBAAiB;AAE7D,SAASC,UAAU,QAAQ,kBAAe;AAC1C,SAKEC,eAAe,EACfC,YAAY,EACZC,YAAY,QAEP,sBAAmB;AAC1B,SAASC,aAAa,EAAEC,WAAW,QAAQ,aAAU;AACrD,SAASC,SAAS,QAAQ,gBAAa;AACvC,SAASC,UAAU,QAAQ,kBAAe;AAC1C,SAASC,cAAc,QAAQ,sBAAmB;AAIlD,SAASC,kBAAkB,EAAEC,SAAS,EAAEC,SAAS,EAAEC,WAAW,QAAQ,mBAAgB;AACtF,SAASC,cAAc,QAAQ,sBAAmB;AAElD,MAAMC,WAAW,GAAIC,IAAY,IAAK,IAAIV,WAAW,CAAC,aAAa,EAAE,sBAAsBU,IAAI,EAAE,CAAC;;AAElG;AACA,MAAMC,MAAM,CAAC;EAEMC,MAAM,GAAG,IAAIX,SAAS,CAAc,CAAC;EAE9CY,KAAK,GAAqBC,OAAO,CAACC,OAAO,CAAC,CAAC;EAClCC,cAAc,GAAG,IAAIC,GAAG,CAAS,CAAC;EAGlCC,SAAS,GAAG,IAAIf,cAAc,CAAEgB,cAAc,IAAK,IAAI,CAACC,KA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_SPANS = 500;
|
|
4
|
+
|
|
5
|
+
/** Clocks of the phone and the device differ a little; a recording this close to the edge is still inside. */
|
|
6
|
+
const EDGE_TOLERANCE_MS = 2_000;
|
|
7
|
+
const MS_PER_SECOND = 1_000;
|
|
8
|
+
|
|
9
|
+
/** Time a stored record covers, for one metric. */
|
|
10
|
+
|
|
11
|
+
/** What a stored record covers: its series, and its waveform when the device stamped it with a time. */
|
|
12
|
+
const coveredBy = ({
|
|
13
|
+
series,
|
|
14
|
+
waveform
|
|
15
|
+
}) => [...(series ? [{
|
|
16
|
+
metric: series.metric,
|
|
17
|
+
from: series.start.getTime(),
|
|
18
|
+
to: series.start.getTime() + series.values.length * series.intervalMs
|
|
19
|
+
}] : []), ...(waveform?.firstSampleAt ? [{
|
|
20
|
+
metric: waveform.metric,
|
|
21
|
+
from: waveform.firstSampleAt.getTime(),
|
|
22
|
+
to: waveform.firstSampleAt.getTime() + (waveform.samples[0]?.length ?? 0) / waveform.sampleRateHz * MS_PER_SECOND
|
|
23
|
+
}] : [])];
|
|
24
|
+
const isInside = ({
|
|
25
|
+
from,
|
|
26
|
+
to
|
|
27
|
+
}, covered) => covered.from - EDGE_TOLERANCE_MS <= from.getTime() && to.getTime() <= covered.to + EDGE_TOLERANCE_MS;
|
|
28
|
+
|
|
29
|
+
/** The live recordings that were saved and that a stored record of the same time may still replace. */
|
|
30
|
+
class LiveLedger {
|
|
31
|
+
spans = [];
|
|
32
|
+
|
|
33
|
+
/** Remembers a recording that was saved whole. */
|
|
34
|
+
add(span) {
|
|
35
|
+
this.spans = [...this.spans, span].slice(-MAX_KEPT_SPANS);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/** The recordings of the same metric that lie inside what a stored record covers. */
|
|
39
|
+
inside(record) {
|
|
40
|
+
const covers = coveredBy(record);
|
|
41
|
+
return this.spans.filter(span => covers.some(covered => covered.metric === span.metric && isInside(span, covered)));
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/** Forgets recordings a stored record has replaced. */
|
|
45
|
+
remove(replaced) {
|
|
46
|
+
this.spans = this.spans.filter(span => !replaced.includes(span));
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
export { LiveLedger };
|
|
50
|
+
//# sourceMappingURL=live-ledger.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["MAX_KEPT_SPANS","EDGE_TOLERANCE_MS","MS_PER_SECOND","coveredBy","series","waveform","metric","from","start","getTime","to","values","length","intervalMs","firstSampleAt","samples","sampleRateHz","isInside","covered","LiveLedger","spans","add","span","slice","inside","record","covers","filter","some","remove","replaced","includes"],"sourceRoot":"../../../../../../src","sources":["modules/next/bluetooth/core/live-ledger.ts"],"mappings":";;AAEA,MAAMA,cAAc,GAAG,GAAG;;AAE1B;AACA,MAAMC,iBAAiB,GAAG,KAAK;AAE/B,MAAMC,aAAa,GAAG,KAAK;;AAE3B;;AAGA;AACA,MAAMC,SAAS,GAAGA,CAAC;EAAEC,MAAM;EAAEC;AAAyB,CAAC,KAAgB,CACrE,IAAID,MAAM,GACN,CAAC;EAAEE,MAAM,EAAEF,MAAM,CAACE,MAAM;EAAEC,IAAI,EAAEH,MAAM,CAACI,KAAK,CAACC,OAAO,CAAC,CAAC;EAAEC,EAAE,EAAEN,MAAM,CAACI,KAAK,CAACC,OAAO,CAAC,CAAC,GAAGL,MAAM,CAACO,MAAM,CAACC,MAAM,GAAGR,MAAM,CAACS;AAAW,CAAC,CAAC,GAChI,EAAE,CAAC,EACP,IAAIR,QAAQ,EAAES,aAAa,GACvB,CACE;EACER,MAAM,EAAED,QAAQ,CAACC,MAAM;EACvBC,IAAI,EAAEF,QAAQ,CAACS,aAAa,CAACL,OAAO,CAAC,CAAC;EACtCC,EAAE,EAAEL,QAAQ,CAACS,aAAa,CAACL,OAAO,CAAC,CAAC,GAAI,CAACJ,QAAQ,CAACU,OAAO,CAAC,CAAC,CAAC,EAAEH,MAAM,IAAI,CAAC,IAAIP,QAAQ,CAACW,YAAY,GAAId;AACxG,CAAC,CACF,GACD,EAAE,CAAC,CACR;AAED,MAAMe,QAAQ,GAAGA,CAAC;EAAEV,IAAI;EAAEG;AAAa,CAAC,EAAEQ,OAAgB,KACxDA,OAAO,CAACX,IAAI,GAAGN,iBAAiB,IAAIM,IAAI,CAACE,OAAO,CAAC,CAAC,IAAIC,EAAE,CAACD,OAAO,CAAC,CAAC,IAAIS,OAAO,CAACR,EAAE,GAAGT,iBAAiB;;AAEtG;AACA,MAAMkB,UAAU,CAAC;EACPC,KAAK,GAAwB,EAAE;;EAEvC;EACOC,GAAGA,CAACC,IAAc,EAAQ;IAC/B,IAAI,CAACF,KAAK,GAAG,CAAC,GAAG,IAAI,CAACA,KAAK,EAAEE,IAAI,CAAC,CAACC,KAAK,CAAC,CAACvB,cAAc,CAAC;EAC3D;;EAEA;EACOwB,MAAMA,CAACC,MAAsB,EAAc;IAChD,MAAMC,MAAM,GAAGvB,SAAS,CAACsB,MAAM,CAAC;IAEhC,OAAO,IAAI,CAACL,KAAK,CAACO,MAAM,CAAEL,IAAI,IAAKI,MAAM,CAACE,IAAI,CAAEV,OAAO,IAAKA,OAAO,CAACZ,MAAM,KAAKgB,IAAI,CAAChB,MAAM,IAAIW,QAAQ,CAACK,IAAI,EAAEJ,OAAO,CAAC,CAAC,CAAC;EACzH;;EAEA;EACOW,MAAMA,CAACC,QAA6B,EAAQ;IACjD,IAAI,CAACV,KAAK,GAAG,IAAI,CAACA,KAAK,CAACO,MAAM,CAAEL,IAAI,IAAK,CAACQ,QAAQ,CAACC,QAAQ,CAACT,IAAI,CAAC,CAAC;EACpE;AACF;AAEA,SAASH,UAAU","ignoreList":[]}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/** How long a device may go without a live frame before it no longer counts as measuring. */
|
|
4
|
+
const QUIET_MS = 5_000;
|
|
5
|
+
|
|
6
|
+
/** Whether live frames are arriving: the first frame starts a measurement, a quiet spell or the stream's end ends it. */
|
|
7
|
+
class MeasuringWatch {
|
|
8
|
+
since = null;
|
|
9
|
+
quiet = null;
|
|
10
|
+
constructor(changed, now) {
|
|
11
|
+
this.changed = changed;
|
|
12
|
+
this.now = now;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/** A live frame arrived. */
|
|
16
|
+
frame() {
|
|
17
|
+
if (this.since === null) {
|
|
18
|
+
this.since = this.now();
|
|
19
|
+
this.changed(this.since);
|
|
20
|
+
}
|
|
21
|
+
this.clearQuiet();
|
|
22
|
+
this.quiet = setTimeout(() => this.stop(), QUIET_MS);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/** Nothing is being measured any more. */
|
|
26
|
+
stop() {
|
|
27
|
+
this.clearQuiet();
|
|
28
|
+
if (this.since !== null) {
|
|
29
|
+
this.since = null;
|
|
30
|
+
this.changed(null);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
clearQuiet() {
|
|
34
|
+
if (this.quiet !== null) {
|
|
35
|
+
clearTimeout(this.quiet);
|
|
36
|
+
this.quiet = null;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
export { MeasuringWatch, QUIET_MS };
|
|
41
|
+
//# sourceMappingURL=measuring-watch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["QUIET_MS","MeasuringWatch","since","quiet","constructor","changed","now","frame","clearQuiet","setTimeout","stop","clearTimeout"],"sourceRoot":"../../../../../../src","sources":["modules/next/bluetooth/core/measuring-watch.ts"],"mappings":";;AAAA;AACA,MAAMA,QAAQ,GAAG,KAAK;;AAEtB;AACA,MAAMC,cAAc,CAAC;EACXC,KAAK,GAAgB,IAAI;EACzBC,KAAK,GAAyC,IAAI;EAEnDC,WAAWA,CACCC,OAAqC,EACrCC,GAAe,EAChC;IAAA,KAFiBD,OAAqC,GAArCA,OAAqC;IAAA,KACrCC,GAAe,GAAfA,GAAe;EAC/B;;EAEH;EACOC,KAAKA,CAAA,EAAS;IACnB,IAAI,IAAI,CAACL,KAAK,KAAK,IAAI,EAAE;MACvB,IAAI,CAACA,KAAK,GAAG,IAAI,CAACI,GAAG,CAAC,CAAC;MACvB,IAAI,CAACD,OAAO,CAAC,IAAI,CAACH,KAAK,CAAC;IAC1B;IACA,IAAI,CAACM,UAAU,CAAC,CAAC;IACjB,IAAI,CAACL,KAAK,GAAGM,UAAU,CAAC,MAAM,IAAI,CAACC,IAAI,CAAC,CAAC,EAAEV,QAAQ,CAAC;EACtD;;EAEA;EACOU,IAAIA,CAAA,EAAS;IAClB,IAAI,CAACF,UAAU,CAAC,CAAC;IACjB,IAAI,IAAI,CAACN,KAAK,KAAK,IAAI,EAAE;MACvB,IAAI,CAACA,KAAK,GAAG,IAAI;MACjB,IAAI,CAACG,OAAO,CAAC,IAAI,CAAC;IACpB;EACF;EAEQG,UAAUA,CAAA,EAAS;IACzB,IAAI,IAAI,CAACL,KAAK,KAAK,IAAI,EAAE;MACvBQ,YAAY,CAAC,IAAI,CAACR,KAAK,CAAC;MACxB,IAAI,CAACA,KAAK,GAAG,IAAI;IACnB;EACF;AACF;AAEA,SAASF,cAAc,EAAED,QAAQ","ignoreList":[]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/** Where each outbox item stands, by id, at one moment. */
|
|
4
|
+
|
|
5
|
+
/** The offline queue behind a sink, which the reading log and the foreground notification watch; the sink side provides it. */
|
|
6
|
+
|
|
7
|
+
/** What a sink says about a save: how it went and, for a queued reading, which outbox items hold it. */
|
|
8
|
+
|
|
9
|
+
/** No offline queue: nothing is ever waiting. */
|
|
10
|
+
const noOutboxWatch = {
|
|
11
|
+
subscribe: () => () => undefined
|
|
12
|
+
};
|
|
13
|
+
export { noOutboxWatch };
|
|
14
|
+
//# sourceMappingURL=outbox-watch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["noOutboxWatch","subscribe","undefined"],"sourceRoot":"../../../../../../src","sources":["modules/next/bluetooth/core/outbox-watch.ts"],"mappings":";;AAEA;;AAaA;;AAOA;;AAUA;AACA,MAAMA,aAA0B,GAAG;EAAEC,SAAS,EAAEA,CAAA,KAAM,MAAMC;AAAU,CAAC;AAEvE,SAASF,aAAa","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["newPairedDevice","address","modelId","name","pairedAt","cursor","lastConnectedAt","lastSyncedAt","lastSyncOutcome","lastReadingAt","battery","identity","autoSync","keepInBackground","secret"],"sourceRoot":"../../../../../../src","sources":["modules/next/bluetooth/core/paired-device.ts"],"mappings":";;AAAA;;AAsBA;;AAaA;;
|
|
1
|
+
{"version":3,"names":["newPairedDevice","address","modelId","name","pairedAt","cursor","lastConnectedAt","lastSyncedAt","lastSyncOutcome","lastReadingAt","battery","identity","autoSync","keepInBackground","record","secret"],"sourceRoot":"../../../../../../src","sources":["modules/next/bluetooth/core/paired-device.ts"],"mappings":";;AAAA;;AAsBA;;AAaA;;AAiDA;;AAGA;AACA,MAAMA,eAAe,GAAGA,CAACC,OAAe,EAAEC,OAAe,EAAEC,IAAmB,EAAEC,QAAc,MAAoB;EAChHH,OAAO;EACPC,OAAO;EACPC,IAAI;EACJC,QAAQ;EACRC,MAAM,EAAE,EAAE;EACVC,eAAe,EAAE,IAAI;EACrBC,YAAY,EAAE,IAAI;EAClBC,eAAe,EAAE,IAAI;EACrBC,aAAa,EAAE,IAAI;EACnBC,OAAO,EAAE,IAAI;EACbC,QAAQ,EAAE,IAAI;EACdC,QAAQ,EAAE,IAAI;EACdC,gBAAgB,EAAE,KAAK;EACvBC,MAAM,EAAE,IAAI;EACZC,MAAM,EAAE;AACV,CAAC,CAAC;AAEF,SAASf,eAAe","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["silentLogger","debug","info","warn","error","alwaysForeground","watch","listener","undefined","noKeepAlive","start","stop"],"sourceRoot":"../../../../../../src","sources":["modules/next/bluetooth/core/ports.ts"],"mappings":";;
|
|
1
|
+
{"version":3,"names":["silentLogger","debug","info","warn","error","alwaysForeground","watch","listener","undefined","noKeepAlive","start","stop"],"sourceRoot":"../../../../../../src","sources":["modules/next/bluetooth/core/ports.ts"],"mappings":";;AAOA;;AAGA;;AAGA;;AAGA;;AAaA;;AAsBA;;AAaA;;AAaA;;AAaA;;AAaA;;AAGA;;AAOA;;AAGA;;AAOA;;AAYA;;AAgBA,MAAMA,YAAoB,GAAG;EAAEC,KAAK,EAAEA,CAAA,KAAM,CAAC,CAAC;EAAEC,IAAI,EAAEA,CAAA,KAAM,CAAC,CAAC;EAAEC,IAAI,EAAEA,CAAA,KAAM,CAAC,CAAC;EAAEC,KAAK,EAAEA,CAAA,KAAM,CAAC;AAAE,CAAC;;AAEjG;AACA,MAAMC,gBAA8B,GAAG;EACrCC,KAAK,EAAGC,QAAQ,IAAK;IACnBA,QAAQ,CAAC,YAAY,CAAC;IAEtB,OAAO,MAAMC,SAAS;EACxB;AACF,CAAC;;AAED;AACA,MAAMC,WAAsB,GAAG;EAAEC,KAAK,EAAE,MAAAA,CAAA,KAAYF,SAAS;EAAEG,IAAI,EAAE,MAAAA,CAAA,KAAYH;AAAU,CAAC;AAE5F,SAASH,gBAAgB,EAAEI,WAAW,EAAET,YAAY","ignoreList":[]}
|
|
@@ -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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OSE_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.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