@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
package/lib/module/modules/bt-management/services/devices/standard-gatt/standard-gatt.devices.js
CHANGED
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
import { MeasurementTypeKey } from "@ovok/core/next";
|
|
6
6
|
import { byteToHex } from "../../../utils/bytes-to-hex.js";
|
|
7
|
+
import { KPA_TO_MMHG } from "../../../utils/kpa-to-mmhg.js";
|
|
8
|
+
import { decorateHeartRateReading, decoratePulseOximeterReading, decorateThermometerReading, decorateWeightReading } from "./standard-gatt.decorators.js";
|
|
7
9
|
import { standardGlucoseDevice } from "./standard-gatt.glucose.js";
|
|
8
10
|
import { decorateBloodPressureReading, declareProfile, littleEndian } from "./standard-gatt.profile.js";
|
|
9
11
|
|
|
@@ -18,12 +20,20 @@ import { decorateBloodPressureReading, declareProfile, littleEndian } from "./st
|
|
|
18
20
|
* every vendor names its hardware differently. A product declares the profile and supplies
|
|
19
21
|
* the name its own hardware advertises.
|
|
20
22
|
*
|
|
21
|
-
* Values are little-endian, as the specification requires.
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
* such a device yields no reading rather than one that is quietly wrong.
|
|
23
|
+
* Values are little-endian, as the specification requires. A device may report in kPa,
|
|
24
|
+
* Fahrenheit or pounds; each field is then declared with the scale and offset that convert
|
|
25
|
+
* it to the catalog's canonical unit.
|
|
25
26
|
*/
|
|
26
27
|
|
|
28
|
+
const BLOOD_PRESSURE_KPA = 0x01;
|
|
29
|
+
const BLOOD_PRESSURE_TIMESTAMP = 0x02;
|
|
30
|
+
const BLOOD_PRESSURE_PULSE = 0x04;
|
|
31
|
+
|
|
32
|
+
/** Bits 0-4 are defined: kPa, timestamp, pulse, user id and measurement status. */
|
|
33
|
+
const BLOOD_PRESSURE_FLAGS = Array.from({
|
|
34
|
+
length: 32
|
|
35
|
+
}, (_, flags) => flags);
|
|
36
|
+
|
|
27
37
|
/**
|
|
28
38
|
* Blood Pressure Service 0x1810, Blood Pressure Measurement 0x2A35.
|
|
29
39
|
*
|
|
@@ -33,8 +43,8 @@ import { decorateBloodPressureReading, declareProfile, littleEndian } from "./st
|
|
|
33
43
|
* declares the length it needs. A device that reports no pulse still decodes, because the
|
|
34
44
|
* flags value it sends selects a case that never looks for one.
|
|
35
45
|
*
|
|
36
|
-
* Bit 3 (user id
|
|
37
|
-
*
|
|
46
|
+
* Bit 3 (user id) and bit 4 (measurement status) follow the pulse, so neither moves it.
|
|
47
|
+
* Bit 0 says the pressures are in kPa, which is converted to whole mmHg.
|
|
38
48
|
*/
|
|
39
49
|
/** Bit 2 set, bit 1 clear: the pulse follows the mean pressure. */
|
|
40
50
|
const pulseAfterMeanPressure = {
|
|
@@ -47,35 +57,25 @@ const pulseAfterTimestamp = {
|
|
|
47
57
|
fields: [littleEndian("heartRate", [14, 15], "bpm", "sfloat")],
|
|
48
58
|
minLengthBytes: 16
|
|
49
59
|
};
|
|
60
|
+
const pressureInKpa = (name, byteIndexes) => ({
|
|
61
|
+
...littleEndian(name, byteIndexes, "mmHg", "sfloat"),
|
|
62
|
+
scale: KPA_TO_MMHG,
|
|
63
|
+
decimals: 0
|
|
64
|
+
});
|
|
65
|
+
const pressuresInKpa = [pressureInKpa("systolic", [1, 2]), pressureInKpa("diastolic", [3, 4])];
|
|
50
66
|
|
|
51
67
|
/** Declares a Bluetooth SIG blood pressure profile device. */
|
|
52
|
-
const standardBloodPressureDevice = params => declareProfile({
|
|
53
|
-
...params,
|
|
54
|
-
decorateReading: (reading, frame, recordOffset) => {
|
|
55
|
-
const decorated = decorateBloodPressureReading(reading, frame, recordOffset);
|
|
56
|
-
if (!decorated) {
|
|
57
|
-
return null;
|
|
58
|
-
}
|
|
59
|
-
return params.decorateReading ? params.decorateReading(decorated, frame, recordOffset) : decorated;
|
|
60
|
-
}
|
|
61
|
-
}, {
|
|
68
|
+
const standardBloodPressureDevice = params => declareProfile(params, {
|
|
62
69
|
service: "1810",
|
|
63
70
|
characteristic: "2a35",
|
|
64
71
|
minLengthBytes: 7,
|
|
65
72
|
measurementTypeKey: MeasurementTypeKey.bloodPressure,
|
|
66
|
-
|
|
67
|
-
selectors:
|
|
73
|
+
decorateReading: decorateBloodPressureReading,
|
|
74
|
+
selectors: BLOOD_PRESSURE_FLAGS.map(byteToHex),
|
|
75
|
+
/** mmHg; the kPa shapes override it in `fieldsBySelector`. */
|
|
68
76
|
fields: [littleEndian("systolic", [1, 2], "mmHg", "sfloat"), littleEndian("diastolic", [3, 4], "mmHg", "sfloat")],
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
"0c": pulseAfterMeanPressure,
|
|
72
|
-
"14": pulseAfterMeanPressure,
|
|
73
|
-
"1c": pulseAfterMeanPressure,
|
|
74
|
-
"06": pulseAfterTimestamp,
|
|
75
|
-
"0e": pulseAfterTimestamp,
|
|
76
|
-
"16": pulseAfterTimestamp,
|
|
77
|
-
"1e": pulseAfterTimestamp
|
|
78
|
-
}
|
|
77
|
+
fieldsBySelector: Object.fromEntries(BLOOD_PRESSURE_FLAGS.filter(flags => flags & BLOOD_PRESSURE_KPA).map(flags => [byteToHex(flags), pressuresInKpa])),
|
|
78
|
+
optionalFields: Object.fromEntries(BLOOD_PRESSURE_FLAGS.filter(flags => flags & BLOOD_PRESSURE_PULSE).map(flags => [byteToHex(flags), flags & BLOOD_PRESSURE_TIMESTAMP ? pulseAfterTimestamp : pulseAfterMeanPressure]))
|
|
79
79
|
});
|
|
80
80
|
|
|
81
81
|
/** Health Thermometer Service 0x1809, Temperature Measurement 0x2A1C. */
|
|
@@ -84,6 +84,7 @@ const standardThermometerDevice = params => declareProfile(params, {
|
|
|
84
84
|
characteristic: "2a1c",
|
|
85
85
|
minLengthBytes: 5,
|
|
86
86
|
measurementTypeKey: MeasurementTypeKey.temperature,
|
|
87
|
+
decorateReading: decorateThermometerReading,
|
|
87
88
|
/** All combinations of Fahrenheit, timestamp and temperature type flags. */
|
|
88
89
|
selectors: ["00", "02", "04", "06", "01", "03", "05", "07"],
|
|
89
90
|
fields: [littleEndian("bodyTemp", [1, 2, 3, 4], "Cel", "float")],
|
|
@@ -122,12 +123,14 @@ const WEIGHT_KG_PER_COUNT = 0.005;
|
|
|
122
123
|
* Weight Scale Service 0x181D, Weight Measurement 0x2A9D.
|
|
123
124
|
*
|
|
124
125
|
* The reading is a scaled integer rather than a float, so the resolution is applied here.
|
|
126
|
+
* A weight of 0xFFFF means the measurement failed, so it yields no reading.
|
|
125
127
|
*/
|
|
126
128
|
const standardWeightScaleDevice = params => declareProfile(params, {
|
|
127
129
|
service: "181d",
|
|
128
130
|
characteristic: "2a9d",
|
|
129
131
|
minLengthBytes: 3,
|
|
130
132
|
measurementTypeKey: MeasurementTypeKey.bodyWeight,
|
|
133
|
+
decorateReading: decorateWeightReading,
|
|
131
134
|
/** Unit, timestamp, user-id and BMI/height flags may all follow the value. */
|
|
132
135
|
selectors: Array.from({
|
|
133
136
|
length: 16
|
|
@@ -153,14 +156,16 @@ const standardWeightScaleDevice = params => declareProfile(params, {
|
|
|
153
156
|
* Pulse Oximeter Service 0x1822, PLX Spot-Check Measurement 0x2A5E.
|
|
154
157
|
*
|
|
155
158
|
* Saturation and pulse rate are both required by the catalog, which matches the
|
|
156
|
-
* specification: a spot-check measurement always carries both
|
|
159
|
+
* specification: a spot-check measurement always carries both, at bytes 1-4 whatever the
|
|
160
|
+
* flags say, so every flags value selects the same fields. The optional ones follow them.
|
|
157
161
|
*/
|
|
158
162
|
const standardPulseOximeterDevice = params => declareProfile(params, {
|
|
159
163
|
service: "1822",
|
|
160
164
|
characteristic: "2a5e",
|
|
161
165
|
minLengthBytes: 5,
|
|
162
166
|
measurementTypeKey: MeasurementTypeKey.bloodOxygenPulseRate,
|
|
163
|
-
|
|
167
|
+
decorateReading: decoratePulseOximeterReading,
|
|
168
|
+
selectors: ["*"],
|
|
164
169
|
fields: [littleEndian("bloodOxygen", [1, 2], "%", "sfloat"), littleEndian("pulseRate", [3, 4], "bpm", "sfloat")]
|
|
165
170
|
});
|
|
166
171
|
|
|
@@ -176,13 +181,15 @@ const UINT16_HEART_RATE_FLAGS = HEART_RATE_FLAGS.filter(flags => (flags & 0x01)
|
|
|
176
181
|
* Heart Rate Service 0x180D, Heart Rate Measurement 0x2A37.
|
|
177
182
|
*
|
|
178
183
|
* Both heart-rate layouts are declared. A contact-not-detected frame is idle, so it cannot
|
|
179
|
-
* become a false reading while the strap is off the body.
|
|
184
|
+
* become a false reading while the strap is off the body. RR intervals, a list of any
|
|
185
|
+
* length, are read from the frame by the decorator and reported as `rrIntervals`.
|
|
180
186
|
*/
|
|
181
187
|
const standardHeartRateDevice = params => declareProfile(params, {
|
|
182
188
|
service: "180d",
|
|
183
189
|
characteristic: "2a37",
|
|
184
190
|
minLengthBytes: 2,
|
|
185
191
|
measurementTypeKey: MeasurementTypeKey.heartRate,
|
|
192
|
+
decorateReading: decorateHeartRateReading,
|
|
186
193
|
selectors: HEART_RATE_FLAGS.map(byteToHex),
|
|
187
194
|
fields: [{
|
|
188
195
|
name: "heartRate",
|
package/lib/module/modules/bt-management/services/devices/standard-gatt/standard-gatt.devices.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["MeasurementTypeKey","byteToHex","standardGlucoseDevice","decorateBloodPressureReading","declareProfile","littleEndian","
|
|
1
|
+
{"version":3,"names":["MeasurementTypeKey","byteToHex","KPA_TO_MMHG","decorateHeartRateReading","decoratePulseOximeterReading","decorateThermometerReading","decorateWeightReading","standardGlucoseDevice","decorateBloodPressureReading","declareProfile","littleEndian","BLOOD_PRESSURE_KPA","BLOOD_PRESSURE_TIMESTAMP","BLOOD_PRESSURE_PULSE","BLOOD_PRESSURE_FLAGS","Array","from","length","_","flags","pulseAfterMeanPressure","fields","minLengthBytes","pulseAfterTimestamp","pressureInKpa","name","byteIndexes","scale","decimals","pressuresInKpa","standardBloodPressureDevice","params","service","characteristic","measurementTypeKey","bloodPressure","decorateReading","selectors","map","fieldsBySelector","Object","fromEntries","filter","optionalFields","standardThermometerDevice","temperature","offset","WEIGHT_KG_PER_COUNT","standardWeightScaleDevice","bodyWeight","selector","standardPulseOximeterDevice","bloodOxygenPulseRate","HEART_RATE_FLAGS","UINT16_HEART_RATE_FLAGS","standardHeartRateDevice","heartRate","encoding","unit","byteOrder"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/standard-gatt/standard-gatt.devices.ts"],"mappings":";;AAAA;;AAEA,SAASA,kBAAkB,QAAQ,iBAAiB;AAIpD,SAASC,SAAS,QAAQ,gCAA6B;AACvD,SAASC,WAAW,QAAQ,+BAA4B;AAExD,SACEC,wBAAwB,EACxBC,4BAA4B,EAC5BC,0BAA0B,EAC1BC,qBAAqB,QAChB,+BAA4B;AACnC,SAASC,qBAAqB,QAAQ,4BAAyB;AAC/D,SACEC,4BAA4B,EAC5BC,cAAc,EACdC,YAAY,QAEP,4BAAyB;;AAEhC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,MAAMC,kBAAkB,GAAG,IAAI;AAC/B,MAAMC,wBAAwB,GAAG,IAAI;AACrC,MAAMC,oBAAoB,GAAG,IAAI;;AAEjC;AACA,MAAMC,o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AAE,CAAC,CAAC,EAAE,CAAC,CAAC;IACnBiC,SAAS,EAAE,QAAiB;IAC5BF,QAAQ,EAAE,MAAe;IACzBC,IAAI,EAAE;EACR,CAAC,CACF,CACF,CACL,CAAC;EACDf,cAAc,EAAEH,MAAM,CAACC,WAAW,CAChCa,uBAAuB,CAAChB,GAAG,CAAEnB,KAAK,IAAK,CAAClB,SAAS,CAACkB,KAAK,CAAC,EAAE;IACtDE,MAAM,EAAE,EAAE;IACVC,cAAc,EAAE;EAClB,CAAC,CAAC,CACN;AACF,CAAC,CAAC;AAEJ,SACEQ,2BAA2B,EAC3BvB,qBAAqB,EACrBgD,uBAAuB,EACvBJ,2BAA2B,EAC3BP,yBAAyB,EACzBI,yBAAyB","ignoreList":[]}
|
package/lib/module/modules/bt-management/services/devices/standard-gatt/standard-gatt.frame.js
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/** The Bluetooth SIG Date Time characteristic is seven bytes long. */
|
|
4
|
+
const DATE_TIME_BYTES = 7;
|
|
5
|
+
|
|
6
|
+
/** The byte at `index` of a record that starts at `offset`; undefined when the frame ends first. */
|
|
7
|
+
const byteAt = (frame, index, offset) => {
|
|
8
|
+
const value = Number.parseInt(frame[index + offset] ?? "", 16);
|
|
9
|
+
return Number.isInteger(value) && value >= 0 && value <= 0xff ? value : undefined;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
/** Reads a SIG Date Time at `index` as a phone-local date; undefined for missing or impossible fields. */
|
|
13
|
+
const dateTimeAt = (frame, index, offset = 0) => {
|
|
14
|
+
const yearLow = byteAt(frame, index, offset);
|
|
15
|
+
const yearHigh = byteAt(frame, index + 1, offset);
|
|
16
|
+
const month = byteAt(frame, index + 2, offset);
|
|
17
|
+
const day = byteAt(frame, index + 3, offset);
|
|
18
|
+
const hour = byteAt(frame, index + 4, offset);
|
|
19
|
+
const minute = byteAt(frame, index + 5, offset);
|
|
20
|
+
const second = byteAt(frame, index + 6, offset);
|
|
21
|
+
if (yearLow === undefined || yearHigh === undefined || month === undefined || day === undefined || hour === undefined || minute === undefined || second === undefined) {
|
|
22
|
+
return undefined;
|
|
23
|
+
}
|
|
24
|
+
const year = yearLow | yearHigh << 8;
|
|
25
|
+
const date = new Date(year, month - 1, day, hour, minute, second);
|
|
26
|
+
return date.getFullYear() === year && date.getMonth() === month - 1 && date.getDate() === day && date.getHours() === hour && date.getMinutes() === minute && date.getSeconds() === second ? date : undefined;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
/** `reading` plus each of `metadata` that has a value. */
|
|
30
|
+
const withDefinedMetadata = (reading, metadata) => ({
|
|
31
|
+
...reading,
|
|
32
|
+
...Object.fromEntries(Object.entries(metadata).filter(([, value]) => value !== undefined))
|
|
33
|
+
});
|
|
34
|
+
export { byteAt, DATE_TIME_BYTES, dateTimeAt, withDefinedMetadata };
|
|
35
|
+
//# sourceMappingURL=standard-gatt.frame.js.map
|
package/lib/module/modules/bt-management/services/devices/standard-gatt/standard-gatt.frame.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["DATE_TIME_BYTES","byteAt","frame","index","offset","value","Number","parseInt","isInteger","undefined","dateTimeAt","yearLow","yearHigh","month","day","hour","minute","second","year","date","Date","getFullYear","getMonth","getDate","getHours","getMinutes","getSeconds","withDefinedMetadata","reading","metadata","Object","fromEntries","entries","filter"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/standard-gatt/standard-gatt.frame.ts"],"mappings":";;AAAA;AACA,MAAMA,eAAe,GAAG,CAAC;;AAEzB;AACA,MAAMC,MAAM,GAAGA,CACbC,KAAwB,EACxBC,KAAa,EACbC,MAAc,KACS;EACvB,MAAMC,KAAK,GAAGC,MAAM,CAACC,QAAQ,CAACL,KAAK,CAACC,KAAK,GAAGC,MAAM,CAAC,IAAI,EAAE,EAAE,EAAE,CAAC;EAE9D,OAAOE,MAAM,CAACE,SAAS,CAACH,KAAK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AOE,IAAI,CAACE,WAAW,CAAC,CAAC,KAAKH,IAAI,IAChCC,IAAI,CAACG,QAAQ,CAAC,CAAC,KAAKT,KAAK,GAAG,CAAC,IAC7BM,IAAI,CAACI,OAAO,CAAC,CAAC,KAAKT,GAAG,IACtBK,IAAI,CAACK,QAAQ,CAAC,CAAC,KAAKT,IAAI,IACxBI,IAAI,CAACM,UAAU,CAAC,CAAC,KAAKT,MAAM,IAC5BG,IAAI,CAACO,UAAU,CAAC,CAAC,KAAKT,MAAM,GAC1BE,IAAI,GACJV,SAAS;AACf,CAAC;;AAED;AACA,MAAMkB,mBAAmB,GAAGA,CAC1BC,OAAU,EACVC,QAA2C,MACpC;EACP,GAAGD,OAAO;EACV,GAAGE,MAAM,CAACC,WAAW,CACnBD,MAAM,CAACE,OAAO,CAACH,QAAQ,CAAC,CAACI,MAAM,CAAC,CAAC,GAAG5B,KAAK,CAAC,KAAKA,KAAK,KAAKI,SAAS,CACpE;AACF,CAAC,CAAC;AAEF,SAASR,MAAM,EAAED,eAAe,EAAEU,UAAU,EAAEiB,mBAAmB","ignoreList":[]}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { byte, FLAG_MOL_PER_L, hasFlag, sensorStatusFromGlucoseFrame, sequenceNumberFromGlucoseFrame, typeAndLocationFromGlucoseFrame } from "./standard-gatt.glucose-frame.js";
|
|
4
|
+
const NIBBLE_BITS = 4;
|
|
5
|
+
const NIBBLE_MASK = 0x0f;
|
|
6
|
+
|
|
7
|
+
/** Indexed by the specimen type code; 0, 10 (control solution) and 11-15 are not a patient sample. */
|
|
8
|
+
const SPECIMEN_TYPES = [undefined, "capillaryWholeBlood", "capillaryPlasma", "venousWholeBlood", "venousPlasma", "arterialWholeBlood", "arterialPlasma", "undeterminedWholeBlood", "undeterminedPlasma", "interstitialFluid"];
|
|
9
|
+
|
|
10
|
+
/** Indexed by the sample location code; 0, 4 (control solution), 5-14 and 15 (not available) say nothing. */
|
|
11
|
+
const SAMPLE_LOCATIONS = [undefined, "finger", "alternateSite", "earlobe"];
|
|
12
|
+
const STATUS_BATTERY_LOW = 0x0001;
|
|
13
|
+
const STATUS_SENSOR_MALFUNCTION = 0x0002;
|
|
14
|
+
const STATUS_SAMPLE_TOO_SMALL = 0x0004;
|
|
15
|
+
const STATUS_STRIP_INSERTION_ERROR = 0x0008;
|
|
16
|
+
const STATUS_STRIP_TYPE_INCORRECT = 0x0010;
|
|
17
|
+
const STATUS_RESULT_TOO_HIGH = 0x0020;
|
|
18
|
+
const STATUS_RESULT_TOO_LOW = 0x0040;
|
|
19
|
+
const STATUS_TEMPERATURE_TOO_HIGH = 0x0080;
|
|
20
|
+
const STATUS_TEMPERATURE_TOO_LOW = 0x0100;
|
|
21
|
+
const STATUS_READ_INTERRUPTED = 0x0200;
|
|
22
|
+
const STATUS_DEVICE_FAULT = 0x0400;
|
|
23
|
+
const STATUS_TIME_FAULT = 0x0800;
|
|
24
|
+
|
|
25
|
+
/** The test did not take place properly, so the concentration is not a patient's result. */
|
|
26
|
+
const UNUSABLE_STATUS = STATUS_SENSOR_MALFUNCTION | STATUS_SAMPLE_TOO_SMALL | STATUS_STRIP_INSERTION_ERROR | STATUS_STRIP_TYPE_INCORRECT | STATUS_READ_INTERRUPTED | STATUS_DEVICE_FAULT;
|
|
27
|
+
const SENSOR_WARNINGS = [[STATUS_BATTERY_LOW, "batteryLow"], [STATUS_TEMPERATURE_TOO_HIGH, "temperatureTooHigh"], [STATUS_TEMPERATURE_TOO_LOW, "temperatureTooLow"], [STATUS_TIME_FAULT, "timeFault"]];
|
|
28
|
+
const reportedUnit = frame => hasFlag(byte(frame, 0) ?? 0, FLAG_MOL_PER_L) ? "mmol/L" : "mg/dL";
|
|
29
|
+
const outOfRange = status => {
|
|
30
|
+
if (hasFlag(status, STATUS_RESULT_TOO_HIGH)) {
|
|
31
|
+
return "high";
|
|
32
|
+
}
|
|
33
|
+
return hasFlag(status, STATUS_RESULT_TOO_LOW) ? "low" : undefined;
|
|
34
|
+
};
|
|
35
|
+
const sensorWarnings = status => SENSOR_WARNINGS.filter(([flag]) => hasFlag(status, flag)).map(([, warning]) => warning);
|
|
36
|
+
|
|
37
|
+
/** Whether the meter flagged the record as a test that failed rather than a result. */
|
|
38
|
+
const hasUnusableSensorStatus = frame => {
|
|
39
|
+
const status = sensorStatusFromGlucoseFrame(frame);
|
|
40
|
+
return status !== undefined && hasFlag(status, UNUSABLE_STATUS);
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
/** What the record says about itself, beside its concentration. */
|
|
44
|
+
const glucoseRecordDetails = frame => {
|
|
45
|
+
const sequenceNumber = sequenceNumberFromGlucoseFrame(frame);
|
|
46
|
+
const typeAndLocation = typeAndLocationFromGlucoseFrame(frame);
|
|
47
|
+
const status = sensorStatusFromGlucoseFrame(frame);
|
|
48
|
+
const specimen = typeAndLocation === undefined ? undefined : SPECIMEN_TYPES[typeAndLocation & NIBBLE_MASK];
|
|
49
|
+
const sampleLocation = typeAndLocation === undefined ? undefined : SAMPLE_LOCATIONS[typeAndLocation >> NIBBLE_BITS];
|
|
50
|
+
const range = status === undefined ? undefined : outOfRange(status);
|
|
51
|
+
const warnings = status === undefined ? [] : sensorWarnings(status);
|
|
52
|
+
return {
|
|
53
|
+
reportedUnit: reportedUnit(frame),
|
|
54
|
+
...(sequenceNumber !== undefined && {
|
|
55
|
+
sequenceNumber
|
|
56
|
+
}),
|
|
57
|
+
...(specimen && {
|
|
58
|
+
specimen
|
|
59
|
+
}),
|
|
60
|
+
...(sampleLocation && {
|
|
61
|
+
sampleLocation
|
|
62
|
+
}),
|
|
63
|
+
...(range && {
|
|
64
|
+
outOfRange: range
|
|
65
|
+
}),
|
|
66
|
+
...(warnings.length > 0 && {
|
|
67
|
+
sensorStatus: warnings
|
|
68
|
+
})
|
|
69
|
+
};
|
|
70
|
+
};
|
|
71
|
+
export { glucoseRecordDetails, hasUnusableSensorStatus };
|
|
72
|
+
//# sourceMappingURL=standard-gatt.glucose-details.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["byte","FLAG_MOL_PER_L","hasFlag","sensorStatusFromGlucoseFrame","sequenceNumberFromGlucoseFrame","typeAndLocationFromGlucoseFrame","NIBBLE_BITS","NIBBLE_MASK","SPECIMEN_TYPES","undefined","SAMPLE_LOCATIONS","STATUS_BATTERY_LOW","STATUS_SENSOR_MALFUNCTION","STATUS_SAMPLE_TOO_SMALL","STATUS_STRIP_INSERTION_ERROR","STATUS_STRIP_TYPE_INCORRECT","STATUS_RESULT_TOO_HIGH","STATUS_RESULT_TOO_LOW","STATUS_TEMPERATURE_TOO_HIGH","STATUS_TEMPERATURE_TOO_LOW","STATUS_READ_INTERRUPTED","STATUS_DEVICE_FAULT","STATUS_TIME_FAULT","UNUSABLE_STATUS","SENSOR_WARNINGS","reportedUnit","frame","outOfRange","status","sensorWarnings","filter","flag","map","warning","hasUnusableSensorStatus","glucoseRecordDetails","sequenceNumber","typeAndLocation","specimen","sampleLocation","range","warnings","length","sensorStatus"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/standard-gatt/standard-gatt.glucose-details.ts"],"mappings":";;AAQA,SACEA,IAAI,EACJC,cAAc,EACdC,OAAO,EACPC,4BAA4B,EAC5BC,8BAA8B,EAC9BC,+BAA+B,QAC1B,kCAA+B;AAEtC,MAAMC,WAAW,GAAG,CAAC;AACrB,MAAMC,WAAW,GAAG,IAAI;;AAExB;AACA,MAAMC,cAA4D,GAAG,CACnEC,SAAS,EACT,qBAAqB,EACrB,iBAAiB,EACjB,kBAAkB,EAClB,cAAc,EACd,oBAAoB,EACpB,gBAAgB,EAChB,wBAAwB,EACxB,oBAAoB,EACpB,mBAAmB,CACpB;;AAED;AACA,MAAMC,gBAAgE,GAAG,CACvED,SAAS,EACT,QAAQ,EACR,eAAe,EACf,SAAS,CACV;AAED,MAAME,kBAAkB,GAAG,MAAM;AACjC,MAAMC,yBAAyB,GAAG,MAAM;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AoB,EAAED,uBAAuB","ignoreList":[]}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
const FLAG_TIME_OFFSET = 0x01;
|
|
4
|
+
const FLAG_CONCENTRATION = 0x02;
|
|
5
|
+
const FLAG_MOL_PER_L = 0x04;
|
|
6
|
+
const FLAG_SENSOR_STATUS = 0x08;
|
|
7
|
+
const SEQUENCE_NUMBER_INDEX = 1;
|
|
8
|
+
const BASE_TIME_INDEX = 3;
|
|
9
|
+
const TIME_OFFSET_INDEX = 10;
|
|
10
|
+
const BYTE_BITS = 8;
|
|
11
|
+
const TYPE_AND_LOCATION_OFFSET = 2;
|
|
12
|
+
const SENSOR_STATUS_OFFSET = 3;
|
|
13
|
+
const hasFlag = (flags, flag) => (flags & flag) !== 0;
|
|
14
|
+
const concentrationIndex = flags => hasFlag(flags, FLAG_TIME_OFFSET) ? TIME_OFFSET_INDEX + 2 : TIME_OFFSET_INDEX;
|
|
15
|
+
const byte = (frame, index) => {
|
|
16
|
+
const value = Number.parseInt(frame[index] ?? "", 16);
|
|
17
|
+
return Number.isInteger(value) ? value : undefined;
|
|
18
|
+
};
|
|
19
|
+
const uint16 = (frame, index) => {
|
|
20
|
+
const low = byte(frame, index);
|
|
21
|
+
const high = byte(frame, index + 1);
|
|
22
|
+
return low === undefined || high === undefined ? undefined : low | high << BYTE_BITS;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
/** The meter's number for the record, in bytes 1-2 of every Glucose Measurement. */
|
|
26
|
+
const sequenceNumberFromGlucoseFrame = frame => uint16(frame, SEQUENCE_NUMBER_INDEX);
|
|
27
|
+
|
|
28
|
+
/** Specimen type in the low nibble and sample location in the high one; only a record with a concentration has it. */
|
|
29
|
+
const typeAndLocationFromGlucoseFrame = frame => {
|
|
30
|
+
const flags = byte(frame, 0) ?? 0;
|
|
31
|
+
return hasFlag(flags, FLAG_CONCENTRATION) ? byte(frame, concentrationIndex(flags) + TYPE_AND_LOCATION_OFFSET) : undefined;
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
/** The Sensor Status Annunciation bits, which only a record that sets flag bit 3 carries. */
|
|
35
|
+
const sensorStatusFromGlucoseFrame = frame => {
|
|
36
|
+
const flags = byte(frame, 0) ?? 0;
|
|
37
|
+
return hasFlag(flags, FLAG_SENSOR_STATUS) && hasFlag(flags, FLAG_CONCENTRATION) ? uint16(frame, concentrationIndex(flags) + SENSOR_STATUS_OFFSET) : undefined;
|
|
38
|
+
};
|
|
39
|
+
export { BASE_TIME_INDEX, byte, concentrationIndex, FLAG_CONCENTRATION, FLAG_MOL_PER_L, FLAG_TIME_OFFSET, hasFlag, sensorStatusFromGlucoseFrame, sequenceNumberFromGlucoseFrame, TIME_OFFSET_INDEX, typeAndLocationFromGlucoseFrame };
|
|
40
|
+
//# sourceMappingURL=standard-gatt.glucose-frame.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["FLAG_TIME_OFFSET","FLAG_CONCENTRATION","FLAG_MOL_PER_L","FLAG_SENSOR_STATUS","SEQUENCE_NUMBER_INDEX","BASE_TIME_INDEX","TIME_OFFSET_INDEX","BYTE_BITS","TYPE_AND_LOCATION_OFFSET","SENSOR_STATUS_OFFSET","hasFlag","flags","flag","concentrationIndex","byte","frame","index","value","Number","parseInt","isInteger","undefined","uint16","low","high","sequenceNumberFromGlucoseFrame","typeAndLocationFromGlucoseFrame","sensorStatusFromGlucoseFrame"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/standard-gatt/standard-gatt.glucose-frame.ts"],"mappings":";;AAAA,MAAMA,gBAAgB,GAAG,IAAI;AAC7B,MAAMC,kBAAkB,GAAG,IAAI;AAC/B,MAAMC,cAAc,GAAG,IAAI;AAC3B,MAAMC,kBAAkB,GAAG,IAAI;AAE/B,MAAMC,qBAAqB,GAAG,CAAC;AAC/B,MAAMC,eAAe,GAAG,CAAC;AACzB,MAAMC,iBAAiB,GAAG,EAAE;A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AC,GAAGH,wBAAwB,CAAC,GACjEa,SAAS;AACf,CAAC;;AAED;AACA,MAAMM,4BAA4B,GAChCZ,KAAwB,IACD;EACvB,MAAMJ,KAAK,GAAGG,IAAI,CAACC,KAAK,EAAE,CAAC,CAAC,IAAI,CAAC;EAEjC,OAAOL,OAAO,CAACC,KAAK,EAAER,kBAAkB,CAAC,IAAIO,OAAO,CAACC,KAAK,EAAEV,kBAAkB,CAAC,GAC3EqB,MAAM,CAACP,KAAK,EAAEF,kBAAkB,CAACF,KAAK,CAAC,GAAGF,oBAAoB,CAAC,GAC/DY,SAAS;AACf,CAAC;AAED,SACEhB,eAAe,EACfS,IAAI,EACJD,kBAAkB,EAClBZ,kBAAkB,EAClBC,cAAc,EACdF,gBAAgB,EAChBU,OAAO,EACPiB,4BAA4B,EAC5BF,8BAA8B,EAC9BnB,iBAAiB,EACjBoB,+BAA+B","ignoreList":[]}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { bytesToHex } from "../../../utils/bytes-to-hex.js";
|
|
4
|
+
import { sigUuid } from "../../../utils/sig-uuid.js";
|
|
5
|
+
import { RecordCursor } from "../../record-cursor.js";
|
|
6
|
+
import { byte, sequenceNumberFromGlucoseFrame } from "./standard-gatt.glucose-frame.js";
|
|
7
|
+
const GLUCOSE_SERVICE_UUID = sigUuid("1808");
|
|
8
|
+
const GLUCOSE_MEASUREMENT_UUID = sigUuid("2a18");
|
|
9
|
+
const RECORD_ACCESS_CONTROL_POINT_UUID = sigUuid("2a52");
|
|
10
|
+
const RACP_REPORT_STORED_RECORDS = 0x01;
|
|
11
|
+
const RACP_RESPONSE_CODE = 0x06;
|
|
12
|
+
const RACP_OPERATOR_ALL_RECORDS = 0x01;
|
|
13
|
+
const RACP_OPERATOR_GREATER_OR_EQUAL = 0x03;
|
|
14
|
+
const RACP_FILTER_SEQUENCE_NUMBER = 0x01;
|
|
15
|
+
const RESPONSE_OPCODE_INDEX = 0;
|
|
16
|
+
const RESPONSE_REQUEST_INDEX = 2;
|
|
17
|
+
const RESPONSE_RESULT_INDEX = 3;
|
|
18
|
+
|
|
19
|
+
/** Invalid operator, operator not supported, invalid operand and operand not supported. */
|
|
20
|
+
const FILTER_REFUSALS = new Set([0x03, 0x04, 0x05, 0x09]);
|
|
21
|
+
const BYTE_BITS = 8;
|
|
22
|
+
const MAX_SEQUENCE_NUMBER = 0xffff;
|
|
23
|
+
const CURSOR_KEY_PREFIX = "@ovok/native/glucose-sequence";
|
|
24
|
+
const reportAllRecords = () => bytesToHex([RACP_REPORT_STORED_RECORDS, RACP_OPERATOR_ALL_RECORDS]);
|
|
25
|
+
const reportRecordsFrom = sequenceNumber => bytesToHex([RACP_REPORT_STORED_RECORDS, RACP_OPERATOR_GREATER_OR_EQUAL, RACP_FILTER_SEQUENCE_NUMBER, sequenceNumber, sequenceNumber >> BYTE_BITS]);
|
|
26
|
+
|
|
27
|
+
/** The first number worth asking for, or nothing when none is known or the one after it cannot be written. */
|
|
28
|
+
const sequenceToAskFrom = newestStored => newestStored === undefined || newestStored >= MAX_SEQUENCE_NUMBER ? undefined : newestStored + 1;
|
|
29
|
+
|
|
30
|
+
/** Whether the meter answered "report stored records" by refusing the filter it was given. */
|
|
31
|
+
const refusesFilter = frame => {
|
|
32
|
+
const result = byte(frame, RESPONSE_RESULT_INDEX);
|
|
33
|
+
return byte(frame, RESPONSE_OPCODE_INDEX) === RACP_RESPONSE_CODE && byte(frame, RESPONSE_REQUEST_INDEX) === RACP_REPORT_STORED_RECORDS && result !== undefined && FILTER_REFUSALS.has(result);
|
|
34
|
+
};
|
|
35
|
+
const racpCommand = frame => ({
|
|
36
|
+
serviceUuid: GLUCOSE_SERVICE_UUID,
|
|
37
|
+
characteristicUuid: RECORD_ACCESS_CONTROL_POINT_UUID,
|
|
38
|
+
frame
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Asks a glucose meter for the records stored after the newest one already read, and keeps
|
|
43
|
+
* count of the sequence numbers it sends. A meter that refuses the sequence-number filter is
|
|
44
|
+
* asked for every record instead, once.
|
|
45
|
+
*
|
|
46
|
+
* Every Glucose Measurement counts, usable or not: a record the SDK withholds is no reason to
|
|
47
|
+
* download it again.
|
|
48
|
+
*/
|
|
49
|
+
class GlucoseRecordSequencer {
|
|
50
|
+
filtered = false;
|
|
51
|
+
constructor(cursor) {
|
|
52
|
+
this.cursor = cursor;
|
|
53
|
+
}
|
|
54
|
+
initialCommands = async () => {
|
|
55
|
+
const from = sequenceToAskFrom(await this.cursor.load());
|
|
56
|
+
this.filtered = from !== undefined;
|
|
57
|
+
return [racpCommand(from === undefined ? reportAllRecords() : reportRecordsFrom(from))];
|
|
58
|
+
};
|
|
59
|
+
nextCommand = (frame, characteristicUuid) => {
|
|
60
|
+
const uuid = characteristicUuid?.toLowerCase();
|
|
61
|
+
if (uuid === GLUCOSE_MEASUREMENT_UUID) {
|
|
62
|
+
this.countRecord(frame);
|
|
63
|
+
return undefined;
|
|
64
|
+
}
|
|
65
|
+
if (uuid === RECORD_ACCESS_CONTROL_POINT_UUID && this.filtered && refusesFilter(frame)) {
|
|
66
|
+
this.filtered = false;
|
|
67
|
+
return [racpCommand(reportAllRecords())];
|
|
68
|
+
}
|
|
69
|
+
return undefined;
|
|
70
|
+
};
|
|
71
|
+
countRecord(frame) {
|
|
72
|
+
const sequenceNumber = sequenceNumberFromGlucoseFrame(frame);
|
|
73
|
+
if (sequenceNumber !== undefined) {
|
|
74
|
+
this.cursor.advance(sequenceNumber);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/** Gives each connection to a glucose meter its own sequencer over that meter's stored cursor. */
|
|
80
|
+
const createGlucoseSequencer = ({
|
|
81
|
+
deviceId,
|
|
82
|
+
recordCursorStorage
|
|
83
|
+
}) => new GlucoseRecordSequencer(new RecordCursor(recordCursorStorage, `${CURSOR_KEY_PREFIX}/${deviceId}`));
|
|
84
|
+
export { createGlucoseSequencer, GLUCOSE_MEASUREMENT_UUID, GLUCOSE_SERVICE_UUID, RECORD_ACCESS_CONTROL_POINT_UUID };
|
|
85
|
+
//# sourceMappingURL=standard-gatt.glucose-racp.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["bytesToHex","sigUuid","RecordCursor","byte","sequenceNumberFromGlucoseFrame","GLUCOSE_SERVICE_UUID","GLUCOSE_MEASUREMENT_UUID","RECORD_ACCESS_CONTROL_POINT_UUID","RACP_REPORT_STORED_RECORDS","RACP_RESPONSE_CODE","RACP_OPERATOR_ALL_RECORDS","RACP_OPERATOR_GREATER_OR_EQUAL","RACP_FILTER_SEQUENCE_NUMBER","RESPONSE_OPCODE_INDEX","RESPONSE_REQUEST_INDEX","RESPONSE_RESULT_INDEX","FILTER_REFUSALS","Set","BYTE_BITS","MAX_SEQUENCE_NUMBER","CURSOR_KEY_PREFIX","reportAllRecords","reportRecordsFrom","sequenceNumber","sequenceToAskFrom","newestStored","undefined","refusesFilter","frame","result","has","racpCommand","serviceUuid","characteristicUuid","GlucoseRecordSequencer","filtered","constructor","cursor","initialCommands","from","load","nextCommand","uuid","toLowerCase","countRecord","advance","createGlucoseSequencer","deviceId","recordCursorStorage"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/standard-gatt/standard-gatt.glucose-racp.ts"],"mappings":";;AAGA,SAASA,UAAU,QAAQ,gCAA6B;AACxD,SAASC,OAAO,QAAQ,4BAAyB;AACjD,SAASC,YAAY,QAAQ,wBAAqB;AAElD,SAASC,IAAI,EAAEC,8BAA8B,QAAQ,kCAA+B;AAEpF,MAAMC,oBAAoB,GAAGJ,OAAO,CAAC,MAAM,CAAC;AAC5C,MAAMK,wBAAwB,GAAGL,OAAO,CAAC,MAAM,CAAC;AAChD,MAAMM,gCAAgC,GAAGN,OAAO,CAAC,MAAM,CAAC;AAExD,MAAMO,0BAA0B,GAAG,IAAI;AACvC,MAAMC,kBAAkB,GAAG,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;AACA,MAAMuB,sBAA8C,GAAGA,CAAC;EACtDC,QAAQ;EACRC;AACF,CAAC,KACC,IAAId,sBAAsB,CACxB,IAAIhC,YAAY,CAAC8C,mBAAmB,EAAE,GAAG5B,iBAAiB,IAAI2B,QAAQ,EAAE,CAC1E,CAAC;AAEH,SACED,sBAAsB,EACtBxC,wBAAwB,EACxBD,oBAAoB,EACpBE,gCAAgC","ignoreList":[]}
|
package/lib/module/modules/bt-management/services/devices/standard-gatt/standard-gatt.glucose.js
CHANGED
|
@@ -2,8 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
import { MeasurementTypeKey } from "@ovok/core/next";
|
|
4
4
|
import { byteToHex } from "../../../utils/bytes-to-hex.js";
|
|
5
|
-
import { sigUuid } from "../../../utils/sig-uuid.js";
|
|
6
5
|
import { defineCustomDevice } from "../../custom/define-custom-device.js";
|
|
6
|
+
import { glucoseRecordDetails, hasUnusableSensorStatus } from "./standard-gatt.glucose-details.js";
|
|
7
|
+
import { BASE_TIME_INDEX, byte, concentrationIndex, FLAG_CONCENTRATION, FLAG_MOL_PER_L, FLAG_TIME_OFFSET, TIME_OFFSET_INDEX, typeAndLocationFromGlucoseFrame } from "./standard-gatt.glucose-frame.js";
|
|
8
|
+
import { createGlucoseSequencer, GLUCOSE_MEASUREMENT_UUID, GLUCOSE_SERVICE_UUID, RECORD_ACCESS_CONTROL_POINT_UUID } from "./standard-gatt.glucose-racp.js";
|
|
7
9
|
import { littleEndian } from "./standard-gatt.profile.js";
|
|
8
10
|
|
|
9
11
|
/**
|
|
@@ -11,10 +13,11 @@ import { littleEndian } from "./standard-gatt.profile.js";
|
|
|
11
13
|
* 0x2A52.
|
|
12
14
|
*
|
|
13
15
|
* A glucose meter does not push its readings. The collector enables indications on the
|
|
14
|
-
* control point
|
|
15
|
-
*
|
|
16
|
-
* (`
|
|
17
|
-
*
|
|
16
|
+
* control point and writes a request for the stored records: those after the newest one it
|
|
17
|
+
* has read (`01 03 01 nn nn`) when the manager has a `recordCursorStorage`, otherwise all of
|
|
18
|
+
* them (`01 01`). The meter answers with one Glucose Measurement per record followed by a
|
|
19
|
+
* control-point response (`06 00 01 xx`). The SDK's stable result identity, which covers the
|
|
20
|
+
* record's sequence number, keeps a record seen twice from becoming a second reading.
|
|
18
21
|
*
|
|
19
22
|
* Glucose Measurement layout: flags, sequence number (2), base time (7), time offset (2,
|
|
20
23
|
* flag bit 0), concentration SFLOAT (2) and type/sample-location (1) (bit 1), sensor status
|
|
@@ -24,17 +27,13 @@ const MG_PER_DL_PER_KG_PER_L = 100_000;
|
|
|
24
27
|
|
|
25
28
|
/** One mol/L of glucose (180.16 g/mol) is 18,016 mg/dL. */
|
|
26
29
|
const MG_PER_DL_PER_MOL_PER_L = 18_016;
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
const
|
|
30
|
-
const BASE_TIME_INDEX = 3;
|
|
31
|
-
const TIME_OFFSET_INDEX = 10;
|
|
30
|
+
|
|
31
|
+
/** One decimal reads a mmol/L result (0.1 mmol/L is 1.8 mg/dL) back as the meter showed it. */
|
|
32
|
+
const MG_PER_DL_DECIMALS = 1;
|
|
32
33
|
|
|
33
34
|
/** Type 0xA and sample location 0x4 both mean a control-solution test, not a patient sample. */
|
|
34
35
|
const CONTROL_SOLUTION_TYPE = 0x0a;
|
|
35
36
|
const CONTROL_SOLUTION_LOCATION = 0x04;
|
|
36
|
-
const REPORT_ALL_STORED_RECORDS = "0101";
|
|
37
|
-
const concentrationIndex = flags => flags & FLAG_TIME_OFFSET ? TIME_OFFSET_INDEX + 2 : TIME_OFFSET_INDEX;
|
|
38
37
|
|
|
39
38
|
/** Bits 5-7 are reserved; a meter that sets one still sends a readable record. */
|
|
40
39
|
const ALL_FLAGS = Array.from({
|
|
@@ -45,13 +44,9 @@ const glucoseField = flags => {
|
|
|
45
44
|
return {
|
|
46
45
|
...littleEndian("bloodGlucose", [index, index + 1], "mg/dL", "sfloat"),
|
|
47
46
|
scale: flags & FLAG_MOL_PER_L ? MG_PER_DL_PER_MOL_PER_L : MG_PER_DL_PER_KG_PER_L,
|
|
48
|
-
decimals:
|
|
47
|
+
decimals: MG_PER_DL_DECIMALS
|
|
49
48
|
};
|
|
50
49
|
};
|
|
51
|
-
const byte = (frame, index) => {
|
|
52
|
-
const value = Number.parseInt(frame[index] ?? "", 16);
|
|
53
|
-
return Number.isInteger(value) ? value : undefined;
|
|
54
|
-
};
|
|
55
50
|
|
|
56
51
|
/** The record's own time: the base time plus its offset in minutes, read as phone-local. */
|
|
57
52
|
const recordedAtFromGlucoseFrame = frame => {
|
|
@@ -82,8 +77,7 @@ const recordedAtFromGlucoseFrame = frame => {
|
|
|
82
77
|
return recordedAt;
|
|
83
78
|
};
|
|
84
79
|
const isControlSolution = frame => {
|
|
85
|
-
const
|
|
86
|
-
const typeAndLocation = byte(frame, concentrationIndex(flags) + 2);
|
|
80
|
+
const typeAndLocation = typeAndLocationFromGlucoseFrame(frame);
|
|
87
81
|
return typeAndLocation !== undefined && ((typeAndLocation & 0x0f) === CONTROL_SOLUTION_TYPE || typeAndLocation >> 4 === CONTROL_SOLUTION_LOCATION);
|
|
88
82
|
};
|
|
89
83
|
|
|
@@ -95,9 +89,9 @@ const standardGlucoseDevice = params => defineCustomDevice({
|
|
|
95
89
|
oneReadingPerConnection: params.oneReadingPerConnection,
|
|
96
90
|
stuckDataTimeoutMs: params.stuckDataTimeoutMs ?? 60_000,
|
|
97
91
|
services: [{
|
|
98
|
-
uuid:
|
|
92
|
+
uuid: GLUCOSE_SERVICE_UUID,
|
|
99
93
|
monitor: [{
|
|
100
|
-
uuid:
|
|
94
|
+
uuid: GLUCOSE_MEASUREMENT_UUID,
|
|
101
95
|
frame: {
|
|
102
96
|
minLengthBytes: TIME_OFFSET_INDEX
|
|
103
97
|
},
|
|
@@ -114,7 +108,7 @@ const standardGlucoseDevice = params => defineCustomDevice({
|
|
|
114
108
|
description: "A record without a concentration"
|
|
115
109
|
})
|
|
116
110
|
}, {
|
|
117
|
-
uuid:
|
|
111
|
+
uuid: RECORD_ACCESS_CONTROL_POINT_UUID,
|
|
118
112
|
frame: {
|
|
119
113
|
minLengthBytes: 2
|
|
120
114
|
},
|
|
@@ -128,23 +122,22 @@ const standardGlucoseDevice = params => defineCustomDevice({
|
|
|
128
122
|
kind: "idle",
|
|
129
123
|
description: "Record access response"
|
|
130
124
|
}]
|
|
131
|
-
}]
|
|
132
|
-
write: {
|
|
133
|
-
uuid: sigUuid("2a52"),
|
|
134
|
-
commandHex: REPORT_ALL_STORED_RECORDS,
|
|
135
|
-
when: "connect"
|
|
136
|
-
}
|
|
125
|
+
}]
|
|
137
126
|
}]
|
|
138
127
|
}, {
|
|
128
|
+
createCommandSequencer: createGlucoseSequencer,
|
|
139
129
|
decorateReading: (reading, frame, recordOffset) => {
|
|
140
|
-
if (frame && isControlSolution(frame)) {
|
|
130
|
+
if (frame && (isControlSolution(frame) || hasUnusableSensorStatus(frame))) {
|
|
141
131
|
return null;
|
|
142
132
|
}
|
|
143
133
|
const recordedAt = frame ? recordedAtFromGlucoseFrame(frame) : undefined;
|
|
144
|
-
const decorated =
|
|
134
|
+
const decorated = {
|
|
145
135
|
...reading,
|
|
146
|
-
|
|
147
|
-
|
|
136
|
+
...(frame && glucoseRecordDetails(frame)),
|
|
137
|
+
...(recordedAt && {
|
|
138
|
+
recordedAt
|
|
139
|
+
})
|
|
140
|
+
};
|
|
148
141
|
return params.decorateReading ? params.decorateReading(decorated, frame, recordOffset) : decorated;
|
|
149
142
|
}
|
|
150
143
|
});
|