@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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_reactNative","require","_reactNativeBlePlx","_index","_sentryLogger","_deviceCreator","BTManager","MAX_DEVICES","devices","Map","eventSubscriptions","constructor","bleManager","acceptedDevices","deviceCreator","DeviceCreator","destroy","sentryLogger","stopScan","
|
|
1
|
+
{"version":3,"names":["_reactNative","require","_reactNativeBlePlx","_index","_sentryLogger","_deviceCreator","BTManager","MAX_DEVICES","devices","Map","eventSubscriptions","autoConnectCandidates","constructor","bleManager","acceptedDevices","options","deviceCreator","DeviceCreator","backgroundScanEnabled","backgroundEnabled","destroy","sentryLogger","stopScan","autoConnectTimer","clearTimeout","undefined","stateChangeListener","remove","onErrorCallback","onDeviceFoundCallback","onResultCallback","onDeviceStatusChangedCallback","forEach","device","clear","startScan","onStateChange","state","State","PoweredOn","index","indexOf","splice","serviceUUIDs","Platform","OS","length","error","Promise","resolve","startDeviceScan","scanMode","ScanMode","LowPower","Balanced","onScanResult","catch","Error","String","Linking","sendIntent","push","setBackgroundScanEnabled","enabled","stopDeviceScan","sub","restoreDevices","onDeviceFound","callback","onError","onDeviceStatusChanged","onResult","message","slog","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","exports"],"sourceRoot":"../../../../../src","sources":["modules/bt-management/services/bt-manager.ts"],"mappings":";;;;;;AACA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,kBAAA,GAAAD,OAAA;AASA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,aAAA,GAAAH,OAAA;AAOA,IAAAI,cAAA,GAAAJ,OAAA;AAnBA;;AA0CA,MAAMK,SAAS,CAAsC;EACnD,OAAwBC,WAAW,GAAG,EAAE,CAAC,CAAC;EAClCC,OAAO,GAAG,IAAIC,GAAG,CAA0C,CAAC;EAG5DC,kBAAkB,GAAmB,EAAE;EAIvCC,qBAAqB,GAAG,IAAIF,GAAG,CAA0C,CAAC;EAGlFG,WAAWA,CACQC,UAAsB,EACtBC,eAAkB,EAClBC,OAAyB,GAAG,CAAC,CAAC,EAC/C;IAAA,KAHiBF,UAAsB,GAAtBA,UAAsB;IAAA,KACtBC,eAAkB,GAAlBA,eAAkB;IAAA,KAClBC,OAAyB,GAAzBA,OAAyB;IAE1C,IAAI,CAACC,aAAa,GAAG,IAAIC,4BAAa,CAAC,IAAI,CAACH,eAAe,CAAC;IAC5D,IAAI,CAACI,qBAAqB,GAAGH,OAAO,CAACI,iBAA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AC;EACzD,CAAC;EAEOZ,8BAA8B,GAAIN,QAAgB,IAAK;IAC7D,IAAA9D,0BAAY,EACV,MAAM,EACN,2EAA2E,EAC3E;MACE8D,QAAQ;MACRH,UAAU,EAAE,IAAI,CAACxE,OAAO,CAAC8F,GAAG,CAACnB,QAAQ,CAAC,EAAElD,MAAM,EAAE0C;IAClD,CACF,CAAC;IACD,IAAI,CAACnE,OAAO,CAAC+F,MAAM,CAACpB,QAAQ,CAAC;EAC/B,CAAC;AACH;AAACqB,OAAA,CAAAlG,SAAA,GAAAA,SAAA","ignoreList":[]}
|
|
@@ -20,7 +20,7 @@ const MAX_MTU = 517;
|
|
|
20
20
|
const MAX_STUCK_TIMEOUT_MS = 6_000_000;
|
|
21
21
|
const HEX_BYTES = /^([0-9a-f]{2})+$/;
|
|
22
22
|
const assertIdentity = spec => {
|
|
23
|
-
const id = typeof spec?.id === "string" ? spec.id.trim() : "";
|
|
23
|
+
const id = typeof spec?.id === "string" ? spec.id.trim() : "ovok-custom-device";
|
|
24
24
|
if (!id) {
|
|
25
25
|
throw (0, _customDeviceError.customDeviceError)(String(spec?.id), "id", "must not be empty");
|
|
26
26
|
}
|
|
@@ -39,9 +39,12 @@ const compileNameMatch = (id, spec) => {
|
|
|
39
39
|
return nameMatch;
|
|
40
40
|
}
|
|
41
41
|
const exact = typeof nameMatch === "string" ? nameMatch.trim() : "";
|
|
42
|
-
if (!exact) {
|
|
42
|
+
if (typeof nameMatch === "string" && !exact) {
|
|
43
43
|
throw (0, _customDeviceError.customDeviceError)(id, "nameMatch", "must not be empty");
|
|
44
44
|
}
|
|
45
|
+
if (!exact) {
|
|
46
|
+
return /.*/;
|
|
47
|
+
}
|
|
45
48
|
return new RegExp(`^${exact.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}$`);
|
|
46
49
|
};
|
|
47
50
|
const assertStuckTimeout = (id, spec) => {
|
|
@@ -127,6 +130,7 @@ const defineCustomDevice = spec => {
|
|
|
127
130
|
id: id,
|
|
128
131
|
spec,
|
|
129
132
|
nameMatch,
|
|
133
|
+
matchByService: spec.matchByService === true,
|
|
130
134
|
mainServices,
|
|
131
135
|
stuckDataTimeout,
|
|
132
136
|
fields,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_customDeviceBrand","require","_integratedDevices","_compileCustomLepu","_compileCustomMonitor","_customDeviceError","_normalizeBleUuid","MIN_STUCK_TIMEOUT_MS","MIN_MTU","MAX_MTU","MAX_STUCK_TIMEOUT_MS","HEX_BYTES","assertIdentity","spec","id","trim","customDeviceError","String","builtIn","Object","values","IntegratedDevices","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","normalizeBleUuid","mainCommandUuid","defineCustomDevice","stuckDataTimeout","Array","isArray","services","length","fields","Map","frames","seenCharacteristics","Set","mainServices","map","service","serviceIndex","monitor","monitorUuids","monitorIndex","monitorPath","characteristic","frame","compileCustomMonitor","has","add","set","writeUuid","lepu","compileCustomLepu","CUSTOM_DEVICE_BRAND","exports"],"sourceRoot":"../../../../../../src","sources":["modules/bt-management/services/custom/define-custom-device.ts"],"mappings":";;;;;;AAAA,IAAAA,kBAAA,GAAAC,OAAA;AAMA,IAAAC,kBAAA,GAAAD,OAAA;AAGA,IAAAE,kBAAA,GAAAF,OAAA;AACA,IAAAG,qBAAA,GAAAH,OAAA;AACA,IAAAI,kBAAA,GAAAJ,OAAA;AACA,IAAAK,iBAAA,GAAAL,OAAA;AAEA,MAAMM,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":["_customDeviceBrand","require","_integratedDevices","_compileCustomLepu","_compileCustomMonitor","_customDeviceError","_normalizeBleUuid","MIN_STUCK_TIMEOUT_MS","MIN_MTU","MAX_MTU","MAX_STUCK_TIMEOUT_MS","HEX_BYTES","assertIdentity","spec","id","trim","customDeviceError","String","builtIn","Object","values","IntegratedDevices","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","normalizeBleUuid","mainCommandUuid","defineCustomDevice","stuckDataTimeout","Array","isArray","services","length","fields","Map","frames","seenCharacteristics","Set","mainServices","map","service","serviceIndex","monitor","monitorUuids","monitorIndex","monitorPath","characteristic","frame","compileCustomMonitor","has","add","set","writeUuid","lepu","compileCustomLepu","CUSTOM_DEVICE_BRAND","matchByService","exports"],"sourceRoot":"../../../../../../src","sources":["modules/bt-management/services/custom/define-custom-device.ts"],"mappings":";;;;;;AAAA,IAAAA,kBAAA,GAAAC,OAAA;AAMA,IAAAC,kBAAA,GAAAD,OAAA;AAGA,IAAAE,kBAAA,GAAAF,OAAA;AACA,IAAAG,qBAAA,GAAAH,OAAA;AACA,IAAAI,kBAAA,GAAAJ,OAAA;AACA,IAAAK,iBAAA,GAAAL,OAAA;AAEA,MAAMM,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,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B,IAAI,CAC5C,CAAC;EAED,OAAO;IACL,CAAC+B,sCAAmB,GAAG,IAAI;IAC3B/D,EAAE,EAAEA,EAAoB;IACxBD,IAAI;IACJa,SAAS;IACToD,cAAc,EAAEjE,IAAI,CAACiE,cAAc,KAAK,IAAI;IAC5ClB,YAAY;IACZV,gBAAgB;IAChBK,MAAM;IACNE,MAAM;IACN,IAAIlB,YAAY,KAAKC,SAAS,GAAG,CAAC,CAAC,GAAG;MAAED;IAAa,CAAC,CAAC;IACvD,IAAIoC,IAAI,KAAKnC,SAAS,GAAG,CAAC,CAAC,GAAG;MAAEmC;IAAK,CAAC;EACxC,CAAC;AACH,CAAC;AAACI,OAAA,CAAA9B,kBAAA,GAAAA,kBAAA","ignoreList":[]}
|
|
@@ -8,6 +8,7 @@ var _integratedDevicesMap = require("../constants/integrated-devices-map.js");
|
|
|
8
8
|
var _integratedDevices = require("../types/integrated-devices.js");
|
|
9
9
|
var _isCustomDeviceDefinition = require("../utils/is-custom-device-definition.js");
|
|
10
10
|
var _bc01Device = require("./devices/bc01/bc01.device.js");
|
|
11
|
+
var _bloodGlucoseDevice = require("./devices/blood-glucose/blood-glucose.device.js");
|
|
11
12
|
var _bp2Device = require("./devices/bp2/bp2.device.js");
|
|
12
13
|
var _customDevice = require("./devices/custom/custom.device.js");
|
|
13
14
|
var _f4Device = require("./devices/f4/f4.device.js");
|
|
@@ -26,6 +27,9 @@ const DEVICE_CLASSES = {
|
|
|
26
27
|
[_integratedDevices.IntegratedDevices.F4]: _f4Device.F4Device,
|
|
27
28
|
[_integratedDevices.IntegratedDevices.PC60WF]: _spo2Device.SPO2Device,
|
|
28
29
|
[_integratedDevices.IntegratedDevices.BC01]: _bc01Device.BC01Device,
|
|
30
|
+
[_integratedDevices.IntegratedDevices.TAIDOC_GLUCOSE]: _bloodGlucoseDevice.BloodGlucoseDevice,
|
|
31
|
+
[_integratedDevices.IntegratedDevices.GLUCOCHECK]: _bloodGlucoseDevice.BloodGlucoseDevice,
|
|
32
|
+
[_integratedDevices.IntegratedDevices.BGM]: _bloodGlucoseDevice.BloodGlucoseDevice,
|
|
29
33
|
[_integratedDevices.IntegratedDevices.VEROVAL_DUO_CONTROL]: _verovalDuoControlDevice.VerovalDuoControlDevice,
|
|
30
34
|
[_integratedDevices.IntegratedDevices.VEROVAL_ECG]: _verovalEcgDevice.VerovalEcgDevice
|
|
31
35
|
};
|
|
@@ -42,11 +46,13 @@ const collectCustomDevices = acceptedDevices => {
|
|
|
42
46
|
if (customDevices.has(entry.id)) {
|
|
43
47
|
throw new Error(`acceptedDevices[${index}] registers the custom device "${entry.id}" twice`);
|
|
44
48
|
}
|
|
45
|
-
if (matchers.has(entry.nameMatch.source)) {
|
|
49
|
+
if (!entry.matchByService && matchers.has(entry.nameMatch.source)) {
|
|
46
50
|
throw new Error(`acceptedDevices[${index}] ("${entry.id}") matches the same advertised name as an earlier custom device, so one would silently shadow the other`);
|
|
47
51
|
}
|
|
48
52
|
customDevices.set(entry.id, entry);
|
|
49
|
-
|
|
53
|
+
if (!entry.matchByService) {
|
|
54
|
+
matchers.add(entry.nameMatch.source);
|
|
55
|
+
}
|
|
50
56
|
});
|
|
51
57
|
return customDevices;
|
|
52
58
|
};
|
|
@@ -57,14 +63,18 @@ class DeviceCreator {
|
|
|
57
63
|
this.acceptedDeviceNames = acceptedDeviceNames;
|
|
58
64
|
this.customDevices = collectCustomDevices(acceptedDeviceNames);
|
|
59
65
|
}
|
|
60
|
-
getDeviceName = foundName => {
|
|
61
|
-
|
|
66
|
+
getDeviceName = (foundName, serviceUUIDs = []) => {
|
|
67
|
+
const normalizedServices = new Set(serviceUUIDs.map(uuid => uuid.toLowerCase()));
|
|
68
|
+
if (!foundName && normalizedServices.size === 0) {
|
|
62
69
|
return undefined;
|
|
63
70
|
}
|
|
71
|
+
if (!foundName && normalizedServices.size > 0) {
|
|
72
|
+
return this.matchDeviceName(foundName, normalizedServices);
|
|
73
|
+
}
|
|
64
74
|
if (this.deviceNameCache.has(foundName)) {
|
|
65
75
|
return this.deviceNameCache.get(foundName) ?? undefined;
|
|
66
76
|
}
|
|
67
|
-
const matched = this.matchDeviceName(foundName);
|
|
77
|
+
const matched = this.matchDeviceName(foundName, normalizedServices);
|
|
68
78
|
|
|
69
79
|
// Cache the result (store null for non-matches to avoid repeated tests)
|
|
70
80
|
this.cacheDeviceName(foundName, matched ?? null);
|
|
@@ -83,7 +93,7 @@ class DeviceCreator {
|
|
|
83
93
|
* `localName` carries the advertised name instead. Accept either so a scan-time
|
|
84
94
|
* `createDevice` call for a real iOS ad is not rejected before it can connect.
|
|
85
95
|
*/
|
|
86
|
-
if (!params.device.name?.trim() && !params.device.localName?.trim()) {
|
|
96
|
+
if (!params.device.name?.trim() && !params.device.localName?.trim() && !this.customDevices.get(params.deviceName)?.matchByService) {
|
|
87
97
|
throw new Error("Device name is required");
|
|
88
98
|
}
|
|
89
99
|
if (!params.device.id) {
|
|
@@ -110,14 +120,15 @@ class DeviceCreator {
|
|
|
110
120
|
* A built-in device always wins over a declaration: its decoder is compiled and tested,
|
|
111
121
|
* and a declaration that happens to match the same advertised name must not displace it.
|
|
112
122
|
*/
|
|
113
|
-
matchDeviceName = deviceName => {
|
|
123
|
+
matchDeviceName = (deviceName, serviceUUIDs) => {
|
|
114
124
|
for (const [regex, deviceType] of _integratedDevicesMap.integratedDevicesMap) {
|
|
115
125
|
if (regex.test(deviceName) && this.acceptedDeviceNames.some(name => name === deviceType)) {
|
|
116
126
|
return deviceType;
|
|
117
127
|
}
|
|
118
128
|
}
|
|
119
129
|
for (const custom of this.customDevices.values()) {
|
|
120
|
-
|
|
130
|
+
const serviceMatch = custom.matchByService && custom.mainServices.some(service => serviceUUIDs.has(service.uuid.toLowerCase()));
|
|
131
|
+
if (serviceMatch || deviceName && custom.nameMatch.test(deviceName)) {
|
|
121
132
|
return custom.id;
|
|
122
133
|
}
|
|
123
134
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_integratedDevicesMap","require","_integratedDevices","_isCustomDeviceDefinition","_bc01Device","_bp2Device","_customDevice","_f4Device","_spo2Device","_verovalDuoControlDevice","_verovalEcgDevice","DEVICE_CLASSES","IntegratedDevices","BP2","BP2Device","F4","F4Device","PC60WF","SPO2Device","BC01","BC01Device","VEROVAL_DUO_CONTROL","VerovalDuoControlDevice","VEROVAL_ECG","VerovalEcgDevice","collectCustomDevices","acceptedDevices","customDevices","Map","matchers","Set","forEach","entry","index","isCustomDeviceDefinition","Error","has","id","nameMatch","source","set","add","DeviceCreator","deviceNameCache","CACHE_MAX_SIZE","constructor","acceptedDeviceNames","getDeviceName","foundName","
|
|
1
|
+
{"version":3,"names":["_integratedDevicesMap","require","_integratedDevices","_isCustomDeviceDefinition","_bc01Device","_bloodGlucoseDevice","_bp2Device","_customDevice","_f4Device","_spo2Device","_verovalDuoControlDevice","_verovalEcgDevice","DEVICE_CLASSES","IntegratedDevices","BP2","BP2Device","F4","F4Device","PC60WF","SPO2Device","BC01","BC01Device","TAIDOC_GLUCOSE","BloodGlucoseDevice","GLUCOCHECK","BGM","VEROVAL_DUO_CONTROL","VerovalDuoControlDevice","VEROVAL_ECG","VerovalEcgDevice","collectCustomDevices","acceptedDevices","customDevices","Map","matchers","Set","forEach","entry","index","isCustomDeviceDefinition","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","CustomDevice","deviceClass","Object","keys","join","destroy","clear","regex","deviceType","integratedDevicesMap","test","some","values","serviceMatch","mainServices","service","firstKey","next","value","delete","exports"],"sourceRoot":"../../../../../src","sources":["modules/bt-management/services/device-creator.ts"],"mappings":";;;;;;AAAA,IAAAA,qBAAA,GAAAC,OAAA;AAMA,IAAAC,kBAAA,GAAAD,OAAA;AACA,IAAAE,yBAAA,G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AEOI,eAAeA,CACrBI,UAAkB,EAClBc,UAA4B,EACtB;IACN;IACA,IAAI,IAAI,CAAClC,eAAe,CAACW,IAAI,IAAI,IAAI,CAACV,cAAc,EAAE;MACpD,MAAMyC,QAAQ,GAAG,IAAI,CAAC1C,eAAe,CAAC6B,IAAI,CAAC,CAAC,CAACc,IAAI,CAAC,CAAC,CAACC,KAAK;MAEzD,IAAIF,QAAQ,KAAK9B,SAAS,EAAE;QAC1B,IAAI,CAACZ,eAAe,CAAC6C,MAAM,CAACH,QAAQ,CAAC;MACvC;IACF;IAEA,IAAI,CAAC1C,eAAe,CAACH,GAAG,CAACuB,UAAU,EAAEc,UAAU,CAAC;EAClD;AACF;AAACY,OAAA,CAAA/C,aAAA,GAAAA,aAAA","ignoreList":[]}
|
|
@@ -48,7 +48,7 @@ const SPOT_CHECK_TIMEOUT_MS = 60_000;
|
|
|
48
48
|
* measurement would post old readings as though they had just been taken.
|
|
49
49
|
*/
|
|
50
50
|
const aoj20aThermometer = params => (0, _defineCustomDevice.defineCustomDevice)({
|
|
51
|
-
id: params.id,
|
|
51
|
+
id: params.id ?? "aoj-20a-thermometer",
|
|
52
52
|
nameMatch: params.nameMatch,
|
|
53
53
|
stuckDataTimeoutMs: params.stuckDataTimeoutMs ?? SPOT_CHECK_TIMEOUT_MS,
|
|
54
54
|
services: [{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_core","require","_defineCustomDevice","FRAME_HEADER","COMMAND_BYTE","FRAME_BYTES","CHECKSUM_INDEX","CHECKSUM_FROM","PAYLOAD","TEMPERATURE_REPLY","TEMPERATURE_SCALE","TEMPERATURE_DECIMALS","SPOT_CHECK_TIMEOUT_MS","aoj20aThermometer","params","defineCustomDevice","id","nameMatch","stuckDataTimeoutMs","services","uuid","monitor","frame","header","minLengthBytes","checksum","algorithm","index","from","caseSelectorBytes","cases","selector","kind","measurementTypeKey","MeasurementTypeKey","temperature","fields","name","byteIndexes","byteOrder","unit","scale","decimals","exports"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/aoj/aoj.thermometers.ts"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AAGA,IAAAC,mBAAA,GAAAD,OAAA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,MAAME,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;AACO,MAAMC,iBAAiB,GAC5BC,MAAuB,IAEvB,IAAAC,sCAAkB,EAAC;EACjBC,EAAE,EAAEF,MAAM,CAACE,EAAE;
|
|
1
|
+
{"version":3,"names":["_core","require","_defineCustomDevice","FRAME_HEADER","COMMAND_BYTE","FRAME_BYTES","CHECKSUM_INDEX","CHECKSUM_FROM","PAYLOAD","TEMPERATURE_REPLY","TEMPERATURE_SCALE","TEMPERATURE_DECIMALS","SPOT_CHECK_TIMEOUT_MS","aoj20aThermometer","params","defineCustomDevice","id","nameMatch","stuckDataTimeoutMs","services","uuid","monitor","frame","header","minLengthBytes","checksum","algorithm","index","from","caseSelectorBytes","cases","selector","kind","measurementTypeKey","MeasurementTypeKey","temperature","fields","name","byteIndexes","byteOrder","unit","scale","decimals","exports"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/aoj/aoj.thermometers.ts"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AAGA,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C,WAAW,EAAE,CAAC9B,OAAO,EAAEA,OAAO,GAAG,CAAC,CAAC;UACnC+B,SAAS,EAAE,KAAK;UAChBC,IAAI,EAAE,KAAK;UACXC,KAAK,EAAE/B,iBAAiB;UACxBgC,QAAQ,EAAE/B;QACZ,CAAC;MAEL,CAAC;IAEL,CAAC;EAEL,CAAC;AAEL,CAAC,CAAC;AAACgC,OAAA,CAAA9B,iBAAA,GAAAA,iBAAA","ignoreList":[]}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.buildSetTimeCommand = exports.buildResetCommand = exports.buildRequestVersionCommand = exports.buildDeleteCommand = exports.buildCommand = exports.bc401Checksum = exports.asHex = exports.RX = exports.RETRY_RECORD_GROUP = exports.RESET_DELAY_MS = exports.REQUEST_NEXT_RECORD_GROUP = exports.REQUEST_ALL = exports.RECORD_LAST_OF_SET_BIT = exports.RECORD_FLAGS_INDEX = exports.OP_REQUEST_RECORDS = exports.OP_REQUEST_QUANTITATIVE_RECORDS = exports.OP_REQUEST_COUNT = exports.FINAL_RECORD_DELAY_MS = exports.ACK_LAST_OF_SET = void 0;
|
|
7
|
+
/** Wire constants and frame builders shared by the BC401 command sequencer. */
|
|
8
|
+
const OP_RESET = 0x80;
|
|
9
|
+
const OP_REQUEST_VERSION = 0x82;
|
|
10
|
+
const OP_SET_TIME = 0x83;
|
|
11
|
+
const OP_REQUEST_COUNT = exports.OP_REQUEST_COUNT = 0x90;
|
|
12
|
+
const OP_REQUEST_RECORDS = exports.OP_REQUEST_RECORDS = 0x92;
|
|
13
|
+
const OP_REQUEST_QUANTITATIVE_RECORDS = exports.OP_REQUEST_QUANTITATIVE_RECORDS = 0x95;
|
|
14
|
+
const ACK_LAST_OF_SET = exports.ACK_LAST_OF_SET = 0x7e;
|
|
15
|
+
const REQUEST_ALL = exports.REQUEST_ALL = 0x00;
|
|
16
|
+
const REQUEST_NEXT_RECORD_GROUP = exports.REQUEST_NEXT_RECORD_GROUP = 0x01;
|
|
17
|
+
const RETRY_RECORD_GROUP = exports.RETRY_RECORD_GROUP = 0x02;
|
|
18
|
+
const FINAL_RECORD_DELAY_MS = exports.FINAL_RECORD_DELAY_MS = 200;
|
|
19
|
+
const RESET_DELAY_MS = exports.RESET_DELAY_MS = 100;
|
|
20
|
+
const RX = exports.RX = {
|
|
21
|
+
ACK: 0xf0,
|
|
22
|
+
VERSION_REPLY: 0xf2,
|
|
23
|
+
TIME_SYNC_ACK: 0xf3,
|
|
24
|
+
COUNT_REPLY: 0xe0,
|
|
25
|
+
STORED_RECORD_URS: 0xe1,
|
|
26
|
+
STORED_RECORD_PAGED: 0xe2,
|
|
27
|
+
FINISH: 0xe3,
|
|
28
|
+
STORED_QUANTITATIVE: 0xe4,
|
|
29
|
+
STORED_QUANTITATIVE_PAGED: 0xe5
|
|
30
|
+
};
|
|
31
|
+
const RECORD_FLAGS_INDEX = exports.RECORD_FLAGS_INDEX = 1;
|
|
32
|
+
const RECORD_LAST_OF_SET_BIT = exports.RECORD_LAST_OF_SET_BIT = 0x40;
|
|
33
|
+
const asHex = byte => (byte & 0xff).toString(16).padStart(2, "0");
|
|
34
|
+
exports.asHex = asHex;
|
|
35
|
+
const bc401Checksum = bytes => bytes.reduce((acc, byte) => acc + (byte & 0x7f), 0) & 0x7f;
|
|
36
|
+
exports.bc401Checksum = bc401Checksum;
|
|
37
|
+
const buildCommand = (opcode, arg) => [opcode, arg, bc401Checksum([opcode, arg])];
|
|
38
|
+
exports.buildCommand = buildCommand;
|
|
39
|
+
const buildResetCommand = () => [OP_RESET, 0x00];
|
|
40
|
+
exports.buildResetCommand = buildResetCommand;
|
|
41
|
+
const buildRequestVersionCommand = () => [OP_REQUEST_VERSION, bc401Checksum([OP_REQUEST_VERSION])];
|
|
42
|
+
exports.buildRequestVersionCommand = buildRequestVersionCommand;
|
|
43
|
+
const buildSetTimeCommand = now => {
|
|
44
|
+
const payload = [OP_SET_TIME, now.getFullYear() - 2000, now.getMonth() + 1, now.getDate(), now.getHours(), now.getMinutes(), now.getSeconds(), now.getMilliseconds() & 0xff, now.getMilliseconds() >> 8 & 0xff];
|
|
45
|
+
return [...payload, bc401Checksum(payload)];
|
|
46
|
+
};
|
|
47
|
+
exports.buildSetTimeCommand = buildSetTimeCommand;
|
|
48
|
+
const buildDeleteCommand = () => [0x93, 0x13];
|
|
49
|
+
exports.buildDeleteCommand = buildDeleteCommand;
|
|
50
|
+
//# sourceMappingURL=bc01-command-builders.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["OP_RESET","OP_REQUEST_VERSION","OP_SET_TIME","OP_REQUEST_COUNT","exports","OP_REQUEST_RECORDS","OP_REQUEST_QUANTITATIVE_RECORDS","ACK_LAST_OF_SET","REQUEST_ALL","REQUEST_NEXT_RECORD_GROUP","RETRY_RECORD_GROUP","FINAL_RECORD_DELAY_MS","RESET_DELAY_MS","RX","ACK","VERSION_REPLY","TIME_SYNC_ACK","COUNT_REPLY","STORED_RECORD_URS","STORED_RECORD_PAGED","FINISH","STORED_QUANTITATIVE","STORED_QUANTITATIVE_PAGED","RECORD_FLAGS_INDEX","RECORD_LAST_OF_SET_BIT","asHex","byte","toString","padStart","bc401Checksum","bytes","reduce","acc","buildCommand","opcode","arg","buildResetCommand","buildRequestVersionCommand","buildSetTimeCommand","now","payload","getFullYear","getMonth","getDate","getHours","getMinutes","getSeconds","getMilliseconds","buildDeleteCommand"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/bc01/bc01-command-builders.ts"],"mappings":";;;;;;AAAA;AACA,MAAMA,QAAQ,GAAG,IAAI;AACrB,MAAMC,kBAAkB,GAAG,IAAI;AAC/B,MAAMC,WAAW,GAAG,IAAI;AACxB,MAAMC,gBAAgB,GAAAC,OAAA,CAAAD,gBAAA,GAAG,IAAI;AAC7B,MAAME,kBAAkB,GAAAD,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Property(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.bc01CommandSequencerInternals = exports.Bc01CommandSequencer = void 0;
|
|
7
7
|
var _hexToByte = require("../../../utils/hex-to-byte.js");
|
|
8
|
-
|
|
9
|
-
* The FF01/FF02 opcodes the BC401 firmware speaks, as reverse-engineered from
|
|
10
|
-
* PHMS 3.0.03 (`I1/b.java` for the switch, `B3/B5.java` for the builders and
|
|
11
|
-
* checksum, `L1/f.java` for the reset write).
|
|
12
|
-
*/
|
|
13
|
-
const OP_RESET = 0x80;
|
|
14
|
-
const OP_REQUEST_VERSION = 0x82;
|
|
15
|
-
const OP_SET_TIME = 0x83;
|
|
16
|
-
const OP_REQUEST_COUNT = 0x90;
|
|
17
|
-
const OP_REQUEST_RECORDS = 0x92;
|
|
18
|
-
|
|
19
|
-
/** Payload byte for `OP_REQUEST_RECORDS` that acknowledges the last record of the set. */
|
|
20
|
-
const ACK_LAST_OF_SET = 0x7e;
|
|
21
|
-
|
|
22
|
-
/** Payload byte for `OP_REQUEST_COUNT` and the initial `OP_REQUEST_RECORDS`. */
|
|
23
|
-
const REQUEST_ALL = 0x00;
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Device-to-host frame prefixes the FSM keys on. Values are decimal opcodes as
|
|
27
|
-
* they appear in the decompiled Java (`switch(bArr[0])`), rendered here as
|
|
28
|
-
* their real hex opcodes.
|
|
29
|
-
*/
|
|
30
|
-
const RX = {
|
|
31
|
-
ACK: 0xf0,
|
|
32
|
-
VERSION_REPLY: 0xf2,
|
|
33
|
-
TIME_SYNC_ACK: 0xf3,
|
|
34
|
-
COUNT_REPLY: 0xe0,
|
|
35
|
-
STORED_RECORD_URS: 0xe1,
|
|
36
|
-
STORED_RECORD_PAGED: 0xe2,
|
|
37
|
-
FINISH: 0xe3
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
/** Position in a 16-byte URS record where the flags byte sits; bit 0x40 marks the last of a set. */
|
|
41
|
-
const RECORD_FLAGS_INDEX = 1;
|
|
42
|
-
const RECORD_LAST_OF_SET_BIT = 0x40;
|
|
43
|
-
/**
|
|
44
|
-
* Formats one byte as a two-digit lowercase hex string, matching the way the
|
|
45
|
-
* SDK's transport already spells raw bytes.
|
|
46
|
-
*/
|
|
47
|
-
const asHex = byte => (byte & 0xff).toString(16).padStart(2, "0");
|
|
48
|
-
|
|
49
|
-
/**
|
|
50
|
-
* BC401 checksum: sum of the low 7 bits of every byte, folded back into 7 bits.
|
|
51
|
-
* Matches `B5.a` in the decompiled Java exactly.
|
|
52
|
-
*/
|
|
53
|
-
const bc401Checksum = bytes => bytes.reduce((acc, byte) => acc + (byte & 0x7f), 0) & 0x7f;
|
|
54
|
-
|
|
55
|
-
/**
|
|
56
|
-
* Builds a "one payload byte plus checksum" command frame. This is the shape
|
|
57
|
-
* of every BC401 host-to-device command that carries an argument: opcode,
|
|
58
|
-
* argument, checksum-over-both.
|
|
59
|
-
*/
|
|
60
|
-
const buildCommand = (opcode, arg) => {
|
|
61
|
-
const chk = bc401Checksum([opcode, arg]);
|
|
62
|
-
return [opcode, arg, chk];
|
|
63
|
-
};
|
|
64
|
-
|
|
65
|
-
/**
|
|
66
|
-
* Builds the two-byte reset frame. It is the one command that does not carry
|
|
67
|
-
* an argument or a checksum — PHMS writes it as `[0x80, 0x00]` verbatim
|
|
68
|
-
* (`L1/f.java:694`).
|
|
69
|
-
*/
|
|
70
|
-
const buildResetCommand = () => [OP_RESET, 0x00];
|
|
71
|
-
|
|
72
|
-
/**
|
|
73
|
-
* Builds the request-version reply. The Java sends it as `[0x82, 0x02]` where
|
|
74
|
-
* `0x02` doubles as the checksum of `0x82` under the BC401 rule
|
|
75
|
-
* (`0x82 & 0x7f = 0x02`), so the same formula that guards every other command
|
|
76
|
-
* produces the right byte here.
|
|
77
|
-
*/
|
|
78
|
-
const buildRequestVersionCommand = () => {
|
|
79
|
-
const chk = bc401Checksum([OP_REQUEST_VERSION]);
|
|
80
|
-
return [OP_REQUEST_VERSION, chk];
|
|
81
|
-
};
|
|
82
|
-
|
|
83
|
-
/**
|
|
84
|
-
* Builds the `SET_TIME` frame for the moment the sequencer receives it. The
|
|
85
|
-
* device does not run its own clock across power cycles, so timestamps on
|
|
86
|
-
* stored records only make sense once the app tells it what "now" is.
|
|
87
|
-
* Millisecond field is written little-endian, matching `I1/b.java`.
|
|
88
|
-
*/
|
|
89
|
-
const buildSetTimeCommand = now => {
|
|
90
|
-
const yy = now.getFullYear() - 2000;
|
|
91
|
-
const mo = now.getMonth() + 1;
|
|
92
|
-
const dd = now.getDate();
|
|
93
|
-
const hh = now.getHours();
|
|
94
|
-
const mi = now.getMinutes();
|
|
95
|
-
const ss = now.getSeconds();
|
|
96
|
-
const ms = now.getMilliseconds();
|
|
97
|
-
const msLo = ms & 0xff;
|
|
98
|
-
const msHi = ms >> 8 & 0xff;
|
|
99
|
-
const payload = [OP_SET_TIME, yy, mo, dd, hh, mi, ss, msLo, msHi];
|
|
100
|
-
const chk = bc401Checksum(payload);
|
|
101
|
-
return [...payload, chk];
|
|
102
|
-
};
|
|
103
|
-
|
|
8
|
+
var _bc01CommandBuilders = require("./bc01-command-builders.js");
|
|
104
9
|
/**
|
|
105
10
|
* Walks the BC401 through its post-reset handshake and pulls every stored
|
|
106
11
|
* record.
|
|
@@ -121,64 +26,110 @@ const buildSetTimeCommand = now => {
|
|
|
121
26
|
class Bc01CommandSequencer {
|
|
122
27
|
isDone = false;
|
|
123
28
|
|
|
29
|
+
/** Ten standard pages per request group; 10 means a new group. */
|
|
30
|
+
standardPage = 10;
|
|
31
|
+
|
|
32
|
+
/** Five quantitative pages per request group; 5 means a new group. */
|
|
33
|
+
quantitativePage = 5;
|
|
34
|
+
|
|
124
35
|
/** Injectable for tests; production reads `Date.now()`. */
|
|
125
36
|
|
|
126
37
|
constructor(params, clock = () => new Date()) {
|
|
127
38
|
this.params = params;
|
|
128
39
|
this.clock = clock;
|
|
129
40
|
}
|
|
130
|
-
initialCommands = () => [this.commandFor(buildResetCommand())];
|
|
41
|
+
initialCommands = () => [this.commandFor((0, _bc01CommandBuilders.buildResetCommand)(), _bc01CommandBuilders.RESET_DELAY_MS)];
|
|
131
42
|
nextCommand = frame => {
|
|
132
43
|
if (this.isDone || frame.length === 0) {
|
|
133
44
|
return undefined;
|
|
134
45
|
}
|
|
135
46
|
const opcode = (0, _hexToByte.hexToByte)(frame[0] ?? "0");
|
|
136
47
|
switch (opcode) {
|
|
137
|
-
case RX.ACK:
|
|
138
|
-
return [this.commandFor(buildRequestVersionCommand())];
|
|
139
|
-
case RX.VERSION_REPLY:
|
|
140
|
-
return [this.commandFor(buildSetTimeCommand(this.clock()))];
|
|
141
|
-
case RX.TIME_SYNC_ACK:
|
|
142
|
-
return [this.commandFor(buildCommand(OP_REQUEST_COUNT, REQUEST_ALL))];
|
|
143
|
-
case RX.COUNT_REPLY:
|
|
144
|
-
return [this.commandFor(buildCommand(OP_REQUEST_RECORDS, REQUEST_ALL))];
|
|
145
|
-
case RX.STORED_RECORD_URS:
|
|
146
|
-
case RX.STORED_RECORD_PAGED:
|
|
147
|
-
return this.answerStoredRecord(frame);
|
|
148
|
-
case RX.
|
|
48
|
+
case _bc01CommandBuilders.RX.ACK:
|
|
49
|
+
return [this.commandFor((0, _bc01CommandBuilders.buildRequestVersionCommand)())];
|
|
50
|
+
case _bc01CommandBuilders.RX.VERSION_REPLY:
|
|
51
|
+
return [this.commandFor((0, _bc01CommandBuilders.buildSetTimeCommand)(this.clock()))];
|
|
52
|
+
case _bc01CommandBuilders.RX.TIME_SYNC_ACK:
|
|
53
|
+
return [this.commandFor((0, _bc01CommandBuilders.buildCommand)(_bc01CommandBuilders.OP_REQUEST_COUNT, _bc01CommandBuilders.REQUEST_ALL))];
|
|
54
|
+
case _bc01CommandBuilders.RX.COUNT_REPLY:
|
|
55
|
+
return [this.commandFor((0, _bc01CommandBuilders.buildCommand)(_bc01CommandBuilders.OP_REQUEST_RECORDS, _bc01CommandBuilders.REQUEST_ALL))];
|
|
56
|
+
case _bc01CommandBuilders.RX.STORED_RECORD_URS:
|
|
57
|
+
case _bc01CommandBuilders.RX.STORED_RECORD_PAGED:
|
|
58
|
+
return this.answerStoredRecord(opcode, frame);
|
|
59
|
+
case _bc01CommandBuilders.RX.STORED_QUANTITATIVE:
|
|
60
|
+
case _bc01CommandBuilders.RX.STORED_QUANTITATIVE_PAGED:
|
|
61
|
+
return this.answerQuantitativeRecord(opcode, frame);
|
|
62
|
+
case _bc01CommandBuilders.RX.FINISH:
|
|
149
63
|
this.isDone = true;
|
|
150
64
|
return undefined;
|
|
151
65
|
default:
|
|
152
66
|
return undefined;
|
|
153
67
|
}
|
|
154
68
|
};
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
69
|
+
answerStoredRecord = (opcode, frame) => {
|
|
70
|
+
const flags = (0, _hexToByte.hexToByte)(frame[_bc01CommandBuilders.RECORD_FLAGS_INDEX] ?? "0");
|
|
71
|
+
if (opcode === _bc01CommandBuilders.RX.STORED_RECORD_URS) {
|
|
72
|
+
return this.finishStoredRecords(_bc01CommandBuilders.OP_REQUEST_RECORDS);
|
|
73
|
+
}
|
|
74
|
+
const page = flags & 0x0f;
|
|
75
|
+
if (this.standardPage === 10) {
|
|
76
|
+
this.standardPage = 0;
|
|
77
|
+
}
|
|
78
|
+
if (page !== this.standardPage) {
|
|
79
|
+
this.standardPage = 10;
|
|
80
|
+
return [this.commandFor((0, _bc01CommandBuilders.buildCommand)(_bc01CommandBuilders.OP_REQUEST_RECORDS, _bc01CommandBuilders.RETRY_RECORD_GROUP))];
|
|
81
|
+
}
|
|
82
|
+
this.standardPage += 1;
|
|
83
|
+
if (this.standardPage === 10 && (flags & _bc01CommandBuilders.RECORD_LAST_OF_SET_BIT) === 0) {
|
|
84
|
+
return [this.commandFor((0, _bc01CommandBuilders.buildCommand)(_bc01CommandBuilders.OP_REQUEST_RECORDS, _bc01CommandBuilders.REQUEST_NEXT_RECORD_GROUP))];
|
|
85
|
+
}
|
|
86
|
+
if ((flags & _bc01CommandBuilders.RECORD_LAST_OF_SET_BIT) === 0) {
|
|
164
87
|
return undefined;
|
|
165
88
|
}
|
|
166
|
-
|
|
89
|
+
this.standardPage = 10;
|
|
90
|
+
return this.finishStoredRecords(_bc01CommandBuilders.OP_REQUEST_RECORDS);
|
|
91
|
+
};
|
|
92
|
+
answerQuantitativeRecord = (opcode, frame) => {
|
|
93
|
+
const flags = (0, _hexToByte.hexToByte)(frame[_bc01CommandBuilders.RECORD_FLAGS_INDEX] ?? "0");
|
|
94
|
+
if (opcode === _bc01CommandBuilders.RX.STORED_QUANTITATIVE) {
|
|
95
|
+
return this.finishStoredRecords(_bc01CommandBuilders.OP_REQUEST_QUANTITATIVE_RECORDS);
|
|
96
|
+
}
|
|
97
|
+
const page = flags & 0x0f;
|
|
98
|
+
if (this.quantitativePage === 5) {
|
|
99
|
+
this.quantitativePage = 0;
|
|
100
|
+
}
|
|
101
|
+
if (page !== this.quantitativePage) {
|
|
102
|
+
this.quantitativePage = 5;
|
|
103
|
+
return [this.commandFor((0, _bc01CommandBuilders.buildCommand)(_bc01CommandBuilders.OP_REQUEST_QUANTITATIVE_RECORDS, _bc01CommandBuilders.RETRY_RECORD_GROUP))];
|
|
104
|
+
}
|
|
105
|
+
this.quantitativePage += 1;
|
|
106
|
+
if (this.quantitativePage === 5 && (flags & _bc01CommandBuilders.RECORD_LAST_OF_SET_BIT) === 0) {
|
|
107
|
+
return [this.commandFor((0, _bc01CommandBuilders.buildCommand)(_bc01CommandBuilders.OP_REQUEST_QUANTITATIVE_RECORDS, _bc01CommandBuilders.REQUEST_NEXT_RECORD_GROUP))];
|
|
108
|
+
}
|
|
109
|
+
if ((flags & _bc01CommandBuilders.RECORD_LAST_OF_SET_BIT) === 0) {
|
|
110
|
+
return undefined;
|
|
111
|
+
}
|
|
112
|
+
this.quantitativePage = 5;
|
|
113
|
+
return this.finishStoredRecords(_bc01CommandBuilders.OP_REQUEST_QUANTITATIVE_RECORDS);
|
|
114
|
+
};
|
|
115
|
+
finishStoredRecords = opcode => {
|
|
116
|
+
this.isDone = true;
|
|
117
|
+
return [this.commandFor((0, _bc01CommandBuilders.buildCommand)(opcode, _bc01CommandBuilders.ACK_LAST_OF_SET)), this.commandFor((0, _bc01CommandBuilders.buildDeleteCommand)(), _bc01CommandBuilders.FINAL_RECORD_DELAY_MS)];
|
|
167
118
|
};
|
|
168
|
-
commandFor = bytes => ({
|
|
119
|
+
commandFor = (bytes, delayBeforeWriteMs = 0) => ({
|
|
169
120
|
...this.params.write,
|
|
170
|
-
frame: bytes.map(asHex),
|
|
171
|
-
|
|
121
|
+
frame: bytes.map(_bc01CommandBuilders.asHex),
|
|
122
|
+
delayBeforeWriteMs
|
|
172
123
|
});
|
|
173
124
|
}
|
|
174
125
|
|
|
175
126
|
// eslint-disable-next-line import/group-exports
|
|
176
127
|
exports.Bc01CommandSequencer = Bc01CommandSequencer;
|
|
177
128
|
const bc01CommandSequencerInternals = exports.bc01CommandSequencerInternals = {
|
|
178
|
-
bc401Checksum,
|
|
179
|
-
buildCommand,
|
|
180
|
-
buildResetCommand,
|
|
181
|
-
buildRequestVersionCommand,
|
|
182
|
-
buildSetTimeCommand
|
|
129
|
+
bc401Checksum: _bc01CommandBuilders.bc401Checksum,
|
|
130
|
+
buildCommand: _bc01CommandBuilders.buildCommand,
|
|
131
|
+
buildResetCommand: _bc01CommandBuilders.buildResetCommand,
|
|
132
|
+
buildRequestVersionCommand: _bc01CommandBuilders.buildRequestVersionCommand,
|
|
133
|
+
buildSetTimeCommand: _bc01CommandBuilders.buildSetTimeCommand
|
|
183
134
|
};
|
|
184
135
|
//# sourceMappingURL=bc01-command-sequencer.js.map
|
package/lib/commonjs/modules/bt-management/services/devices/bc01/bc01-command-sequencer.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_hexToByte","require","
|
|
1
|
+
{"version":3,"names":["_hexToByte","require","_bc01CommandBuilders","Bc01CommandSequencer","isDone","standardPage","quantitativePage","constructor","params","clock","Date","initialCommands","commandFor","buildResetCommand","RESET_DELAY_MS","nextCommand","frame","length","undefined","opcode","hexToByte","RX","ACK","buildRequestVersionCommand","VERSION_REPLY","buildSetTimeCommand","TIME_SYNC_ACK","buildCommand","OP_REQUEST_COUNT","REQUEST_ALL","COUNT_REPLY","OP_REQUEST_RECORDS","STORED_RECORD_URS","STORED_RECORD_PAGED","answerStoredRecord","STORED_QUANTITATIVE","STORED_QUANTITATIVE_PAGED","answerQuantitativeRecord","FINISH","flags","RECORD_FLAGS_INDEX","finishStoredRecords","page","RETRY_RECORD_GROUP","RECORD_LAST_OF_SET_BIT","REQUEST_NEXT_RECORD_GROUP","OP_REQUEST_QUANTITATIVE_RECORDS","ACK_LAST_OF_SET","buildDeleteCommand","FINAL_RECORD_DELAY_MS","bytes","delayBeforeWriteMs","write","map","asHex","exports","bc01CommandSequencerInternals","bc401Checksum"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/bc01/bc01-command-sequencer.ts"],"mappings":";;;;;;AAEA,IAAAA,UAAA,GAAAC,OAAA;AAEA,IAAAC,oBAAA,GAAAD,OAAA;AAmCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAME,oBAAoB,CAA6B;EACpDC,MAAM,GAAG,KAAK;;EAEtB;EACQC,YAAY,GAAG,EAAE;;EAEzB;EACQC,gBAAgB,GAAG,CAAC;;EAE5B;;EAGOC,WAAWA,CACCC,MAA2B,EAC5CC,KAAiB,GAAGA,CAAA,KAAM,IAAIC,IAAI,CAAC,CAAC,EACpC;IAAA,KAFiBF,MAA2B,GAA3BA,MAA2B;IAG5C,IAAI,CAACC,KAAK,GAAGA,KAAK;EACpB;EAEOE,eAAe,GAAGA,CAAA,KAAgC,CACvD,IAAI,CAACC,UAAU,CAAC,IAAAC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