@ovok/native 1.2.0 → 1.4.0
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/auth/sign-in/components/social-logins/apple-login-button.js +9 -3
- package/lib/commonjs/modules/auth/sign-in/components/social-logins/apple-login-button.js.map +1 -1
- package/lib/commonjs/modules/auth/sign-in/components/social-logins/google-login-button.js +8 -2
- package/lib/commonjs/modules/auth/sign-in/components/social-logins/google-login-button.js.map +1 -1
- package/lib/commonjs/modules/bt-device/constants/device-instruction-pdfs.js +22 -22
- package/lib/commonjs/modules/bt-device/constants/device-instruction-pdfs.js.map +1 -1
- package/lib/commonjs/modules/bt-device/constants/device-list-items.js +36 -0
- package/lib/commonjs/modules/bt-device/constants/device-list-items.js.map +1 -1
- package/lib/commonjs/modules/bt-device/constants/supported-device-catalog-assets.js +36 -0
- package/lib/commonjs/modules/bt-device/constants/supported-device-catalog-assets.js.map +1 -0
- package/lib/commonjs/modules/bt-device/constants/supported-device-catalog-entries.js +45 -0
- package/lib/commonjs/modules/bt-device/constants/supported-device-catalog-entries.js.map +1 -0
- package/lib/commonjs/modules/bt-device/constants/supported-devices.js +198 -42
- package/lib/commonjs/modules/bt-device/constants/supported-devices.js.map +1 -1
- package/lib/commonjs/modules/bt-management/components/bluetooth-device-picker.js +88 -0
- package/lib/commonjs/modules/bt-management/components/bluetooth-device-picker.js.map +1 -0
- package/lib/commonjs/modules/bt-management/components/bt-provider-child-wrapper.js +77 -10
- package/lib/commonjs/modules/bt-management/components/bt-provider-child-wrapper.js.map +1 -1
- package/lib/commonjs/modules/bt-management/constants/integrated-devices-map.js +1 -1
- package/lib/commonjs/modules/bt-management/constants/integrated-devices-map.js.map +1 -1
- package/lib/commonjs/modules/bt-management/index.js +77 -0
- package/lib/commonjs/modules/bt-management/index.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/background-sync/background-ble-manager.js +27 -0
- package/lib/commonjs/modules/bt-management/services/background-sync/background-ble-manager.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/background-sync/background-service-uuids.js +31 -0
- package/lib/commonjs/modules/bt-management/services/background-sync/background-service-uuids.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/background-sync/background-sync-coordinator.js +104 -0
- package/lib/commonjs/modules/bt-management/services/background-sync/background-sync-coordinator.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/bt-manager.js +59 -6
- 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 +6 -2
- package/lib/commonjs/modules/bt-management/services/custom/define-custom-device.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/device-creator.js +19 -8
- package/lib/commonjs/modules/bt-management/services/device-creator.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/devices/aoj/aoj.thermometers.js +1 -1
- package/lib/commonjs/modules/bt-management/services/devices/aoj/aoj.thermometers.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/devices/bc01/bc01-command-builders.js +50 -0
- package/lib/commonjs/modules/bt-management/services/devices/bc01/bc01-command-builders.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/devices/bc01/bc01-command-sequencer.js +78 -127
- package/lib/commonjs/modules/bt-management/services/devices/bc01/bc01-command-sequencer.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/devices/bc01/bc01.device.js +2 -0
- package/lib/commonjs/modules/bt-management/services/devices/bc01/bc01.device.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/devices/bc01/bc01.frame-reader.js +60 -0
- package/lib/commonjs/modules/bt-management/services/devices/bc01/bc01.frame-reader.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/devices/blood-glucose/blood-glucose.device.js +74 -0
- package/lib/commonjs/modules/bt-management/services/devices/blood-glucose/blood-glucose.device.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/devices/boso/boso.medicus.js +1 -1
- package/lib/commonjs/modules/bt-management/services/devices/boso/boso.medicus.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/devices/bt-command-writer.js +3 -0
- 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 +1 -1
- package/lib/commonjs/modules/bt-management/services/devices/bt-connection-handler.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/devices/custom/custom.device.js +37 -4
- package/lib/commonjs/modules/bt-management/services/devices/custom/custom.device.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.file-transfer.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.transports.js +4 -1
- package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.transports.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/devices/standard-gatt/standard-gatt.profile.js +2 -1
- package/lib/commonjs/modules/bt-management/services/devices/standard-gatt/standard-gatt.profile.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/devices/uebe/visomat.comfort-soft-bt.js +1 -1
- package/lib/commonjs/modules/bt-management/services/devices/uebe/visomat.comfort-soft-bt.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/devices/veroval/veroval.bp-monitors.js +1 -1
- package/lib/commonjs/modules/bt-management/services/devices/veroval/veroval.bp-monitors.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/devices/viatom/viatom.bp-monitors.js +1 -1
- package/lib/commonjs/modules/bt-management/services/devices/viatom/viatom.bp-monitors.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/devices/viatom/viatom.ecg-files.js +35 -0
- package/lib/commonjs/modules/bt-management/services/devices/viatom/viatom.ecg-files.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/devices/viatom/viatom.ecg-recorders.js +3 -2
- package/lib/commonjs/modules/bt-management/services/devices/viatom/viatom.ecg-recorders.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/devices/viatom/viatom.lepod.js +2 -1
- package/lib/commonjs/modules/bt-management/services/devices/viatom/viatom.lepod.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/devices/viatom/viatom.oximeters.js +1 -1
- package/lib/commonjs/modules/bt-management/services/devices/viatom/viatom.oximeters.js.map +1 -1
- package/lib/commonjs/modules/bt-management/types/background-sync.js +6 -0
- package/lib/commonjs/modules/bt-management/types/background-sync.js.map +1 -0
- package/lib/commonjs/modules/bt-management/types/device-measurement-map.js.map +1 -1
- package/lib/commonjs/modules/data-sync/services/managers/data-processor.js +11 -2
- package/lib/commonjs/modules/data-sync/services/managers/data-processor.js.map +1 -1
- package/lib/commonjs/modules/data-sync/utils/get-samples-from-health.js +3 -1
- package/lib/commonjs/modules/data-sync/utils/get-samples-from-health.js.map +1 -1
- package/lib/commonjs/modules/data-sync/utils/get-total-samples-count.js +3 -1
- package/lib/commonjs/modules/data-sync/utils/get-total-samples-count.js.map +1 -1
- package/lib/commonjs/modules/data-sync/utils/health-units.js +22 -0
- package/lib/commonjs/modules/data-sync/utils/health-units.js.map +1 -0
- package/lib/module/modules/auth/sign-in/components/social-logins/apple-login-button.js +9 -3
- package/lib/module/modules/auth/sign-in/components/social-logins/apple-login-button.js.map +1 -1
- package/lib/module/modules/auth/sign-in/components/social-logins/google-login-button.js +8 -2
- package/lib/module/modules/auth/sign-in/components/social-logins/google-login-button.js.map +1 -1
- package/lib/module/modules/bt-device/constants/device-instruction-pdfs.js +1 -1
- package/lib/module/modules/bt-device/constants/device-instruction-pdfs.js.map +1 -1
- package/lib/module/modules/bt-device/constants/device-list-items.js +36 -0
- package/lib/module/modules/bt-device/constants/device-list-items.js.map +1 -1
- package/lib/module/modules/bt-device/constants/supported-device-catalog-assets.js +33 -0
- package/lib/module/modules/bt-device/constants/supported-device-catalog-assets.js.map +1 -0
- package/lib/module/modules/bt-device/constants/supported-device-catalog-entries.js +41 -0
- package/lib/module/modules/bt-device/constants/supported-device-catalog-entries.js.map +1 -0
- package/lib/module/modules/bt-device/constants/supported-devices.js +188 -32
- package/lib/module/modules/bt-device/constants/supported-devices.js.map +1 -1
- package/lib/module/modules/bt-management/components/bluetooth-device-picker.js +83 -0
- package/lib/module/modules/bt-management/components/bluetooth-device-picker.js.map +1 -0
- package/lib/module/modules/bt-management/components/bt-provider-child-wrapper.js +77 -10
- package/lib/module/modules/bt-management/components/bt-provider-child-wrapper.js.map +1 -1
- package/lib/module/modules/bt-management/constants/integrated-devices-map.js +1 -1
- package/lib/module/modules/bt-management/constants/integrated-devices-map.js.map +1 -1
- package/lib/module/modules/bt-management/index.js +7 -0
- package/lib/module/modules/bt-management/index.js.map +1 -1
- package/lib/module/modules/bt-management/services/background-sync/background-ble-manager.js +22 -0
- package/lib/module/modules/bt-management/services/background-sync/background-ble-manager.js.map +1 -0
- package/lib/module/modules/bt-management/services/background-sync/background-service-uuids.js +26 -0
- package/lib/module/modules/bt-management/services/background-sync/background-service-uuids.js.map +1 -0
- package/lib/module/modules/bt-management/services/background-sync/background-sync-coordinator.js +100 -0
- package/lib/module/modules/bt-management/services/background-sync/background-sync-coordinator.js.map +1 -0
- package/lib/module/modules/bt-management/services/bt-manager.js +61 -7
- 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 +6 -2
- package/lib/module/modules/bt-management/services/custom/define-custom-device.js.map +1 -1
- package/lib/module/modules/bt-management/services/device-creator.js +19 -8
- package/lib/module/modules/bt-management/services/device-creator.js.map +1 -1
- package/lib/module/modules/bt-management/services/devices/aoj/aoj.thermometers.js +1 -1
- package/lib/module/modules/bt-management/services/devices/aoj/aoj.thermometers.js.map +1 -1
- package/lib/module/modules/bt-management/services/devices/bc01/bc01-command-builders.js +40 -0
- package/lib/module/modules/bt-management/services/devices/bc01/bc01-command-builders.js.map +1 -0
- package/lib/module/modules/bt-management/services/devices/bc01/bc01-command-sequencer.js +59 -109
- package/lib/module/modules/bt-management/services/devices/bc01/bc01-command-sequencer.js.map +1 -1
- package/lib/module/modules/bt-management/services/devices/bc01/bc01.device.js +2 -0
- package/lib/module/modules/bt-management/services/devices/bc01/bc01.device.js.map +1 -1
- package/lib/module/modules/bt-management/services/devices/bc01/bc01.frame-reader.js +56 -0
- package/lib/module/modules/bt-management/services/devices/bc01/bc01.frame-reader.js.map +1 -0
- package/lib/module/modules/bt-management/services/devices/blood-glucose/blood-glucose.device.js +69 -0
- package/lib/module/modules/bt-management/services/devices/blood-glucose/blood-glucose.device.js.map +1 -0
- package/lib/module/modules/bt-management/services/devices/boso/boso.medicus.js +1 -1
- package/lib/module/modules/bt-management/services/devices/boso/boso.medicus.js.map +1 -1
- package/lib/module/modules/bt-management/services/devices/bt-command-writer.js +3 -0
- 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 +1 -1
- package/lib/module/modules/bt-management/services/devices/bt-connection-handler.js.map +1 -1
- package/lib/module/modules/bt-management/services/devices/custom/custom.device.js +36 -4
- package/lib/module/modules/bt-management/services/devices/custom/custom.device.js.map +1 -1
- package/lib/module/modules/bt-management/services/devices/lepu/lepu.file-transfer.js +2 -1
- package/lib/module/modules/bt-management/services/devices/lepu/lepu.file-transfer.js.map +1 -1
- package/lib/module/modules/bt-management/services/devices/lepu/lepu.transports.js +4 -1
- package/lib/module/modules/bt-management/services/devices/lepu/lepu.transports.js.map +1 -1
- package/lib/module/modules/bt-management/services/devices/standard-gatt/standard-gatt.profile.js +2 -1
- package/lib/module/modules/bt-management/services/devices/standard-gatt/standard-gatt.profile.js.map +1 -1
- package/lib/module/modules/bt-management/services/devices/uebe/visomat.comfort-soft-bt.js +1 -1
- package/lib/module/modules/bt-management/services/devices/uebe/visomat.comfort-soft-bt.js.map +1 -1
- package/lib/module/modules/bt-management/services/devices/veroval/veroval.bp-monitors.js +1 -1
- package/lib/module/modules/bt-management/services/devices/veroval/veroval.bp-monitors.js.map +1 -1
- package/lib/module/modules/bt-management/services/devices/viatom/viatom.bp-monitors.js +1 -1
- package/lib/module/modules/bt-management/services/devices/viatom/viatom.bp-monitors.js.map +1 -1
- package/lib/module/modules/bt-management/services/devices/viatom/viatom.ecg-files.js +31 -0
- package/lib/module/modules/bt-management/services/devices/viatom/viatom.ecg-files.js.map +1 -0
- package/lib/module/modules/bt-management/services/devices/viatom/viatom.ecg-recorders.js +3 -2
- package/lib/module/modules/bt-management/services/devices/viatom/viatom.ecg-recorders.js.map +1 -1
- package/lib/module/modules/bt-management/services/devices/viatom/viatom.lepod.js +2 -1
- package/lib/module/modules/bt-management/services/devices/viatom/viatom.lepod.js.map +1 -1
- package/lib/module/modules/bt-management/services/devices/viatom/viatom.oximeters.js +1 -1
- package/lib/module/modules/bt-management/services/devices/viatom/viatom.oximeters.js.map +1 -1
- package/lib/module/modules/bt-management/types/background-sync.js +4 -0
- package/lib/module/modules/bt-management/types/background-sync.js.map +1 -0
- package/lib/module/modules/bt-management/types/device-measurement-map.js.map +1 -1
- package/lib/module/modules/data-sync/services/managers/data-processor.js +11 -2
- package/lib/module/modules/data-sync/services/managers/data-processor.js.map +1 -1
- package/lib/module/modules/data-sync/utils/get-samples-from-health.js +3 -1
- package/lib/module/modules/data-sync/utils/get-samples-from-health.js.map +1 -1
- package/lib/module/modules/data-sync/utils/get-total-samples-count.js +3 -1
- package/lib/module/modules/data-sync/utils/get-total-samples-count.js.map +1 -1
- package/lib/module/modules/data-sync/utils/health-units.js +17 -0
- package/lib/module/modules/data-sync/utils/health-units.js.map +1 -0
- package/lib/typescript/commonjs/src/modules/auth/sign-in/components/social-logins/apple-login-button.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/auth/sign-in/components/social-logins/google-login-button.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-device/constants/device-instruction-pdfs.d.ts +1 -1
- package/lib/typescript/commonjs/src/modules/bt-device/constants/device-instruction-pdfs.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-device/constants/device-list-items.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-device/constants/supported-device-catalog-assets.d.ts +31 -0
- package/lib/typescript/commonjs/src/modules/bt-device/constants/supported-device-catalog-assets.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-device/constants/supported-device-catalog-entries.d.ts +3 -0
- package/lib/typescript/commonjs/src/modules/bt-device/constants/supported-device-catalog-entries.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-device/constants/supported-devices.d.ts +36 -22
- package/lib/typescript/commonjs/src/modules/bt-device/constants/supported-devices.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/components/bluetooth-device-picker.d.ts +11 -0
- package/lib/typescript/commonjs/src/modules/bt-management/components/bluetooth-device-picker.d.ts.map +1 -0
- 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/index.d.ts +7 -0
- package/lib/typescript/commonjs/src/modules/bt-management/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/background-sync/background-ble-manager.d.ts +13 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/background-sync/background-ble-manager.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/background-sync/background-service-uuids.d.ts +3 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/background-sync/background-service-uuids.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/background-sync/background-sync-coordinator.d.ts +29 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/background-sync/background-sync-coordinator.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/bt-manager.d.ts +26 -3
- 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.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/device-creator.d.ts +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/device-creator.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/aoj/aoj.thermometers.d.ts +2 -2
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/aoj/aoj.thermometers.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bc01/bc01-command-builders.d.ts +31 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bc01/bc01-command-builders.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bc01/bc01-command-sequencer.d.ts +6 -5
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bc01/bc01-command-sequencer.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bc01/bc01.device.d.ts +2 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bc01/bc01.device.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bc01/bc01.frame-reader.d.ts +16 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bc01/bc01.frame-reader.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/blood-glucose/blood-glucose.device.d.ts +19 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/blood-glucose/blood-glucose.device.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/boso/boso.medicus.d.ts +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/boso/boso.medicus.d.ts.map +1 -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/custom/custom.device.d.ts +1 -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/lepu/lepu.file-transfer.d.ts +3 -2
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.file-transfer.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.transports.d.ts +3 -2
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.transports.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.profile.d.ts +2 -2
- 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/devices/uebe/visomat.comfort-soft-bt.d.ts +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/uebe/visomat.comfort-soft-bt.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/veroval/veroval.bp-monitors.d.ts +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/veroval/veroval.bp-monitors.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/viatom/viatom.bp-monitors.d.ts +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/viatom/viatom.bp-monitors.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/viatom/viatom.ecg-files.d.ts +9 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/viatom/viatom.ecg-files.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/viatom/viatom.ecg-recorders.d.ts +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/viatom/viatom.ecg-recorders.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/viatom/viatom.lepod.d.ts +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/viatom/viatom.lepod.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/viatom/viatom.oximeters.d.ts +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/viatom/viatom.oximeters.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/types/background-sync.d.ts +32 -0
- package/lib/typescript/commonjs/src/modules/bt-management/types/background-sync.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/types/btprovider-children-props.d.ts +2 -0
- package/lib/typescript/commonjs/src/modules/bt-management/types/btprovider-children-props.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/types/custom-device-definition.d.ts +1 -0
- 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/custom-device-spec.d.ts +6 -4
- package/lib/typescript/commonjs/src/modules/bt-management/types/custom-device-spec.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/types/custom-lepu-spec.d.ts +2 -0
- package/lib/typescript/commonjs/src/modules/bt-management/types/custom-lepu-spec.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/types/device-command.d.ts +5 -0
- package/lib/typescript/commonjs/src/modules/bt-management/types/device-command.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/types/device-measurement-map.d.ts +4 -4
- package/lib/typescript/commonjs/src/modules/bt-management/types/device-measurement-map.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/data-sync/services/managers/data-processor.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/data-sync/utils/get-samples-from-health.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/data-sync/utils/get-total-samples-count.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/data-sync/utils/health-units.d.ts +3 -0
- package/lib/typescript/commonjs/src/modules/data-sync/utils/health-units.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/auth/sign-in/components/social-logins/apple-login-button.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/auth/sign-in/components/social-logins/google-login-button.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-device/constants/device-instruction-pdfs.d.ts +1 -1
- package/lib/typescript/module/src/modules/bt-device/constants/device-instruction-pdfs.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-device/constants/device-list-items.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-device/constants/supported-device-catalog-assets.d.ts +31 -0
- package/lib/typescript/module/src/modules/bt-device/constants/supported-device-catalog-assets.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-device/constants/supported-device-catalog-entries.d.ts +3 -0
- package/lib/typescript/module/src/modules/bt-device/constants/supported-device-catalog-entries.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-device/constants/supported-devices.d.ts +36 -22
- package/lib/typescript/module/src/modules/bt-device/constants/supported-devices.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/components/bluetooth-device-picker.d.ts +11 -0
- package/lib/typescript/module/src/modules/bt-management/components/bluetooth-device-picker.d.ts.map +1 -0
- 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/index.d.ts +7 -0
- package/lib/typescript/module/src/modules/bt-management/index.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/background-sync/background-ble-manager.d.ts +13 -0
- package/lib/typescript/module/src/modules/bt-management/services/background-sync/background-ble-manager.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/background-sync/background-service-uuids.d.ts +3 -0
- package/lib/typescript/module/src/modules/bt-management/services/background-sync/background-service-uuids.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/background-sync/background-sync-coordinator.d.ts +29 -0
- package/lib/typescript/module/src/modules/bt-management/services/background-sync/background-sync-coordinator.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/bt-manager.d.ts +26 -3
- 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.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/device-creator.d.ts +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/device-creator.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/devices/aoj/aoj.thermometers.d.ts +2 -2
- package/lib/typescript/module/src/modules/bt-management/services/devices/aoj/aoj.thermometers.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/devices/bc01/bc01-command-builders.d.ts +31 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/bc01/bc01-command-builders.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/bc01/bc01-command-sequencer.d.ts +6 -5
- package/lib/typescript/module/src/modules/bt-management/services/devices/bc01/bc01-command-sequencer.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/devices/bc01/bc01.device.d.ts +2 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/bc01/bc01.device.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/devices/bc01/bc01.frame-reader.d.ts +16 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/bc01/bc01.frame-reader.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/blood-glucose/blood-glucose.device.d.ts +19 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/blood-glucose/blood-glucose.device.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/boso/boso.medicus.d.ts +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/devices/boso/boso.medicus.d.ts.map +1 -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/custom/custom.device.d.ts +1 -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/lepu/lepu.file-transfer.d.ts +3 -2
- package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.file-transfer.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.transports.d.ts +3 -2
- package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.transports.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.profile.d.ts +2 -2
- 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/devices/uebe/visomat.comfort-soft-bt.d.ts +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/devices/uebe/visomat.comfort-soft-bt.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/devices/veroval/veroval.bp-monitors.d.ts +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/devices/veroval/veroval.bp-monitors.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/devices/viatom/viatom.bp-monitors.d.ts +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/devices/viatom/viatom.bp-monitors.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/devices/viatom/viatom.ecg-files.d.ts +9 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/viatom/viatom.ecg-files.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/viatom/viatom.ecg-recorders.d.ts +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/devices/viatom/viatom.ecg-recorders.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/devices/viatom/viatom.lepod.d.ts +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/devices/viatom/viatom.lepod.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/devices/viatom/viatom.oximeters.d.ts +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/devices/viatom/viatom.oximeters.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/types/background-sync.d.ts +32 -0
- package/lib/typescript/module/src/modules/bt-management/types/background-sync.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/types/btprovider-children-props.d.ts +2 -0
- package/lib/typescript/module/src/modules/bt-management/types/btprovider-children-props.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/types/custom-device-definition.d.ts +1 -0
- 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/custom-device-spec.d.ts +6 -4
- package/lib/typescript/module/src/modules/bt-management/types/custom-device-spec.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/types/custom-lepu-spec.d.ts +2 -0
- package/lib/typescript/module/src/modules/bt-management/types/custom-lepu-spec.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/types/device-command.d.ts +5 -0
- package/lib/typescript/module/src/modules/bt-management/types/device-command.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/types/device-measurement-map.d.ts +4 -4
- package/lib/typescript/module/src/modules/bt-management/types/device-measurement-map.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/data-sync/services/managers/data-processor.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/data-sync/utils/get-samples-from-health.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/data-sync/utils/get-total-samples-count.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/data-sync/utils/health-units.d.ts +3 -0
- package/lib/typescript/module/src/modules/data-sync/utils/health-units.d.ts.map +1 -0
- package/package.json +5 -3
|
@@ -28,12 +28,17 @@ export * from "./types/service.type.js";
|
|
|
28
28
|
export * from "./types/device-status.js";
|
|
29
29
|
export * from "./types/btprovider-props.js";
|
|
30
30
|
export * from "./types/btprovider-children-props.js";
|
|
31
|
+
export * from "./types/background-sync.js";
|
|
31
32
|
export * from "./types/result-callback.js";
|
|
32
33
|
export * from "./types/error-callback.js";
|
|
33
34
|
export * from "./types/device-status-change-callback.js";
|
|
34
35
|
export * from "./services/devices/bt-managed-device.js";
|
|
36
|
+
export * from "./services/devices/blood-glucose/blood-glucose.device.js";
|
|
35
37
|
export * from "./services/devices/custom/custom.device.js";
|
|
36
38
|
export * from "./services/bt-manager.js";
|
|
39
|
+
export * from "./services/background-sync/background-ble-manager.js";
|
|
40
|
+
export * from "./services/background-sync/background-sync-coordinator.js";
|
|
41
|
+
export * from "./services/background-sync/background-service-uuids.js";
|
|
37
42
|
export * from "./services/custom/define-custom-device.js";
|
|
38
43
|
export * from "./services/devices/standard-gatt/standard-gatt.devices.js";
|
|
39
44
|
export * from "./services/devices/boso/boso.medicus.js";
|
|
@@ -47,6 +52,7 @@ export * from "./services/devices/aoj/aoj.thermometers.js";
|
|
|
47
52
|
export * from "./services/devices/viatom/viatom.bp-monitors.js";
|
|
48
53
|
export * from "./services/devices/viatom/viatom.oximeters.js";
|
|
49
54
|
export * from "./services/devices/viatom/viatom.ecg-recorders.js";
|
|
55
|
+
export * from "./services/devices/viatom/viatom.ecg-files.js";
|
|
50
56
|
export * from "./services/devices/viatom/viatom.lepod.js";
|
|
51
57
|
export * from "./services/devices/lepu/lepu.device-names.js";
|
|
52
58
|
export * from "./services/devices/lepu/lepu.name-match.js";
|
|
@@ -56,6 +62,7 @@ export * from "./services/devices/lepu/lepu.file-transfer.js";
|
|
|
56
62
|
export * from "./services/devices/lepu/lepu.response-type.js";
|
|
57
63
|
export * from "./constants/measurement-field-catalog.js";
|
|
58
64
|
export * from "./components/bt-provider.js";
|
|
65
|
+
export * from "./components/bluetooth-device-picker.js";
|
|
59
66
|
export * from "./components/default-permission-fallback.js";
|
|
60
67
|
export * from "./hooks/use-request-permissions.js";
|
|
61
68
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sourceRoot":"../../../../src","sources":["modules/bt-management/index.ts"],"mappings":";;AAAA,cAAc,gCAA6B;AAC3C,cAAc,4BAAyB;AACvC,cAAc,kCAA+B;AAC7C,cAAc,8BAA2B;AACzC,cAAc,6BAA0B;AACxC,cAAc,6BAA0B;AACxC,cAAc,qCAAkC;AAChD,cAAc,6BAA0B;AACxC,cAAc,+BAA4B;AAC1C,cAAc,kCAA+B;AAC7C,cAAc,8BAA2B;AACzC,cAAc,8BAA2B;AACzC,cAAc,6BAA0B;AACxC,cAAc,+BAA4B;AAC1C,cAAc,gCAA6B;AAC3C,cAAc,gCAA6B;AAC3C,cAAc,8BAA2B;AACzC,cAAc,2BAAwB;AACtC,cAAc,uBAAoB;AAClC,cAAc,0BAAuB;AACrC,cAAc,wBAAqB;AACnC,cAAc,0BAAuB;AACrC,cAAc,+BAA4B;AAC1C,cAAc,6BAA0B;AACxC,cAAc,yBAAsB;AACpC,cAAc,0BAAuB;AACrC,cAAc,6BAA0B;AACxC,cAAc,sCAAmC;AACjD,cAAc,4BAAyB;AACvC,cAAc,2BAAwB;AACtC,cAAc,0CAAuC;AAErD,cAAc,yCAAsC;AACpD,cAAc,4CAAyC;AACvD,cAAc,0BAAuB;AACrC,cAAc,2CAAwC;AACtD,cAAc,2DAAwD;AACtE,cAAc,yCAAsC;AACpD,cAAc,oDAAiD;AAC/D,cAAc,mDAAgD;AAC9D,cAAc,0DAAuD;AACrE,cAAc,kDAA+C;AAC7D,cAAc,mDAAgD;AAC9D,cAAc,4CAAyC;AACvD,cAAc,4CAAyC;AACvD,cAAc,iDAA8C;AAC5D,cAAc,+CAA4C;AAC1D,cAAc,mDAAgD;AAC9D,cAAc,2CAAwC;AACtD,cAAc,8CAA2C;AACzD,cAAc,4CAAyC;AACvD,cAAc,0CAAuC;AACrD,cAAc,6CAA0C;AACxD,cAAc,+CAA4C;AAC1D,cAAc,+CAA4C;AAE1D,cAAc,0CAAuC;AAErD,cAAc,6BAA0B;AACxC,cAAc,6CAA0C;AACxD,cAAc,oCAAiC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../../src","sources":["modules/bt-management/index.ts"],"mappings":";;AAAA,cAAc,gCAA6B;AAC3C,cAAc,4BAAyB;AACvC,cAAc,kCAA+B;AAC7C,cAAc,8BAA2B;AACzC,cAAc,6BAA0B;AACxC,cAAc,6BAA0B;AACxC,cAAc,qCAAkC;AAChD,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@@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { BleManager } from "react-native-ble-plx";
|
|
4
|
+
const DEFAULT_RESTORE_STATE_IDENTIFIER = "com.ovok.native.background-sync";
|
|
5
|
+
const restoredStates = new Map();
|
|
6
|
+
/**
|
|
7
|
+
* Creates a BLE manager configured for iOS CoreBluetooth state restoration. The returned
|
|
8
|
+
* manager must be created once at module scope, not inside a React render.
|
|
9
|
+
*/
|
|
10
|
+
const createBackgroundBleManager = ({
|
|
11
|
+
restoreStateIdentifier = DEFAULT_RESTORE_STATE_IDENTIFIER,
|
|
12
|
+
onRestoreState
|
|
13
|
+
} = {}) => new BleManager({
|
|
14
|
+
restoreStateIdentifier,
|
|
15
|
+
restoreStateFunction: state => {
|
|
16
|
+
restoredStates.set(restoreStateIdentifier, state);
|
|
17
|
+
onRestoreState?.(state);
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
const getRestoredBleState = (restoreStateIdentifier = DEFAULT_RESTORE_STATE_IDENTIFIER) => restoredStates.get(restoreStateIdentifier);
|
|
21
|
+
export { DEFAULT_RESTORE_STATE_IDENTIFIER, createBackgroundBleManager, getRestoredBleState };
|
|
22
|
+
//# sourceMappingURL=background-ble-manager.js.map
|
package/lib/module/modules/bt-management/services/background-sync/background-ble-manager.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["BleManager","DEFAULT_RESTORE_STATE_IDENTIFIER","restoredStates","Map","createBackgroundBleManager","restoreStateIdentifier","onRestoreState","restoreStateFunction","state","set","getRestoredBleState","get"],"sourceRoot":"../../../../../../src","sources":["modules/bt-management/services/background-sync/background-ble-manager.ts"],"mappings":";;AAAA,SACEA,UAAU,QAGL,sBAAsB;AAE7B,MAAMC,gCAAgC,GACpC,iCAAiC;AAEnC,MAAMC,cAAc,GAAG,IAAIC,GAAG,CAAkC,CAAC;AAOjE;AACA;AACA;AACA;AACA,MAAMC,0BAA0B,GAAGA,CAAC;EAClCC,sBAAsB,GAAGJ,gCAAgC;EACzDK;AAC2B,CAAC,GAAG,CAAC,CAAC,KACjC,IAAIN,UAAU,CAAC;EACbK,sBAAsB;EACtBE,oBAAoB,EAAGC,KAAK,IAAK;IAC/BN,cAAc,CAACO,GAAG,CAACJ,sBAAsB,EAAEG,KAAK,CAAC;IACjDF,cAAc,GAAGE,KAAK,CAAC;EACzB;AACF,CAAC,CAAC;AAEJ,MAAME,mBAAmB,GAAGA,CAC1BL,sBAAsB,GAAGJ,gCAAgC,KAEzDC,cAAc,CAACS,GAAG,CAACN,sBAAsB,CAAC;AAE5C,SAEEJ,gCAAgC,EAChCG,0BAA0B,EAC1BM,mBAAmB","ignoreList":[]}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { IntegratedDevices } from "../../types/integrated-devices.js";
|
|
4
|
+
import { bc01MainServices } from "../devices/bc01/bc01.main-services.js";
|
|
5
|
+
import { bp2MainServices } from "../devices/bp2/bp2.main-services.js";
|
|
6
|
+
import { f4MainServices } from "../devices/f4/f4.main-services.js";
|
|
7
|
+
import { spo2MainServices } from "../devices/spo/spo2.main-services.js";
|
|
8
|
+
const normalize = uuid => uuid.toLowerCase();
|
|
9
|
+
const serviceUUIDs = services => services.map(service => normalize(service.uuid));
|
|
10
|
+
const BUILT_IN_SERVICE_UUIDS = {
|
|
11
|
+
[IntegratedDevices.BP2]: serviceUUIDs(bp2MainServices),
|
|
12
|
+
[IntegratedDevices.F4]: serviceUUIDs(f4MainServices),
|
|
13
|
+
[IntegratedDevices.PC60WF]: serviceUUIDs(spo2MainServices),
|
|
14
|
+
[IntegratedDevices.BC01]: serviceUUIDs(bc01MainServices),
|
|
15
|
+
[IntegratedDevices.VEROVAL_DUO_CONTROL]: ["5d4b8aa6-a26a-4a1b-99f5-cd4473c786e3"],
|
|
16
|
+
[IntegratedDevices.VEROVAL_ECG]: ["0000a000-0000-1000-8000-00805f9b34fb"]
|
|
17
|
+
};
|
|
18
|
+
export const getBackgroundServiceUUIDs = (acceptedDevices, additionalServiceUUIDs = []) => {
|
|
19
|
+
const uuids = new Set(additionalServiceUUIDs.map(normalize));
|
|
20
|
+
acceptedDevices.forEach(acceptedDevice => {
|
|
21
|
+
const deviceUUIDs = typeof acceptedDevice === "string" ? BUILT_IN_SERVICE_UUIDS[acceptedDevice] : serviceUUIDs(acceptedDevice.mainServices);
|
|
22
|
+
deviceUUIDs?.forEach(uuid => uuids.add(normalize(uuid)));
|
|
23
|
+
});
|
|
24
|
+
return [...uuids];
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=background-service-uuids.js.map
|
package/lib/module/modules/bt-management/services/background-sync/background-service-uuids.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["IntegratedDevices","bc01MainServices","bp2MainServices","f4MainServices","spo2MainServices","normalize","uuid","toLowerCase","serviceUUIDs","services","map","service","BUILT_IN_SERVICE_UUIDS","BP2","F4","PC60WF","BC01","VEROVAL_DUO_CONTROL","VEROVAL_ECG","getBackgroundServiceUUIDs","acceptedDevices","additionalServiceUUIDs","uuids","Set","forEach","acceptedDevice","deviceUUIDs","mainServices","add"],"sourceRoot":"../../../../../../src","sources":["modules/bt-management/services/background-sync/background-service-uuids.ts"],"mappings":";;AAEA,SAASA,iBAAiB,QAAQ,mCAAgC;AAElE,SAASC,gBAAgB,QAAQ,uCAAoC;AACrE,SAASC,eAAe,QAAQ,qCAAkC;AAClE,SAASC,cAAc,QAAQ,mCAAgC;AAC/D,SAASC,gBAAgB,QAAQ,sCAAmC;AAEpE,MAAMC,SAAS,GAAIC,IAAY,IAAaA,IAAI,CAACC,WAAW,CAAC,CAAC;AAE9D,MAAMC,YAAY,GAAIC,QAA6B,IACjDA,QAAQ,CAACC,GAAG,CAAEC,OAAO,IAAKN,SAAS,CAACM,OAAO,CAACL,IAAI,CAAC,CAAC;AAEpD,MAAMM,sBAAoE,GAAG;EAC3E,CAACZ,iBAAiB,CAACa,GAAG,GAAGL,YAAY,CAACN,eAAe,CAAC;EACtD,CAACF,iBAAiB,CAACc,EAAE,GAAGN,YAAY,CAACL,cAAc,CAAC;EACpD,CAACH,iBAAiB,CAACe,MAAM,GAAGP,YAAY,CAACJ,gBAAgB,CAAC;EAC1D,CAACJ,iBAAiB,CAACgB,IAAI,GAAGR,YAAY,CAACP,gBAAgB,CAAC;EACxD,CAACD,iBAAiB,CAACiB,mBAAmB,GAAG,CACvC,sCAAsC,CACvC;EACD,CAACjB,iBAAiB,CAACkB,WAAW,GAAG,CAC/B,sCAAsC;AAE1C,CAAC;AAED,OAAO,MAAMC,yBAAyB,GAAGA,CACvCC,eAA0C,EAC1CC,sBAAyC,GAAG,EAAE,KACjC;EACb,MAAMC,KAAK,GAAG,IAAIC,GAAG,CAACF,sBAAsB,CAACX,GAAG,CAACL,SAAS,CAAC,CAAC;EAE5De,eAAe,CAACI,OAAO,CAAEC,cAAc,IAAK;IAC1C,MAAMC,WAAW,GACf,OAAOD,cAAc,KAAK,QAAQ,GAC9Bb,sBAAsB,CAACa,cAAc,CAAC,GACtCjB,YAAY,CAAEiB,cAAc,CAA4BE,YAAY,CAAC;IAE3ED,WAAW,EAAEF,OAAO,CAAElB,IAAI,IAAKgB,KAAK,CAACM,GAAG,CAACvB,SAAS,CAACC,IAAI,CAAC,CAAC,CAAC;EAC5D,CAAC,CAAC;EAEF,OAAO,CAAC,GAAGgB,KAAK,CAAC;AACnB,CAAC","ignoreList":[]}
|
package/lib/module/modules/bt-management/services/background-sync/background-sync-coordinator.js
ADDED
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
const DEFAULT_QUEUE_KEY = "@ovok/native/background-sync/results";
|
|
4
|
+
const DEFAULT_MAX_RETRIES = 3;
|
|
5
|
+
const DEFAULT_RETRY_BACKOFF_MS = 30_000;
|
|
6
|
+
let resultSequence = 0;
|
|
7
|
+
const createResultId = () => {
|
|
8
|
+
resultSequence += 1;
|
|
9
|
+
return `${Date.now()}-${resultSequence}-${Math.random().toString(36).slice(2, 10)}`;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* A small durable, at-least-once queue. The result is written before delivery and removed only
|
|
14
|
+
* after the consumer resolves. A process death between those two operations can deliver a
|
|
15
|
+
* result twice, so consumers should de-duplicate by `id`.
|
|
16
|
+
*/
|
|
17
|
+
class BackgroundSyncCoordinator {
|
|
18
|
+
operation = Promise.resolve();
|
|
19
|
+
constructor(options) {
|
|
20
|
+
this.options = options;
|
|
21
|
+
this.storageKey = options.storageKey ?? DEFAULT_QUEUE_KEY;
|
|
22
|
+
this.maxRetries = Math.max(1, options.maxRetries ?? DEFAULT_MAX_RETRIES);
|
|
23
|
+
this.retryBackoffMs = Math.max(1, options.retryBackoffMs ?? DEFAULT_RETRY_BACKOFF_MS);
|
|
24
|
+
}
|
|
25
|
+
enqueue = result => this.runExclusive(async () => {
|
|
26
|
+
const queue = await this.readQueue();
|
|
27
|
+
queue.push({
|
|
28
|
+
id: createResultId(),
|
|
29
|
+
queuedAt: new Date().toISOString(),
|
|
30
|
+
attempt: 0,
|
|
31
|
+
nextAttemptAt: 0,
|
|
32
|
+
result
|
|
33
|
+
});
|
|
34
|
+
await this.writeQueue(queue);
|
|
35
|
+
await this.flushQueue(queue);
|
|
36
|
+
});
|
|
37
|
+
flush = (options = {}) => this.runExclusive(async () => {
|
|
38
|
+
await this.flushQueue(await this.readQueue(), options);
|
|
39
|
+
});
|
|
40
|
+
runExclusive = operation => {
|
|
41
|
+
const next = this.operation.then(operation, operation);
|
|
42
|
+
this.operation = next.catch(() => undefined);
|
|
43
|
+
return next;
|
|
44
|
+
};
|
|
45
|
+
readQueue = async () => {
|
|
46
|
+
const serialized = await this.options.storage.getItem(this.storageKey);
|
|
47
|
+
if (!serialized) {
|
|
48
|
+
return [];
|
|
49
|
+
}
|
|
50
|
+
try {
|
|
51
|
+
const parsed = JSON.parse(serialized);
|
|
52
|
+
if (!Array.isArray(parsed)) {
|
|
53
|
+
throw new Error("Background sync queue is not an array");
|
|
54
|
+
}
|
|
55
|
+
return parsed;
|
|
56
|
+
} catch (error) {
|
|
57
|
+
await this.options.storage.setItem(this.storageKey, "[]");
|
|
58
|
+
throw new Error(`Background sync queue could not be read: ${error instanceof Error ? error.message : String(error)}`);
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
writeQueue = async queue => {
|
|
62
|
+
await this.options.storage.setItem(this.storageKey, JSON.stringify(queue));
|
|
63
|
+
};
|
|
64
|
+
flushQueue = async (queue, options = {}) => {
|
|
65
|
+
let changed = false;
|
|
66
|
+
const now = Date.now();
|
|
67
|
+
for (const item of [...queue]) {
|
|
68
|
+
if (item.exhausted && options.resetExhausted) {
|
|
69
|
+
item.attempt = 0;
|
|
70
|
+
item.exhausted = false;
|
|
71
|
+
item.nextAttemptAt = 0;
|
|
72
|
+
changed = true;
|
|
73
|
+
}
|
|
74
|
+
if (item.exhausted && !options.includeExhausted || item.nextAttemptAt > now) {
|
|
75
|
+
continue;
|
|
76
|
+
}
|
|
77
|
+
const attempt = item.attempt + 1;
|
|
78
|
+
try {
|
|
79
|
+
await this.options.onResult({
|
|
80
|
+
...item.result,
|
|
81
|
+
id: item.id,
|
|
82
|
+
queuedAt: item.queuedAt,
|
|
83
|
+
attempt
|
|
84
|
+
});
|
|
85
|
+
queue.splice(queue.indexOf(item), 1);
|
|
86
|
+
changed = true;
|
|
87
|
+
} catch {
|
|
88
|
+
item.attempt = attempt;
|
|
89
|
+
item.exhausted = attempt >= this.maxRetries;
|
|
90
|
+
item.nextAttemptAt = item.exhausted ? Number.MAX_SAFE_INTEGER : Date.now() + this.retryBackoffMs * 2 ** (attempt - 1);
|
|
91
|
+
changed = true;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
if (changed) {
|
|
95
|
+
await this.writeQueue(queue);
|
|
96
|
+
}
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
export { BackgroundSyncCoordinator, DEFAULT_QUEUE_KEY };
|
|
100
|
+
//# sourceMappingURL=background-sync-coordinator.js.map
|
package/lib/module/modules/bt-management/services/background-sync/background-sync-coordinator.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["DEFAULT_QUEUE_KEY","DEFAULT_MAX_RETRIES","DEFAULT_RETRY_BACKOFF_MS","resultSequence","createResultId","Date","now","Math","random","toString","slice","BackgroundSyncCoordinator","operation","Promise","resolve","constructor","options","storageKey","maxRetries","max","retryBackoffMs","enqueue","result","runExclusive","queue","readQueue","push","id","queuedAt","toISOString","attempt","nextAttemptAt","writeQueue","flushQueue","flush","next","then","catch","undefined","serialized","storage","getItem","parsed","JSON","parse","Array","isArray","Error","error","setItem","message","String","stringify","changed","item","exhausted","resetExhausted","includeExhausted","onResult","splice","indexOf","Number","MAX_SAFE_INTEGER"],"sourceRoot":"../../../../../../src","sources":["modules/bt-management/services/background-sync/background-sync-coordinator.ts"],"mappings":";;AAkBA,MAAMA,iBAAiB,GAAG,sCAAsC;AAChE,MAAMC,mBAAmB,GAAG,CAAC;AAC7B,MAAMC,wBAAwB,GAAG,MAAM;AAEvC,IAAIC,cAAc,GAAG,CAAC;AAEtB,MAAMC,cAAc,GAAGA,CAAA,KAAc;EACnCD,cAAc,IAAI,CAAC;EAEnB,OAAO,GAAGE,IAAI,CAACC,GAAG,CAAC,CAAC,IAAIH,cAAc,IAAII,IAAI,CAACC,MAAM,CAAC,CAAC,CAACC,QAAQ,CAAC,EAAE,CAAC,CAACC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,EAAE;AACrF,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA,MAAMC,yBAAyB,CAAsB;EAI3CC,SAAS,GAAkBC,OAAO,CAACC,OAAO,CAAC,CAAC;EAE7CC,WAAWA,CAAkBC,OAAiC,EAAE;IAAA,KAAnCA,OAAiC,GAAjCA,OAAiC;IACnE,IAAI,CAACC,UAAU,GAAGD,OAAO,CAACC,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I;MAChB;MAEA,IACGC,IAAI,CAACC,SAAS,IAAI,CAACvC,OAAO,CAACyC,gBAAgB,IAC5CH,IAAI,CAACvB,aAAa,GAAGzB,GAAG,EACxB;QACA;MACF;MAEA,MAAMwB,OAAO,GAAGwB,IAAI,CAACxB,OAAO,GAAG,CAAC;MAEhC,IAAI;QACF,MAAM,IAAI,CAACd,OAAO,CAAC0C,QAAQ,CAAC;UAC1B,GAAGJ,IAAI,CAAChC,MAAM;UACdK,EAAE,EAAE2B,IAAI,CAAC3B,EAAE;UACXC,QAAQ,EAAE0B,IAAI,CAAC1B,QAAQ;UACvBE;QACF,CAA4B,CAAC;QAE7BN,KAAK,CAACmC,MAAM,CAACnC,KAAK,CAACoC,OAAO,CAACN,IAAI,CAAC,EAAE,CAAC,CAAC;QACpCD,OAAO,GAAG,IAAI;MAChB,CAAC,CAAC,MAAM;QACNC,IAAI,CAACxB,OAAO,GAAGA,OAAO;QACtBwB,IAAI,CAACC,SAAS,GAAGzB,OAAO,IAAI,IAAI,CAACZ,UAAU;QAC3CoC,IAAI,CAACvB,aAAa,GAAGuB,IAAI,CAACC,SAAS,GAC/BM,MAAM,CAACC,gBAAgB,GACvBzD,IAAI,CAACC,GAAG,CAAC,CAAC,GAAG,IAAI,CAACc,cAAc,GAAG,CAAC,KAAKU,OAAO,GAAG,CAAC,CAAC;QACzDuB,OAAO,GAAG,IAAI;MAChB;IACF;IAEA,IAAIA,OAAO,EAAE;MACX,MAAM,IAAI,CAACrB,UAAU,CAACR,KAAK,CAAC;IAC9B;EACF,CAAC;AACH;AAEA,SAASb,yBAAyB,EAAEX,iBAAiB","ignoreList":[]}
|
|
@@ -6,18 +6,25 @@ import { ScanMode, State } from "react-native-ble-plx";
|
|
|
6
6
|
import { slog } from "../../helpers/index.js";
|
|
7
7
|
import { sentryLogger } from "../../helpers/utils/sentry-logger.js";
|
|
8
8
|
import { DeviceCreator } from "./device-creator.js";
|
|
9
|
-
|
|
9
|
+
class BTManager {
|
|
10
10
|
static MAX_DEVICES = 15; // Safety limit to prevent unbounded growth
|
|
11
11
|
devices = new Map();
|
|
12
12
|
eventSubscriptions = [];
|
|
13
|
-
|
|
13
|
+
autoConnectCandidates = new Map();
|
|
14
|
+
constructor(bleManager, acceptedDevices, options = {}) {
|
|
14
15
|
this.bleManager = bleManager;
|
|
15
16
|
this.acceptedDevices = acceptedDevices;
|
|
17
|
+
this.options = options;
|
|
16
18
|
this.deviceCreator = new DeviceCreator(this.acceptedDevices);
|
|
19
|
+
this.backgroundScanEnabled = options.backgroundEnabled === true;
|
|
17
20
|
}
|
|
18
21
|
destroy = () => {
|
|
19
22
|
sentryLogger("info", "BT_MANAGER: Destroying BTManager");
|
|
20
23
|
this.stopScan();
|
|
24
|
+
if (this.autoConnectTimer) {
|
|
25
|
+
clearTimeout(this.autoConnectTimer);
|
|
26
|
+
this.autoConnectTimer = undefined;
|
|
27
|
+
}
|
|
21
28
|
|
|
22
29
|
// Remove state change listener
|
|
23
30
|
if (this.stateChangeListener) {
|
|
@@ -51,9 +58,20 @@ export class BTManager {
|
|
|
51
58
|
}
|
|
52
59
|
this.stateChangeListener?.remove();
|
|
53
60
|
this.stateChangeListener = undefined;
|
|
54
|
-
this.
|
|
55
|
-
|
|
56
|
-
|
|
61
|
+
const serviceUUIDs = this.options.serviceUUIDs ?? [];
|
|
62
|
+
if (Platform.OS === "ios" && this.backgroundScanEnabled && !serviceUUIDs.length) {
|
|
63
|
+
this.onErrorCallback?.({
|
|
64
|
+
error: "Background Bluetooth sync on iOS requires at least one service UUID. Add serviceUUIDs for custom devices."
|
|
65
|
+
});
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
void Promise.resolve(this.bleManager.startDeviceScan(this.backgroundScanEnabled ? [...serviceUUIDs] : null, {
|
|
69
|
+
scanMode: this.backgroundScanEnabled ? ScanMode.LowPower : ScanMode.Balanced
|
|
70
|
+
}, this.onScanResult)).catch(error => {
|
|
71
|
+
this.onErrorCallback?.({
|
|
72
|
+
error: error instanceof Error ? error : String(error)
|
|
73
|
+
});
|
|
74
|
+
});
|
|
57
75
|
sentryLogger("info", "BT_MANAGER: Scan started (continuous mode)");
|
|
58
76
|
return;
|
|
59
77
|
}
|
|
@@ -74,6 +92,11 @@ export class BTManager {
|
|
|
74
92
|
this.eventSubscriptions.push(this.stateChangeListener);
|
|
75
93
|
}
|
|
76
94
|
};
|
|
95
|
+
|
|
96
|
+
/** Switches only the scan policy; the app can keep a foreground scan broad. */
|
|
97
|
+
setBackgroundScanEnabled = enabled => {
|
|
98
|
+
this.backgroundScanEnabled = enabled;
|
|
99
|
+
};
|
|
77
100
|
stopScan = () => {
|
|
78
101
|
sentryLogger("info", "BT_MANAGER: Stopping scan");
|
|
79
102
|
this.bleManager.stopDeviceScan();
|
|
@@ -92,6 +115,9 @@ export class BTManager {
|
|
|
92
115
|
});
|
|
93
116
|
this.devices.clear();
|
|
94
117
|
};
|
|
118
|
+
restoreDevices = devices => {
|
|
119
|
+
devices.forEach(device => this.onScanResult(null, device));
|
|
120
|
+
};
|
|
95
121
|
onDeviceFound = callback => {
|
|
96
122
|
sentryLogger("info", "BT_MANAGER: Setting onDeviceFound callback");
|
|
97
123
|
this.onDeviceFoundCallback = callback;
|
|
@@ -133,13 +159,13 @@ export class BTManager {
|
|
|
133
159
|
* matcher runs against the string the peripheral actually advertised.
|
|
134
160
|
*/
|
|
135
161
|
const advertisedName = device?.name?.trim() || device?.localName?.trim() || "";
|
|
136
|
-
if (!device
|
|
162
|
+
if (!device) {
|
|
137
163
|
return;
|
|
138
164
|
}
|
|
139
165
|
if (this.devices.has(device.id)) {
|
|
140
166
|
return;
|
|
141
167
|
}
|
|
142
|
-
const deviceName = this.deviceCreator.getDeviceName(advertisedName);
|
|
168
|
+
const deviceName = this.deviceCreator.getDeviceName(advertisedName, device.serviceUUIDs ?? []);
|
|
143
169
|
if (!deviceName) {
|
|
144
170
|
return;
|
|
145
171
|
}
|
|
@@ -166,6 +192,7 @@ export class BTManager {
|
|
|
166
192
|
});
|
|
167
193
|
this.devices.set(device.id, deviceClass);
|
|
168
194
|
this.onDeviceFoundCallback?.(deviceClass, this);
|
|
195
|
+
this.queueAutoConnect(deviceClass);
|
|
169
196
|
} catch (error) {
|
|
170
197
|
sentryLogger("error", "BT_MANAGER: Error creating device", {
|
|
171
198
|
error: error instanceof Error ? error.message : error,
|
|
@@ -179,6 +206,32 @@ export class BTManager {
|
|
|
179
206
|
});
|
|
180
207
|
}
|
|
181
208
|
};
|
|
209
|
+
queueAutoConnect = device => {
|
|
210
|
+
if (!this.options.autoConnect) {
|
|
211
|
+
return;
|
|
212
|
+
}
|
|
213
|
+
this.autoConnectCandidates.set(device.id, device);
|
|
214
|
+
if (this.autoConnectTimer) {
|
|
215
|
+
clearTimeout(this.autoConnectTimer);
|
|
216
|
+
}
|
|
217
|
+
this.autoConnectTimer = setTimeout(() => {
|
|
218
|
+
this.autoConnectTimer = undefined;
|
|
219
|
+
const devices = [...this.autoConnectCandidates.values()];
|
|
220
|
+
this.autoConnectCandidates.clear();
|
|
221
|
+
if (devices.length === 1) {
|
|
222
|
+
void devices[0]?.connect();
|
|
223
|
+
return;
|
|
224
|
+
}
|
|
225
|
+
if (devices.length > 1) {
|
|
226
|
+
this.options.onDeviceSelectionRequired?.({
|
|
227
|
+
devices: devices,
|
|
228
|
+
select: async selected => {
|
|
229
|
+
await selected.connect();
|
|
230
|
+
}
|
|
231
|
+
});
|
|
232
|
+
}
|
|
233
|
+
}, Math.max(0, this.options.autoConnectDelayMs ?? 500));
|
|
234
|
+
};
|
|
182
235
|
removeDeviceFromFoundedDevices = deviceId => {
|
|
183
236
|
sentryLogger("info", "BT_MANAGER: Removing device from founded devices now its accessible again", {
|
|
184
237
|
deviceId,
|
|
@@ -187,4 +240,5 @@ export class BTManager {
|
|
|
187
240
|
this.devices.delete(deviceId);
|
|
188
241
|
};
|
|
189
242
|
}
|
|
243
|
+
export { BTManager };
|
|
190
244
|
//# sourceMappingURL=bt-manager.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Linking","Platform","ScanMode","State","slog","sentryLogger","DeviceCreator","BTManager","MAX_DEVICES","devices","Map","eventSubscriptions","constructor","bleManager","acceptedDevices","deviceCreator","destroy","stopScan","
|
|
1
|
+
{"version":3,"names":["Linking","Platform","ScanMode","State","slog","sentryLogger","DeviceCreator","BTManager","MAX_DEVICES","devices","Map","eventSubscriptions","autoConnectCandidates","constructor","bleManager","acceptedDevices","options","deviceCreator","backgroundScanEnabled","backgroundEnabled","destroy","stopScan","autoConnectTimer","clearTimeout","undefined","stateChangeListener","remove","onErrorCallback","onDeviceFoundCallback","onResultCallback","onDeviceStatusChangedCallback","forEach","device","clear","startScan","onStateChange","state","PoweredOn","index","indexOf","splice","serviceUUIDs","OS","length","error","Promise","resolve","startDeviceScan","scanMode","LowPower","Balanced","onScanResult","catch","Error","String","sendIntent","push","setBackgroundScanEnabled","enabled","stopDeviceScan","sub","restoreDevices","onDeviceFound","callback","onError","onDeviceStatusChanged","onResult","message","advertisedName","name","trim","localName","has","id","deviceName","getDeviceName","size","deviceId","currentSize","deviceClass","createDevice","bind","onDeviceDisconnected","removeDeviceFromFoundedDevices","set","queueAutoConnect","autoConnect","setTimeout","values","connect","onDeviceSelectionRequired","select","selected","Math","max","autoConnectDelayMs","get","delete"],"sourceRoot":"../../../../../src","sources":["modules/bt-management/services/bt-manager.ts"],"mappings":";;AAAA;AACA,SAASA,OAAO,EAAEC,QAAQ,QAAQ,cAAc;AAChD,SAIEC,QAAQ,EACRC,KAAK,QAEA,sBAAsB;AAE7B,SAASC,IAAI,QAAQ,wBAAe;AACpC,SAASC,YAAY,QAAQ,sCAAmC;AAOhE,SAASC,aAAa,QAAQ,qBAAkB;AAuBhD,MAAMC,SAAS,CAAsC;EACnD,OAAwBC,WAAW,GAAG,EAAE,CAAC,CAAC;EAClCC,OAAO,GAAG,IAAIC,GAAG,CAA0C,CAAC;EAG5DC,kBAAkB,GAAmB,EAAE;EAIvCC,qBA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;UACvCjF,OAAO,EAAEA,OAAuC;UAChDkF,MAAM,EAAE,MAAOC,QAAQ,IAAK;YAC1B,MAAMA,QAAQ,CAACH,OAAO,CAAC,CAAC;UAC1B;QACF,CAAC,CAAC;MACJ;IACF,CAAC,EAAEI,IAAI,CAACC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC9E,OAAO,CAAC+E,kBAAkB,IAAI,GAAG,CAAC,CAAC;EACzD,CAAC;EAEOZ,8BAA8B,GAAIN,QAAgB,IAAK;IAC7DxE,YAAY,CACV,MAAM,EACN,2EAA2E,EAC3E;MACEwE,QAAQ;MACRH,UAAU,EAAE,IAAI,CAACjE,OAAO,CAACuF,GAAG,CAACnB,QAAQ,CAAC,EAAE7C,MAAM,EAAEqC;IAClD,CACF,CAAC;IACD,IAAI,CAAC5D,OAAO,CAACwF,MAAM,CAACpB,QAAQ,CAAC;EAC/B,CAAC;AACH;AAEA,SAAStE,SAAS","ignoreList":[]}
|
|
@@ -16,7 +16,7 @@ const MAX_MTU = 517;
|
|
|
16
16
|
const MAX_STUCK_TIMEOUT_MS = 6_000_000;
|
|
17
17
|
const HEX_BYTES = /^([0-9a-f]{2})+$/;
|
|
18
18
|
const assertIdentity = spec => {
|
|
19
|
-
const id = typeof spec?.id === "string" ? spec.id.trim() : "";
|
|
19
|
+
const id = typeof spec?.id === "string" ? spec.id.trim() : "ovok-custom-device";
|
|
20
20
|
if (!id) {
|
|
21
21
|
throw customDeviceError(String(spec?.id), "id", "must not be empty");
|
|
22
22
|
}
|
|
@@ -35,9 +35,12 @@ const compileNameMatch = (id, spec) => {
|
|
|
35
35
|
return nameMatch;
|
|
36
36
|
}
|
|
37
37
|
const exact = typeof nameMatch === "string" ? nameMatch.trim() : "";
|
|
38
|
-
if (!exact) {
|
|
38
|
+
if (typeof nameMatch === "string" && !exact) {
|
|
39
39
|
throw customDeviceError(id, "nameMatch", "must not be empty");
|
|
40
40
|
}
|
|
41
|
+
if (!exact) {
|
|
42
|
+
return /.*/;
|
|
43
|
+
}
|
|
41
44
|
return new RegExp(`^${exact.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}$`);
|
|
42
45
|
};
|
|
43
46
|
const assertStuckTimeout = (id, spec) => {
|
|
@@ -123,6 +126,7 @@ export const defineCustomDevice = spec => {
|
|
|
123
126
|
id: id,
|
|
124
127
|
spec,
|
|
125
128
|
nameMatch,
|
|
129
|
+
matchByService: spec.matchByService === true,
|
|
126
130
|
mainServices,
|
|
127
131
|
stuckDataTimeout,
|
|
128
132
|
fields,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["CUSTOM_DEVICE_BRAND","IntegratedDevices","compileCustomLepu","compileCustomMonitor","customDeviceError","normalizeBleUuid","MIN_STUCK_TIMEOUT_MS","MIN_MTU","MAX_MTU","MAX_STUCK_TIMEOUT_MS","HEX_BYTES","assertIdentity","spec","id","trim","String","builtIn","Object","values","find","name","toLowerCase","compileNameMatch","nameMatch","RegExp","global","sticky","exact","replace","assertStuckTimeout","timeout","stuckDataTimeoutMs","Number","isInteger","assertPreferredMtu","mtu","preferredMtu","undefined","compileWrite","path","write","commandHex","test","uuid","mainCommandUuid","defineCustomDevice","stuckDataTimeout","Array","isArray","services","length","fields","Map","frames","seenCharacteristics","Set","mainServices","map","service","serviceIndex","monitor","monitorUuids","monitorIndex","monitorPath","characteristic","frame","has","add","set","writeUuid","lepu"],"sourceRoot":"../../../../../../src","sources":["modules/bt-management/services/custom/define-custom-device.ts"],"mappings":";;AAAA,SAASA,mBAAmB,QAAQ,wCAAqC;AAMzE,SAASC,iBAAiB,QAAQ,mCAAgC;AAGlE,SAASC,iBAAiB,QAAQ,0BAAuB;AACzD,SAASC,oBAAoB,QAAQ,6BAA0B;AAC/D,SAASC,iBAAiB,QAAQ,0BAAuB;AACzD,SAASC,gBAAgB,QAAQ,yBAAsB;AAEvD,MAAMC,oBAAoB,GAAG,KAAK;;AAElC;AACA,MAAMC,OAAO,GAAG,EAAE;AAClB,MAAMC,OAAO,GAAG,GAAG;;AAEnB;AACA,MAAMC,oBAAoB,GAAG,SAAS;AACtC,MAAMC,SAAS,GAAG,kBAAkB;AAEpC,MAAMC,cAAc,GAAIC,IAAsB,IAAa;EACzD,MAAMC,EAAE,GAAG,OAAOD,IAAI,EAAEC,EAAE,KAAK,QAAQ,GAAGD,IAAI,CAACC,EAAE,CAACC,IAAI,CAAC,CAAC,GAAG,
|
|
1
|
+
{"version":3,"names":["CUSTOM_DEVICE_BRAND","IntegratedDevices","compileCustomLepu","compileCustomMonitor","customDeviceError","normalizeBleUuid","MIN_STUCK_TIMEOUT_MS","MIN_MTU","MAX_MTU","MAX_STUCK_TIMEOUT_MS","HEX_BYTES","assertIdentity","spec","id","trim","String","builtIn","Object","values","find","name","toLowerCase","compileNameMatch","nameMatch","RegExp","global","sticky","exact","replace","assertStuckTimeout","timeout","stuckDataTimeoutMs","Number","isInteger","assertPreferredMtu","mtu","preferredMtu","undefined","compileWrite","path","write","commandHex","test","uuid","mainCommandUuid","defineCustomDevice","stuckDataTimeout","Array","isArray","services","length","fields","Map","frames","seenCharacteristics","Set","mainServices","map","service","serviceIndex","monitor","monitorUuids","monitorIndex","monitorPath","characteristic","frame","has","add","set","writeUuid","lepu","matchByService"],"sourceRoot":"../../../../../../src","sources":["modules/bt-management/services/custom/define-custom-device.ts"],"mappings":";;AAAA,SAASA,mBAAmB,QAAQ,wCAAqC;AAMzE,SAASC,iBAAiB,QAAQ,mCAAgC;AAGlE,SAASC,iBAAiB,QAAQ,0BAAuB;AACzD,SAASC,oBAAoB,QAAQ,6BAA0B;AAC/D,SAASC,iBAAiB,QAAQ,0BAAuB;AACzD,SAASC,gBAAgB,QAAQ,yBAAsB;AAEvD,MAAMC,oBAAoB,GAAG,KAAK;;AAElC;AACA,MAAMC,OAAO,GAAG,EAAE;AAClB,MAAMC,OAAO,GAAG,GAAG;;AAEnB;AACA,MAAMC,oBAAoB,GAAG,SAAS;AACtC,MAAMC,SAAS,GAAG,kBAAkB;AAEpC,M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,IAAI,CAC5C,CAAC;EAED,OAAO;IACL,CAAC3C,mBAAmB,GAAG,IAAI;IAC3Ba,EAAE,EAAEA,EAAoB;IACxBD,IAAI;IACJW,SAAS;IACTgD,cAAc,EAAE3D,IAAI,CAAC2D,cAAc,KAAK,IAAI;IAC5Cf,YAAY;IACZV,gBAAgB;IAChBK,MAAM;IACNE,MAAM;IACN,IAAIjB,YAAY,KAAKC,SAAS,GAAG,CAAC,CAAC,GAAG;MAAED;IAAa,CAAC,CAAC;IACvD,IAAIkC,IAAI,KAAKjC,SAAS,GAAG,CAAC,CAAC,GAAG;MAAEiC;IAAK,CAAC;EACxC,CAAC;AACH,CAAC","ignoreList":[]}
|
|
@@ -4,6 +4,7 @@ import { integratedDevicesMap } from "../constants/integrated-devices-map.js";
|
|
|
4
4
|
import { IntegratedDevices } from "../types/integrated-devices.js";
|
|
5
5
|
import { isCustomDeviceDefinition } from "../utils/is-custom-device-definition.js";
|
|
6
6
|
import { BC01Device } from "./devices/bc01/bc01.device.js";
|
|
7
|
+
import { BloodGlucoseDevice } from "./devices/blood-glucose/blood-glucose.device.js";
|
|
7
8
|
import { BP2Device } from "./devices/bp2/bp2.device.js";
|
|
8
9
|
import { CustomDevice } from "./devices/custom/custom.device.js";
|
|
9
10
|
import { F4Device } from "./devices/f4/f4.device.js";
|
|
@@ -23,6 +24,9 @@ const DEVICE_CLASSES = {
|
|
|
23
24
|
[IntegratedDevices.F4]: F4Device,
|
|
24
25
|
[IntegratedDevices.PC60WF]: SPO2Device,
|
|
25
26
|
[IntegratedDevices.BC01]: BC01Device,
|
|
27
|
+
[IntegratedDevices.TAIDOC_GLUCOSE]: BloodGlucoseDevice,
|
|
28
|
+
[IntegratedDevices.GLUCOCHECK]: BloodGlucoseDevice,
|
|
29
|
+
[IntegratedDevices.BGM]: BloodGlucoseDevice,
|
|
26
30
|
[IntegratedDevices.VEROVAL_DUO_CONTROL]: VerovalDuoControlDevice,
|
|
27
31
|
[IntegratedDevices.VEROVAL_ECG]: VerovalEcgDevice
|
|
28
32
|
};
|
|
@@ -39,11 +43,13 @@ const collectCustomDevices = acceptedDevices => {
|
|
|
39
43
|
if (customDevices.has(entry.id)) {
|
|
40
44
|
throw new Error(`acceptedDevices[${index}] registers the custom device "${entry.id}" twice`);
|
|
41
45
|
}
|
|
42
|
-
if (matchers.has(entry.nameMatch.source)) {
|
|
46
|
+
if (!entry.matchByService && matchers.has(entry.nameMatch.source)) {
|
|
43
47
|
throw new Error(`acceptedDevices[${index}] ("${entry.id}") matches the same advertised name as an earlier custom device, so one would silently shadow the other`);
|
|
44
48
|
}
|
|
45
49
|
customDevices.set(entry.id, entry);
|
|
46
|
-
|
|
50
|
+
if (!entry.matchByService) {
|
|
51
|
+
matchers.add(entry.nameMatch.source);
|
|
52
|
+
}
|
|
47
53
|
});
|
|
48
54
|
return customDevices;
|
|
49
55
|
};
|
|
@@ -54,14 +60,18 @@ export class DeviceCreator {
|
|
|
54
60
|
this.acceptedDeviceNames = acceptedDeviceNames;
|
|
55
61
|
this.customDevices = collectCustomDevices(acceptedDeviceNames);
|
|
56
62
|
}
|
|
57
|
-
getDeviceName = foundName => {
|
|
58
|
-
|
|
63
|
+
getDeviceName = (foundName, serviceUUIDs = []) => {
|
|
64
|
+
const normalizedServices = new Set(serviceUUIDs.map(uuid => uuid.toLowerCase()));
|
|
65
|
+
if (!foundName && normalizedServices.size === 0) {
|
|
59
66
|
return undefined;
|
|
60
67
|
}
|
|
68
|
+
if (!foundName && normalizedServices.size > 0) {
|
|
69
|
+
return this.matchDeviceName(foundName, normalizedServices);
|
|
70
|
+
}
|
|
61
71
|
if (this.deviceNameCache.has(foundName)) {
|
|
62
72
|
return this.deviceNameCache.get(foundName) ?? undefined;
|
|
63
73
|
}
|
|
64
|
-
const matched = this.matchDeviceName(foundName);
|
|
74
|
+
const matched = this.matchDeviceName(foundName, normalizedServices);
|
|
65
75
|
|
|
66
76
|
// Cache the result (store null for non-matches to avoid repeated tests)
|
|
67
77
|
this.cacheDeviceName(foundName, matched ?? null);
|
|
@@ -80,7 +90,7 @@ export class DeviceCreator {
|
|
|
80
90
|
* `localName` carries the advertised name instead. Accept either so a scan-time
|
|
81
91
|
* `createDevice` call for a real iOS ad is not rejected before it can connect.
|
|
82
92
|
*/
|
|
83
|
-
if (!params.device.name?.trim() && !params.device.localName?.trim()) {
|
|
93
|
+
if (!params.device.name?.trim() && !params.device.localName?.trim() && !this.customDevices.get(params.deviceName)?.matchByService) {
|
|
84
94
|
throw new Error("Device name is required");
|
|
85
95
|
}
|
|
86
96
|
if (!params.device.id) {
|
|
@@ -107,14 +117,15 @@ export class DeviceCreator {
|
|
|
107
117
|
* A built-in device always wins over a declaration: its decoder is compiled and tested,
|
|
108
118
|
* and a declaration that happens to match the same advertised name must not displace it.
|
|
109
119
|
*/
|
|
110
|
-
matchDeviceName = deviceName => {
|
|
120
|
+
matchDeviceName = (deviceName, serviceUUIDs) => {
|
|
111
121
|
for (const [regex, deviceType] of integratedDevicesMap) {
|
|
112
122
|
if (regex.test(deviceName) && this.acceptedDeviceNames.some(name => name === deviceType)) {
|
|
113
123
|
return deviceType;
|
|
114
124
|
}
|
|
115
125
|
}
|
|
116
126
|
for (const custom of this.customDevices.values()) {
|
|
117
|
-
|
|
127
|
+
const serviceMatch = custom.matchByService && custom.mainServices.some(service => serviceUUIDs.has(service.uuid.toLowerCase()));
|
|
128
|
+
if (serviceMatch || deviceName && custom.nameMatch.test(deviceName)) {
|
|
118
129
|
return custom.id;
|
|
119
130
|
}
|
|
120
131
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["integratedDevicesMap","IntegratedDevices","isCustomDeviceDefinition","BC01Device","BP2Device","CustomDevice","F4Device","SPO2Device","VerovalDuoControlDevice","VerovalEcgDevice","DEVICE_CLASSES","BP2","F4","PC60WF","BC01","VEROVAL_DUO_CONTROL","VEROVAL_ECG","collectCustomDevices","acceptedDevices","customDevices","Map","matchers","Set","forEach","entry","index","Error","has","id","nameMatch","source","set","add","DeviceCreator","deviceNameCache","CACHE_MAX_SIZE","constructor","acceptedDeviceNames","getDeviceName","foundName","
|
|
1
|
+
{"version":3,"names":["integratedDevicesMap","IntegratedDevices","isCustomDeviceDefinition","BC01Device","BloodGlucoseDevice","BP2Device","CustomDevice","F4Device","SPO2Device","VerovalDuoControlDevice","VerovalEcgDevice","DEVICE_CLASSES","BP2","F4","PC60WF","BC01","TAIDOC_GLUCOSE","GLUCOCHECK","BGM","VEROVAL_DUO_CONTROL","VEROVAL_ECG","collectCustomDevices","acceptedDevices","customDevices","Map","matchers","Set","forEach","entry","index","Error","has","id","matchByService","nameMatch","source","set","add","DeviceCreator","deviceNameCache","CACHE_MAX_SIZE","constructor","acceptedDeviceNames","getDeviceName","foundName","serviceUUIDs","normalizedServices","map","uuid","toLowerCase","size","undefined","matchDeviceName","get","matched","cacheDeviceName","createDevice","params","String","deviceName","trim","device","name","localName","custom","deviceClass","Object","keys","join","destroy","clear","regex","deviceType","test","some","values","serviceMatch","mainServices","service","firstKey","next","value","delete"],"sourceRoot":"../../../../../src","sources":["modules/bt-management/services/device-creator.ts"],"mappings":";;AAAA,SAASA,oBAAoB,QAAQ,wCAAqC;AAM1E,SAASC,iBAAiB,QAAQ,gCAA6B;AAC/D,SAASC,wBAAwB,QAAQ,yCAAsC;AAE/E,SAASC,UAAU,QAAQ,+BAA4B;AACvD,SAASC,kBAAkB,QAAQ,iDAA8C;AACjF,SAASC,SAAS,QAAQ,6BAA0B;AAEpD,SAASC,YAAY,QAAQ,mCAAgC;AAC7D,SAASC,QAAQ,QAAQ,2BAAwB;AACjD,SAASC,UAAU,QAAQ,8BAA2B;AACtD,SAASC,uBAAuB,QAAQ,iDAA8C;AACtF,SAASC,gBAAgB,QAAQ,yCAAsC;;AAEvE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,cAAc,GAAG;EACrB,CAACV,iBAAiB,CAACW,GAAG,GAAGP,SAAS;EAClC,CAACJ,iBAAiB,CAACY,EAAE,GA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AEa,UAAU,CAAC;EAClD;AACF","ignoreList":[]}
|
|
@@ -45,7 +45,7 @@ const SPOT_CHECK_TIMEOUT_MS = 60_000;
|
|
|
45
45
|
* measurement would post old readings as though they had just been taken.
|
|
46
46
|
*/
|
|
47
47
|
export const aoj20aThermometer = params => defineCustomDevice({
|
|
48
|
-
id: params.id,
|
|
48
|
+
id: params.id ?? "aoj-20a-thermometer",
|
|
49
49
|
nameMatch: params.nameMatch,
|
|
50
50
|
stuckDataTimeoutMs: params.stuckDataTimeoutMs ?? SPOT_CHECK_TIMEOUT_MS,
|
|
51
51
|
services: [{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["MeasurementTypeKey","defineCustomDevice","FRAME_HEADER","COMMAND_BYTE","FRAME_BYTES","CHECKSUM_INDEX","CHECKSUM_FROM","PAYLOAD","TEMPERATURE_REPLY","TEMPERATURE_SCALE","TEMPERATURE_DECIMALS","SPOT_CHECK_TIMEOUT_MS","aoj20aThermometer","params","id","nameMatch","stuckDataTimeoutMs","services","uuid","monitor","frame","header","minLengthBytes","checksum","algorithm","index","from","caseSelectorBytes","cases","selector","kind","measurementTypeKey","temperature","fields","name","byteIndexes","byteOrder","unit","scale","decimals"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/aoj/aoj.thermometers.ts"],"mappings":";;AAAA,SAASA,kBAAkB,QAAQ,YAAY;AAG/C,SAASC,kBAAkB,QAAQ,sCAAmC;;AAEtE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,MAAMC,YAAY,GAAG,CAAC,IAAI,EAAE,IAAI,CAAC;AAEjC,MAAMC,YAAY,GAAG,CAAC;;AAEtB;AACA,MAAMC,WAAW,GAAG,CAAC;AACrB,MAAMC,cAAc,GAAG,CAAC;;AAExB;AACA,MAAMC,aAAa,GAAG,CAAC;AAEvB,MAAMC,OAAO,GAAG,CAAC;;AAEjB;AACA,MAAMC,iBAAiB,GAAG,IAAI;;AAE9B;AACA,MAAMC,iBAAiB,GAAG,IAAI;AAC9B,MAAMC,oBAAoB,GAAG,CAAC;AAE9B,MAAMC,qBAAqB,GAAG,MAAM;AAapC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,iBAAiB,GAC5BC,MAAuB,IAEvBZ,kBAAkB,CAAC;EACjBa,EAAE,EAAED,MAAM,CAACC,EAAE;
|
|
1
|
+
{"version":3,"names":["MeasurementTypeKey","defineCustomDevice","FRAME_HEADER","COMMAND_BYTE","FRAME_BYTES","CHECKSUM_INDEX","CHECKSUM_FROM","PAYLOAD","TEMPERATURE_REPLY","TEMPERATURE_SCALE","TEMPERATURE_DECIMALS","SPOT_CHECK_TIMEOUT_MS","aoj20aThermometer","params","id","nameMatch","stuckDataTimeoutMs","services","uuid","monitor","frame","header","minLengthBytes","checksum","algorithm","index","from","caseSelectorBytes","cases","selector","kind","measurementTypeKey","temperature","fields","name","byteIndexes","byteOrder","unit","scale","decimals"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/aoj/aoj.thermometers.ts"],"mappings":";;AAAA,SAASA,kBAAkB,QAAQ,YAAY;AAG/C,SAASC,kBAAkB,QAAQ,sCAAmC;;AAEtE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,MAAMC,YAAY,GAAG,CAAC,IAAI,EAAE,IAAI,CAAC;AAEjC,MAAMC,YAAY,GAAG,CAAC;;AAEtB;AACA,MAAMC,WAAW,GAAG,CAAC;AACrB,MAAMC,cAAc,GAAG,CAAC;;AAExB;AACA,MAAMC,aAAa,GAAG,CAAC;AAEvB,MAAMC,OAAO,GAAG,CAAC;;AAEjB;AACA,MAAMC,iBAAiB,GAAG,IAAI;;AAE9B;AACA,MAAMC,iBAAiB,GAAG,IAAI;AAC9B,MAAMC,oBAAoB,GAAG,CAAC;AAE9B,MAAMC,qBAAqB,GAAG,MAAM;AAapC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA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