@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
|
@@ -1,45 +1,54 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
import { createStableResultId } from "../../bt-management/utils/result-identity.js";
|
|
5
|
-
import { openBleLink } from "./link.js";
|
|
3
|
+
import { stableHash } from "./stable-hash.js";
|
|
6
4
|
|
|
7
|
-
/**
|
|
5
|
+
/** What a driver reports while it runs. */
|
|
6
|
+
|
|
7
|
+
/** Connects to a peripheral and reports what happens until it disconnects or `signal` aborts. */
|
|
8
8
|
|
|
9
9
|
/** One device's conversation over a link, as the readings it produces. */
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
11
|
+
/** Whether a reading carries the time it was taken, which makes a stored reading recognisable when resent. */
|
|
12
|
+
const isTimestamped = reading => {
|
|
13
|
+
const temporal = reading;
|
|
14
|
+
return [temporal.recordedAt, temporal.start, temporal.end].some(value => value instanceof Date);
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
/** The same for every resend of a timestamped reading; `null` for a reading without a time. */
|
|
18
|
+
const readingId = (key, peripheral, reading) => isTimestamped(reading) ? `ovok:${stableHash({
|
|
19
|
+
key,
|
|
20
|
+
peripheral: peripheral.id,
|
|
21
|
+
reading
|
|
22
|
+
})}` : null;
|
|
19
23
|
|
|
20
|
-
/** Runs a protocol over a fresh
|
|
21
|
-
const gattDriver = (
|
|
22
|
-
const link = await
|
|
23
|
-
const identity = readingIdentity(deviceName, device);
|
|
24
|
+
/** Runs a protocol over a fresh link. */
|
|
25
|
+
const gattDriver = (key, protocol) => async function* (peripheral, signal) {
|
|
26
|
+
const link = await peripheral.openLink(signal);
|
|
24
27
|
try {
|
|
25
28
|
yield {
|
|
26
29
|
kind: "status",
|
|
27
|
-
status:
|
|
30
|
+
status: "connected"
|
|
28
31
|
};
|
|
32
|
+
if (link.deviceInformation) {
|
|
33
|
+
yield {
|
|
34
|
+
kind: "information",
|
|
35
|
+
information: link.deviceInformation
|
|
36
|
+
};
|
|
37
|
+
}
|
|
29
38
|
for await (const reading of protocol(link)) {
|
|
30
39
|
yield {
|
|
31
40
|
kind: "reading",
|
|
32
|
-
id:
|
|
41
|
+
id: readingId(key, peripheral, reading),
|
|
33
42
|
reading
|
|
34
43
|
};
|
|
35
44
|
}
|
|
36
45
|
yield {
|
|
37
46
|
kind: "status",
|
|
38
|
-
status:
|
|
47
|
+
status: "disconnected"
|
|
39
48
|
};
|
|
40
49
|
} finally {
|
|
41
50
|
await link.close();
|
|
42
51
|
}
|
|
43
52
|
};
|
|
44
|
-
export { gattDriver };
|
|
53
|
+
export { gattDriver, isTimestamped };
|
|
45
54
|
//# sourceMappingURL=driver.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["stableHash","isTimestamped","reading","temporal","recordedAt","start","end","some","value","Date","readingId","key","peripheral","id","gattDriver","protocol","signal","link","openLink","kind","status","deviceInformation","information","close"],"sourceRoot":"../../../../../src","sources":["modules/next/bluetooth/driver.ts"],"mappings":";;AAIA,SAASA,UAAU,QAAQ,kBAAe;;AAG1C;;AAsCA;;AAGA;;AAGA;AACA,MAAMC,aAAa,GAAIC,OAAoB,IAAc;EACvD,MAAMC,QAAQ,GAAGD,OAAmE;EAEpF,OAAO,CAACC,QAAQ,CAACC,UAAU,EAAED,QAAQ,CAACE,KAAK,EAAEF,QAAQ,CAACG,GAAG,CAAC,CAACC,IAAI,CAAEC,KAAK,IAAKA,KAAK,YAAYC,IAAI,CAAC;AACnG,CAAC;;AAED;AACA,MAAMC,SAAS,GAAGA,CAACC,GAAW,EAAEC,UAAsB,EAAEV,OAAoB,KAC1ED,aAAa,CAACC,OAAO,CAAC,GAAG,QAAQF,UAAU,CAAC;EAAEW,GAAG;EAAEC,UAAU,EAAEA,UAAU,CAACC,EAAE;EAAEX;AAAQ,CAAC,CAAC,EAAE,GAAG,IAAI;;AAEnG;AACA,MAAMY,UAAU,GAAGA,CAACH,GAAW,EAAEI,QAAwB,KACvD,iBAAiBH,UAAU,EAAEI,MAAM,EAAE;EACnC,MAAMC,IAAI,GAAG,MAAML,UAAU,CAACM,QAAQ,CAACF,MAAM,CAAC;EAE9C,IAAI;IACF,MAAM;MAAEG,IAAI,EAAE,QAAQ;MAAEC,MAAM,EAAE;IAAY,CAAC;IAC7C,IAAIH,IAAI,CAACI,iBAAiB,EAAE;MAC1B,MAAM;QAAEF,IAAI,EAAE,aAAa;QAAEG,WAAW,EAAEL,IAAI,CAACI;MAAkB,CAAC;IACpE;IACA,WAAW,MAAMnB,OAAO,IAAIa,QAAQ,CAACE,IAAI,CAAC,EAAE;MAC1C,MAAM;QAAEE,IAAI,EAAE,SAAS;QAAEN,EAAE,EAAEH,SAAS,CAACC,GAAG,EAAEC,UAAU,EAAEV,OAAO,CAAC;QAAEA;MAAQ,CAAC;IAC7E;IACA,MAAM;MAAEiB,IAAI,EAAE,QAAQ;MAAEC,MAAM,EAAE;IAAe,CAAC;EAClD,CAAC,SAAS;IACR,MAAMH,IAAI,CAACM,KAAK,CAAC,CAAC;EACpB;AACF,CAAC;AAEH,SAAST,UAAU,EAAEb,aAAa","ignoreList":[]}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/** Why a Bluetooth operation failed. */
|
|
4
|
+
|
|
5
|
+
/** Every failure the Bluetooth runtime reports; `cause` holds the underlying error, when any. */
|
|
6
|
+
class BluetoothError extends Error {
|
|
7
|
+
/** Always `"BluetoothError"`. */
|
|
8
|
+
name = "BluetoothError";
|
|
9
|
+
constructor(/** Why it failed. */
|
|
10
|
+
code, message, cause) {
|
|
11
|
+
super(message, {
|
|
12
|
+
cause
|
|
13
|
+
});
|
|
14
|
+
this.code = code;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/** `error` as a `BluetoothError`, classified as `code` unless it already is one. */
|
|
19
|
+
const asBluetoothError = (error, code) => error instanceof BluetoothError ? error : new BluetoothError(code, error instanceof Error ? error.message : String(error), error);
|
|
20
|
+
export { asBluetoothError, BluetoothError };
|
|
21
|
+
//# sourceMappingURL=errors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["BluetoothError","Error","name","constructor","code","message","cause","asBluetoothError","error","String"],"sourceRoot":"../../../../../src","sources":["modules/next/bluetooth/errors.ts"],"mappings":";;AAAA;;AAiBA;AACA,MAAMA,cAAc,SAASC,KAAK,CAAC;EACjC;EACgBC,IAAI,GAAG,gBAAgB;EAEhCC,WAAWA,CAEhB;EACgBC,IAAwB,EACxCC,OAAe,EACfC,KAAe,EACf;IACA,KAAK,CAACD,OAAO,EAAE;MAAEC;IAAM,CAAC,CAAC;IAAC,KAJVF,IAAwB,GAAxBA,IAAwB;EAK1C;AACF;;AAEA;AACA,MAAMG,gBAAgB,GAAGA,CAACC,KAAc,EAAEJ,IAAwB,KAChEI,KAAK,YAAYR,cAAc,GAC3BQ,KAAK,GACL,IAAIR,cAAc,CAACI,IAAI,EAAEI,KAAK,YAAYP,KAAK,GAAGO,KAAK,CAACH,OAAO,GAAGI,MAAM,CAACD,KAAK,CAAC,EAAEA,KAAK,CAAC;AAE7F,SAASD,gBAAgB,EAAEP,cAAc","ignoreList":[]}
|
|
@@ -1,8 +1,26 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
/**
|
|
4
|
+
* Bluetooth for `@ovok/native/next`, in layers: the framework-free `BluetoothRuntime` and its ports, device drivers,
|
|
5
|
+
* the `react-native-ble-plx` and React Native adapters, React hooks over the runtime, and optional UI built only from
|
|
6
|
+
* those hooks.
|
|
7
|
+
*
|
|
8
|
+
* Import from `@ovok/native/next/bluetooth`.
|
|
9
|
+
*
|
|
10
|
+
* @module next/bluetooth
|
|
11
|
+
*/
|
|
12
|
+
export { BluetoothRuntime } from "./runtime.js";
|
|
13
|
+
export { BluetoothError } from "./errors.js";
|
|
14
|
+
export { defineDevice } from "./devices.js";
|
|
15
|
+
export { acceptedMemorySlots, dailyTotalsOnly, everyReading, firstReadingPerKind, keepReadings, policyByKind } from "./result-policy.js";
|
|
7
16
|
export { SIG_PROTOCOLS } from "./sig-profiles.js";
|
|
17
|
+
export { bleManagerScanner } from "./ble-plx/ble-scanner.js";
|
|
18
|
+
export { builtInDevices } from "./ble-plx/built-in-devices.js";
|
|
19
|
+
export { IntegratedDevices } from "../../bt-management/types/integrated-devices.js";
|
|
20
|
+
export { osBluetoothPermissions } from "./react-native/os-permissions.js";
|
|
21
|
+
export { ovokReadingSink } from "./react-native/ovok-sink.js";
|
|
22
|
+
export { createBluetoothRuntime } from "./react-native/create-bluetooth-runtime.js";
|
|
23
|
+
export { BluetoothProvider, useBluetooth } from "./react/context.js";
|
|
24
|
+
export { useBluetoothPermission, useBluetoothState, useMeasurements, useNearbyDevice, useNearbyDevices, usePairedDevices, useScanning } from "./react/hooks.js";
|
|
25
|
+
export { BluetoothDevicePicker } from "./react/bluetooth-device-picker.js";
|
|
8
26
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["BluetoothRuntime","BluetoothError","defineDevice","acceptedMemorySlots","dailyTotalsOnly","everyReading","firstReadingPerKind","keepReadings","policyByKind","SIG_PROTOCOLS","bleManagerScanner","builtInDevices","IntegratedDevices","osBluetoothPermissions","ovokReadingSink","createBluetoothRuntime","BluetoothProvider","useBluetooth","useBluetoothPermission","useBluetoothState","useMeasurements","useNearbyDevice","useNearbyDevices","usePairedDevices","useScanning","BluetoothDevicePicker"],"sourceRoot":"../../../../../src","sources":["modules/next/bluetooth/index.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,gBAAgB,QAAQ,cAAW;AAE5C,SAASC,cAAc,QAAQ,aAAU;AAOzC,SAASC,YAAY,QAAQ,cAAW;AAIxC,SACEC,mBAAmB,EACnBC,eAAe,EACfC,YAAY,EACZC,mBAAmB,EACnBC,YAAY,EACZC,YAAY,QACP,oBAAiB;AAExB,SAASC,aAAa,QAAQ,mBAAgB;AAE9C,SAASC,iBAAiB,QAAQ,0BAAuB;AACzD,SAASC,cAAc,QAAQ,+BAA4B;AAC3D,SAASC,iBAAiB,QAAQ,iDAA8C;AAEhF,SAASC,sBAAsB,QAAQ,kCAA+B;AACtE,SAASC,eAAe,QAAQ,6BAA0B;AAC1D,SAASC,sBAAsB,QAAQ,4CAAyC;AAGhF,SAASC,iBAAiB,EAAEC,YAAY,QAAQ,oBAAiB;AAEjE,SACEC,sBAAsB,EACtBC,iBAAiB,EACjBC,eAAe,EACfC,eAAe,EACfC,gBAAgB,EAChBC,gBAAgB,EAChBC,WAAW,QACN,kBAAe;AACtB,SAASC,qBAAqB,QAAQ,oCAAiC","ignoreList":[]}
|
|
@@ -1,103 +1,2 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
import { toBluetoothError } from "../../bt-management/types/bluetooth-error.js";
|
|
4
|
-
import { sentryLogger } from "../../helpers/utils/sentry-logger.js";
|
|
5
|
-
import { Channel } from "./channel.js";
|
|
6
|
-
|
|
7
|
-
/** An open GATT connection: bytes in, bytes out, no knowledge of any device. */
|
|
8
|
-
|
|
9
|
-
const CONNECT_ATTEMPTS = 5;
|
|
10
|
-
const FIRST_RETRY_DELAY_MS = 1000;
|
|
11
|
-
const MAX_RETRY_DELAY_MS = 5000;
|
|
12
|
-
|
|
13
|
-
/** BleErrorCode.OperationCancelled and DeviceDisconnected; the enum is not available at runtime. */
|
|
14
|
-
const ENDS_THE_LINK = new Set([2, 201]);
|
|
15
|
-
const toBytes = base64 => Uint8Array.from(atob(base64), char => char.charCodeAt(0));
|
|
16
|
-
const toBase64 = bytes => btoa(String.fromCharCode(...bytes));
|
|
17
|
-
const retryDelay = attempt => Math.min(FIRST_RETRY_DELAY_MS * 2 ** (attempt - 1), MAX_RETRY_DELAY_MS);
|
|
18
|
-
const wait = ms => new Promise(resolve => setTimeout(resolve, ms));
|
|
19
|
-
const abortReason = signal => signal.reason ?? new Error("The Bluetooth connection was cancelled");
|
|
20
|
-
async function connectWithRetries(device, signal) {
|
|
21
|
-
for (let attempt = 1;; attempt += 1) {
|
|
22
|
-
if (signal.aborted) {
|
|
23
|
-
throw abortReason(signal);
|
|
24
|
-
}
|
|
25
|
-
try {
|
|
26
|
-
if (!(await device.isConnected())) {
|
|
27
|
-
await device.connect();
|
|
28
|
-
}
|
|
29
|
-
return;
|
|
30
|
-
} catch (error) {
|
|
31
|
-
if (attempt >= CONNECT_ATTEMPTS) {
|
|
32
|
-
sentryLogger("error", "BLUETOOTH: Connection failed", {
|
|
33
|
-
errorCode: toBluetoothError(error).code,
|
|
34
|
-
attempts: attempt
|
|
35
|
-
});
|
|
36
|
-
throw error;
|
|
37
|
-
}
|
|
38
|
-
await wait(retryDelay(attempt));
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
class BleLink {
|
|
43
|
-
channels = new Set();
|
|
44
|
-
ended = false;
|
|
45
|
-
constructor(device) {
|
|
46
|
-
this.device = device;
|
|
47
|
-
this.disconnected = device.onDisconnected(() => this.endAll());
|
|
48
|
-
}
|
|
49
|
-
subscribe(service, characteristic) {
|
|
50
|
-
const channel = new Channel(() => {
|
|
51
|
-
subscription.remove();
|
|
52
|
-
this.channels.delete(channel);
|
|
53
|
-
});
|
|
54
|
-
const subscription = this.device.monitorCharacteristicForService(service, characteristic, (error, value) => {
|
|
55
|
-
if (error) {
|
|
56
|
-
this.endOrFail(channel, error);
|
|
57
|
-
} else if (value?.value) {
|
|
58
|
-
channel.push(toBytes(value.value));
|
|
59
|
-
}
|
|
60
|
-
});
|
|
61
|
-
this.channels.add(channel);
|
|
62
|
-
if (this.ended) {
|
|
63
|
-
channel.end();
|
|
64
|
-
}
|
|
65
|
-
return channel;
|
|
66
|
-
}
|
|
67
|
-
async write(service, characteristic, bytes) {
|
|
68
|
-
await this.device.writeCharacteristicWithResponseForService(service, characteristic, toBase64(bytes));
|
|
69
|
-
}
|
|
70
|
-
async close() {
|
|
71
|
-
this.endAll();
|
|
72
|
-
this.disconnected.remove();
|
|
73
|
-
await this.device.cancelConnection().catch(() => undefined);
|
|
74
|
-
}
|
|
75
|
-
endOrFail(channel, error) {
|
|
76
|
-
if (ENDS_THE_LINK.has(error.errorCode)) {
|
|
77
|
-
channel.end();
|
|
78
|
-
} else {
|
|
79
|
-
channel.fail(toBluetoothError(error));
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
endAll() {
|
|
83
|
-
this.ended = true;
|
|
84
|
-
[...this.channels].forEach(channel => channel.end());
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
/** Connects (retrying with backoff) and discovers services; aborting `signal` closes the link. */
|
|
89
|
-
async function openBleLink(device, signal) {
|
|
90
|
-
await connectWithRetries(device, signal);
|
|
91
|
-
await device.discoverAllServicesAndCharacteristics();
|
|
92
|
-
const link = new BleLink(device);
|
|
93
|
-
if (signal.aborted) {
|
|
94
|
-
await link.close();
|
|
95
|
-
throw abortReason(signal);
|
|
96
|
-
}
|
|
97
|
-
signal.addEventListener("abort", () => void link.close(), {
|
|
98
|
-
once: true
|
|
99
|
-
});
|
|
100
|
-
return link;
|
|
101
|
-
}
|
|
102
|
-
export { openBleLink };
|
|
103
2
|
//# sourceMappingURL=link.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../../../src","sources":["modules/next/bluetooth/link.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
const DEFAULT_PAIRED_KEY = "@ovok/native/next/paired-bluetooth-devices";
|
|
4
|
+
const parseIds = value => {
|
|
5
|
+
try {
|
|
6
|
+
const parsed = value ? JSON.parse(value) : [];
|
|
7
|
+
return Array.isArray(parsed) ? parsed.filter(id => typeof id === "string") : [];
|
|
8
|
+
} catch {
|
|
9
|
+
return [];
|
|
10
|
+
}
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
/** The paired device IDs, persisted when storage is given. */
|
|
14
|
+
class PairedDevices {
|
|
15
|
+
ids = [];
|
|
16
|
+
constructor(onChange, storage, key = DEFAULT_PAIRED_KEY) {
|
|
17
|
+
this.onChange = onChange;
|
|
18
|
+
this.storage = storage;
|
|
19
|
+
this.key = key;
|
|
20
|
+
this.loaded = this.load();
|
|
21
|
+
}
|
|
22
|
+
has(id) {
|
|
23
|
+
return this.ids.includes(id);
|
|
24
|
+
}
|
|
25
|
+
async add(id) {
|
|
26
|
+
await this.change(ids => [...new Set([...ids, id])]);
|
|
27
|
+
}
|
|
28
|
+
async remove(id) {
|
|
29
|
+
await this.change(ids => ids.filter(candidate => candidate !== id));
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/** Waits for the stored list, so a change never overwrites IDs not read yet. */
|
|
33
|
+
async change(update) {
|
|
34
|
+
await this.loaded;
|
|
35
|
+
this.ids = update(this.ids);
|
|
36
|
+
this.onChange(this.ids);
|
|
37
|
+
await this.storage?.setItem(this.key, JSON.stringify(this.ids));
|
|
38
|
+
}
|
|
39
|
+
async load() {
|
|
40
|
+
const stored = await Promise.resolve(this.storage?.getItem(this.key) ?? null).catch(() => null);
|
|
41
|
+
this.ids = parseIds(stored);
|
|
42
|
+
this.onChange(this.ids);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
export { PairedDevices };
|
|
46
|
+
//# sourceMappingURL=paired.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["DEFAULT_PAIRED_KEY","parseIds","value","parsed","JSON","parse","Array","isArray","filter","id","PairedDevices","ids","constructor","onChange","storage","key","loaded","load","has","includes","add","change","Set","remove","candidate","update","setItem","stringify","stored","Promise","resolve","getItem","catch"],"sourceRoot":"../../../../../src","sources":["modules/next/bluetooth/paired.ts"],"mappings":";;AAEA,MAAMA,kBAAkB,GAAG,4CAA4C;AAEvE,MAAMC,QAAQ,GAAIC,KAAoB,IAAe;EACnD,IAAI;IACF,MAAMC,MAAe,GAAGD,KAAK,GAAGE,IAAI,CAACC,KAAK,CAACH,KAAK,CAAC,GAAG,EAAE;IAEtD,OAAOI,KAAK,CAACC,OAAO,CAACJ,MAAM,CAAC,GAAGA,MAAM,CAACK,MAAM,CAAEC,EAAE,IAAmB,OAAOA,EAAE,KAAK,QAAQ,CAAC,GAAG,EAAE;EACjG,CAAC,CAAC,MAAM;IACN,OAAO,EAAE;EACX;AACF,CAAC;;AAED;AACA,MAAMC,aAAa,CAAC;EACVC,GAAG,GAAsB,EAAE;EAG5BC,WAAWA,CACCC,QAA0C,EAC1CC,OAAqB,EACrBC,GAAG,GAAGf,kBAAkB,EACzC;IAAA,KAHiBa,QAA0C,GAA1CA,QAA0C;IAAA,KAC1CC,OAAqB,GAArBA,OAAqB;IAAA,KACrBC,GAAG,GAAHA,GAAG;IAEpB,IAAI,CAACC,MAAM,GAAG,IAAI,CAACC,IAAI,CAAC,CAAC;EAC3B;EAEOC,GAAGA,CAACT,EAAU,EAAW;IAC9B,OAAO,IAAI,CAACE,GAAG,CAACQ,QAAQ,CAACV,EAAE,CAAC;EAC9B;EAEA,MAAaW,GAAGA,CAACX,EAAU,EAAiB;IAC1C,MAAM,IAAI,CAACY,MAAM,CAAEV,GAAG,IAAK,CAAC,GAAG,IAAIW,GAAG,CAAC,CAAC,GAAGX,GAAG,EAAEF,EAAE,CAAC,CAAC,CAAC,CAAC;EACxD;EAEA,MAAac,MAAMA,CAACd,EAAU,EAAiB;IAC7C,MAAM,IAAI,CAACY,MAAM,CAAEV,GAAG,IAAKA,GAAG,CAACH,MAAM,CAAEgB,SAAS,IAAKA,SAAS,KAAKf,EAAE,CAAC,CAAC;EACzE;;EAEA;EACA,MAAcY,MAAMA,CAACI,MAAqD,EAAiB;IACzF,MAAM,IAAI,CAACT,MAAM;IACjB,IAAI,CAACL,GAAG,GAAGc,MAAM,CAAC,IAAI,CAACd,GAAG,CAAC;IAC3B,IAAI,CAACE,QAAQ,CAAC,IAAI,CAACF,GAAG,CAAC;IACvB,MAAM,IAAI,CAACG,OAAO,EAAEY,OAAO,CAAC,IAAI,CAACX,GAAG,EAAEX,IAAI,CAACuB,SAAS,CAAC,IAAI,CAAChB,GAAG,CAAC,CAAC;EACjE;EAEA,MAAcM,IAAIA,CAAA,EAAkB;IAClC,MAAMW,MAAM,GAAG,MAAMC,OAAO,CAACC,OAAO,CAAC,IAAI,CAAChB,OAAO,EAAEiB,OAAO,CAAC,IAAI,CAAChB,GAAG,CAAC,IAAI,IAAI,CAAC,CAACiB,KAAK,CAAC,MAAM,IAAI,CAAC;IAE/F,IAAI,CAACrB,GAAG,GAAGV,QAAQ,CAAC2B,MAAM,CAAC;IAC3B,IAAI,CAACf,QAAQ,CAAC,IAAI,CAACF,GAAG,CAAC;EACzB;AACF;AAEA,SAASD,aAAa","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../../../src","sources":["modules/next/bluetooth/permissions.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { DevicePickerSheet } from "../../../bt-management/components/device-picker-sheet.js";
|
|
5
|
+
import { useBluetooth } from "./context.js";
|
|
6
|
+
import { useNearbyDevices } from "./hooks.js";
|
|
7
|
+
|
|
8
|
+
/** Props of {@link BluetoothDevicePicker}. */
|
|
9
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
|
+
/**
|
|
11
|
+
* A bottom sheet listing the found devices; picking one connects to it. Built only from public hooks.
|
|
12
|
+
*
|
|
13
|
+
* @group Components
|
|
14
|
+
*/
|
|
15
|
+
const BluetoothDevicePicker = ({
|
|
16
|
+
onSelect,
|
|
17
|
+
title = "Choose a device",
|
|
18
|
+
dismissLabel = "Not now",
|
|
19
|
+
labelForDevice = device => device.name || device.key,
|
|
20
|
+
...props
|
|
21
|
+
}) => {
|
|
22
|
+
const runtime = useBluetooth();
|
|
23
|
+
const devices = useNearbyDevices();
|
|
24
|
+
const select = device => {
|
|
25
|
+
runtime.connect(device.id).catch(() => undefined);
|
|
26
|
+
onSelect?.(device);
|
|
27
|
+
};
|
|
28
|
+
return /*#__PURE__*/_jsx(DevicePickerSheet, {
|
|
29
|
+
...props,
|
|
30
|
+
devices: devices,
|
|
31
|
+
onSelect: select,
|
|
32
|
+
title: title,
|
|
33
|
+
dismissLabel: dismissLabel,
|
|
34
|
+
labelForDevice: labelForDevice,
|
|
35
|
+
modelForDevice: device => device.key
|
|
36
|
+
});
|
|
37
|
+
};
|
|
38
|
+
export { BluetoothDevicePicker };
|
|
39
|
+
//# sourceMappingURL=bluetooth-device-picker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","DevicePickerSheet","useBluetooth","useNearbyDevices","jsx","_jsx","BluetoothDevicePicker","onSelect","title","dismissLabel","labelForDevice","device","name","key","props","runtime","devices","select","connect","id","catch","undefined","modelForDevice"],"sourceRoot":"../../../../../../src","sources":["modules/next/bluetooth/react/bluetooth-device-picker.tsx"],"mappings":";;AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAI9B,SAASC,iBAAiB,QAAQ,0DAAuD;AAGzF,SAASC,YAAY,QAAQ,cAAW;AACxC,SAASC,gBAAgB,QAAQ,YAAS;;AAE1C;AAAA,SAAAC,GAAA,IAAAC,IAAA;AA+BA;AACA;AACA;AACA;AACA;AACA,MAAMC,qBAAqB,GAAGA,CAAC;EAC7BC,QAAQ;EACRC,KAAK,GAAG,iBAAiB;EACzBC,YAAY,GAAG,SAAS;EACxBC,cAAc,GAAIC,MAAM,IAAKA,MAAM,CAACC,IAAI,IAAID,MAAM,CAACE,GAAG;EACtD,GAAGC;AACuB,CAAC,KAAK;EAChC,MAAMC,OAAO,GAAGb,YAAY,CAAC,CAAC;EAC9B,MAAMc,OAAO,GAAGb,gBAAgB,CAAC,CAAC;EAElC,MAAMc,MAAM,GAAIN,MAAoB,IAAK;IACvCI,OAAO,CAACG,OAAO,CAACP,MAAM,CAACQ,EAAE,CAAC,CAACC,KAAK,CAAC,MAAMC,SAAS,CAAC;IACjDd,QAAQ,GAAGI,MAAM,CAAC;EACpB,CAAC;EAED,oBACEN,IAAA,CAACJ,iBAAiB;IAAA,GACZa,KAAK;IACTE,OAAO,EAAEA,OAAQ;IACjBT,QAAQ,EAAEU,MAAO;IACjBT,KAAK,EAAEA,KAAM;IACbC,YAAY,EAAEA,YAAa;IAC3BC,cAAc,EAAEA,cAAe;IAC/BY,cAAc,EAAGX,MAAM,IAAKA,MAAM,CAACE;EAAI,CACxC,CAAC;AAEN,CAAC;AAED,SAASP,qBAAqB","ignoreList":[]}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { AndroidBluetoothForegroundService } from "../../../bt-management/components/android-bluetooth-foreground-service.js";
|
|
5
|
+
import { fromBleError } from "../ble-plx/ble-errors.js";
|
|
6
|
+
|
|
7
|
+
/** Props of {@link BluetoothProvider}. */
|
|
8
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
|
+
const RuntimeContext = /*#__PURE__*/React.createContext(null);
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Gives the Bluetooth hooks below it a runtime.
|
|
13
|
+
*
|
|
14
|
+
* @group Components
|
|
15
|
+
*/
|
|
16
|
+
const BluetoothProvider = ({
|
|
17
|
+
runtime,
|
|
18
|
+
androidForegroundService,
|
|
19
|
+
onForegroundServiceError,
|
|
20
|
+
children
|
|
21
|
+
}) => /*#__PURE__*/_jsx(RuntimeContext.Provider, {
|
|
22
|
+
value: runtime,
|
|
23
|
+
children: /*#__PURE__*/_jsx(AndroidBluetoothForegroundService, {
|
|
24
|
+
enabled: androidForegroundService !== undefined,
|
|
25
|
+
options: androidForegroundService,
|
|
26
|
+
onError: ({
|
|
27
|
+
error
|
|
28
|
+
}) => onForegroundServiceError?.(fromBleError(error)),
|
|
29
|
+
children: children
|
|
30
|
+
})
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* The runtime of the enclosing `BluetoothProvider`: every Bluetooth action is a call on it.
|
|
35
|
+
*
|
|
36
|
+
* @throws When rendered outside `BluetoothProvider`.
|
|
37
|
+
*
|
|
38
|
+
* @group Hooks
|
|
39
|
+
*/
|
|
40
|
+
const useBluetooth = () => {
|
|
41
|
+
const runtime = React.useContext(RuntimeContext);
|
|
42
|
+
if (!runtime) {
|
|
43
|
+
throw new Error("Bluetooth hooks must be rendered inside BluetoothProvider");
|
|
44
|
+
}
|
|
45
|
+
return runtime;
|
|
46
|
+
};
|
|
47
|
+
export { BluetoothProvider, useBluetooth };
|
|
48
|
+
//# sourceMappingURL=context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","AndroidBluetoothForegroundService","fromBleError","jsx","_jsx","RuntimeContext","createContext","BluetoothProvider","runtime","androidForegroundService","onForegroundServiceError","children","Provider","value","enabled","undefined","options","onError","error","useBluetooth","useContext","Error"],"sourceRoot":"../../../../../../src","sources":["modules/next/bluetooth/react/context.tsx"],"mappings":";;AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAI9B,SAASC,iCAAiC,QAAQ,2EAAwE;AAC1H,SAASC,YAAY,QAAQ,0BAAuB;;AAKpD;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAaA,MAAMC,cAAc,gBAAGL,KAAK,CAACM,aAAa,CAA0B,IAAI,CAAC;;AAEzE;AACA;AACA;AACA;AACA;AACA,MAAMC,iBAAiB,GAAGA,CAAC;EACzBC,OAAO;EACPC,wBAAwB;EACxBC,wBAAwB;EACxBC;AACsB,CAAC,kBACvBP,IAAA,CAACC,cAAc,CAACO,QAAQ;EAACC,KAAK,EAAEL,OAAQ;EAAAG,QAAA,eACtCP,IAAA,CAACH,iCAAiC;IAChCa,OAAO,EAAEL,wBAAwB,KAAKM,SAAU;IAChDC,OAAO,EAAEP,wBAAyB;IAClCQ,OAAO,EAAEA,CAAC;MAAEC;IAAM,CAAC,KAAKR,wBAAwB,GAAGR,YAAY,CAACgB,KAAK,CAAC,CAAE;IAAAP,QAAA,EAEvEA;EAAQ,CACwB;AAAC,CACb,CAC1B;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMQ,YAAY,GAAGA,CAAA,KAAwB;EAC3C,MAAMX,OAAO,GAAGR,KAAK,CAACoB,UAAU,CAACf,cAAc,CAAC;EAEhD,IAAI,CAACG,OAAO,EAAE;IACZ,MAAM,IAAIa,KAAK,CAAC,2DAA2D,CAAC;EAC9E;EAEA,OAAOb,OAAO;AAChB,CAAC;AAED,SAASD,iBAAiB,EAAEY,YAAY","ignoreList":[]}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { AppState } from "react-native";
|
|
5
|
+
import { useBluetooth } from "./context.js";
|
|
6
|
+
|
|
7
|
+
/** One slice of the runtime snapshot, re-rendering only when that slice changes. */
|
|
8
|
+
const useSnapshot = select => {
|
|
9
|
+
const runtime = useBluetooth();
|
|
10
|
+
const read = () => select(runtime.getSnapshot());
|
|
11
|
+
return React.useSyncExternalStore(runtime.subscribe, read, read);
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* The Bluetooth adapter state.
|
|
16
|
+
*
|
|
17
|
+
* @group Hooks
|
|
18
|
+
*/
|
|
19
|
+
const useBluetoothState = () => useSnapshot(snapshot => snapshot.adapter);
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* The Bluetooth permission, re-checked whenever the app returns to the foreground; `unknown` until first checked.
|
|
23
|
+
*
|
|
24
|
+
* @group Hooks
|
|
25
|
+
*/
|
|
26
|
+
const useBluetoothPermission = () => {
|
|
27
|
+
const runtime = useBluetooth();
|
|
28
|
+
React.useEffect(() => {
|
|
29
|
+
const subscription = AppState.addEventListener("change", state => {
|
|
30
|
+
if (state === "active") {
|
|
31
|
+
runtime.checkPermission().catch(() => undefined);
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
return () => subscription.remove();
|
|
35
|
+
}, [runtime]);
|
|
36
|
+
return useSnapshot(snapshot => snapshot.permission);
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Whether a scan is requested.
|
|
41
|
+
*
|
|
42
|
+
* @group Hooks
|
|
43
|
+
*/
|
|
44
|
+
const useScanning = () => useSnapshot(snapshot => snapshot.scanning);
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* The supported devices the scan found, each with its connection state.
|
|
48
|
+
*
|
|
49
|
+
* @group Hooks
|
|
50
|
+
*/
|
|
51
|
+
const useNearbyDevices = () => useSnapshot(snapshot => snapshot.devices);
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* One found device, or `null` until the scan finds it.
|
|
55
|
+
*
|
|
56
|
+
* @group Hooks
|
|
57
|
+
*/
|
|
58
|
+
const useNearbyDevice = deviceId => useSnapshot(snapshot => snapshot.devices.find(({
|
|
59
|
+
id
|
|
60
|
+
}) => id === deviceId) ?? null);
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* IDs of the paired devices.
|
|
64
|
+
*
|
|
65
|
+
* @group Hooks
|
|
66
|
+
*/
|
|
67
|
+
const usePairedDevices = () => useSnapshot(snapshot => snapshot.paired);
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* The recent readings, oldest first, each with its save state.
|
|
71
|
+
*
|
|
72
|
+
* @group Hooks
|
|
73
|
+
*/
|
|
74
|
+
const useMeasurements = () => useSnapshot(snapshot => snapshot.readings);
|
|
75
|
+
export { useBluetoothPermission, useBluetoothState, useMeasurements, useNearbyDevice, useNearbyDevices, usePairedDevices, useScanning };
|
|
76
|
+
//# sourceMappingURL=hooks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","AppState","useBluetooth","useSnapshot","select","runtime","read","getSnapshot","useSyncExternalStore","subscribe","useBluetoothState","snapshot","adapter","useBluetoothPermission","useEffect","subscription","addEventListener","state","checkPermission","catch","undefined","remove","permission","useScanning","scanning","useNearbyDevices","devices","useNearbyDevice","deviceId","find","id","usePairedDevices","paired","useMeasurements","readings"],"sourceRoot":"../../../../../../src","sources":["modules/next/bluetooth/react/hooks.ts"],"mappings":";;AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,QAAQ,QAAQ,cAAc;AAMvC,SAASC,YAAY,QAAQ,cAAW;;AAExC;AACA,MAAMC,WAAW,GAAWC,MAA8C,IAAY;EACpF,MAAMC,OAAO,GAAGH,YAAY,CAAC,CAAC;EAC9B,MAAMI,IAAI,GAAGA,CAAA,KAAMF,MAAM,CAACC,OAAO,CAACE,WAAW,CAAC,CAAC,CAAC;EAEhD,OAAOP,KAAK,CAACQ,oBAAoB,CAACH,OAAO,CAACI,SAAS,EAAEH,IAAI,EAAEA,IAAI,CAAC;AAClE,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA,MAAMI,iBAAiB,GAAGA,CAAA,KAAoBP,WAAW,CAAEQ,QAAQ,IAAKA,QAAQ,CAACC,OAAO,CAAC;;AAEzF;AACA;AACA;AACA;AACA;AACA,MAAMC,sBAAsB,GAAGA,CAAA,KAAuC;EACpE,MAAMR,OAAO,GAAGH,YAAY,CAAC,CAAC;EAE9BF,KAAK,CAACc,SAAS,CAAC,MAAM;IACpB,MAAMC,YAAY,GAAGd,QAAQ,CAACe,gBAAgB,CAAC,QAAQ,EAAGC,KAAK,IAAK;MAClE,IAAIA,KAAK,KAAK,QAAQ,EAAE;QACtBZ,OAAO,CAACa,eAAe,CAAC,CAAC,CAACC,KAAK,CAAC,MAAMC,SAAS,CAAC;MAClD;IACF,CAAC,CAAC;IAEF,OAAO,MAAML,YAAY,CAACM,MAAM,CAAC,CAAC;EACpC,CAAC,EAAE,CAAChB,OAAO,CAAC,CAAC;EAEb,OAAOF,WAAW,CAAEQ,QAAQ,IAAKA,QAAQ,CAACW,UAAU,CAAC;AACvD,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA,MAAMC,WAAW,GAAGA,CAAA,KAAepB,WAAW,CAAEQ,QAAQ,IAAKA,QAAQ,CAACa,QAAQ,CAAC;;AAE/E;AACA;AACA;AACA;AACA;AACA,MAAMC,gBAAgB,GAAGA,CAAA,KAA+BtB,WAAW,CAAEQ,QAAQ,IAAKA,QAAQ,CAACe,OAAO,CAAC;;AAEnG;AACA;AACA;AACA;AACA;AACA,MAAMC,eAAe,GAAIC,QAAgB,IACvCzB,WAAW,CAAEQ,QAAQ,IAAKA,QAAQ,CAACe,OAAO,CAACG,IAAI,CAAC,CAAC;EAAEC;AAAG,CAAC,KAAKA,EAAE,KAAKF,QAAQ,CAAC,IAAI,IAAI,CAAC;;AAEvF;AACA;AACA;AACA;AACA;AACA,MAAMG,gBAAgB,GAAGA,CAAA,KAAyB5B,WAAW,CAAEQ,QAAQ,IAAKA,QAAQ,CAACqB,MAAM,CAAC;;AAE5F;AACA;AACA;AACA;AACA;AACA,MAAMC,eAAe,GAAGA,CAAA,KAAgC9B,WAAW,CAAEQ,QAAQ,IAAKA,QAAQ,CAACuB,QAAQ,CAAC;AAEpG,SACErB,sBAAsB,EACtBH,iBAAiB,EACjBuB,eAAe,EACfN,eAAe,EACfF,gBAAgB,EAChBM,gBAAgB,EAChBR,WAAW","ignoreList":[]}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { bleManagerScanner } from "../ble-plx/ble-scanner.js";
|
|
4
|
+
import { BluetoothRuntime } from "../runtime.js";
|
|
5
|
+
import { osBluetoothPermissions } from "./os-permissions.js";
|
|
6
|
+
import { ovokReadingSink } from "./ovok-sink.js";
|
|
7
|
+
|
|
8
|
+
/** What `createBluetoothRuntime` needs. */
|
|
9
|
+
|
|
10
|
+
/** A `BluetoothRuntime` wired for React Native: BLE through `bleManager`, OS permissions, saving through `client`. */
|
|
11
|
+
const createBluetoothRuntime = ({
|
|
12
|
+
client,
|
|
13
|
+
bleManager,
|
|
14
|
+
devices,
|
|
15
|
+
resultPolicy
|
|
16
|
+
}) => new BluetoothRuntime({
|
|
17
|
+
scanner: bleManagerScanner(bleManager),
|
|
18
|
+
permissions: osBluetoothPermissions(),
|
|
19
|
+
sink: ovokReadingSink(client),
|
|
20
|
+
devices,
|
|
21
|
+
resultPolicy,
|
|
22
|
+
pairedStorage: client.storage
|
|
23
|
+
});
|
|
24
|
+
export { createBluetoothRuntime };
|
|
25
|
+
//# sourceMappingURL=create-bluetooth-runtime.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["bleManagerScanner","BluetoothRuntime","osBluetoothPermissions","ovokReadingSink","createBluetoothRuntime","client","bleManager","devices","resultPolicy","scanner","permissions","sink","pairedStorage","storage"],"sourceRoot":"../../../../../../src","sources":["modules/next/bluetooth/react-native/create-bluetooth-runtime.ts"],"mappings":";;AAIA,SAASA,iBAAiB,QAAQ,2BAAwB;AAG1D,SAASC,gBAAgB,QAAQ,eAAY;AAE7C,SAASC,sBAAsB,QAAQ,qBAAkB;AACzD,SAASC,eAAe,QAAQ,gBAAa;;AAE7C;;AAgBA;AACA,MAAMC,sBAAsB,GAAGA,CAAC;EAC9BC,MAAM;EACNC,UAAU;EACVC,OAAO;EACPC;AAC6B,CAAC,KAC9B,IAAIP,gBAAgB,CAAC;EACnBQ,OAAO,EAAET,iBAAiB,CAACM,UAAU,CAAC;EACtCI,WAAW,EAAER,sBAAsB,CAAC,CAAC;EACrCS,IAAI,EAAER,eAAe,CAACE,MAAM,CAAC;EAC7BE,OAAO;EACPC,YAAY;EACZI,aAAa,EAAEP,MAAM,CAACQ;AACxB,CAAC,CAAC;AAEJ,SAAST,sBAAsB","ignoreList":[]}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { Linking } from "react-native";
|
|
4
|
+
import { checkMultiple, requestMultiple } from "react-native-permissions";
|
|
5
|
+
import { bluetoothPermissionList } from "../../../bt-management/utils/bluetooth-permission-list.js";
|
|
6
|
+
const GRANTED = new Set(["granted", "limited"]);
|
|
7
|
+
const permissionOf = (permissions, results) => {
|
|
8
|
+
const statuses = permissions.map(permission => results[permission]);
|
|
9
|
+
if (statuses.length > 0 && statuses.every(status => status !== undefined && GRANTED.has(status))) {
|
|
10
|
+
return "granted";
|
|
11
|
+
}
|
|
12
|
+
return statuses.includes("blocked") ? "blocked" : "denied";
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
/** The platform's Bluetooth permissions through `react-native-permissions`. */
|
|
16
|
+
const osBluetoothPermissions = () => ({
|
|
17
|
+
check: async () => {
|
|
18
|
+
const permissions = bluetoothPermissionList();
|
|
19
|
+
return permissionOf(permissions, await checkMultiple(permissions));
|
|
20
|
+
},
|
|
21
|
+
request: async () => {
|
|
22
|
+
const permissions = bluetoothPermissionList();
|
|
23
|
+
return permissionOf(permissions, await requestMultiple(permissions));
|
|
24
|
+
},
|
|
25
|
+
openSettings: () => Linking.openSettings()
|
|
26
|
+
});
|
|
27
|
+
export { osBluetoothPermissions };
|
|
28
|
+
//# sourceMappingURL=os-permissions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Linking","checkMultiple","requestMultiple","bluetoothPermissionList","GRANTED","Set","permissionOf","permissions","results","statuses","map","permission","length","every","status","undefined","has","includes","osBluetoothPermissions","check","request","openSettings"],"sourceRoot":"../../../../../../src","sources":["modules/next/bluetooth/react-native/os-permissions.ts"],"mappings":";;AAAA,SAASA,OAAO,QAAQ,cAAc;AACtC,SAASC,aAAa,EAAgCC,eAAe,QAAQ,0BAA0B;AAEvG,SAASC,uBAAuB,QAAQ,2DAAwD;AAGhG,MAAMC,OAAsC,GAAG,IAAIC,GAAG,CAAC,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;AAE9E,MAAMC,YAAY,GAAGA,CACnBC,WAAkC,EAClCC,OAAsD,KAC9B;EACxB,MAAMC,QAAQ,GAAGF,WAAW,CAACG,GAAG,CAAEC,UAAU,IAAKH,OAAO,CAACG,UAAU,CAAC,CAAC;EAErE,IAAIF,QAAQ,CAACG,MAAM,GAAG,CAAC,IAAIH,QAAQ,CAACI,KAAK,CAAEC,MAAM,IAAKA,MAAM,KAAKC,SAAS,IAAIX,OAAO,CAACY,GAAG,CAACF,MAAM,CAAC,CAAC,EAAE;IAClG,OAAO,SAAS;EAClB;EAEA,OAAOL,QAAQ,CAACQ,QAAQ,CAAC,SAAS,CAAC,GAAG,SAAS,GAAG,QAAQ;AAC5D,CAAC;;AAED;AACA,MAAMC,sBAAsB,GAAGA,CAAA,MAA6B;EAC1DC,KAAK,EAAE,MAAAA,CAAA,KAAY;IACjB,MAAMZ,WAAW,GAAGJ,uBAAuB,CAAC,CAAC;IAE7C,OAAOG,YAAY,CAACC,WAAW,EAAE,MAAMN,aAAa,CAACM,WAAW,CAAC,CAAC;EACpE,CAAC;EACDa,OAAO,EAAE,MAAAA,CAAA,KAAY;IACnB,MAAMb,WAAW,GAAGJ,uBAAuB,CAAC,CAAC;IAE7C,OAAOG,YAAY,CAACC,WAAW,EAAE,MAAML,eAAe,CAACK,WAAW,CAAC,CAAC;EACtE,CAAC;EACDc,YAAY,EAAEA,CAAA,KAAMrB,OAAO,CAACqB,YAAY,CAAC;AAC3C,CAAC,CAAC;AAEF,SAASH,sBAAsB","ignoreList":[]}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/** The time the device took the reading, when it reported one. */
|
|
4
|
+
const recordedAtOf = measurement => {
|
|
5
|
+
const {
|
|
6
|
+
recordedAt
|
|
7
|
+
} = measurement;
|
|
8
|
+
return recordedAt instanceof Date && !Number.isNaN(recordedAt.getTime()) ? recordedAt : undefined;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
/** Saves readings for the signed-in account through the `Ovok` measurements API. */
|
|
12
|
+
const ovokReadingSink = client => ({
|
|
13
|
+
save: async ({
|
|
14
|
+
id,
|
|
15
|
+
device,
|
|
16
|
+
measurement
|
|
17
|
+
}) => {
|
|
18
|
+
const result = await client.measurements.save({
|
|
19
|
+
measurement,
|
|
20
|
+
sourceId: id,
|
|
21
|
+
effectiveDateTime: recordedAtOf(measurement),
|
|
22
|
+
device: {
|
|
23
|
+
id: device.id,
|
|
24
|
+
name: device.key,
|
|
25
|
+
localName: device.name,
|
|
26
|
+
manufacturerData: "",
|
|
27
|
+
manufacturerName: device.information?.manufacturerName,
|
|
28
|
+
model: device.information?.model,
|
|
29
|
+
sn: device.information?.serialNumber ?? ""
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
return result.status === "saved" ? {
|
|
33
|
+
status: "saved"
|
|
34
|
+
} : result;
|
|
35
|
+
},
|
|
36
|
+
flushQueued: async () => Object.keys((await client.measurements.offlineQueue.flush()).responses)
|
|
37
|
+
});
|
|
38
|
+
export { ovokReadingSink };
|
|
39
|
+
//# sourceMappingURL=ovok-sink.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["recordedAtOf","measurement","recordedAt","Date","Number","isNaN","getTime","undefined","ovokReadingSink","client","save","id","device","result","measurements","sourceId","effectiveDateTime","name","key","localName","manufacturerData","manufacturerName","information","model","sn","serialNumber","status","flushQueued","Object","keys","offlineQueue","flush","responses"],"sourceRoot":"../../../../../../src","sources":["modules/next/bluetooth/react-native/ovok-sink.ts"],"mappings":";;AAIA;AACA,MAAMA,YAAY,GAAIC,WAAmB,IAAuB;EAC9D,MAAM;IAAEC;EAAW,CAAC,GAAGD,WAAuC;EAE9D,OAAOC,UAAU,YAAYC,IAAI,IAAI,CAACC,MAAM,CAACC,KAAK,CAACH,UAAU,CAACI,OAAO,CAAC,CAAC,CAAC,GAAGJ,UAAU,GAAGK,SAAS;AACnG,CAAC;;AAED;AACA,MAAMC,eAAe,GAAIC,MAAY,KAAmB;EACtDC,IAAI,EAAE,MAAAA,CAAO;IAAEC,EAAE;IAAEC,MAAM;IAAEX;EAAY,CAAC,KAAK;IAC3C,MAAMY,MAAM,GAAG,MAAMJ,MAAM,CAACK,YAAY,CAACJ,IAAI,CAAC;MAC5CT,WAAW;MACXc,QAAQ,EAAEJ,EAAE;MACZK,iBAAiB,EAAEhB,YAAY,CAACC,WAAW,CAAC;MAC5CW,MAAM,EAAE;QACND,EAAE,EAAEC,MAAM,CAACD,EAAE;QACbM,IAAI,EAAEL,MAAM,CAACM,GAAG;QAChBC,SAAS,EAAEP,MAAM,CAACK,IAAI;QACtBG,gBAAgB,EAAE,EAAE;QACpBC,gBAAgB,EAAET,MAAM,CAACU,WAAW,EAAED,gBAAgB;QACtDE,KAAK,EAAEX,MAAM,CAACU,WAAW,EAAEC,KAAK;QAChCC,EAAE,EAAEZ,MAAM,CAACU,WAAW,EAAEG,YAAY,IAAI;MAC1C;IACF,CAAC,CAAC;IAEF,OAAOZ,MAAM,CAACa,MAAM,KAAK,OAAO,GAAG;MAAEA,MAAM,EAAE;IAAQ,CAAC,GAAGb,MAAM;EACjE,CAAC;EACDc,WAAW,EAAE,MAAAA,CAAA,KAAYC,MAAM,CAACC,IAAI,CAAC,CAAC,MAAMpB,MAAM,CAACK,YAAY,CAACgB,YAAY,CAACC,KAAK,CAAC,CAAC,EAAEC,SAAS;AACjG,CAAC,CAAC;AAEF,SAASxB,eAAe","ignoreList":[]}
|