@ovok/native 1.16.1-dev.2118 → 1.16.1-dev.2129
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/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/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/services/devices/bt-managed-device.js +1 -1
- package/lib/commonjs/modules/bt-management/services/devices/bt-managed-device.js.map +1 -1
- 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/result-identity.js +3 -25
- package/lib/commonjs/modules/bt-management/utils/result-identity.js.map +1 -1
- 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 +125 -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 +110 -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 +24 -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 +116 -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 +32 -0
- package/lib/commonjs/modules/next/bluetooth/react-native/ovok-sink.js.map +1 -0
- package/lib/commonjs/modules/next/bluetooth/readings.js +92 -0
- package/lib/commonjs/modules/next/bluetooth/readings.js.map +1 -0
- package/lib/commonjs/modules/next/bluetooth/result-policy.js +6 -1
- 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/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 +33 -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/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/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/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/services/devices/bt-managed-device.js +1 -1
- package/lib/module/modules/bt-management/services/devices/bt-managed-device.js.map +1 -1
- 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/result-identity.js +3 -25
- package/lib/module/modules/bt-management/utils/result-identity.js.map +1 -1
- 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 +122 -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 +106 -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 +23 -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 +21 -3
- 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 +28 -0
- package/lib/module/modules/next/bluetooth/react-native/ovok-sink.js.map +1 -0
- package/lib/module/modules/next/bluetooth/readings.js +88 -0
- package/lib/module/modules/next/bluetooth/readings.js.map +1 -0
- package/lib/module/modules/next/bluetooth/result-policy.js +6 -1
- 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/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 +28 -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/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/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/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/services/devices/bt-managed-device.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/result-identity.d.ts.map +1 -1
- 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 +21 -19
- 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 +32 -3
- 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 +2 -4
- 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 +3 -0
- 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/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 +69 -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 +3 -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/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/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/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/services/devices/bt-managed-device.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/result-identity.d.ts.map +1 -1
- 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 +21 -19
- 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 +32 -3
- 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 +2 -4
- 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 +3 -0
- 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/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 +69 -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 +3 -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/package.json +1 -1
- 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
|
@@ -3,42 +3,46 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.gattDriver = void 0;
|
|
7
|
-
var
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
/** Connects to a
|
|
6
|
+
exports.isTimestamped = exports.gattDriver = void 0;
|
|
7
|
+
var _stableHash = require("./stable-hash.js");
|
|
8
|
+
/** What a driver reports while it runs. */
|
|
9
|
+
|
|
10
|
+
/** Connects to a peripheral and reports what happens until it disconnects or `signal` aborts. */
|
|
11
11
|
|
|
12
12
|
/** One device's conversation over a link, as the readings it produces. */
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
14
|
+
/** Whether a reading carries the time it was taken, which makes a stored reading recognisable when resent. */
|
|
15
|
+
const isTimestamped = reading => {
|
|
16
|
+
const temporal = reading;
|
|
17
|
+
return [temporal.recordedAt, temporal.start, temporal.end].some(value => value instanceof Date);
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
/** The same for every resend of a timestamped reading; `null` for a reading without a time. */
|
|
21
|
+
exports.isTimestamped = isTimestamped;
|
|
22
|
+
const readingId = (key, peripheral, reading) => isTimestamped(reading) ? `ovok:${(0, _stableHash.stableHash)({
|
|
23
|
+
key,
|
|
24
|
+
peripheral: peripheral.id,
|
|
25
|
+
reading
|
|
26
|
+
})}` : null;
|
|
22
27
|
|
|
23
|
-
/** Runs a protocol over a fresh
|
|
24
|
-
const gattDriver = (
|
|
25
|
-
const link = await
|
|
26
|
-
const identity = readingIdentity(deviceName, device);
|
|
28
|
+
/** Runs a protocol over a fresh link. */
|
|
29
|
+
const gattDriver = (key, protocol) => async function* (peripheral, signal) {
|
|
30
|
+
const link = await peripheral.openLink(signal);
|
|
27
31
|
try {
|
|
28
32
|
yield {
|
|
29
33
|
kind: "status",
|
|
30
|
-
status:
|
|
34
|
+
status: "connected"
|
|
31
35
|
};
|
|
32
36
|
for await (const reading of protocol(link)) {
|
|
33
37
|
yield {
|
|
34
38
|
kind: "reading",
|
|
35
|
-
id: (
|
|
39
|
+
id: readingId(key, peripheral, reading),
|
|
36
40
|
reading
|
|
37
41
|
};
|
|
38
42
|
}
|
|
39
43
|
yield {
|
|
40
44
|
kind: "status",
|
|
41
|
-
status:
|
|
45
|
+
status: "disconnected"
|
|
42
46
|
};
|
|
43
47
|
} finally {
|
|
44
48
|
await link.close();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["_stableHash","require","isTimestamped","reading","temporal","recordedAt","start","end","some","value","Date","exports","readingId","key","peripheral","stableHash","id","gattDriver","protocol","signal","link","openLink","kind","status","close"],"sourceRoot":"../../../../../src","sources":["modules/next/bluetooth/driver.ts"],"mappings":";;;;;;AAIA,IAAAA,WAAA,GAAAC,OAAA;AAGA;;AA8BA;;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;AAAAC,OAAA,CAAAT,aAAA,GAAAA,aAAA;AACA,MAAMU,SAAS,GAAGA,CAACC,GAAW,EAAEC,UAAsB,EAAEX,OAAoB,KAC1ED,aAAa,CAACC,OAAO,CAAC,GAAG,QAAQ,IAAAY,sBAAU,EAAC;EAAEF,GAAG;EAAEC,UAAU,EAAEA,UAAU,CAACE,EAAE;EAAEb;AAAQ,CAAC,CAAC,EAAE,GAAG,IAAI;;AAEnG;AACA,MAAMc,UAAU,GAAGA,CAACJ,GAAW,EAAEK,QAAwB,KACvD,iBAAiBJ,UAAU,EAAEK,MAAM,EAAE;EACnC,MAAMC,IAAI,GAAG,MAAMN,UAAU,CAACO,QAAQ,CAACF,MAAM,CAAC;EAE9C,IAAI;IACF,MAAM;MAAEG,IAAI,EAAE,QAAQ;MAAEC,MAAM,EAAE;IAAY,CAAC;IAC7C,WAAW,MAAMpB,OAAO,IAAIe,QAAQ,CAACE,IAAI,CAAC,EAAE;MAC1C,MAAM;QAAEE,IAAI,EAAE,SAAS;QAAEN,EAAE,EAAEJ,SAAS,CAACC,GAAG,EAAEC,UAAU,EAAEX,OAAO,CAAC;QAAEA;MAAQ,CAAC;IAC7E;IACA,MAAM;MAAEmB,IAAI,EAAE,QAAQ;MAAEC,MAAM,EAAE;IAAe,CAAC;EAClD,CAAC,SAAS;IACR,MAAMH,IAAI,CAACI,KAAK,CAAC,CAAC;EACpB;AACF,CAAC;AAACb,OAAA,CAAAM,UAAA,GAAAA,UAAA","ignoreList":[]}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.asBluetoothError = exports.BluetoothError = void 0;
|
|
7
|
+
/** Why a Bluetooth operation failed. */
|
|
8
|
+
|
|
9
|
+
/** Every failure the Bluetooth runtime reports; `cause` holds the underlying error, when any. */
|
|
10
|
+
class BluetoothError extends Error {
|
|
11
|
+
/** Always `"BluetoothError"`. */
|
|
12
|
+
name = "BluetoothError";
|
|
13
|
+
constructor(/** Why it failed. */
|
|
14
|
+
code, message, cause) {
|
|
15
|
+
super(message, {
|
|
16
|
+
cause
|
|
17
|
+
});
|
|
18
|
+
this.code = code;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/** `error` as a `BluetoothError`, classified as `code` unless it already is one. */
|
|
23
|
+
exports.BluetoothError = BluetoothError;
|
|
24
|
+
const asBluetoothError = (error, code) => error instanceof BluetoothError ? error : new BluetoothError(code, error instanceof Error ? error.message : String(error), error);
|
|
25
|
+
exports.asBluetoothError = asBluetoothError;
|
|
26
|
+
//# sourceMappingURL=errors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["BluetoothError","Error","name","constructor","code","message","cause","exports","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;AAAAG,OAAA,CAAAP,cAAA,GAAAA,cAAA;AACA,MAAMQ,gBAAgB,GAAGA,CAACC,KAAc,EAAEL,IAAwB,KAChEK,KAAK,YAAYT,cAAc,GAC3BS,KAAK,GACL,IAAIT,cAAc,CAACI,IAAI,EAAEK,KAAK,YAAYR,KAAK,GAAGQ,KAAK,CAACJ,OAAO,GAAGK,MAAM,CAACD,KAAK,CAAC,EAAEA,KAAK,CAAC;AAACF,OAAA,CAAAC,gBAAA,GAAAA,gBAAA","ignoreList":[]}
|
|
@@ -3,16 +3,58 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
+
Object.defineProperty(exports, "BluetoothDevicePicker", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _bluetoothDevicePicker.BluetoothDevicePicker;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "BluetoothError", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () {
|
|
15
|
+
return _errors.BluetoothError;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
Object.defineProperty(exports, "BluetoothProvider", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function () {
|
|
21
|
+
return _context.BluetoothProvider;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
Object.defineProperty(exports, "BluetoothRuntime", {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
get: function () {
|
|
27
|
+
return _runtime.BluetoothRuntime;
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
Object.defineProperty(exports, "IntegratedDevices", {
|
|
31
|
+
enumerable: true,
|
|
32
|
+
get: function () {
|
|
33
|
+
return _integratedDevices.IntegratedDevices;
|
|
34
|
+
}
|
|
35
|
+
});
|
|
6
36
|
Object.defineProperty(exports, "SIG_PROTOCOLS", {
|
|
7
37
|
enumerable: true,
|
|
8
38
|
get: function () {
|
|
9
39
|
return _sigProfiles.SIG_PROTOCOLS;
|
|
10
40
|
}
|
|
11
41
|
});
|
|
12
|
-
Object.defineProperty(exports, "
|
|
42
|
+
Object.defineProperty(exports, "bleManagerScanner", {
|
|
13
43
|
enumerable: true,
|
|
14
44
|
get: function () {
|
|
15
|
-
return
|
|
45
|
+
return _bleScanner.bleManagerScanner;
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
Object.defineProperty(exports, "builtInDevices", {
|
|
49
|
+
enumerable: true,
|
|
50
|
+
get: function () {
|
|
51
|
+
return _builtInDevices.builtInDevices;
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
Object.defineProperty(exports, "createBluetoothRuntime", {
|
|
55
|
+
enumerable: true,
|
|
56
|
+
get: function () {
|
|
57
|
+
return _createBluetoothRuntime.createBluetoothRuntime;
|
|
16
58
|
}
|
|
17
59
|
});
|
|
18
60
|
Object.defineProperty(exports, "dailyTotalsOnly", {
|
|
@@ -21,6 +63,12 @@ Object.defineProperty(exports, "dailyTotalsOnly", {
|
|
|
21
63
|
return _resultPolicy.dailyTotalsOnly;
|
|
22
64
|
}
|
|
23
65
|
});
|
|
66
|
+
Object.defineProperty(exports, "defineDevice", {
|
|
67
|
+
enumerable: true,
|
|
68
|
+
get: function () {
|
|
69
|
+
return _devices.defineDevice;
|
|
70
|
+
}
|
|
71
|
+
});
|
|
24
72
|
Object.defineProperty(exports, "everyReading", {
|
|
25
73
|
enumerable: true,
|
|
26
74
|
get: function () {
|
|
@@ -33,22 +81,22 @@ Object.defineProperty(exports, "firstReadingPerKind", {
|
|
|
33
81
|
return _resultPolicy.firstReadingPerKind;
|
|
34
82
|
}
|
|
35
83
|
});
|
|
36
|
-
Object.defineProperty(exports, "
|
|
84
|
+
Object.defineProperty(exports, "keepReadings", {
|
|
37
85
|
enumerable: true,
|
|
38
86
|
get: function () {
|
|
39
|
-
return
|
|
87
|
+
return _resultPolicy.keepReadings;
|
|
40
88
|
}
|
|
41
89
|
});
|
|
42
|
-
Object.defineProperty(exports, "
|
|
90
|
+
Object.defineProperty(exports, "osBluetoothPermissions", {
|
|
43
91
|
enumerable: true,
|
|
44
92
|
get: function () {
|
|
45
|
-
return
|
|
93
|
+
return _osPermissions.osBluetoothPermissions;
|
|
46
94
|
}
|
|
47
95
|
});
|
|
48
|
-
Object.defineProperty(exports, "
|
|
96
|
+
Object.defineProperty(exports, "ovokReadingSink", {
|
|
49
97
|
enumerable: true,
|
|
50
98
|
get: function () {
|
|
51
|
-
return
|
|
99
|
+
return _ovokSink.ovokReadingSink;
|
|
52
100
|
}
|
|
53
101
|
});
|
|
54
102
|
Object.defineProperty(exports, "policyByKind", {
|
|
@@ -57,9 +105,66 @@ Object.defineProperty(exports, "policyByKind", {
|
|
|
57
105
|
return _resultPolicy.policyByKind;
|
|
58
106
|
}
|
|
59
107
|
});
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
108
|
+
Object.defineProperty(exports, "useBluetooth", {
|
|
109
|
+
enumerable: true,
|
|
110
|
+
get: function () {
|
|
111
|
+
return _context.useBluetooth;
|
|
112
|
+
}
|
|
113
|
+
});
|
|
114
|
+
Object.defineProperty(exports, "useBluetoothPermission", {
|
|
115
|
+
enumerable: true,
|
|
116
|
+
get: function () {
|
|
117
|
+
return _hooks.useBluetoothPermission;
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
|
+
Object.defineProperty(exports, "useBluetoothState", {
|
|
121
|
+
enumerable: true,
|
|
122
|
+
get: function () {
|
|
123
|
+
return _hooks.useBluetoothState;
|
|
124
|
+
}
|
|
125
|
+
});
|
|
126
|
+
Object.defineProperty(exports, "useMeasurements", {
|
|
127
|
+
enumerable: true,
|
|
128
|
+
get: function () {
|
|
129
|
+
return _hooks.useMeasurements;
|
|
130
|
+
}
|
|
131
|
+
});
|
|
132
|
+
Object.defineProperty(exports, "useNearbyDevice", {
|
|
133
|
+
enumerable: true,
|
|
134
|
+
get: function () {
|
|
135
|
+
return _hooks.useNearbyDevice;
|
|
136
|
+
}
|
|
137
|
+
});
|
|
138
|
+
Object.defineProperty(exports, "useNearbyDevices", {
|
|
139
|
+
enumerable: true,
|
|
140
|
+
get: function () {
|
|
141
|
+
return _hooks.useNearbyDevices;
|
|
142
|
+
}
|
|
143
|
+
});
|
|
144
|
+
Object.defineProperty(exports, "usePairedDevices", {
|
|
145
|
+
enumerable: true,
|
|
146
|
+
get: function () {
|
|
147
|
+
return _hooks.usePairedDevices;
|
|
148
|
+
}
|
|
149
|
+
});
|
|
150
|
+
Object.defineProperty(exports, "useScanning", {
|
|
151
|
+
enumerable: true,
|
|
152
|
+
get: function () {
|
|
153
|
+
return _hooks.useScanning;
|
|
154
|
+
}
|
|
155
|
+
});
|
|
156
|
+
var _runtime = require("./runtime.js");
|
|
157
|
+
var _errors = require("./errors.js");
|
|
158
|
+
var _devices = require("./devices.js");
|
|
63
159
|
var _resultPolicy = require("./result-policy.js");
|
|
64
160
|
var _sigProfiles = require("./sig-profiles.js");
|
|
161
|
+
var _bleScanner = require("./ble-plx/ble-scanner.js");
|
|
162
|
+
var _builtInDevices = require("./ble-plx/built-in-devices.js");
|
|
163
|
+
var _integratedDevices = require("../../bt-management/types/integrated-devices.js");
|
|
164
|
+
var _osPermissions = require("./react-native/os-permissions.js");
|
|
165
|
+
var _ovokSink = require("./react-native/ovok-sink.js");
|
|
166
|
+
var _createBluetoothRuntime = require("./react-native/create-bluetooth-runtime.js");
|
|
167
|
+
var _context = require("./react/context.js");
|
|
168
|
+
var _hooks = require("./react/hooks.js");
|
|
169
|
+
var _bluetoothDevicePicker = require("./react/bluetooth-device-picker.js");
|
|
65
170
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["_runtime","require","_errors","_devices","_resultPolicy","_sigProfiles","_bleScanner","_builtInDevices","_integratedDevices","_osPermissions","_ovokSink","_createBluetoothRuntime","_context","_hooks","_bluetoothDevicePicker"],"sourceRoot":"../../../../../src","sources":["modules/next/bluetooth/index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AASA,IAAAA,QAAA,GAAAC,OAAA;AAEA,IAAAC,OAAA,GAAAD,OAAA;AAOA,IAAAE,QAAA,GAAAF,OAAA;AAIA,IAAAG,aAAA,GAAAH,OAAA;AAEA,IAAAI,YAAA,GAAAJ,OAAA;AAEA,IAAAK,WAAA,GAAAL,OAAA;AACA,IAAAM,eAAA,GAAAN,OAAA;AACA,IAAAO,kBAAA,GAAAP,OAAA;AAEA,IAAAQ,cAAA,GAAAR,OAAA;AACA,IAAAS,SAAA,GAAAT,OAAA;AACA,IAAAU,uBAAA,GAAAV,OAAA;AAGA,IAAAW,QAAA,GAAAX,OAAA;AAEA,IAAAY,MAAA,GAAAZ,OAAA;AASA,IAAAa,sBAAA,GAAAb,OAAA","ignoreList":[]}
|
|
@@ -1,105 +1,2 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.openBleLink = openBleLink;
|
|
7
|
-
var _bluetoothError = require("../../bt-management/types/bluetooth-error.js");
|
|
8
|
-
var _sentryLogger = require("../../helpers/utils/sentry-logger.js");
|
|
9
|
-
var _channel = require("./channel.js");
|
|
10
|
-
/** An open GATT connection: bytes in, bytes out, no knowledge of any device. */
|
|
11
|
-
|
|
12
|
-
const CONNECT_ATTEMPTS = 5;
|
|
13
|
-
const FIRST_RETRY_DELAY_MS = 1000;
|
|
14
|
-
const MAX_RETRY_DELAY_MS = 5000;
|
|
15
|
-
|
|
16
|
-
/** BleErrorCode.OperationCancelled and DeviceDisconnected; the enum is not available at runtime. */
|
|
17
|
-
const ENDS_THE_LINK = new Set([2, 201]);
|
|
18
|
-
const toBytes = base64 => Uint8Array.from(atob(base64), char => char.charCodeAt(0));
|
|
19
|
-
const toBase64 = bytes => btoa(String.fromCharCode(...bytes));
|
|
20
|
-
const retryDelay = attempt => Math.min(FIRST_RETRY_DELAY_MS * 2 ** (attempt - 1), MAX_RETRY_DELAY_MS);
|
|
21
|
-
const wait = ms => new Promise(resolve => setTimeout(resolve, ms));
|
|
22
|
-
const abortReason = signal => signal.reason ?? new Error("The Bluetooth connection was cancelled");
|
|
23
|
-
async function connectWithRetries(device, signal) {
|
|
24
|
-
for (let attempt = 1;; attempt += 1) {
|
|
25
|
-
if (signal.aborted) {
|
|
26
|
-
throw abortReason(signal);
|
|
27
|
-
}
|
|
28
|
-
try {
|
|
29
|
-
if (!(await device.isConnected())) {
|
|
30
|
-
await device.connect();
|
|
31
|
-
}
|
|
32
|
-
return;
|
|
33
|
-
} catch (error) {
|
|
34
|
-
if (attempt >= CONNECT_ATTEMPTS) {
|
|
35
|
-
(0, _sentryLogger.sentryLogger)("error", "BLUETOOTH: Connection failed", {
|
|
36
|
-
errorCode: (0, _bluetoothError.toBluetoothError)(error).code,
|
|
37
|
-
attempts: attempt
|
|
38
|
-
});
|
|
39
|
-
throw error;
|
|
40
|
-
}
|
|
41
|
-
await wait(retryDelay(attempt));
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
class BleLink {
|
|
46
|
-
channels = new Set();
|
|
47
|
-
ended = false;
|
|
48
|
-
constructor(device) {
|
|
49
|
-
this.device = device;
|
|
50
|
-
this.disconnected = device.onDisconnected(() => this.endAll());
|
|
51
|
-
}
|
|
52
|
-
subscribe(service, characteristic) {
|
|
53
|
-
const channel = new _channel.Channel(() => {
|
|
54
|
-
subscription.remove();
|
|
55
|
-
this.channels.delete(channel);
|
|
56
|
-
});
|
|
57
|
-
const subscription = this.device.monitorCharacteristicForService(service, characteristic, (error, value) => {
|
|
58
|
-
if (error) {
|
|
59
|
-
this.endOrFail(channel, error);
|
|
60
|
-
} else if (value?.value) {
|
|
61
|
-
channel.push(toBytes(value.value));
|
|
62
|
-
}
|
|
63
|
-
});
|
|
64
|
-
this.channels.add(channel);
|
|
65
|
-
if (this.ended) {
|
|
66
|
-
channel.end();
|
|
67
|
-
}
|
|
68
|
-
return channel;
|
|
69
|
-
}
|
|
70
|
-
async write(service, characteristic, bytes) {
|
|
71
|
-
await this.device.writeCharacteristicWithResponseForService(service, characteristic, toBase64(bytes));
|
|
72
|
-
}
|
|
73
|
-
async close() {
|
|
74
|
-
this.endAll();
|
|
75
|
-
this.disconnected.remove();
|
|
76
|
-
await this.device.cancelConnection().catch(() => undefined);
|
|
77
|
-
}
|
|
78
|
-
endOrFail(channel, error) {
|
|
79
|
-
if (ENDS_THE_LINK.has(error.errorCode)) {
|
|
80
|
-
channel.end();
|
|
81
|
-
} else {
|
|
82
|
-
channel.fail((0, _bluetoothError.toBluetoothError)(error));
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
endAll() {
|
|
86
|
-
this.ended = true;
|
|
87
|
-
[...this.channels].forEach(channel => channel.end());
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
/** Connects (retrying with backoff) and discovers services; aborting `signal` closes the link. */
|
|
92
|
-
async function openBleLink(device, signal) {
|
|
93
|
-
await connectWithRetries(device, signal);
|
|
94
|
-
await device.discoverAllServicesAndCharacteristics();
|
|
95
|
-
const link = new BleLink(device);
|
|
96
|
-
if (signal.aborted) {
|
|
97
|
-
await link.close();
|
|
98
|
-
throw abortReason(signal);
|
|
99
|
-
}
|
|
100
|
-
signal.addEventListener("abort", () => void link.close(), {
|
|
101
|
-
once: true
|
|
102
|
-
});
|
|
103
|
-
return link;
|
|
104
|
-
}
|
|
105
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,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.PairedDevices = void 0;
|
|
7
|
+
const DEFAULT_PAIRED_KEY = "@ovok/native/next/paired-bluetooth-devices";
|
|
8
|
+
const parseIds = value => {
|
|
9
|
+
try {
|
|
10
|
+
const parsed = value ? JSON.parse(value) : [];
|
|
11
|
+
return Array.isArray(parsed) ? parsed.filter(id => typeof id === "string") : [];
|
|
12
|
+
} catch {
|
|
13
|
+
return [];
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
/** The paired device IDs, persisted when storage is given. */
|
|
18
|
+
class PairedDevices {
|
|
19
|
+
ids = [];
|
|
20
|
+
constructor(onChange, storage, key = DEFAULT_PAIRED_KEY) {
|
|
21
|
+
this.onChange = onChange;
|
|
22
|
+
this.storage = storage;
|
|
23
|
+
this.key = key;
|
|
24
|
+
this.loaded = this.load();
|
|
25
|
+
}
|
|
26
|
+
has(id) {
|
|
27
|
+
return this.ids.includes(id);
|
|
28
|
+
}
|
|
29
|
+
async add(id) {
|
|
30
|
+
await this.change(ids => [...new Set([...ids, id])]);
|
|
31
|
+
}
|
|
32
|
+
async remove(id) {
|
|
33
|
+
await this.change(ids => ids.filter(candidate => candidate !== id));
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/** Waits for the stored list, so a change never overwrites IDs not read yet. */
|
|
37
|
+
async change(update) {
|
|
38
|
+
await this.loaded;
|
|
39
|
+
this.ids = update(this.ids);
|
|
40
|
+
this.onChange(this.ids);
|
|
41
|
+
await this.storage?.setItem(this.key, JSON.stringify(this.ids));
|
|
42
|
+
}
|
|
43
|
+
async load() {
|
|
44
|
+
const stored = await Promise.resolve(this.storage?.getItem(this.key) ?? null).catch(() => null);
|
|
45
|
+
this.ids = parseIds(stored);
|
|
46
|
+
this.onChange(this.ids);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
exports.PairedDevices = PairedDevices;
|
|
50
|
+
//# 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","exports"],"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;AAACsB,OAAA,CAAAvB,aAAA,GAAAA,aAAA","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../../../src","sources":["modules/next/bluetooth/permissions.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.BluetoothDevicePicker = void 0;
|
|
7
|
+
var React = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _devicePickerSheet = require("../../../bt-management/components/device-picker-sheet.js");
|
|
9
|
+
var _context = require("./context.js");
|
|
10
|
+
var _hooks = require("./hooks.js");
|
|
11
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
13
|
+
/** Props of {@link BluetoothDevicePicker}. */
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* A bottom sheet listing the found devices; picking one connects to it. Built only from public hooks.
|
|
17
|
+
*
|
|
18
|
+
* @group Components
|
|
19
|
+
*/
|
|
20
|
+
const BluetoothDevicePicker = ({
|
|
21
|
+
onSelect,
|
|
22
|
+
title = "Choose a device",
|
|
23
|
+
dismissLabel = "Not now",
|
|
24
|
+
labelForDevice = device => device.name || device.key,
|
|
25
|
+
...props
|
|
26
|
+
}) => {
|
|
27
|
+
const runtime = (0, _context.useBluetooth)();
|
|
28
|
+
const devices = (0, _hooks.useNearbyDevices)();
|
|
29
|
+
const select = device => {
|
|
30
|
+
runtime.connect(device.id).catch(() => undefined);
|
|
31
|
+
onSelect?.(device);
|
|
32
|
+
};
|
|
33
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_devicePickerSheet.DevicePickerSheet, {
|
|
34
|
+
...props,
|
|
35
|
+
devices: devices,
|
|
36
|
+
onSelect: select,
|
|
37
|
+
title: title,
|
|
38
|
+
dismissLabel: dismissLabel,
|
|
39
|
+
labelForDevice: labelForDevice,
|
|
40
|
+
modelForDevice: device => device.key
|
|
41
|
+
});
|
|
42
|
+
};
|
|
43
|
+
exports.BluetoothDevicePicker = BluetoothDevicePicker;
|
|
44
|
+
//# sourceMappingURL=bluetooth-device-picker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","_interopRequireWildcard","require","_devicePickerSheet","_context","_hooks","_jsxRuntime","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","BluetoothDevicePicker","onSelect","title","dismissLabel","labelForDevice","device","name","key","props","runtime","useBluetooth","devices","useNearbyDevices","select","connect","id","catch","undefined","jsx","DevicePickerSheet","modelForDevice","exports"],"sourceRoot":"../../../../../../src","sources":["modules/next/bluetooth/react/bluetooth-device-picker.tsx"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AAIA,IAAAC,kBAAA,GAAAD,OAAA;AAGA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AAA2C,IAAAI,WAAA,GAAAJ,OAAA;AAAA,SAAAD,wBAAAM,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAR,uBAAA,YAAAA,CAAAM,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,GAAAM,CAAA,CAAAO,GAAA,CAAAb,CAAA,EAAAQ,CAAA,gBAAAP,CAAA,IAAAD,CAAA,gBAAAC,CAAA,OAAAa,cAAA,CAAAC,IAAA,CAAAf,CAAA,EAAAC,CAAA,OAAAM,CAAA,IAAAD,CAAA,GAAAU,MAAA,CAAAC,cAAA,KAAAD,MAAA,CAAAE,wBAAA,CAAAlB,CAAA,EAAAC,CAAA,OAAAM,CAAA,CAAAK,GAAA,IAAAL,CAAA,CAAAM,GAAA,IAAAP,CAAA,CAAAE,CAAA,EAAAP,CAAA,EAAAM,CAAA,IAAAC,CAAA,CAAAP,CAAA,IAAAD,CAAA,CAAAC,CAAA,WAAAO,CAAA,KAAAR,CAAA,EAAAC,CAAA;AAE3C;;AA+BA;AACA;AACA;AACA;AACA;AACA,MAAMkB,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,GAAG,IAAAC,qBAAY,EAAC,CAAC;EAC9B,MAAMC,OAAO,GAAG,IAAAC,uBAAgB,EAAC,CAAC;EAElC,MAAMC,MAAM,GAAIR,MAAoB,IAAK;IACvCI,OAAO,CAACK,OAAO,CAACT,MAAM,CAACU,EAAE,CAAC,CAACC,KAAK,CAAC,MAAMC,SAAS,CAAC;IACjDhB,QAAQ,GAAGI,MAAM,CAAC;EACpB,CAAC;EAED,oBACE,IAAAzB,WAAA,CAAAsC,GAAA,EAACzC,kBAAA,CAAA0C,iBAAiB;IAAA,GACZX,KAAK;IACTG,OAAO,EAAEA,OAAQ;IACjBV,QAAQ,EAAEY,MAAO;IACjBX,KAAK,EAAEA,KAAM;IACbC,YAAY,EAAEA,YAAa;IAC3BC,cAAc,EAAEA,cAAe;IAC/BgB,cAAc,EAAGf,MAAM,IAAKA,MAAM,CAACE;EAAI,CACxC,CAAC;AAEN,CAAC;AAACc,OAAA,CAAArB,qBAAA,GAAAA,qBAAA","ignoreList":[]}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useBluetooth = exports.BluetoothProvider = void 0;
|
|
7
|
+
var React = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _androidBluetoothForegroundService = require("../../../bt-management/components/android-bluetooth-foreground-service.js");
|
|
9
|
+
var _bleErrors = require("../ble-plx/ble-errors.js");
|
|
10
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
12
|
+
/** Props of {@link BluetoothProvider}. */
|
|
13
|
+
|
|
14
|
+
const RuntimeContext = /*#__PURE__*/React.createContext(null);
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Gives the Bluetooth hooks below it a runtime.
|
|
18
|
+
*
|
|
19
|
+
* @group Components
|
|
20
|
+
*/
|
|
21
|
+
const BluetoothProvider = ({
|
|
22
|
+
runtime,
|
|
23
|
+
androidForegroundService,
|
|
24
|
+
onForegroundServiceError,
|
|
25
|
+
children
|
|
26
|
+
}) => /*#__PURE__*/(0, _jsxRuntime.jsx)(RuntimeContext.Provider, {
|
|
27
|
+
value: runtime,
|
|
28
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_androidBluetoothForegroundService.AndroidBluetoothForegroundService, {
|
|
29
|
+
enabled: androidForegroundService !== undefined,
|
|
30
|
+
options: androidForegroundService,
|
|
31
|
+
onError: ({
|
|
32
|
+
error
|
|
33
|
+
}) => onForegroundServiceError?.((0, _bleErrors.fromBleError)(error)),
|
|
34
|
+
children: children
|
|
35
|
+
})
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* The runtime of the enclosing `BluetoothProvider`: every Bluetooth action is a call on it.
|
|
40
|
+
*
|
|
41
|
+
* @throws When rendered outside `BluetoothProvider`.
|
|
42
|
+
*
|
|
43
|
+
* @group Hooks
|
|
44
|
+
*/
|
|
45
|
+
exports.BluetoothProvider = BluetoothProvider;
|
|
46
|
+
const useBluetooth = () => {
|
|
47
|
+
const runtime = React.useContext(RuntimeContext);
|
|
48
|
+
if (!runtime) {
|
|
49
|
+
throw new Error("Bluetooth hooks must be rendered inside BluetoothProvider");
|
|
50
|
+
}
|
|
51
|
+
return runtime;
|
|
52
|
+
};
|
|
53
|
+
exports.useBluetooth = useBluetooth;
|
|
54
|
+
//# sourceMappingURL=context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","_interopRequireWildcard","require","_androidBluetoothForegroundService","_bleErrors","_jsxRuntime","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","RuntimeContext","createContext","BluetoothProvider","runtime","androidForegroundService","onForegroundServiceError","children","jsx","Provider","value","AndroidBluetoothForegroundService","enabled","undefined","options","onError","error","fromBleError","exports","useBluetooth","useContext","Error"],"sourceRoot":"../../../../../../src","sources":["modules/next/bluetooth/react/context.tsx"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AAIA,IAAAC,kCAAA,GAAAD,OAAA;AACA,IAAAE,UAAA,GAAAF,OAAA;AAAqD,IAAAG,WAAA,GAAAH,OAAA;AAAA,SAAAD,wBAAAK,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAP,uBAAA,YAAAA,CAAAK,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,GAAAM,CAAA,CAAAO,GAAA,CAAAb,CAAA,EAAAQ,CAAA,gBAAAP,CAAA,IAAAD,CAAA,gBAAAC,CAAA,OAAAa,cAAA,CAAAC,IAAA,CAAAf,CAAA,EAAAC,CAAA,OAAAM,CAAA,IAAAD,CAAA,GAAAU,MAAA,CAAAC,cAAA,KAAAD,MAAA,CAAAE,wBAAA,CAAAlB,CAAA,EAAAC,CAAA,OAAAM,CAAA,CAAAK,GAAA,IAAAL,CAAA,CAAAM,GAAA,IAAAP,CAAA,CAAAE,CAAA,EAAAP,CAAA,EAAAM,CAAA,IAAAC,CAAA,CAAAP,CAAA,IAAAD,CAAA,CAAAC,CAAA,WAAAO,CAAA,KAAAR,CAAA,EAAAC,CAAA;AAKrD;;AAaA,MAAMkB,cAAc,gBAAGzB,KAAK,CAAC0B,aAAa,CAA0B,IAAI,CAAC;;AAEzE;AACA;AACA;AACA;AACA;AACA,MAAMC,iBAAiB,GAAGA,CAAC;EACzBC,OAAO;EACPC,wBAAwB;EACxBC,wBAAwB;EACxBC;AACsB,CAAC,kBACvB,IAAA1B,WAAA,CAAA2B,GAAA,EAACP,cAAc,CAACQ,QAAQ;EAACC,KAAK,EAAEN,OAAQ;EAAAG,QAAA,eACtC,IAAA1B,WAAA,CAAA2B,GAAA,EAAC7B,kCAAA,CAAAgC,iCAAiC;IAChCC,OAAO,EAAEP,wBAAwB,KAAKQ,SAAU;IAChDC,OAAO,EAAET,wBAAyB;IAClCU,OAAO,EAAEA,CAAC;MAAEC;IAAM,CAAC,KAAKV,wBAAwB,GAAG,IAAAW,uBAAY,EAACD,KAAK,CAAC,CAAE;IAAAT,QAAA,EAEvEA;EAAQ,CACwB;AAAC,CACb,CAC1B;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AANAW,OAAA,CAAAf,iBAAA,GAAAA,iBAAA;AAOA,MAAMgB,YAAY,GAAGA,CAAA,KAAwB;EAC3C,MAAMf,OAAO,GAAG5B,KAAK,CAAC4C,UAAU,CAACnB,cAAc,CAAC;EAEhD,IAAI,CAACG,OAAO,EAAE;IACZ,MAAM,IAAIiB,KAAK,CAAC,2DAA2D,CAAC;EAC9E;EAEA,OAAOjB,OAAO;AAChB,CAAC;AAACc,OAAA,CAAAC,YAAA,GAAAA,YAAA","ignoreList":[]}
|