@ovok/native 1.16.1-rc.3 → 1.16.1-rc.4
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/bt-management/components/android-bluetooth-foreground-service.js +3 -1
- package/lib/commonjs/modules/bt-management/components/android-bluetooth-foreground-service.js.map +1 -1
- package/lib/commonjs/modules/bt-management/components/bluetooth-device-picker.js +9 -141
- package/lib/commonjs/modules/bt-management/components/bluetooth-device-picker.js.map +1 -1
- package/lib/commonjs/modules/bt-management/components/bt-provider-child-wrapper.js +1 -0
- package/lib/commonjs/modules/bt-management/components/bt-provider-child-wrapper.js.map +1 -1
- package/lib/commonjs/modules/bt-management/components/device-picker-sheet.js +160 -0
- package/lib/commonjs/modules/bt-management/components/device-picker-sheet.js.map +1 -0
- package/lib/commonjs/modules/bt-management/hooks/runtime-context.js.map +1 -1
- package/lib/commonjs/modules/bt-management/hooks/use-bluetooth-permission.js +2 -1
- package/lib/commonjs/modules/bt-management/hooks/use-bluetooth-permission.js.map +1 -1
- package/lib/commonjs/modules/bt-management/hooks/use-measurements.js +1 -1
- package/lib/commonjs/modules/bt-management/hooks/use-measurements.js.map +1 -1
- package/lib/commonjs/modules/bt-management/index.js +12 -0
- package/lib/commonjs/modules/bt-management/index.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/bt-manager.js +50 -0
- package/lib/commonjs/modules/bt-management/services/bt-manager.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/custom/define-custom-device.js +3 -0
- package/lib/commonjs/modules/bt-management/services/custom/define-custom-device.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/devices/bt-command-writer.js +4 -2
- package/lib/commonjs/modules/bt-management/services/devices/bt-command-writer.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/devices/bt-connection-handler.js +97 -28
- package/lib/commonjs/modules/bt-management/services/devices/bt-connection-handler.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/devices/bt-current-time.js +59 -0
- package/lib/commonjs/modules/bt-management/services/devices/bt-current-time.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/devices/bt-device-information.js +18 -37
- package/lib/commonjs/modules/bt-management/services/devices/bt-device-information.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/devices/bt-managed-device.js +31 -3
- package/lib/commonjs/modules/bt-management/services/devices/bt-managed-device.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/devices/bt-notification-readiness.js +68 -0
- package/lib/commonjs/modules/bt-management/services/devices/bt-notification-readiness.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/devices/bt-pairing-retry.js +70 -0
- package/lib/commonjs/modules/bt-management/services/devices/bt-pairing-retry.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/devices/custom/custom.device.js +14 -0
- package/lib/commonjs/modules/bt-management/services/devices/custom/custom.device.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/devices/standard-gatt/standard-gatt.blood-pressure-status.js +4 -7
- package/lib/commonjs/modules/bt-management/services/devices/standard-gatt/standard-gatt.blood-pressure-status.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/devices/standard-gatt/standard-gatt.decorators.js +106 -0
- package/lib/commonjs/modules/bt-management/services/devices/standard-gatt/standard-gatt.decorators.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/devices/standard-gatt/standard-gatt.devices.js +38 -31
- package/lib/commonjs/modules/bt-management/services/devices/standard-gatt/standard-gatt.devices.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/devices/standard-gatt/standard-gatt.frame.js +41 -0
- package/lib/commonjs/modules/bt-management/services/devices/standard-gatt/standard-gatt.frame.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/devices/standard-gatt/standard-gatt.glucose-details.js +77 -0
- package/lib/commonjs/modules/bt-management/services/devices/standard-gatt/standard-gatt.glucose-details.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/devices/standard-gatt/standard-gatt.glucose-frame.js +49 -0
- package/lib/commonjs/modules/bt-management/services/devices/standard-gatt/standard-gatt.glucose-frame.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/devices/standard-gatt/standard-gatt.glucose-racp.js +89 -0
- package/lib/commonjs/modules/bt-management/services/devices/standard-gatt/standard-gatt.glucose-racp.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/devices/standard-gatt/standard-gatt.glucose.js +35 -42
- package/lib/commonjs/modules/bt-management/services/devices/standard-gatt/standard-gatt.glucose.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/devices/standard-gatt/standard-gatt.profile.js +22 -24
- package/lib/commonjs/modules/bt-management/services/devices/standard-gatt/standard-gatt.profile.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/record-cursor.js +70 -0
- package/lib/commonjs/modules/bt-management/services/record-cursor.js.map +1 -0
- package/lib/commonjs/modules/bt-management/testing/fake-ble-manager.js +8 -0
- package/lib/commonjs/modules/bt-management/testing/fake-ble-manager.js.map +1 -1
- package/lib/commonjs/modules/bt-management/types/glucose-record-details.js +2 -0
- package/lib/commonjs/modules/bt-management/types/glucose-record-details.js.map +1 -0
- package/lib/commonjs/modules/bt-management/utils/bluetooth-permission-list.js +19 -0
- package/lib/commonjs/modules/bt-management/utils/bluetooth-permission-list.js.map +1 -0
- package/lib/commonjs/modules/bt-management/utils/device-user.js +22 -0
- package/lib/commonjs/modules/bt-management/utils/device-user.js.map +1 -0
- package/lib/commonjs/modules/bt-management/utils/kpa-to-mmhg.js +9 -0
- package/lib/commonjs/modules/bt-management/utils/kpa-to-mmhg.js.map +1 -0
- package/lib/commonjs/modules/bt-management/utils/result-identity.js +26 -35
- package/lib/commonjs/modules/bt-management/utils/result-identity.js.map +1 -1
- package/lib/commonjs/modules/bt-management/utils/rr-interval.js +16 -0
- package/lib/commonjs/modules/bt-management/utils/rr-interval.js.map +1 -0
- package/lib/commonjs/modules/bt-management/utils/temperature-type.js +15 -0
- package/lib/commonjs/modules/bt-management/utils/temperature-type.js.map +1 -0
- package/lib/commonjs/modules/bt-management/utils/wait.js +10 -0
- package/lib/commonjs/modules/bt-management/utils/wait.js.map +1 -0
- package/lib/commonjs/modules/next/background-sync/index.js +28 -0
- package/lib/commonjs/modules/next/background-sync/index.js.map +1 -0
- package/lib/commonjs/modules/next/background-sync/offline-measurement-background-sync.js +63 -0
- package/lib/commonjs/modules/next/background-sync/offline-measurement-background-sync.js.map +1 -0
- package/lib/commonjs/modules/next/bluetooth/auto-connect.js +32 -0
- package/lib/commonjs/modules/next/bluetooth/auto-connect.js.map +1 -0
- package/lib/commonjs/modules/next/bluetooth/ble-plx/ble-errors.js +33 -0
- package/lib/commonjs/modules/next/bluetooth/ble-plx/ble-errors.js.map +1 -0
- package/lib/commonjs/modules/next/bluetooth/ble-plx/ble-link.js +162 -0
- package/lib/commonjs/modules/next/bluetooth/ble-plx/ble-link.js.map +1 -0
- package/lib/commonjs/modules/next/bluetooth/ble-plx/ble-scanner.js +75 -0
- package/lib/commonjs/modules/next/bluetooth/ble-plx/ble-scanner.js.map +1 -0
- package/lib/commonjs/modules/next/bluetooth/ble-plx/built-in-devices.js +34 -0
- package/lib/commonjs/modules/next/bluetooth/ble-plx/built-in-devices.js.map +1 -0
- package/lib/commonjs/modules/next/bluetooth/ble-plx/legacy-driver.js +67 -0
- package/lib/commonjs/modules/next/bluetooth/ble-plx/legacy-driver.js.map +1 -0
- package/lib/commonjs/modules/next/bluetooth/connections.js +114 -0
- package/lib/commonjs/modules/next/bluetooth/connections.js.map +1 -0
- package/lib/commonjs/modules/next/bluetooth/daily-total-day.js.map +1 -0
- package/lib/commonjs/modules/next/bluetooth/devices.js +41 -0
- package/lib/commonjs/modules/next/bluetooth/devices.js.map +1 -0
- package/lib/commonjs/modules/next/bluetooth/driver.js +30 -20
- package/lib/commonjs/modules/next/bluetooth/driver.js.map +1 -1
- package/lib/commonjs/modules/next/bluetooth/errors.js +26 -0
- package/lib/commonjs/modules/next/bluetooth/errors.js.map +1 -0
- package/lib/commonjs/modules/next/bluetooth/index.js +122 -11
- package/lib/commonjs/modules/next/bluetooth/index.js.map +1 -1
- package/lib/commonjs/modules/next/bluetooth/link.js +0 -103
- package/lib/commonjs/modules/next/bluetooth/link.js.map +1 -1
- package/lib/commonjs/modules/next/bluetooth/paired.js +50 -0
- package/lib/commonjs/modules/next/bluetooth/paired.js.map +1 -0
- package/lib/commonjs/modules/next/bluetooth/permissions.js +2 -0
- package/lib/commonjs/modules/next/bluetooth/permissions.js.map +1 -0
- package/lib/commonjs/modules/next/bluetooth/react/bluetooth-device-picker.js +44 -0
- package/lib/commonjs/modules/next/bluetooth/react/bluetooth-device-picker.js.map +1 -0
- package/lib/commonjs/modules/next/bluetooth/react/context.js +54 -0
- package/lib/commonjs/modules/next/bluetooth/react/context.js.map +1 -0
- package/lib/commonjs/modules/next/bluetooth/react/hooks.js +86 -0
- package/lib/commonjs/modules/next/bluetooth/react/hooks.js.map +1 -0
- package/lib/commonjs/modules/next/bluetooth/react-native/create-bluetooth-runtime.js +28 -0
- package/lib/commonjs/modules/next/bluetooth/react-native/create-bluetooth-runtime.js.map +1 -0
- package/lib/commonjs/modules/next/bluetooth/react-native/os-permissions.js +32 -0
- package/lib/commonjs/modules/next/bluetooth/react-native/os-permissions.js.map +1 -0
- package/lib/commonjs/modules/next/bluetooth/react-native/ovok-sink.js +43 -0
- package/lib/commonjs/modules/next/bluetooth/react-native/ovok-sink.js.map +1 -0
- package/lib/commonjs/modules/next/bluetooth/readings.js +93 -0
- package/lib/commonjs/modules/next/bluetooth/readings.js.map +1 -0
- package/lib/commonjs/modules/next/bluetooth/result-policy.js +15 -2
- package/lib/commonjs/modules/next/bluetooth/result-policy.js.map +1 -1
- package/lib/commonjs/modules/next/bluetooth/runtime.js +223 -0
- package/lib/commonjs/modules/next/bluetooth/runtime.js.map +1 -0
- package/lib/commonjs/modules/next/bluetooth/scan-loop.js +82 -0
- package/lib/commonjs/modules/next/bluetooth/scan-loop.js.map +1 -0
- package/lib/commonjs/modules/next/bluetooth/sig-profiles.js +46 -13
- package/lib/commonjs/modules/next/bluetooth/sig-profiles.js.map +1 -1
- package/lib/commonjs/modules/next/bluetooth/sink.js +6 -0
- package/lib/commonjs/modules/next/bluetooth/sink.js.map +1 -0
- package/lib/commonjs/modules/next/bluetooth/snapshot.js +6 -0
- package/lib/commonjs/modules/next/bluetooth/snapshot.js.map +1 -0
- package/lib/commonjs/modules/next/bluetooth/stable-hash.js +42 -0
- package/lib/commonjs/modules/next/bluetooth/stable-hash.js.map +1 -0
- package/lib/commonjs/modules/next/bluetooth/store.js +61 -0
- package/lib/commonjs/modules/next/bluetooth/store.js.map +1 -0
- package/lib/commonjs/modules/next/bluetooth/transport.js +6 -0
- package/lib/commonjs/modules/next/bluetooth/transport.js.map +1 -0
- package/lib/commonjs/modules/next/data-sync/index.js +17 -0
- package/lib/commonjs/modules/next/data-sync/index.js.map +1 -0
- package/lib/module/modules/bt-management/components/android-bluetooth-foreground-service.js +3 -1
- package/lib/module/modules/bt-management/components/android-bluetooth-foreground-service.js.map +1 -1
- package/lib/module/modules/bt-management/components/bluetooth-device-picker.js +9 -141
- package/lib/module/modules/bt-management/components/bluetooth-device-picker.js.map +1 -1
- package/lib/module/modules/bt-management/components/bt-provider-child-wrapper.js +1 -0
- package/lib/module/modules/bt-management/components/bt-provider-child-wrapper.js.map +1 -1
- package/lib/module/modules/bt-management/components/device-picker-sheet.js +154 -0
- package/lib/module/modules/bt-management/components/device-picker-sheet.js.map +1 -0
- package/lib/module/modules/bt-management/hooks/runtime-context.js.map +1 -1
- package/lib/module/modules/bt-management/hooks/use-bluetooth-permission.js +4 -3
- package/lib/module/modules/bt-management/hooks/use-bluetooth-permission.js.map +1 -1
- package/lib/module/modules/bt-management/hooks/use-measurements.js +1 -1
- package/lib/module/modules/bt-management/hooks/use-measurements.js.map +1 -1
- package/lib/module/modules/bt-management/index.js +1 -0
- package/lib/module/modules/bt-management/index.js.map +1 -1
- package/lib/module/modules/bt-management/services/bt-manager.js +50 -0
- package/lib/module/modules/bt-management/services/bt-manager.js.map +1 -1
- package/lib/module/modules/bt-management/services/custom/define-custom-device.js +3 -0
- package/lib/module/modules/bt-management/services/custom/define-custom-device.js.map +1 -1
- package/lib/module/modules/bt-management/services/devices/bt-command-writer.js +4 -2
- package/lib/module/modules/bt-management/services/devices/bt-command-writer.js.map +1 -1
- package/lib/module/modules/bt-management/services/devices/bt-connection-handler.js +97 -28
- package/lib/module/modules/bt-management/services/devices/bt-connection-handler.js.map +1 -1
- package/lib/module/modules/bt-management/services/devices/bt-current-time.js +55 -0
- package/lib/module/modules/bt-management/services/devices/bt-current-time.js.map +1 -0
- package/lib/module/modules/bt-management/services/devices/bt-device-information.js +18 -37
- package/lib/module/modules/bt-management/services/devices/bt-device-information.js.map +1 -1
- package/lib/module/modules/bt-management/services/devices/bt-managed-device.js +33 -5
- package/lib/module/modules/bt-management/services/devices/bt-managed-device.js.map +1 -1
- package/lib/module/modules/bt-management/services/devices/bt-notification-readiness.js +65 -0
- package/lib/module/modules/bt-management/services/devices/bt-notification-readiness.js.map +1 -0
- package/lib/module/modules/bt-management/services/devices/bt-pairing-retry.js +65 -0
- package/lib/module/modules/bt-management/services/devices/bt-pairing-retry.js.map +1 -0
- package/lib/module/modules/bt-management/services/devices/custom/custom.device.js +14 -0
- package/lib/module/modules/bt-management/services/devices/custom/custom.device.js.map +1 -1
- package/lib/module/modules/bt-management/services/devices/standard-gatt/standard-gatt.blood-pressure-status.js +1 -4
- package/lib/module/modules/bt-management/services/devices/standard-gatt/standard-gatt.blood-pressure-status.js.map +1 -1
- package/lib/module/modules/bt-management/services/devices/standard-gatt/standard-gatt.decorators.js +99 -0
- package/lib/module/modules/bt-management/services/devices/standard-gatt/standard-gatt.decorators.js.map +1 -0
- package/lib/module/modules/bt-management/services/devices/standard-gatt/standard-gatt.devices.js +38 -31
- package/lib/module/modules/bt-management/services/devices/standard-gatt/standard-gatt.devices.js.map +1 -1
- package/lib/module/modules/bt-management/services/devices/standard-gatt/standard-gatt.frame.js +35 -0
- package/lib/module/modules/bt-management/services/devices/standard-gatt/standard-gatt.frame.js.map +1 -0
- package/lib/module/modules/bt-management/services/devices/standard-gatt/standard-gatt.glucose-details.js +72 -0
- package/lib/module/modules/bt-management/services/devices/standard-gatt/standard-gatt.glucose-details.js.map +1 -0
- package/lib/module/modules/bt-management/services/devices/standard-gatt/standard-gatt.glucose-frame.js +40 -0
- package/lib/module/modules/bt-management/services/devices/standard-gatt/standard-gatt.glucose-frame.js.map +1 -0
- package/lib/module/modules/bt-management/services/devices/standard-gatt/standard-gatt.glucose-racp.js +85 -0
- package/lib/module/modules/bt-management/services/devices/standard-gatt/standard-gatt.glucose-racp.js.map +1 -0
- package/lib/module/modules/bt-management/services/devices/standard-gatt/standard-gatt.glucose.js +25 -32
- package/lib/module/modules/bt-management/services/devices/standard-gatt/standard-gatt.glucose.js.map +1 -1
- package/lib/module/modules/bt-management/services/devices/standard-gatt/standard-gatt.profile.js +18 -20
- package/lib/module/modules/bt-management/services/devices/standard-gatt/standard-gatt.profile.js.map +1 -1
- package/lib/module/modules/bt-management/services/record-cursor.js +66 -0
- package/lib/module/modules/bt-management/services/record-cursor.js.map +1 -0
- package/lib/module/modules/bt-management/testing/fake-ble-manager.js +8 -0
- package/lib/module/modules/bt-management/testing/fake-ble-manager.js.map +1 -1
- package/lib/module/modules/bt-management/types/custom-device-definition.js +4 -0
- package/lib/module/modules/bt-management/types/custom-device-definition.js.map +1 -1
- package/lib/module/modules/bt-management/types/glucose-record-details.js +2 -0
- package/lib/module/modules/bt-management/types/glucose-record-details.js.map +1 -0
- package/lib/module/modules/bt-management/utils/bluetooth-permission-list.js +14 -0
- package/lib/module/modules/bt-management/utils/bluetooth-permission-list.js.map +1 -0
- package/lib/module/modules/bt-management/utils/device-user.js +17 -0
- package/lib/module/modules/bt-management/utils/device-user.js.map +1 -0
- package/lib/module/modules/bt-management/utils/kpa-to-mmhg.js +6 -0
- package/lib/module/modules/bt-management/utils/kpa-to-mmhg.js.map +1 -0
- package/lib/module/modules/bt-management/utils/result-identity.js +23 -33
- package/lib/module/modules/bt-management/utils/result-identity.js.map +1 -1
- package/lib/module/modules/bt-management/utils/rr-interval.js +12 -0
- package/lib/module/modules/bt-management/utils/rr-interval.js.map +1 -0
- package/lib/module/modules/bt-management/utils/temperature-type.js +11 -0
- package/lib/module/modules/bt-management/utils/temperature-type.js.map +1 -0
- package/lib/module/modules/bt-management/utils/wait.js +5 -0
- package/lib/module/modules/bt-management/utils/wait.js.map +1 -0
- package/lib/module/modules/next/background-sync/index.js +12 -0
- package/lib/module/modules/next/background-sync/index.js.map +1 -0
- package/lib/module/modules/next/background-sync/offline-measurement-background-sync.js +55 -0
- package/lib/module/modules/next/background-sync/offline-measurement-background-sync.js.map +1 -0
- package/lib/module/modules/next/bluetooth/auto-connect.js +28 -0
- package/lib/module/modules/next/bluetooth/auto-connect.js.map +1 -0
- package/lib/module/modules/next/bluetooth/ble-plx/ble-errors.js +28 -0
- package/lib/module/modules/next/bluetooth/ble-plx/ble-errors.js.map +1 -0
- package/lib/module/modules/next/bluetooth/ble-plx/ble-link.js +159 -0
- package/lib/module/modules/next/bluetooth/ble-plx/ble-link.js.map +1 -0
- package/lib/module/modules/next/bluetooth/ble-plx/ble-scanner.js +69 -0
- package/lib/module/modules/next/bluetooth/ble-plx/ble-scanner.js.map +1 -0
- package/lib/module/modules/next/bluetooth/ble-plx/built-in-devices.js +31 -0
- package/lib/module/modules/next/bluetooth/ble-plx/built-in-devices.js.map +1 -0
- package/lib/module/modules/next/bluetooth/ble-plx/legacy-driver.js +63 -0
- package/lib/module/modules/next/bluetooth/ble-plx/legacy-driver.js.map +1 -0
- package/lib/module/modules/next/bluetooth/connections.js +110 -0
- package/lib/module/modules/next/bluetooth/connections.js.map +1 -0
- package/lib/module/modules/next/bluetooth/daily-total-day.js.map +1 -0
- package/lib/module/modules/next/bluetooth/devices.js +37 -0
- package/lib/module/modules/next/bluetooth/devices.js.map +1 -0
- package/lib/module/modules/next/bluetooth/driver.js +29 -20
- package/lib/module/modules/next/bluetooth/driver.js.map +1 -1
- package/lib/module/modules/next/bluetooth/errors.js +21 -0
- package/lib/module/modules/next/bluetooth/errors.js.map +1 -0
- package/lib/module/modules/next/bluetooth/index.js +22 -4
- package/lib/module/modules/next/bluetooth/index.js.map +1 -1
- package/lib/module/modules/next/bluetooth/link.js +0 -101
- package/lib/module/modules/next/bluetooth/link.js.map +1 -1
- package/lib/module/modules/next/bluetooth/paired.js +46 -0
- package/lib/module/modules/next/bluetooth/paired.js.map +1 -0
- package/lib/module/modules/next/bluetooth/permissions.js +2 -0
- package/lib/module/modules/next/bluetooth/permissions.js.map +1 -0
- package/lib/module/modules/next/bluetooth/react/bluetooth-device-picker.js +39 -0
- package/lib/module/modules/next/bluetooth/react/bluetooth-device-picker.js.map +1 -0
- package/lib/module/modules/next/bluetooth/react/context.js +48 -0
- package/lib/module/modules/next/bluetooth/react/context.js.map +1 -0
- package/lib/module/modules/next/bluetooth/react/hooks.js +76 -0
- package/lib/module/modules/next/bluetooth/react/hooks.js.map +1 -0
- package/lib/module/modules/next/bluetooth/react-native/create-bluetooth-runtime.js +25 -0
- package/lib/module/modules/next/bluetooth/react-native/create-bluetooth-runtime.js.map +1 -0
- package/lib/module/modules/next/bluetooth/react-native/os-permissions.js +28 -0
- package/lib/module/modules/next/bluetooth/react-native/os-permissions.js.map +1 -0
- package/lib/module/modules/next/bluetooth/react-native/ovok-sink.js +39 -0
- package/lib/module/modules/next/bluetooth/react-native/ovok-sink.js.map +1 -0
- package/lib/module/modules/next/bluetooth/readings.js +89 -0
- package/lib/module/modules/next/bluetooth/readings.js.map +1 -0
- package/lib/module/modules/next/bluetooth/result-policy.js +14 -2
- package/lib/module/modules/next/bluetooth/result-policy.js.map +1 -1
- package/lib/module/modules/next/bluetooth/runtime.js +220 -0
- package/lib/module/modules/next/bluetooth/runtime.js.map +1 -0
- package/lib/module/modules/next/bluetooth/scan-loop.js +78 -0
- package/lib/module/modules/next/bluetooth/scan-loop.js.map +1 -0
- package/lib/module/modules/next/bluetooth/sig-profiles.js +44 -11
- package/lib/module/modules/next/bluetooth/sig-profiles.js.map +1 -1
- package/lib/module/modules/next/bluetooth/sink.js +4 -0
- package/lib/module/modules/next/bluetooth/sink.js.map +1 -0
- package/lib/module/modules/next/bluetooth/snapshot.js +4 -0
- package/lib/module/modules/next/bluetooth/snapshot.js.map +1 -0
- package/lib/module/modules/next/bluetooth/stable-hash.js +37 -0
- package/lib/module/modules/next/bluetooth/stable-hash.js.map +1 -0
- package/lib/module/modules/next/bluetooth/store.js +57 -0
- package/lib/module/modules/next/bluetooth/store.js.map +1 -0
- package/lib/module/modules/next/bluetooth/transport.js +4 -0
- package/lib/module/modules/next/bluetooth/transport.js.map +1 -0
- package/lib/module/modules/next/data-sync/index.js +11 -0
- package/lib/module/modules/next/data-sync/index.js.map +1 -0
- package/lib/typescript/commonjs/src/modules/auth/hooks/use-sign-in.d.ts +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/components/android-bluetooth-foreground-service.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/components/bluetooth-device-picker.d.ts +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/components/bluetooth-device-picker.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/components/bt-provider-child-wrapper.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/components/device-picker-sheet.d.ts +25 -0
- package/lib/typescript/commonjs/src/modules/bt-management/components/device-picker-sheet.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/hooks/runtime-context.d.ts +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/hooks/runtime-context.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/hooks/use-bluetooth-permission.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/hooks/use-measurements.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/index.d.ts +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/bt-manager.d.ts +20 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/bt-manager.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/custom/define-custom-device.d.ts +2 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/custom/define-custom-device.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bt-command-writer.d.ts +3 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bt-command-writer.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bt-connection-handler.d.ts +14 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bt-connection-handler.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bt-current-time.d.ts +11 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bt-current-time.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bt-device-information.d.ts +2 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bt-device-information.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bt-managed-device.d.ts +11 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bt-managed-device.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bt-notification-readiness.d.ts +15 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bt-notification-readiness.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bt-pairing-retry.d.ts +21 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bt-pairing-retry.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/custom/custom.device.d.ts +2 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/custom/custom.device.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.blood-pressure-status.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.decorators.d.ts +11 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.decorators.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.devices.d.ts +5 -2
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.devices.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.frame.d.ts +10 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.frame.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.glucose-details.d.ts +7 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.glucose-details.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.glucose-frame.d.ts +16 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.glucose-frame.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.glucose-racp.d.ts +8 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.glucose-racp.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.glucose.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.profile.d.ts +2 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.profile.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/record-cursor.d.ts +21 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/record-cursor.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/testing/fake-ble-manager.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/types/command-sequencer.d.ts +6 -2
- package/lib/typescript/commonjs/src/modules/bt-management/types/command-sequencer.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/types/create-device-params.d.ts +3 -0
- package/lib/typescript/commonjs/src/modules/bt-management/types/create-device-params.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/types/custom-device-definition.d.ts +14 -1
- package/lib/typescript/commonjs/src/modules/bt-management/types/custom-device-definition.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/types/glucose-record-details.d.ts +33 -0
- package/lib/typescript/commonjs/src/modules/bt-management/types/glucose-record-details.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/types/result-callback.d.ts +2 -0
- package/lib/typescript/commonjs/src/modules/bt-management/types/result-callback.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/types/result-policy.d.ts +6 -0
- package/lib/typescript/commonjs/src/modules/bt-management/types/result-policy.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/utils/bluetooth-permission-list.d.ts +4 -0
- package/lib/typescript/commonjs/src/modules/bt-management/utils/bluetooth-permission-list.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/utils/device-user.d.ts +6 -0
- package/lib/typescript/commonjs/src/modules/bt-management/utils/device-user.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/utils/kpa-to-mmhg.d.ts +4 -0
- package/lib/typescript/commonjs/src/modules/bt-management/utils/kpa-to-mmhg.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/utils/result-identity.d.ts +5 -4
- package/lib/typescript/commonjs/src/modules/bt-management/utils/result-identity.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/utils/rr-interval.d.ts +4 -0
- package/lib/typescript/commonjs/src/modules/bt-management/utils/rr-interval.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/utils/temperature-type.d.ts +7 -0
- package/lib/typescript/commonjs/src/modules/bt-management/utils/temperature-type.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/utils/wait.d.ts +3 -0
- package/lib/typescript/commonjs/src/modules/bt-management/utils/wait.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/data-sync/services/managers/sync-progress-manager.d.ts +1 -1
- package/lib/typescript/commonjs/src/modules/next/background-sync/index.d.ts +10 -0
- package/lib/typescript/commonjs/src/modules/next/background-sync/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/next/background-sync/offline-measurement-background-sync.d.ts +22 -0
- package/lib/typescript/commonjs/src/modules/next/background-sync/offline-measurement-background-sync.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/auto-connect.d.ts +10 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/auto-connect.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/ble-plx/ble-errors.d.ts +4 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/ble-plx/ble-errors.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/ble-plx/ble-link.d.ts +6 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/ble-plx/ble-link.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/ble-plx/ble-scanner.d.ts +10 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/ble-plx/ble-scanner.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/ble-plx/built-in-devices.d.ts +6 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/ble-plx/built-in-devices.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/ble-plx/legacy-driver.d.ts +8 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/ble-plx/legacy-driver.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/connections.d.ts +25 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/connections.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/daily-total-day.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/devices.d.ts +30 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/devices.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/driver.d.ts +27 -20
- package/lib/typescript/commonjs/src/modules/next/bluetooth/driver.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/next/bluetooth/errors.d.ts +17 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/errors.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/index.d.ts +34 -5
- package/lib/typescript/commonjs/src/modules/next/bluetooth/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/next/bluetooth/link.d.ts +14 -5
- package/lib/typescript/commonjs/src/modules/next/bluetooth/link.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/next/bluetooth/paired.d.ts +18 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/paired.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/permissions.d.ts +13 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/permissions.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/react/bluetooth-device-picker.d.ts +35 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/react/bluetooth-device-picker.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/react/context.d.ts +30 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/react/context.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/react/hooks.d.ts +47 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/react/hooks.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/react-native/create-bluetooth-runtime.d.ts +21 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/react-native/create-bluetooth-runtime.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/react-native/os-permissions.d.ts +5 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/react-native/os-permissions.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/react-native/ovok-sink.d.ts +6 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/react-native/ovok-sink.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/readings.d.ts +21 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/readings.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/result-policy.d.ts +9 -1
- package/lib/typescript/commonjs/src/modules/next/bluetooth/result-policy.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/next/bluetooth/runtime.d.ts +87 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/runtime.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/scan-loop.d.ts +23 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/scan-loop.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/sig-profiles.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/next/bluetooth/sink.d.ts +20 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/sink.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/snapshot.d.ts +72 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/snapshot.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/stable-hash.d.ts +6 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/stable-hash.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/store.d.ts +16 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/store.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/transport.d.ts +31 -0
- package/lib/typescript/commonjs/src/modules/next/bluetooth/transport.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/next/data-sync/index.d.ts +9 -0
- package/lib/typescript/commonjs/src/modules/next/data-sync/index.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/auth/hooks/use-sign-in.d.ts +1 -1
- package/lib/typescript/module/src/modules/bt-management/components/android-bluetooth-foreground-service.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/components/bluetooth-device-picker.d.ts +1 -1
- package/lib/typescript/module/src/modules/bt-management/components/bluetooth-device-picker.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/components/bt-provider-child-wrapper.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/components/device-picker-sheet.d.ts +25 -0
- package/lib/typescript/module/src/modules/bt-management/components/device-picker-sheet.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/hooks/runtime-context.d.ts +1 -1
- package/lib/typescript/module/src/modules/bt-management/hooks/runtime-context.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/hooks/use-bluetooth-permission.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/hooks/use-measurements.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/index.d.ts +1 -0
- package/lib/typescript/module/src/modules/bt-management/index.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/bt-manager.d.ts +20 -0
- package/lib/typescript/module/src/modules/bt-management/services/bt-manager.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/custom/define-custom-device.d.ts +2 -1
- package/lib/typescript/module/src/modules/bt-management/services/custom/define-custom-device.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/devices/bt-command-writer.d.ts +3 -1
- package/lib/typescript/module/src/modules/bt-management/services/devices/bt-command-writer.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/devices/bt-connection-handler.d.ts +14 -1
- package/lib/typescript/module/src/modules/bt-management/services/devices/bt-connection-handler.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/devices/bt-current-time.d.ts +11 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/bt-current-time.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/bt-device-information.d.ts +2 -1
- package/lib/typescript/module/src/modules/bt-management/services/devices/bt-device-information.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/devices/bt-managed-device.d.ts +11 -1
- package/lib/typescript/module/src/modules/bt-management/services/devices/bt-managed-device.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/devices/bt-notification-readiness.d.ts +15 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/bt-notification-readiness.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/bt-pairing-retry.d.ts +21 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/bt-pairing-retry.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/custom/custom.device.d.ts +2 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/custom/custom.device.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.blood-pressure-status.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.decorators.d.ts +11 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.decorators.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.devices.d.ts +5 -2
- package/lib/typescript/module/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.devices.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.frame.d.ts +10 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.frame.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.glucose-details.d.ts +7 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.glucose-details.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.glucose-frame.d.ts +16 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.glucose-frame.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.glucose-racp.d.ts +8 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.glucose-racp.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.glucose.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.profile.d.ts +2 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.profile.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/record-cursor.d.ts +21 -0
- package/lib/typescript/module/src/modules/bt-management/services/record-cursor.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/testing/fake-ble-manager.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/types/command-sequencer.d.ts +6 -2
- package/lib/typescript/module/src/modules/bt-management/types/command-sequencer.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/types/create-device-params.d.ts +3 -0
- package/lib/typescript/module/src/modules/bt-management/types/create-device-params.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/types/custom-device-definition.d.ts +14 -1
- package/lib/typescript/module/src/modules/bt-management/types/custom-device-definition.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/types/glucose-record-details.d.ts +33 -0
- package/lib/typescript/module/src/modules/bt-management/types/glucose-record-details.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/types/result-callback.d.ts +2 -0
- package/lib/typescript/module/src/modules/bt-management/types/result-callback.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/types/result-policy.d.ts +6 -0
- package/lib/typescript/module/src/modules/bt-management/types/result-policy.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/utils/bluetooth-permission-list.d.ts +4 -0
- package/lib/typescript/module/src/modules/bt-management/utils/bluetooth-permission-list.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/utils/device-user.d.ts +6 -0
- package/lib/typescript/module/src/modules/bt-management/utils/device-user.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/utils/kpa-to-mmhg.d.ts +4 -0
- package/lib/typescript/module/src/modules/bt-management/utils/kpa-to-mmhg.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/utils/result-identity.d.ts +5 -4
- package/lib/typescript/module/src/modules/bt-management/utils/result-identity.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/utils/rr-interval.d.ts +4 -0
- package/lib/typescript/module/src/modules/bt-management/utils/rr-interval.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/utils/temperature-type.d.ts +7 -0
- package/lib/typescript/module/src/modules/bt-management/utils/temperature-type.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/utils/wait.d.ts +3 -0
- package/lib/typescript/module/src/modules/bt-management/utils/wait.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/data-sync/services/managers/sync-progress-manager.d.ts +1 -1
- package/lib/typescript/module/src/modules/next/background-sync/index.d.ts +10 -0
- package/lib/typescript/module/src/modules/next/background-sync/index.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/next/background-sync/offline-measurement-background-sync.d.ts +22 -0
- package/lib/typescript/module/src/modules/next/background-sync/offline-measurement-background-sync.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/next/bluetooth/auto-connect.d.ts +10 -0
- package/lib/typescript/module/src/modules/next/bluetooth/auto-connect.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/next/bluetooth/ble-plx/ble-errors.d.ts +4 -0
- package/lib/typescript/module/src/modules/next/bluetooth/ble-plx/ble-errors.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/next/bluetooth/ble-plx/ble-link.d.ts +6 -0
- package/lib/typescript/module/src/modules/next/bluetooth/ble-plx/ble-link.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/next/bluetooth/ble-plx/ble-scanner.d.ts +10 -0
- package/lib/typescript/module/src/modules/next/bluetooth/ble-plx/ble-scanner.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/next/bluetooth/ble-plx/built-in-devices.d.ts +6 -0
- package/lib/typescript/module/src/modules/next/bluetooth/ble-plx/built-in-devices.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/next/bluetooth/ble-plx/legacy-driver.d.ts +8 -0
- package/lib/typescript/module/src/modules/next/bluetooth/ble-plx/legacy-driver.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/next/bluetooth/connections.d.ts +25 -0
- package/lib/typescript/module/src/modules/next/bluetooth/connections.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/next/bluetooth/daily-total-day.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/next/bluetooth/devices.d.ts +30 -0
- package/lib/typescript/module/src/modules/next/bluetooth/devices.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/next/bluetooth/driver.d.ts +27 -20
- package/lib/typescript/module/src/modules/next/bluetooth/driver.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/next/bluetooth/errors.d.ts +17 -0
- package/lib/typescript/module/src/modules/next/bluetooth/errors.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/next/bluetooth/index.d.ts +34 -5
- package/lib/typescript/module/src/modules/next/bluetooth/index.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/next/bluetooth/link.d.ts +14 -5
- package/lib/typescript/module/src/modules/next/bluetooth/link.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/next/bluetooth/paired.d.ts +18 -0
- package/lib/typescript/module/src/modules/next/bluetooth/paired.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/next/bluetooth/permissions.d.ts +13 -0
- package/lib/typescript/module/src/modules/next/bluetooth/permissions.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/next/bluetooth/react/bluetooth-device-picker.d.ts +35 -0
- package/lib/typescript/module/src/modules/next/bluetooth/react/bluetooth-device-picker.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/next/bluetooth/react/context.d.ts +30 -0
- package/lib/typescript/module/src/modules/next/bluetooth/react/context.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/next/bluetooth/react/hooks.d.ts +47 -0
- package/lib/typescript/module/src/modules/next/bluetooth/react/hooks.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/next/bluetooth/react-native/create-bluetooth-runtime.d.ts +21 -0
- package/lib/typescript/module/src/modules/next/bluetooth/react-native/create-bluetooth-runtime.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/next/bluetooth/react-native/os-permissions.d.ts +5 -0
- package/lib/typescript/module/src/modules/next/bluetooth/react-native/os-permissions.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/next/bluetooth/react-native/ovok-sink.d.ts +6 -0
- package/lib/typescript/module/src/modules/next/bluetooth/react-native/ovok-sink.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/next/bluetooth/readings.d.ts +21 -0
- package/lib/typescript/module/src/modules/next/bluetooth/readings.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/next/bluetooth/result-policy.d.ts +9 -1
- package/lib/typescript/module/src/modules/next/bluetooth/result-policy.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/next/bluetooth/runtime.d.ts +87 -0
- package/lib/typescript/module/src/modules/next/bluetooth/runtime.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/next/bluetooth/scan-loop.d.ts +23 -0
- package/lib/typescript/module/src/modules/next/bluetooth/scan-loop.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/next/bluetooth/sig-profiles.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/next/bluetooth/sink.d.ts +20 -0
- package/lib/typescript/module/src/modules/next/bluetooth/sink.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/next/bluetooth/snapshot.d.ts +72 -0
- package/lib/typescript/module/src/modules/next/bluetooth/snapshot.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/next/bluetooth/stable-hash.d.ts +6 -0
- package/lib/typescript/module/src/modules/next/bluetooth/stable-hash.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/next/bluetooth/store.d.ts +16 -0
- package/lib/typescript/module/src/modules/next/bluetooth/store.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/next/bluetooth/transport.d.ts +31 -0
- package/lib/typescript/module/src/modules/next/bluetooth/transport.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/next/data-sync/index.d.ts +9 -0
- package/lib/typescript/module/src/modules/next/data-sync/index.d.ts.map +1 -0
- package/package.json +12 -2
- package/lib/commonjs/modules/bt-management/utils/daily-total-day.js.map +0 -1
- package/lib/commonjs/modules/next/bluetooth/drivers.js +0 -20
- package/lib/commonjs/modules/next/bluetooth/drivers.js.map +0 -1
- package/lib/commonjs/modules/next/bluetooth/legacy-driver.js +0 -55
- package/lib/commonjs/modules/next/bluetooth/legacy-driver.js.map +0 -1
- package/lib/module/modules/bt-management/utils/daily-total-day.js.map +0 -1
- package/lib/module/modules/next/bluetooth/drivers.js +0 -17
- package/lib/module/modules/next/bluetooth/drivers.js.map +0 -1
- package/lib/module/modules/next/bluetooth/legacy-driver.js +0 -51
- package/lib/module/modules/next/bluetooth/legacy-driver.js.map +0 -1
- package/lib/typescript/commonjs/src/modules/bt-management/utils/daily-total-day.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/modules/next/bluetooth/drivers.d.ts +0 -7
- package/lib/typescript/commonjs/src/modules/next/bluetooth/drivers.d.ts.map +0 -1
- package/lib/typescript/commonjs/src/modules/next/bluetooth/legacy-driver.d.ts +0 -8
- package/lib/typescript/commonjs/src/modules/next/bluetooth/legacy-driver.d.ts.map +0 -1
- package/lib/typescript/module/src/modules/bt-management/utils/daily-total-day.d.ts.map +0 -1
- package/lib/typescript/module/src/modules/next/bluetooth/drivers.d.ts +0 -7
- package/lib/typescript/module/src/modules/next/bluetooth/drivers.d.ts.map +0 -1
- package/lib/typescript/module/src/modules/next/bluetooth/legacy-driver.d.ts +0 -8
- package/lib/typescript/module/src/modules/next/bluetooth/legacy-driver.d.ts.map +0 -1
- /package/lib/commonjs/modules/{bt-management/utils → next/bluetooth}/daily-total-day.js +0 -0
- /package/lib/module/modules/{bt-management/utils → next/bluetooth}/daily-total-day.js +0 -0
- /package/lib/typescript/commonjs/src/modules/{bt-management/utils → next/bluetooth}/daily-total-day.d.ts +0 -0
- /package/lib/typescript/module/src/modules/{bt-management/utils → next/bluetooth}/daily-total-day.d.ts +0 -0
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { BluetoothError } from "./errors.js";
|
|
4
|
+
const KEPT_READINGS = 100;
|
|
5
|
+
|
|
6
|
+
/** How many recent reading IDs a resend is checked against. */
|
|
7
|
+
const RECOGNISED_READINGS = 1_000;
|
|
8
|
+
const saveFailed = error => new BluetoothError("save-failed", error instanceof Error ? error.message : String(error), error);
|
|
9
|
+
|
|
10
|
+
/** Keeps the recent readings, each resend once, and saves every new one through the sink. */
|
|
11
|
+
class ReadingLog {
|
|
12
|
+
recent = new Set();
|
|
13
|
+
sequence = 0;
|
|
14
|
+
constructor(store, sink) {
|
|
15
|
+
this.store = store;
|
|
16
|
+
this.sink = sink;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/** `id` is `null` for a reading that cannot be recognised when resent. */
|
|
20
|
+
receive(device, id, measurement) {
|
|
21
|
+
if (id !== null && !this.remember(id)) {
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
const receivedAt = new Date();
|
|
25
|
+
const reading = {
|
|
26
|
+
id: id ?? `${device.id}:${receivedAt.getTime()}:${this.sequence += 1}`,
|
|
27
|
+
device: {
|
|
28
|
+
id: device.id,
|
|
29
|
+
key: device.key,
|
|
30
|
+
name: device.name,
|
|
31
|
+
information: device.information
|
|
32
|
+
},
|
|
33
|
+
measurement,
|
|
34
|
+
receivedAt,
|
|
35
|
+
save: {
|
|
36
|
+
status: "saving"
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
this.store.set({
|
|
40
|
+
readings: [...this.store.get().readings, reading].slice(-KEPT_READINGS)
|
|
41
|
+
});
|
|
42
|
+
void this.save(reading);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/** Saves the readings whose save failed again and flushes the sink's offline queue. */
|
|
46
|
+
async retrySaves() {
|
|
47
|
+
const failed = this.store.get().readings.filter(({
|
|
48
|
+
save
|
|
49
|
+
}) => save.status === "failed");
|
|
50
|
+
this.store.updateReadings(reading => failed.includes(reading) ? {
|
|
51
|
+
...reading,
|
|
52
|
+
save: {
|
|
53
|
+
status: "saving"
|
|
54
|
+
}
|
|
55
|
+
} : reading);
|
|
56
|
+
await Promise.all(failed.map(reading => this.save(reading)));
|
|
57
|
+
const flushed = new Set(await this.sink.flushQueued());
|
|
58
|
+
this.store.updateReadings(reading => reading.save.status === "queued" && flushed.has(reading.save.queueId) ? {
|
|
59
|
+
...reading,
|
|
60
|
+
save: {
|
|
61
|
+
status: "saved"
|
|
62
|
+
}
|
|
63
|
+
} : reading);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/** Records `id`; false when it is a resend of a recent reading. */
|
|
67
|
+
remember(id) {
|
|
68
|
+
if (this.recent.has(id)) {
|
|
69
|
+
return false;
|
|
70
|
+
}
|
|
71
|
+
this.recent.add(id);
|
|
72
|
+
if (this.recent.size > RECOGNISED_READINGS) {
|
|
73
|
+
this.recent.delete(this.recent.values().next().value);
|
|
74
|
+
}
|
|
75
|
+
return true;
|
|
76
|
+
}
|
|
77
|
+
async save(reading) {
|
|
78
|
+
const save = await this.sink.save(reading).then(result => result, error => ({
|
|
79
|
+
status: "failed",
|
|
80
|
+
error: saveFailed(error)
|
|
81
|
+
}));
|
|
82
|
+
this.store.updateReadings(current => current.id === reading.id ? {
|
|
83
|
+
...current,
|
|
84
|
+
save
|
|
85
|
+
} : current);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
export { ReadingLog };
|
|
89
|
+
//# sourceMappingURL=readings.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["BluetoothError","KEPT_READINGS","RECOGNISED_READINGS","saveFailed","error","Error","message","String","ReadingLog","recent","Set","sequence","constructor","store","sink","receive","device","id","measurement","remember","receivedAt","Date","reading","getTime","key","name","information","save","status","set","readings","get","slice","retrySaves","failed","filter","updateReadings","includes","Promise","all","map","flushed","flushQueued","has","queueId","add","size","delete","values","next","value","then","result","current"],"sourceRoot":"../../../../../src","sources":["modules/next/bluetooth/readings.ts"],"mappings":";;AAEA,SAASA,cAAc,QAAQ,aAAU;AAKzC,MAAMC,aAAa,GAAG,GAAG;;AAEzB;AACA,MAAMC,mBAAmB,GAAG,KAAK;AAEjC,MAAMC,UAAU,GAAIC,KAAc,IAChC,IAAIJ,cAAc,CAAC,aAAa,EAAEI,KAAK,YAAYC,KAAK,GAAGD,KAAK,CAACE,OAAO,GAAGC,MAAM,CAACH,KAAK,CAAC,EAAEA,KAAK,CAAC;;AAElG;AACA,MAAMI,UAAU,CAAC;EACEC,MAAM,GAAG,IAAIC,GAAG,CAAS,CAAC;EACnCC,QAAQ,GAAG,CAAC;EAEbC,WAAWA,CAAkBC,KAAoB,EAAmBC,IAAiB,EAAE;IAAA,KAA1DD,KAAoB,GAApBA,KAAoB;IAAA,KAAmBC,IAAiB,GAAjBA,IAAiB;EAAG;;EAE/F;EACOC,OAAOA,CAACC,MAAoB,EAAEC,EAAiB,EAAEC,WAAwB,EAAQ;IACtF,IAAID,EAAE,KAAK,IAAI,IAAI,CAAC,IAAI,CAACE,QAAQ,CAACF,EAAE,CAAC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AE,GAAG;MAAE,GAAGoC,OAAO;MAAE1B;IAAK,CAAC,GAAG0B,OAAQ,CAAC;EACtG;AACF;AAEA,SAAS7C,UAAU","ignoreList":[]}
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { isFromAcceptedMemorySlot } from "../../bt-management/utils/device-user.js";
|
|
4
|
+
import { dailyTotalDay } from "./daily-total-day.js";
|
|
4
5
|
|
|
5
6
|
/** Makes, for each connection, the test of which readings to keep. */
|
|
6
7
|
|
|
8
|
+
/** Keeps every reading. */
|
|
7
9
|
const everyReading = () => () => true;
|
|
10
|
+
|
|
11
|
+
/** Keeps the first reading of each measurement type per connection. */
|
|
8
12
|
const firstReadingPerKind = () => {
|
|
9
13
|
const reported = new Set();
|
|
10
14
|
return ({
|
|
@@ -34,6 +38,14 @@ const dailyTotalsOnly = () => {
|
|
|
34
38
|
return true;
|
|
35
39
|
};
|
|
36
40
|
};
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Keeps the readings of the device users in `slots` (a multi-user device reports its user as `memorySlot`, starting at
|
|
44
|
+
* 1), and drops the others. A reading that names no device user is kept.
|
|
45
|
+
*/
|
|
46
|
+
const acceptedMemorySlots = slots => () => reading => isFromAcceptedMemorySlot(reading, slots);
|
|
47
|
+
|
|
48
|
+
/** Applies a policy per measurement type, and `fallback` to the other types. */
|
|
37
49
|
const policyByKind = (policies, fallback = everyReading) => () => {
|
|
38
50
|
const tests = new Map();
|
|
39
51
|
const fallbackTest = fallback();
|
|
@@ -57,5 +69,5 @@ async function* keepReadings(events, policy) {
|
|
|
57
69
|
}
|
|
58
70
|
}
|
|
59
71
|
}
|
|
60
|
-
export { dailyTotalsOnly, everyReading, firstReadingPerKind, keepReadings, policyByKind };
|
|
72
|
+
export { acceptedMemorySlots, dailyTotalsOnly, everyReading, firstReadingPerKind, keepReadings, policyByKind };
|
|
61
73
|
//# sourceMappingURL=result-policy.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["dailyTotalDay","everyReading","firstReadingPerKind","reported","Set","measurementTypeKey","has","add","dailyTotalsOnly","reading","day","Date","now","undefined","key","policyByKind","policies","fallback","tests","Map","fallbackTest","policy","test","get","set","keepReadings","events","keep","event","kind"],"sourceRoot":"../../../../../src","sources":["modules/next/bluetooth/result-policy.ts"],"mappings":";;AAEA,SAASA,aAAa,QAAQ,
|
|
1
|
+
{"version":3,"names":["isFromAcceptedMemorySlot","dailyTotalDay","everyReading","firstReadingPerKind","reported","Set","measurementTypeKey","has","add","dailyTotalsOnly","reading","day","Date","now","undefined","key","acceptedMemorySlots","slots","policyByKind","policies","fallback","tests","Map","fallbackTest","policy","test","get","set","keepReadings","events","keep","event","kind"],"sourceRoot":"../../../../../src","sources":["modules/next/bluetooth/result-policy.ts"],"mappings":";;AAEA,SAASA,wBAAwB,QAAQ,0CAAuC;AAEhF,SAASC,aAAa,QAAQ,sBAAmB;;AAGjD;;AAGA;AACA,MAAMC,YAA0B,GAAGA,CAAA,KAAM,MAAM,IAAI;;AAEnD;AACA,MAAMC,mBAAiC,GAAGA,CAAA,KAAM;EAC9C,MAAMC,QAAQ,GAAG,IAAIC,GAAG,CAAqB,CAAC;EAE9C,OAAO,CAAC;IAAEC;EAAmB,CAAC,KAAK;IACjC,IAAIF,QAAQ,CAACG,GAAG,CAACD,kBAAkB,CAAC,EAAE;MACpC,OAAO,KAAK;IACd;IAEAF,QAAQ,CAACI,GAAG,CAACF,kBAAkB,CAAC;IAEhC,OAAO,IAAI;EACb,CAAC;AACH,CAAC;;AAED;AACA,MAAMG,eAA6B,GAAGA,CAAA,KAAM;EAC1C,MAAML,QAAQ,GAAG,IAAIC,GAAG,CAAS,CAAC;EAElC,OAAQK,OAAO,IAAK;IAClB,MAAMC,GAAG,GAAGV,aAAa,CAACS,OAAO,EAAEE,IAAI,CAACC,GAAG,CAAC,CAAC,CAAC;IAE9C,IAAIF,GAAG,KAAKG,SA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I,CAACC,KAAK,CAACrB,OAAO,CAAC,EAAE;MACnD,MAAMqB,KAAK;IACb;EACF;AACF;AAEA,SAASf,mBAAmB,EAAEP,eAAe,EAAEP,YAAY,EAAEC,mBAAmB,EAAEyB,YAAY,EAAEV,YAAY","ignoreList":[]}
|
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { AutoConnectBackoff } from "./auto-connect.js";
|
|
4
|
+
import { Connections } from "./connections.js";
|
|
5
|
+
import { matchDevice } from "./devices.js";
|
|
6
|
+
import { BluetoothError } from "./errors.js";
|
|
7
|
+
import { PairedDevices } from "./paired.js";
|
|
8
|
+
import { ReadingLog } from "./readings.js";
|
|
9
|
+
import { everyReading } from "./result-policy.js";
|
|
10
|
+
import { ScanLoop } from "./scan-loop.js";
|
|
11
|
+
import { SnapshotStore } from "./store.js";
|
|
12
|
+
|
|
13
|
+
/** What a `BluetoothRuntime` is built from. */
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Scans for supported devices, connects to them, collects their readings and saves each one. Framework-free: React
|
|
17
|
+
* hooks and components sit on top of it. Every failure is a `BluetoothError`. Call `dispose()` when done.
|
|
18
|
+
*/
|
|
19
|
+
class BluetoothRuntime {
|
|
20
|
+
store = new SnapshotStore();
|
|
21
|
+
known = new Map();
|
|
22
|
+
held = new Set();
|
|
23
|
+
backoff = new AutoConnectBackoff();
|
|
24
|
+
retryTimers = new Set();
|
|
25
|
+
scanRequest = 0;
|
|
26
|
+
disposed = false;
|
|
27
|
+
constructor(options) {
|
|
28
|
+
this.options = options;
|
|
29
|
+
this.readings = new ReadingLog(this.store, options.sink);
|
|
30
|
+
this.connections = new Connections(this.store, this.readings, options.resultPolicy ?? everyReading, id => this.connectionEnded(id));
|
|
31
|
+
this.paired = new PairedDevices(paired => this.store.set({
|
|
32
|
+
paired
|
|
33
|
+
}), options.pairedStorage);
|
|
34
|
+
this.scan = new ScanLoop(options.scanner, this.store, peripheral => this.found(peripheral));
|
|
35
|
+
this.unwatchAdapter = options.scanner.watchState(adapter => {
|
|
36
|
+
this.store.set({
|
|
37
|
+
adapter
|
|
38
|
+
});
|
|
39
|
+
this.scan.sync();
|
|
40
|
+
});
|
|
41
|
+
void this.checkPermission().catch(() => undefined);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/** The current state. */
|
|
45
|
+
getSnapshot = () => this.store.get();
|
|
46
|
+
|
|
47
|
+
/** Calls `listener` after every state change; returns the unsubscribe. */
|
|
48
|
+
subscribe = listener => this.store.subscribe(listener);
|
|
49
|
+
|
|
50
|
+
/** Reads the permission without prompting. */
|
|
51
|
+
async checkPermission() {
|
|
52
|
+
return this.recordPermission(await this.options.permissions.check());
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/** Prompts for the permission when the OS still can. */
|
|
56
|
+
async requestPermission() {
|
|
57
|
+
return this.recordPermission(await this.options.permissions.request());
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/** Opens the app's system settings, where a blocked permission can be granted. */
|
|
61
|
+
openPermissionSettings() {
|
|
62
|
+
return this.options.permissions.openSettings();
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Asks for permission when needed, then scans whenever the adapter is on, until `stopScan`.
|
|
67
|
+
*
|
|
68
|
+
* @throws BluetoothError `permission-denied` when permission is not granted; `runtime-disposed` after `dispose`.
|
|
69
|
+
*/
|
|
70
|
+
async startScan() {
|
|
71
|
+
this.assertLive();
|
|
72
|
+
const request = ++this.scanRequest;
|
|
73
|
+
const permission = this.store.get().permission === "granted" ? "granted" : await this.requestPermission();
|
|
74
|
+
if (permission !== "granted") {
|
|
75
|
+
throw new BluetoothError("permission-denied", "Bluetooth permission is not granted");
|
|
76
|
+
}
|
|
77
|
+
if (request === this.scanRequest && !this.disposed) {
|
|
78
|
+
this.store.set({
|
|
79
|
+
scanning: true
|
|
80
|
+
});
|
|
81
|
+
this.scan.sync();
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/** Stops scanning; connected devices stay connected. */
|
|
86
|
+
stopScan() {
|
|
87
|
+
this.scanRequest += 1;
|
|
88
|
+
this.store.set({
|
|
89
|
+
scanning: false
|
|
90
|
+
});
|
|
91
|
+
this.scan.sync();
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Connects to a found device for this session; resolves once connected.
|
|
96
|
+
*
|
|
97
|
+
* @throws BluetoothError `device-not-found`, `connection-failed` or the driver's failure.
|
|
98
|
+
*/
|
|
99
|
+
async connect(deviceId) {
|
|
100
|
+
this.assertLive();
|
|
101
|
+
const {
|
|
102
|
+
peripheral,
|
|
103
|
+
match
|
|
104
|
+
} = this.require(deviceId);
|
|
105
|
+
this.held.delete(deviceId);
|
|
106
|
+
await this.connections.connect(peripheral, match.driver);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/** Disconnects a device; a paired one stays disconnected until `connect` or `pair` is called again. */
|
|
110
|
+
async disconnect(deviceId) {
|
|
111
|
+
this.held.add(deviceId);
|
|
112
|
+
await this.connections.disconnect(deviceId);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/** Remembers a device, so it connects whenever the scan finds it, and connects to it now. */
|
|
116
|
+
async pair(deviceId) {
|
|
117
|
+
this.require(deviceId);
|
|
118
|
+
await this.paired.add(deviceId);
|
|
119
|
+
await this.connect(deviceId);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
/** Forgets a paired device and disconnects it. */
|
|
123
|
+
async forget(deviceId) {
|
|
124
|
+
await this.paired.remove(deviceId);
|
|
125
|
+
await this.disconnect(deviceId);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
/** Saves the readings whose save failed again, and the readings the sink queued offline. */
|
|
129
|
+
retrySaves() {
|
|
130
|
+
return this.readings.retrySaves();
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
/** Stops scanning and disconnects every device; resolves once they have disconnected, after which nothing changes. */
|
|
134
|
+
async dispose() {
|
|
135
|
+
if (this.disposed) {
|
|
136
|
+
return;
|
|
137
|
+
}
|
|
138
|
+
this.stopScan();
|
|
139
|
+
this.disposed = true;
|
|
140
|
+
this.scan.close();
|
|
141
|
+
this.unwatchAdapter();
|
|
142
|
+
this.retryTimers.forEach(clearTimeout);
|
|
143
|
+
await this.connections.disconnectAll();
|
|
144
|
+
this.store.close();
|
|
145
|
+
}
|
|
146
|
+
recordPermission(permission) {
|
|
147
|
+
this.store.set({
|
|
148
|
+
permission
|
|
149
|
+
});
|
|
150
|
+
return permission;
|
|
151
|
+
}
|
|
152
|
+
found(peripheral) {
|
|
153
|
+
const known = this.known.get(peripheral.id);
|
|
154
|
+
const match = known?.match ?? matchDevice(this.options.devices, peripheral.advertisement);
|
|
155
|
+
if (!match) {
|
|
156
|
+
return;
|
|
157
|
+
}
|
|
158
|
+
this.known.set(peripheral.id, {
|
|
159
|
+
peripheral,
|
|
160
|
+
match
|
|
161
|
+
});
|
|
162
|
+
if (!known) {
|
|
163
|
+
const device = {
|
|
164
|
+
id: peripheral.id,
|
|
165
|
+
key: match.key,
|
|
166
|
+
name: peripheral.advertisement.name
|
|
167
|
+
};
|
|
168
|
+
this.store.set({
|
|
169
|
+
devices: [...this.store.get().devices, {
|
|
170
|
+
...device,
|
|
171
|
+
connection: "idle",
|
|
172
|
+
error: null
|
|
173
|
+
}]
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
this.connectIfPaired(peripheral.id);
|
|
177
|
+
}
|
|
178
|
+
connectIfPaired(id) {
|
|
179
|
+
const waiting = this.held.has(id) || this.connections.isActive(id) || !this.backoff.allows(id);
|
|
180
|
+
if (this.paired.has(id) && !waiting) {
|
|
181
|
+
this.connect(id).catch(() => undefined);
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
/** A scan reports a peripheral once, so a paired device is only found again by a fresh scan. */
|
|
186
|
+
connectionEnded(id) {
|
|
187
|
+
if (!this.paired.has(id) || this.held.has(id) || this.disposed) {
|
|
188
|
+
return;
|
|
189
|
+
}
|
|
190
|
+
if (this.store.device(id)?.connection !== "failed") {
|
|
191
|
+
this.backoff.succeeded(id);
|
|
192
|
+
this.restartScan();
|
|
193
|
+
return;
|
|
194
|
+
}
|
|
195
|
+
const timer = setTimeout(() => {
|
|
196
|
+
this.retryTimers.delete(timer);
|
|
197
|
+
this.restartScan();
|
|
198
|
+
}, this.backoff.failed(id));
|
|
199
|
+
this.retryTimers.add(timer);
|
|
200
|
+
}
|
|
201
|
+
restartScan() {
|
|
202
|
+
if (this.scan.running) {
|
|
203
|
+
this.scan.restart();
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
require(deviceId) {
|
|
207
|
+
const device = this.known.get(deviceId);
|
|
208
|
+
if (!device) {
|
|
209
|
+
throw new BluetoothError("device-not-found", `No device ${deviceId} was found by the scan`);
|
|
210
|
+
}
|
|
211
|
+
return device;
|
|
212
|
+
}
|
|
213
|
+
assertLive() {
|
|
214
|
+
if (this.disposed) {
|
|
215
|
+
throw new BluetoothError("runtime-disposed", "This BluetoothRuntime was disposed");
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
export { BluetoothRuntime };
|
|
220
|
+
//# sourceMappingURL=runtime.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["AutoConnectBackoff","Connections","matchDevice","BluetoothError","PairedDevices","ReadingLog","everyReading","ScanLoop","SnapshotStore","BluetoothRuntime","store","known","Map","held","Set","backoff","retryTimers","scanRequest","disposed","constructor","options","readings","sink","connections","resultPolicy","id","connectionEnded","paired","set","pairedStorage","scan","scanner","peripheral","found","unwatchAdapter","watchState","adapter","sync","checkPermission","catch","undefined","getSnapshot","get","subscribe","listener","recordPermission","permissions","check","requestPermission","request","openPermissionSettings","openSettings","startScan","assertLive","permission","scanning","stopScan","connect","deviceId","match","require","delete","driver","disconnect","add","pair","forget","remove","retrySaves","dispose","close","forEach","clearTimeout","disconnectAll","devices","advertisement","device","key","name","connection","error","connectIfPaired","waiting","has","isActive","allows","succeeded","restartScan","timer","setTimeout","failed","running","restart"],"sourceRoot":"../../../../../src","sources":["modules/next/bluetooth/runtime.ts"],"mappings":";;AAEA,SAASA,kBAAkB,QAAQ,mBAAgB;AACnD,SAASC,WAAW,QAAQ,kBAAe;AAC3C,SAAqCC,WAAW,QAAQ,cAAW;AACnE,SAASC,cAAc,QAAQ,aAAU;AACzC,SAASC,aAAa,QAAQ,aAAU;AAExC,SAASC,UAAU,QAAQ,eAAY;AACvC,SAASC,YAAY,QAAsB,oBAAiB;AAC5D,SAASC,QAAQ,QAAQ,gBAAa;AAGtC,SAASC,aAAa,QAAQ,YAAS;;AAGvC;;AAwBA;AACA;AACA;AACA;AACA,MAAMC,gBAAgB,CAAC;EACJC,KAAK,GAAG,IAAIF,aAAa,CAAC,CAAC;EAC3BG,KAAK,GAAG,IAAIC,GAAG,CAAsB,CAAC;EACtCC,IAAI,GAAG,IAAIC,GAAG,CAAS,CAAC;EACxBC,OAAO,GAAG,IAAIf,kBAAkB,CAAC,CAAC;EAClCgB,WAAW,GAAG,IAAIF,GAAG,CAAgC,CAAC;EAM/DG,WAAW,GAAG,CAAC;EACfC,QAAQ,GAAG,KAAK;EAEjBC,WAAWA,CAAkBC,OAAgC,EAAE;IAAA,KAAlCA,OAAgC,GAAhCA,OAAgC;IAClE,IAAI,CAACC,QAAQ,GAAG,IAAIhB,UAAU,CAAC,IAAI,CAACK,KAAK,EAAEU,OAAO,CAACE,IAAI,CAAC;IACxD,IAAI,CAACC,WAAW,GAAG,IAAItB,WAAW,CAAC,IAAI,CAACS,KAAK,EAAE,IAAI,CAACW,QAAQ,EAAED,OAAO,CAACI,YAAY,IAAIlB,YAAY,EAAGmB,EAAE,IACrG,IAAI,CAACC,eAAe,CAACD,EAAE,CAAC,CAAC;IAC3B,IAAI,CAACE,MAAM,GAAG,IAAIvB,aAAa,CAAEuB,MAAM,IAAK,IAAI,CAAC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AASM,gBAAgB","ignoreList":[]}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
const SCAN_RETRY_DELAY_MS = 1_000;
|
|
4
|
+
|
|
5
|
+
/** Runs the scanner while a scan is requested and the adapter is on, retrying after a scan error. */
|
|
6
|
+
class ScanLoop {
|
|
7
|
+
closed = false;
|
|
8
|
+
constructor(scanner, store, onFound) {
|
|
9
|
+
this.scanner = scanner;
|
|
10
|
+
this.store = store;
|
|
11
|
+
this.onFound = onFound;
|
|
12
|
+
}
|
|
13
|
+
get running() {
|
|
14
|
+
return this.stop !== undefined;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/** Starts or stops the scanner to match the snapshot. */
|
|
18
|
+
sync() {
|
|
19
|
+
const {
|
|
20
|
+
scanning,
|
|
21
|
+
adapter
|
|
22
|
+
} = this.store.get();
|
|
23
|
+
const shouldScan = scanning && adapter === "on" && !this.closed;
|
|
24
|
+
if (shouldScan && !this.stop && !this.retry) {
|
|
25
|
+
this.start();
|
|
26
|
+
} else if (!shouldScan) {
|
|
27
|
+
this.halt();
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
restart() {
|
|
31
|
+
this.halt();
|
|
32
|
+
this.sync();
|
|
33
|
+
}
|
|
34
|
+
close() {
|
|
35
|
+
this.closed = true;
|
|
36
|
+
this.halt();
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/** A scan can fail before `scan` returns its stop, so the stop is only kept for a scan still running. */
|
|
40
|
+
start() {
|
|
41
|
+
const scan = {
|
|
42
|
+
failed: false
|
|
43
|
+
};
|
|
44
|
+
const stop = this.scanner.scan(this.onFound, error => {
|
|
45
|
+
if (scan.stop === this.stop) {
|
|
46
|
+
scan.failed = true;
|
|
47
|
+
this.failed(error);
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
if (scan.failed) {
|
|
51
|
+
stop();
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
scan.stop = stop;
|
|
55
|
+
this.stop = stop;
|
|
56
|
+
this.store.set({
|
|
57
|
+
scanError: null
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
failed(error) {
|
|
61
|
+
this.store.set({
|
|
62
|
+
scanError: error
|
|
63
|
+
});
|
|
64
|
+
this.halt();
|
|
65
|
+
this.retry = setTimeout(() => {
|
|
66
|
+
this.retry = undefined;
|
|
67
|
+
this.sync();
|
|
68
|
+
}, SCAN_RETRY_DELAY_MS);
|
|
69
|
+
}
|
|
70
|
+
halt() {
|
|
71
|
+
clearTimeout(this.retry);
|
|
72
|
+
this.retry = undefined;
|
|
73
|
+
this.stop?.();
|
|
74
|
+
this.stop = undefined;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
export { ScanLoop };
|
|
78
|
+
//# sourceMappingURL=scan-loop.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["SCAN_RETRY_DELAY_MS","ScanLoop","closed","constructor","scanner","store","onFound","running","stop","undefined","sync","scanning","adapter","get","shouldScan","retry","start","halt","restart","close","scan","failed","error","set","scanError","setTimeout","clearTimeout"],"sourceRoot":"../../../../../src","sources":["modules/next/bluetooth/scan-loop.ts"],"mappings":";;AAIA,MAAMA,mBAAmB,GAAG,KAAK;;AAEjC;AACA,MAAMC,QAAQ,CAAC;EAGLC,MAAM,GAAG,KAAK;EAEfC,WAAWA,CACCC,OAAyB,EACzBC,KAAoB,EACpBC,OAAyC,EAC1D;IAAA,KAHiBF,OAAyB,GAAzBA,OAAyB;IAAA,KACzBC,KAAoB,GAApBA,KAAoB;IAAA,KACpBC,OAAyC,GAAzCA,OAAyC;EACzD;EAEH,IAAWC,OAAOA,CAAA,EAAY;IAC5B,OAAO,IAAI,CAACC,IAAI,KAAKC,SAAS;EAChC;;EAEA;EACOC,IAAIA,CAAA,EAAS;IAClB,MAAM;MAAEC,QAAQ;MAAEC;IAAQ,CAAC,GAAG,IAAI,CAACP,KAAK,CAACQ,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C,CAAC;IACpC,IAAI,CAACL,IAAI,CAAC,CAAC;IACX,IAAI,CAACF,KAAK,GAAGU,UAAU,CAAC,MAAM;MAC5B,IAAI,CAACV,KAAK,GAAGN,SAAS;MACtB,IAAI,CAACC,IAAI,CAAC,CAAC;IACb,CAAC,EAAEV,mBAAmB,CAAC;EACzB;EAEQiB,IAAIA,CAAA,EAAS;IACnBS,YAAY,CAAC,IAAI,CAACX,KAAK,CAAC;IACxB,IAAI,CAACA,KAAK,GAAGN,SAAS;IACtB,IAAI,CAACD,IAAI,GAAG,CAAC;IACb,IAAI,CAACA,IAAI,GAAGC,SAAS;EACvB;AACF;AAEA,SAASR,QAAQ","ignoreList":[]}
|
|
@@ -2,9 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
import { MeasurementTypeKey } from "@ovok/core/next";
|
|
4
4
|
import { BloodPressureStates } from "../../bt-management/types/blood-pressure-states.js";
|
|
5
|
+
import { memorySlotForDeviceUser } from "../../bt-management/utils/device-user.js";
|
|
6
|
+
import { KPA_TO_MMHG } from "../../bt-management/utils/kpa-to-mmhg.js";
|
|
7
|
+
import { rrIntervalMilliseconds } from "../../bt-management/utils/rr-interval.js";
|
|
5
8
|
import { sigUuid } from "../../bt-management/utils/sig-uuid.js";
|
|
9
|
+
import { temperatureTypeFromCode } from "../../bt-management/utils/temperature-type.js";
|
|
6
10
|
import { dateTimeAt, decodeFrame, floatAt, roundTo, sfloatAt, withDefined } from "./sig-values.js";
|
|
7
|
-
const KPA_TO_MMHG = 7.50062;
|
|
8
11
|
const KG_PER_SI_COUNT = 0.005;
|
|
9
12
|
const KG_PER_IMPERIAL_COUNT = 0.01 * 0.45359237;
|
|
10
13
|
const WEIGHT_UNSUCCESSFUL = 0xffff;
|
|
@@ -19,15 +22,29 @@ const BP_LOOSE_CUFF = 0x02;
|
|
|
19
22
|
const BP_IRREGULAR_PULSE = 0x04;
|
|
20
23
|
const TEMPERATURE_FAHRENHEIT = 0x01;
|
|
21
24
|
const TEMPERATURE_TIMESTAMP = 0x02;
|
|
25
|
+
const TEMPERATURE_TYPE = 0x04;
|
|
26
|
+
const TEMPERATURE_TIMESTAMP_OFFSET = 5;
|
|
22
27
|
const WEIGHT_IMPERIAL = 0x01;
|
|
23
28
|
const WEIGHT_TIMESTAMP = 0x02;
|
|
29
|
+
const WEIGHT_USER = 0x04;
|
|
30
|
+
const WEIGHT_TIMESTAMP_OFFSET = 3;
|
|
24
31
|
const PLX_TIMESTAMP = 0x01;
|
|
25
32
|
const HEART_RATE_UINT16 = 0x01;
|
|
26
33
|
const HEART_RATE_CONTACT_BITS = 0x06;
|
|
27
34
|
const HEART_RATE_NO_CONTACT = 0x04;
|
|
35
|
+
const HEART_RATE_ENERGY_EXPENDED = 0x08;
|
|
36
|
+
const HEART_RATE_RR_INTERVALS = 0x10;
|
|
37
|
+
const UINT8_BYTES = 1;
|
|
38
|
+
const UINT16_BYTES = 2;
|
|
28
39
|
|
|
29
40
|
/** Core does not export its status enum; this one has the same values. */
|
|
30
41
|
|
|
42
|
+
/** Core's temperature has no body site, so it rides along on the reading as `memorySlot` does on blood pressure. */
|
|
43
|
+
|
|
44
|
+
/** The device user, carried the way blood pressure carries it. */
|
|
45
|
+
|
|
46
|
+
/** Core's heart rate has no RR intervals, so they ride along on the reading, in milliseconds. */
|
|
47
|
+
|
|
31
48
|
const bloodPressureStatus = status => {
|
|
32
49
|
if (status & BP_BODY_MOVEMENT) {
|
|
33
50
|
return BloodPressureStates.DISTURB_DETECTED;
|
|
@@ -48,8 +65,7 @@ const bloodPressureExtras = (view, flags) => {
|
|
|
48
65
|
offset += 2;
|
|
49
66
|
}
|
|
50
67
|
if (flags & BP_USER) {
|
|
51
|
-
|
|
52
|
-
extras.memorySlot = user < 2 ? user + 1 : undefined;
|
|
68
|
+
extras.memorySlot = memorySlotForDeviceUser(view.getUint8(offset));
|
|
53
69
|
offset += 1;
|
|
54
70
|
}
|
|
55
71
|
if (flags & BP_STATUS) {
|
|
@@ -86,13 +102,16 @@ const temperature = view => {
|
|
|
86
102
|
if (value === undefined) {
|
|
87
103
|
return undefined;
|
|
88
104
|
}
|
|
105
|
+
const hasTimestamp = Boolean(flags & TEMPERATURE_TIMESTAMP);
|
|
106
|
+
const typeOffset = TEMPERATURE_TIMESTAMP_OFFSET + (hasTimestamp ? DATE_TIME_BYTES : 0);
|
|
89
107
|
const reading = {
|
|
90
108
|
measurementTypeKey: MeasurementTypeKey.temperature,
|
|
91
109
|
bodyTemp: flags & TEMPERATURE_FAHRENHEIT ? roundTo((value - 32) * 5 / 9, 2) : value
|
|
92
110
|
};
|
|
93
|
-
return
|
|
94
|
-
recordedAt: dateTimeAt(view,
|
|
95
|
-
|
|
111
|
+
return withDefined(reading, {
|
|
112
|
+
recordedAt: hasTimestamp ? dateTimeAt(view, TEMPERATURE_TIMESTAMP_OFFSET) : undefined,
|
|
113
|
+
temperatureType: flags & TEMPERATURE_TYPE ? temperatureTypeFromCode(view.getUint8(typeOffset)) : undefined
|
|
114
|
+
});
|
|
96
115
|
};
|
|
97
116
|
|
|
98
117
|
/** Weight Measurement 0x2A9D, in kilograms. */
|
|
@@ -102,13 +121,16 @@ const bodyWeight = view => {
|
|
|
102
121
|
if (counts === WEIGHT_UNSUCCESSFUL) {
|
|
103
122
|
return undefined;
|
|
104
123
|
}
|
|
124
|
+
const hasTimestamp = Boolean(flags & WEIGHT_TIMESTAMP);
|
|
125
|
+
const userOffset = WEIGHT_TIMESTAMP_OFFSET + (hasTimestamp ? DATE_TIME_BYTES : 0);
|
|
105
126
|
const reading = {
|
|
106
127
|
measurementTypeKey: MeasurementTypeKey.bodyWeight,
|
|
107
128
|
bodyWeight: roundTo(counts * (flags & WEIGHT_IMPERIAL ? KG_PER_IMPERIAL_COUNT : KG_PER_SI_COUNT), 3)
|
|
108
129
|
};
|
|
109
|
-
return
|
|
110
|
-
recordedAt: dateTimeAt(view,
|
|
111
|
-
|
|
130
|
+
return withDefined(reading, {
|
|
131
|
+
recordedAt: hasTimestamp ? dateTimeAt(view, WEIGHT_TIMESTAMP_OFFSET) : undefined,
|
|
132
|
+
memorySlot: flags & WEIGHT_USER ? memorySlotForDeviceUser(view.getUint8(userOffset)) : undefined
|
|
133
|
+
});
|
|
112
134
|
};
|
|
113
135
|
|
|
114
136
|
/** PLX Spot-Check Measurement 0x2A5E. */
|
|
@@ -129,17 +151,28 @@ const pulseOximetry = view => {
|
|
|
129
151
|
}) : reading;
|
|
130
152
|
};
|
|
131
153
|
|
|
154
|
+
/** The RR intervals from `offset` to the end of the frame, in milliseconds. */
|
|
155
|
+
const rrIntervalsFrom = (view, offset) => Array.from({
|
|
156
|
+
length: Math.floor((view.byteLength - offset) / UINT16_BYTES)
|
|
157
|
+
}, (_, index) => rrIntervalMilliseconds(view.getUint16(offset + index * UINT16_BYTES, true)));
|
|
158
|
+
|
|
132
159
|
/** Heart Rate Measurement 0x2A37; a strap reporting no skin contact has no reading. */
|
|
133
160
|
const heartRate = view => {
|
|
134
161
|
const flags = view.getUint8(0);
|
|
135
162
|
if ((flags & HEART_RATE_CONTACT_BITS) === HEART_RATE_NO_CONTACT) {
|
|
136
163
|
return undefined;
|
|
137
164
|
}
|
|
165
|
+
const hasUint16 = Boolean(flags & HEART_RATE_UINT16);
|
|
166
|
+
const rrOffset = 1 + (hasUint16 ? UINT16_BYTES : UINT8_BYTES) + (flags & HEART_RATE_ENERGY_EXPENDED ? UINT16_BYTES : 0);
|
|
167
|
+
const rrIntervals = flags & HEART_RATE_RR_INTERVALS ? rrIntervalsFrom(view, rrOffset) : [];
|
|
138
168
|
const reading = {
|
|
139
169
|
measurementTypeKey: MeasurementTypeKey.heartRate,
|
|
140
|
-
heartRate:
|
|
170
|
+
heartRate: hasUint16 ? view.getUint16(1, true) : view.getUint8(1)
|
|
141
171
|
};
|
|
142
|
-
return
|
|
172
|
+
return rrIntervals.length > 0 ? {
|
|
173
|
+
...reading,
|
|
174
|
+
rrIntervals
|
|
175
|
+
} : reading;
|
|
143
176
|
};
|
|
144
177
|
const subscribed = (service, characteristic, decode) => async function* (link) {
|
|
145
178
|
for await (const frame of link.subscribe(sigUuid(service), sigUuid(characteristic))) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["MeasurementTypeKey","BloodPressureStates","sigUuid","dateTimeAt","decodeFrame","floatAt","roundTo","sfloatAt","withDefined","
|
|
1
|
+
{"version":3,"names":["MeasurementTypeKey","BloodPressureStates","memorySlotForDeviceUser","KPA_TO_MMHG","rrIntervalMilliseconds","sigUuid","temperatureTypeFromCode","dateTimeAt","decodeFrame","floatAt","roundTo","sfloatAt","withDefined","KG_PER_SI_COUNT","KG_PER_IMPERIAL_COUNT","WEIGHT_UNSUCCESSFUL","DATE_TIME_BYTES","BP_KPA","BP_TIMESTAMP","BP_PULSE","BP_USER","BP_STATUS","BP_BODY_MOVEMENT","BP_LOOSE_CUFF","BP_IRREGULAR_PULSE","TEMPERATURE_FAHRENHEIT","TEMPERATURE_TIMESTAMP","TEMPERATURE_TYPE","TEMPERATURE_TIMESTAMP_OFFSET","WEIGHT_IMPERIAL","WEIGHT_TIMESTAMP","WEIGHT_USER","WEIGHT_TIMESTAMP_OFFSET","PLX_TIMESTAMP","HEART_RATE_UINT16","HEART_RATE_CONTACT_BITS","HEART_RATE_NO_CONTACT","HEART_RATE_ENERGY_EXPENDED","HEART_RATE_RR_INTERVALS","UINT8_BYTES","UINT16_BYTES","bloodPressureStatus","status","DISTURB_DETECTED","LOOSE_SLEEVE","REGULAR","bloodPressureExtras","view","flags","offset","extras","recordedAt","heartRate","memorySlot","getUint8","getUint16","irregularHeartbeat","undefined","bloodPressure","pressure","value","systolic","diastolic","mean","map","reading","measurementTypeKey","meanArterialPressure","temperature","hasTimestamp","Boolean","typeOffset","bodyTemp","temperatureType","bodyWeight","counts","userOffset","pulseOximetry","bloodOxygen","pulseRate","bloodOxygenPulseRate","rrIntervalsFrom","Array","from","length","Math","floor","byteLength","_","index","hasUint16","rrOffset","rrIntervals","subscribed","service","characteristic","decode","link","frame","sub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