@ovok/native 1.3.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 +15 -8
- 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 +55 -0
- package/lib/commonjs/modules/bt-management/index.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/background-sync/background-sync-coordinator.js +10 -4
- package/lib/commonjs/modules/bt-management/services/background-sync/background-sync-coordinator.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/bt-manager.js +43 -5
- 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/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 +15 -8
- 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 +5 -0
- package/lib/module/modules/bt-management/index.js.map +1 -1
- package/lib/module/modules/bt-management/services/background-sync/background-sync-coordinator.js +10 -4
- package/lib/module/modules/bt-management/services/background-sync/background-sync-coordinator.js.map +1 -1
- package/lib/module/modules/bt-management/services/bt-manager.js +45 -6
- 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/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 +5 -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-sync-coordinator.d.ts +5 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/background-sync/background-sync-coordinator.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/bt-manager.d.ts +19 -2
- 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/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 +5 -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-sync-coordinator.d.ts +5 -1
- package/lib/typescript/module/src/modules/bt-management/services/background-sync/background-sync-coordinator.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/bt-manager.d.ts +19 -2
- 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/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
|
@@ -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,OAAA,CAAAC,kBAAA,GAAG,IAAI;AAC/B,MAAMC,+BAA+B,GAAAF,OAAA,CAAAE,+BAAA,GAAG,IAAI;AAE5C,MAAMC,eAAe,GAAAH,OAAA,CAAAG,eAAA,GAAG,IAAI;AAC5B,MAAMC,WAAW,GAAAJ,OAAA,CAAAI,WAAA,GAAG,IAAI;AACxB,MAAMC,yBAAyB,GAAAL,OAAA,CAAAK,yBAAA,GAAG,IAAI;AACtC,MAAMC,kBAAkB,GAAAN,OAAA,CAAAM,kBAAA,GAAG,IAAI;AAC/B,MAAMC,qBAAqB,GAAAP,OAAA,CAAAO,qBAAA,GAAG,GAAG;AACjC,MAAMC,cAAc,GAAAR,OAAA,CAAAQ,cAAA,GAAG,GAAG;AAE1B,MAAMC,EAAE,GAAAT,OAAA,CAAAS,EAAA,GAAG;EACTC,GAAG,EAAE,IAAI;EACTC,aAAa,EAAE,IAAI;EACnBC,aAAa,EAAE,IAAI;EACnBC,WAAW,EAAE,IAAI;EACjBC,iBAAiB,EAAE,IAAI;EACvBC,mBAAmB,EAAE,IAAI;EACzBC,MAAM,EAAE,IAAI;EACZC,mBAAmB,EAAE,IAAI;EACzBC,yBAAyB,EAAE;AAC7B,CAAU;AAEV,MAAMC,kBAAkB,GAAAnB,OAAA,CAAAmB,kBAAA,GAAG,CAAC;AAC5B,MAAMC,sBAAsB,GAAApB,OAAA,CAAAoB,sBAAA,GAAG,IAAI;AAEnC,MAAMC,KAAK,GAAIC,I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AAC,CAAC,IAAI,CAAC,GAAI,IAAI,CACpC;EAED,OAAO,CAAC,GAAGP,OAAO,EAAEX,aAAa,CAACW,OAAO,CAAC,CAAC;AAC7C,CAAC;AAACpC,OAAA,CAAAkC,mBAAA,GAAAA,mBAAA;AAEF,MAAMU,kBAAkB,GAAGA,CAAA,KAAgB,CAAC,IAAI,EAAE,IAAI,CAAC;AAAC5C,OAAA,CAAA4C,kBAAA,GAAAA,kBAAA","ignoreList":[]}
|
|
@@ -5,102 +5,7 @@ Object.defineProperty(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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AG,IAAI;IAElB,OAAO,CACL,IAAI,CAACQ,UAAU,CAAC,IAAAe,iCAAY,EAACR,MAAM,EAAE4B,oCAAe,CAAC,CAAC,EACtD,IAAI,CAACnC,UAAU,CAAC,IAAAoC,uCAAkB,EAAC,CAAC,EAAEC,0CAAqB,CAAC,CAC7D;EACH,CAAC;EAEOrC,UAAU,GAAGA,CACnBsC,KAAwB,EACxBC,kBAAkB,GAAG,CAAC,MACH;IACnB,GAAG,IAAI,CAAC3C,MAAM,CAAC4C,KAAK;IACpBpC,KAAK,EAAEkC,KAAK,CAACG,GAAG,CAACC,0BAAK,CAAC;IACvBH;EACF,CAAC,CAAC;AACJ;;AAEA;AAAAI,OAAA,CAAApD,oBAAA,GAAAA,oBAAA;AACO,MAAMqD,6BAA6B,GAAAD,OAAA,CAAAC,6BAAA,GAAG;EAC3CC,aAAa,EAAbA,kCAAa;EACb9B,YAAY,EAAZA,iCAAY;EACZd,iBAAiB,EAAjBA,sCAAiB;EACjBU,0BAA0B,EAA1BA,+CAA0B;EAC1BE,mBAAmB,EAAnBA;AACF,CAAC","ignoreList":[]}
|
|
@@ -10,6 +10,7 @@ var _hexToByte = require("../../../utils/hex-to-byte.js");
|
|
|
10
10
|
var _btManagedDevice = require("../bt-managed-device.js");
|
|
11
11
|
var _bc01CommandSequencer = require("./bc01-command-sequencer.js");
|
|
12
12
|
var _bc01FrameParser = require("./bc01-frame-parser.js");
|
|
13
|
+
var _bc01FrameReader = require("./bc01.frame-reader.js");
|
|
13
14
|
var _bc01MainServices = require("./bc01.main-services.js");
|
|
14
15
|
/** Minimum bytes a complete frame carries, keyed by its opening opcode. */
|
|
15
16
|
const BC01_FRAME_MIN_LENGTH = {
|
|
@@ -45,6 +46,7 @@ const BC01_FRAME_MIN_LENGTH = {
|
|
|
45
46
|
class BC01Device extends _btManagedDevice.BTManagedDevice {
|
|
46
47
|
onStreamStart = () => {};
|
|
47
48
|
mainServices = _bc01MainServices.bc01MainServices;
|
|
49
|
+
frameReader = new _bc01FrameReader.Bc01FrameReader();
|
|
48
50
|
|
|
49
51
|
/**
|
|
50
52
|
* 90 s covers the maximum firmware-side reagent-pad settle time on a URS-7
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_core","require","_caseType","_hexToByte","_btManagedDevice","_bc01CommandSequencer","_bc01FrameParser","_bc01MainServices","BC01_FRAME_MIN_LENGTH","BC01Device","BTManagedDevice","onStreamStart","mainServices","bc01MainServices","stuckDataTimeout","constructor","device","params","createCommandSequencer","Bc01CommandSequencer","write","serviceUuid","uuid","characteristicUuid","writeUuid","onRefused","reason","onError","Error","validatePackage","pkg","length","opcode","hexToByte","minLength","undefined","handleDependentResult","data","frame","reportUrsRecord","parsingCase","caseType","CaseType","OTHER","handleSuccessResult","parsed","parseBc01Record","measuredValues","BC01_ANALYTE_ORDER","reduce","acc","analyte","value","values","Object","keys","reading","RESULT","measurementTypeKey","MeasurementTypeKey","uricAcid","urineValues","recordedAt","timestamp","onResult","exports"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/bc01/bc01.device.ts"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AAGA,IAAAC,SAAA,GAAAD,OAAA;AAQA,IAAAE,UAAA,GAAAF,OAAA;AACA,IAAAG,gBAAA,GAAAH,OAAA;AAEA,IAAAI,qBAAA,GAAAJ,OAAA;AACA,IAAAK,gBAAA,GAAAL,OAAA;AACA,IAAAM,
|
|
1
|
+
{"version":3,"names":["_core","require","_caseType","_hexToByte","_btManagedDevice","_bc01CommandSequencer","_bc01FrameParser","_bc01FrameReader","_bc01MainServices","BC01_FRAME_MIN_LENGTH","BC01Device","BTManagedDevice","onStreamStart","mainServices","bc01MainServices","frameReader","Bc01FrameReader","stuckDataTimeout","constructor","device","params","createCommandSequencer","Bc01CommandSequencer","write","serviceUuid","uuid","characteristicUuid","writeUuid","onRefused","reason","onError","Error","validatePackage","pkg","length","opcode","hexToByte","minLength","undefined","handleDependentResult","data","frame","reportUrsRecord","parsingCase","caseType","CaseType","OTHER","handleSuccessResult","parsed","parseBc01Record","measuredValues","BC01_ANALYTE_ORDER","reduce","acc","analyte","value","values","Object","keys","reading","RESULT","measurementTypeKey","MeasurementTypeKey","uricAcid","urineValues","recordedAt","timestamp","onResult","exports"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/bc01/bc01.device.ts"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AAGA,IAAAC,SAAA,GAAAD,OAAA;AAQA,IAAAE,UAAA,GAAAF,OAAA;AACA,IAAAG,gBAAA,GAAAH,OAAA;AAEA,IAAAI,qBAAA,GAAAJ,OAAA;AACA,IAAAK,gBAAA,GAAAL,OAAA;AACA,IAAAM,gBAAA,GAAAN,OAAA;AACA,IAAAO,iBAAA,GAAAP,OAAA;AAEA;AACA,MAAMQ,qBAA6C,GAAG;EACpD,IAAI,EAAE,CAAC;EAAE;EACT,IAAI,EAAE,CAAC;EAAE;EACT,IAAI,EAAE,CAAC;EAAE;EACT,IAAI,EAAE,CAAC;EAAE;EACT,IAAI,EAAE,EAAE;EAAE;EACV,IAAI,EAAE,EAAE;EAAE;EACV,IAAI,EAAE,CAAC;EAAE;EACT,IAAI,EAAE,EAAE;EAAE;EACV,IAAI,EAAE,EAAE,CAAE;AACZ,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMC,UAAU,SAASC,gCAAe,CAAyB;EAC5DC,aAAa,GAAeA,CAAA,KAAM,CAAC,CAAC;EAEpCC,YAAY,GAAeC,kCAAgB;EAC3CC,WAAW,GAAoB,IAAIC,gCAAe,CAAC,CAAC;;EAE9D;AACF;AACA;AACA;AACA;AACA;EACYC,gBAAgB,GAAG,MAAM;EAEnCC,WAAWA,CAACC,MAAc,EAAEC,MAAkD,EAAE;IAC9E,KAAK,CAACD,MAAM,EAAEC,MAAM,CAAC;;IAErB;AACJ;AACA;AACA;AACA;AACA;AACA;IACI,IAA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,MAAM,EAAE;MACX;IACF;IAEA,MAAME,cAAc,GAAGC,mCAAkB,CAACC,MAAM,CAE9C,CAACC,GAAG,EAAEC,OAAO,KAAK;MAClB,MAAMC,KAAK,GAAGP,MAAM,CAACQ,MAAM,CAACF,OAAO,CAAC;MAEpC,IAAIC,KAAK,KAAKjB,SAAS,EAAE;QACvBe,GAAG,CAACC,OAAO,CAAC,GAAGC,KAAK;MACtB;MAEA,OAAOF,GAAG;IACZ,CAAC,EAAE,CAAC,CAAC,CAAC;IAEN,IAAII,MAAM,CAACC,IAAI,CAACR,cAAc,CAAC,CAAChB,MAAM,KAAK,CAAC,EAAE;MAC5C,IAAI,CAACJ,OAAO,GAAG,sDAAsD,CAAC;MAEtE;IACF;IAEA,MAAM6B,OAAO,GAAG;MACdf,QAAQ,EAAEC,kBAAQ,CAACe,MAAM;MACzBC,kBAAkB,EAAEC,wBAAkB,CAACC,QAAQ;MAC/CC,WAAW,EAAE,EAAE;MACfC,UAAU,EAAEjB,MAAM,CAACkB,SAAS;MAC5B,GAAGhB;IACL,CAEC;IAED,IAAI,CAACiB,QAAQ,GAAGR,OAAO,CAAC;EAC1B;AACF;AAACS,OAAA,CAAA1D,UAAA,GAAAA,UAAA","ignoreList":[]}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.bc01FrameLengths = exports.Bc01FrameReader = void 0;
|
|
7
|
+
var _frameReadStatus = require("../../../types/frame-read-status.js");
|
|
8
|
+
/** Fixed BC401 reply lengths, keyed by the first byte of each PHMS frame. */
|
|
9
|
+
const BC01_FRAME_LENGTHS = exports.bc01FrameLengths = {
|
|
10
|
+
f0: 2,
|
|
11
|
+
f2: 8,
|
|
12
|
+
f3: 3,
|
|
13
|
+
e0: 7,
|
|
14
|
+
e1: 16,
|
|
15
|
+
e2: 16,
|
|
16
|
+
e3: 3,
|
|
17
|
+
e4: 36,
|
|
18
|
+
e5: 36
|
|
19
|
+
};
|
|
20
|
+
const lower = byte => (byte ?? "").toLowerCase();
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Isolates the fixed-length frames used by Contec BC401BT.
|
|
24
|
+
*
|
|
25
|
+
* PHMS keeps a byte queue and repeatedly consumes complete replies. BLE notifications are
|
|
26
|
+
* not frame boundaries, so the SDK must retain partial replies and drain multiple replies
|
|
27
|
+
* when Android combines them into one notification.
|
|
28
|
+
*/
|
|
29
|
+
class Bc01FrameReader {
|
|
30
|
+
readFrame(buffer) {
|
|
31
|
+
const start = buffer.findIndex(byte => Object.prototype.hasOwnProperty.call(BC01_FRAME_LENGTHS, lower(byte)));
|
|
32
|
+
if (start === -1) {
|
|
33
|
+
return {
|
|
34
|
+
status: _frameReadStatus.FrameReadStatus.INCOMPLETE,
|
|
35
|
+
consumedBytes: buffer.length
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
const opcode = lower(buffer[start]);
|
|
39
|
+
const length = BC01_FRAME_LENGTHS[opcode];
|
|
40
|
+
if (length === undefined) {
|
|
41
|
+
return {
|
|
42
|
+
status: _frameReadStatus.FrameReadStatus.INCOMPLETE,
|
|
43
|
+
consumedBytes: start + 1
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
if (start + length > buffer.length) {
|
|
47
|
+
return {
|
|
48
|
+
status: _frameReadStatus.FrameReadStatus.INCOMPLETE,
|
|
49
|
+
consumedBytes: start
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
return {
|
|
53
|
+
status: _frameReadStatus.FrameReadStatus.COMPLETE,
|
|
54
|
+
consumedBytes: start + length,
|
|
55
|
+
frame: buffer.slice(start, start + length)
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
exports.Bc01FrameReader = Bc01FrameReader;
|
|
60
|
+
//# sourceMappingURL=bc01.frame-reader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_frameReadStatus","require","BC01_FRAME_LENGTHS","exports","bc01FrameLengths","f0","f2","f3","e0","e1","e2","e3","e4","e5","lower","byte","toLowerCase","Bc01FrameReader","readFrame","buffer","start","findIndex","Object","prototype","hasOwnProperty","call","status","FrameReadStatus","INCOMPLETE","consumedBytes","length","opcode","undefined","COMPLETE","frame","slice"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/bc01/bc01.frame-reader.ts"],"mappings":";;;;;;AACA,IAAAA,gBAAA,GAAAC,OAAA;AAGA;AACA,MAAMC,kBAAoD,GAAAC,OAAA,CAAAC,gBAAA,GAAG;EAC3DC,EAAE,EAAE,CAAC;EACLC,EAAE,EAAE,CAAC;EACLC,EAAE,EAAE,CAAC;EACLC,EAAE,EAAE,CAAC;EACLC,EAAE,EAAE,EAAE;EACNC,EAAE,EAAE,EAAE;EACNC,EAAE,EAAE,CAAC;EACLC,EAAE,EAAE,EAAE;EACNC,EAAE,EAAE;AACN,CAAC;AAED,MAAMC,KAAK,GAAIC,IAAwB,IAAa,CAACA,IAAI,IAAI,EAAE,EAAEC,WAAW,CAAC,CAAC;;AAE9E;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,eAAe,CAAwB;EACpCC,SAASA,CAACC,MAAyB,EAAmB;IAC3D,MAAMC,KAAK,GAAGD,MAAM,CAACE,SAAS,CAAEN,IAAI,IAClCO,MAAM,CAACC,SAAS,CAACC,cAAc,CAACC,IAAI,CAACvB,kBAAkB,EAAEY,KAAK,CAACC,IAAI,CAAC,CACtE,CAAC;IAED,IAAIK,KAAK,KAAK,CAAC,CAAC,EAAE;MAChB,OAAO;QACLM,MAAM,EAAEC,gCAAe,CAACC,UAAU;QAClCC,aAAa,EAAEV,MAAM,CAACW;MACxB,CAAC;IACH;IAEA,MAAMC,MAAM,GAAGjB,KAAK,CAACK,MAAM,CAACC,KAAK,CAAC,CAAC;IACnC,MAAMU,MAAM,GAAG5B,kBAAkB,CAAC6B,MAAM,CAAC;IAEzC,IAAID,MAAM,KAAKE,SAAS,EAAE;MACxB,OAAO;QACLN,MAAM,EAAEC,gCAAe,CAACC,UAAU;QAClCC,aAAa,EAAET,KAAK,GAAG;MACzB,CAAC;IACH;IAEA,IAAIA,KAAK,GAAGU,MAAM,GAAGX,MAAM,CAACW,MAAM,EAAE;MAClC,OAAO;QACLJ,MAAM,EAAEC,gCAAe,CAACC,UAAU;QAClCC,aAAa,EAAET;MACjB,CAAC;IACH;IAEA,OAAO;MACLM,MAAM,EAAEC,gCAAe,CAACM,QAAQ;MAChCJ,aAAa,EAAET,KAAK,GAAGU,MAAM;MAC7BI,KAAK,EAAEf,MAAM,CAACgB,KAAK,CAACf,KAAK,EAAEA,KAAK,GAAGU,MAAM;IAC3C,CAAC;EACH;AACF;AAAC3B,OAAA,CAAAc,eAAA,GAAAA,eAAA","ignoreList":[]}
|
package/lib/commonjs/modules/bt-management/services/devices/blood-glucose/blood-glucose.device.js
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.BloodGlucoseDevice = void 0;
|
|
7
|
+
var _core = require("@ovok/core");
|
|
8
|
+
var _caseType = require("../../../types/case-type.js");
|
|
9
|
+
var _integratedDevices = require("../../../types/integrated-devices.js");
|
|
10
|
+
var _hexToByte = require("../../../utils/hex-to-byte.js");
|
|
11
|
+
var _btManagedDevice = require("../bt-managed-device.js");
|
|
12
|
+
const LEGACY_SERVICE = "00001523-1212-efde-1523-785feabcd123";
|
|
13
|
+
const LEGACY_CHARACTERISTIC = "00001524-1212-efde-1523-785feabcd123";
|
|
14
|
+
const BGM_SERVICE = "0003cdd0-0000-1000-8000-00805f9b0131";
|
|
15
|
+
const BGM_CHARACTERISTIC = "0003cdd1-0000-1000-8000-00805f9b0131";
|
|
16
|
+
const GLUCOSE_REQUEST = "512600000000a31a";
|
|
17
|
+
const servicesFor = device => {
|
|
18
|
+
const isBgm = device === _integratedDevices.IntegratedDevices.BGM;
|
|
19
|
+
return [{
|
|
20
|
+
uuid: isBgm ? BGM_SERVICE : LEGACY_SERVICE,
|
|
21
|
+
monitorUuids: [{
|
|
22
|
+
uuid: isBgm ? BGM_CHARACTERISTIC : LEGACY_CHARACTERISTIC,
|
|
23
|
+
parsingModel: {
|
|
24
|
+
caseValuePosition: [isBgm ? 9 : 1],
|
|
25
|
+
cases: [...(isBgm ? ["00", "0b", "10", "11", "18", "22", "33", "55"] : ["46", ...(device === _integratedDevices.IntegratedDevices.GLUCOCHECK ? ["50"] : [])]).map(caseValue => ({
|
|
26
|
+
caseType: _caseType.CaseType.OTHER,
|
|
27
|
+
caseValue,
|
|
28
|
+
parseDefinitions: []
|
|
29
|
+
})), {
|
|
30
|
+
measurementTypeKey: _core.MeasurementTypeKey.bloodGlucose,
|
|
31
|
+
caseType: _caseType.CaseType.RESULT,
|
|
32
|
+
caseValue: isBgm ? "44" : "26",
|
|
33
|
+
parseDefinitions: [{
|
|
34
|
+
name: "bloodGlucose",
|
|
35
|
+
parseType: "custom",
|
|
36
|
+
byteIndexes: isBgm ? [10, 11] : [3, 2],
|
|
37
|
+
parseReference: 16,
|
|
38
|
+
customParserDefinition: value => {
|
|
39
|
+
if (isBgm) {
|
|
40
|
+
return (0, _hexToByte.hexToByte)(value.slice(0, 2)) * 100 + (0, _hexToByte.hexToByte)(value.slice(2, 4));
|
|
41
|
+
}
|
|
42
|
+
const raw = parseInt(value, 16);
|
|
43
|
+
return device === _integratedDevices.IntegratedDevices.TAIDOC_GLUCOSE ? Number((raw * 18).toFixed(2)) : raw;
|
|
44
|
+
}
|
|
45
|
+
}]
|
|
46
|
+
}]
|
|
47
|
+
}
|
|
48
|
+
}],
|
|
49
|
+
...(isBgm ? {} : {
|
|
50
|
+
writeUuid: {
|
|
51
|
+
uuid: LEGACY_CHARACTERISTIC,
|
|
52
|
+
mainCommandUuid: GLUCOSE_REQUEST
|
|
53
|
+
}
|
|
54
|
+
})
|
|
55
|
+
}];
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
/** Decodes the legacy TaiDoc, GlucoCheck Gold and TeleBGM glucose protocols. */
|
|
59
|
+
class BloodGlucoseDevice extends _btManagedDevice.BTManagedDevice {
|
|
60
|
+
stuckDataTimeout = 60_000;
|
|
61
|
+
constructor(device, params) {
|
|
62
|
+
super(device, params);
|
|
63
|
+
this.mainServices = servicesFor(params.deviceName);
|
|
64
|
+
}
|
|
65
|
+
validatePackage = pkg => pkg.length >= (this.deviceData.name === _integratedDevices.IntegratedDevices.BGM ? 12 : 8);
|
|
66
|
+
handleSuccessResult(result) {
|
|
67
|
+
if (result.caseType !== _caseType.CaseType.RESULT || result.bloodGlucose === 0) {
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
this.onResult?.(result);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
exports.BloodGlucoseDevice = BloodGlucoseDevice;
|
|
74
|
+
//# sourceMappingURL=blood-glucose.device.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_core","require","_caseType","_integratedDevices","_hexToByte","_btManagedDevice","LEGACY_SERVICE","LEGACY_CHARACTERISTIC","BGM_SERVICE","BGM_CHARACTERISTIC","GLUCOSE_REQUEST","servicesFor","device","isBgm","IntegratedDevices","BGM","uuid","monitorUuids","parsingModel","caseValuePosition","cases","GLUCOCHECK","map","caseValue","caseType","CaseType","OTHER","parseDefinitions","measurementTypeKey","MeasurementTypeKey","bloodGlucose","RESULT","name","parseType","byteIndexes","parseReference","customParserDefinition","value","hexToByte","slice","raw","parseInt","TAIDOC_GLUCOSE","Number","toFixed","writeUuid","mainCommandUuid","BloodGlucoseDevice","BTManagedDevice","stuckDataTimeout","constructor","params","mainServices","deviceName","validatePackage","pkg","length","deviceData","handleSuccessResult","result","onResult","exports"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/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AKlB,oCAAiB,CAACC,GAAG,GAAG,EAAE,GAAG,CAAC,CAAC;EAE/D2C,mBAAmBA,CAC3BC,MAA2E,EACrE;IACN,IAAIA,MAAM,CAACnC,QAAQ,KAAKC,kBAAQ,CAACM,MAAM,IAAI4B,MAAM,CAAC7B,YAAY,KAAK,CAAC,EAAE;MACpE;IACF;IAEA,IAAI,CAAC8B,QAAQ,GAAGD,MAA0D,CAAC;EAC7E;AACF;AAACE,OAAA,CAAAd,kBAAA,GAAAA,kBAAA","ignoreList":[]}
|
|
@@ -19,7 +19,7 @@ const BOSO_MEDICUS_NAME_MATCH = exports.BOSO_MEDICUS_NAME_MATCH = /^boso medicus
|
|
|
19
19
|
* the profile's user/status bytes without inventing a boso-specific wire format.
|
|
20
20
|
*/
|
|
21
21
|
const bosoMedicusMonitor = params => (0, _standardGattDevices.standardBloodPressureDevice)({
|
|
22
|
-
id: params.id,
|
|
22
|
+
id: params.id ?? "boso-medicus-system",
|
|
23
23
|
nameMatch: params.nameMatch ?? BOSO_MEDICUS_NAME_MATCH,
|
|
24
24
|
...(params.stuckDataTimeoutMs === undefined ? {} : {
|
|
25
25
|
stuckDataTimeoutMs: params.stuckDataTimeoutMs
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_standardGattDevices","require","BOSO_MEDICUS_NAME_MATCH","exports","bosoMedicusMonitor","params","standardBloodPressureDevice","id","nameMatch","stuckDataTimeoutMs","undefined"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/boso/boso.medicus.ts"],"mappings":";;;;;;AACA,IAAAA,oBAAA,GAAAC,OAAA;AAEA;AACA;AACA;AACA;AACA;AACA,MAAMC,uBAAuB,GAAAC,OAAA,CAAAD,uBAAA,GAAG,6BAA6B;AAc7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAME,kBAAkB,GACtBC,MAAyB,IAEzB,IAAAC,gDAA2B,EAAC;EAC1BC,EAAE,EAAEF,MAAM,CAACE,EAAE;
|
|
1
|
+
{"version":3,"names":["_standardGattDevices","require","BOSO_MEDICUS_NAME_MATCH","exports","bosoMedicusMonitor","params","standardBloodPressureDevice","id","nameMatch","stuckDataTimeoutMs","undefined"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/boso/boso.medicus.ts"],"mappings":";;;;;;AACA,IAAAA,oBAAA,GAAAC,OAAA;AAEA;AACA;AACA;AACA;AACA;AACA,MAAMC,uBAAuB,GAAAC,OAAA,CAAAD,uBAAA,GAAG,6BAA6B;AAc7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAME,kBAAkB,GACtBC,MAAyB,IAEzB,IAAAC,gDAA2B,EAAC;EAC1BC,EAAE,EAAEF,MAAM,CAACE,EAAE,IAAI,qBAAqB;EACtCC,SAAS,EAAEH,MAAM,CAACG,SAAS,IAAIN,uBAAuB;EACtD,IAAIG,MAAM,CAACI,kBAAkB,KAAKC,SAAS,GACvC,CAAC,CAAC,GACF;IAAED,kBAAkB,EAAEJ,MAAM,CAACI;EAAmB,CAAC;AACvD,CAAC,CAAC;AAACN,OAAA,CAAAC,kBAAA,GAAAA,kBAAA","ignoreList":[]}
|
|
@@ -83,6 +83,9 @@ class BTCommandWriter {
|
|
|
83
83
|
* for - worse than sending nothing, because it would be answered.
|
|
84
84
|
*/
|
|
85
85
|
writeCommand = async command => {
|
|
86
|
+
if (command.delayBeforeWriteMs && command.delayBeforeWriteMs > 0) {
|
|
87
|
+
await new Promise(resolve => setTimeout(resolve, command.delayBeforeWriteMs));
|
|
88
|
+
}
|
|
86
89
|
for (const chunk of this.chunksOf(command.frame)) {
|
|
87
90
|
const written = await this.writeChunk(command, chunk);
|
|
88
91
|
if (!written) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_sLog","require","_sentryLogger","_hexToBase","MAX_WRITE_ATTEMPTS","DEFAULT_ATT_MTU","ATT_WRITE_HEADER_BYTES","BTCommandWriter","pendingWrites","Promise","resolve","mtu","constructor","device","onError","useNegotiatedMtu","Number","isInteger","reset","send","commands","then","writeInOrder","catch","error","command","writeCommand","chunk","chunksOf","frame","written","writeChunk","writeTo","value","withoutResponse","writeCharacteristicWithoutResponseForService","serviceUuid","characteristicUuid","writeCharacteristicWithResponseForService","size","Math","max","chunks","start","length","push","slice","attempt","isConnected","hexToBase64","join","sentryLogger","Error","message","deviceName","name","slog","exports"],"sourceRoot":"../../../../../../src","sources":["modules/bt-management/services/devices/bt-command-writer.ts"],"mappings":";;;;;;AAEA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,aAAA,GAAAD,OAAA;AAEA,IAAAE,UAAA,GAAAF,OAAA;AAEA,MAAMG,kBAAkB,GAAG,CAAC;;AAE5B;AACA,MAAMC,eAAe,GAAG,EAAE;;AAE1B;AACA,MAAMC,sBAAsB,GAAG,CAAC;;AAEhC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMC,eAAe,CAAC;EACnBC,aAAa,GAAkBC,OAAO,CAACC,OAAO,CAAC,CAAC;EAChDC,GAAG,GAAGN,eAAe;EAEtBO,WAAWA,CACCC,MAAc,EACdC,OAA2C,EAC5D;IAAA,KAFiBD,MAAc,GAAdA,MAAc;IAAA,KACdC,OAA2C,GAA3CA,OAA2C;EAC3D;;EAEH;AACF;AACA;AACA;AACA;AACA;AACA;EACSC,gBAAgB,GAAIJ,GAAY,IAAW;IAChD,IAAI,OAAOA,GAAG,KAAK,QAAQ,IAAIK,MAAM,CAACC,SAAS,CAACN,GAAG,CAAC,IAAIA,GAAG,GAAG,IAAI,CAACA,GAAG,EAAE;MACtE,IAAI,CAACA,GAAG,GAAGA,GAAG;IAChB;EACF,CAAC;;EAED;EACOO,KAAK,GAAGA,CAAA,KAAY;IACzB,IAAI,CAACV,aAAa,GAAGC,OAAO,CAACC,OAAO,CAAC,CAAC;EACxC,CAAC;;EAED;AACF;AACA;AACA;AACA;AACA;AACA;AACA;EACSS,IAAI,GAAIC,QAAkC,IAAoB;IACnE,IAAI,CAACZ,aAAa,GAAG,IAAI,CAACA,aAAa,CACpCa,IAAI,CAAC,MAAM,IAAI,CAACC,YAAY,CAACF,QAAQ,CAAC,CAAC,CACvCG,KAAK,CAAEC,KAAK,IAAK;MAChB,IAAI,CAACV,OAAO,GAAGU,KAAyB,CAAC;IAC3C,CAAC,CAAC;IAEJ,OAAO,IAAI,CAAChB,aAAa;EAC3B,CAAC;EAEOc,YAAY,GAAG,MACrBF,QAAkC,IAChB;IAClB,KAAK,MAAMK,OAAO,IAAIL,QAAQ,EAAE;MAC9B,MAAM,IAAI,CAACM,YAAY,CAACD,OAAO,CAAC;IAClC;EACF,CAAC;;EAED;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACUC,YAAY,GAAG,MAAOD,OAAsB,IAAoB;IACtE,KAAK,MAAME,KAAK,IAAI,IAAI,CAACC,QAAQ,
|
|
1
|
+
{"version":3,"names":["_sLog","require","_sentryLogger","_hexToBase","MAX_WRITE_ATTEMPTS","DEFAULT_ATT_MTU","ATT_WRITE_HEADER_BYTES","BTCommandWriter","pendingWrites","Promise","resolve","mtu","constructor","device","onError","useNegotiatedMtu","Number","isInteger","reset","send","commands","then","writeInOrder","catch","error","command","writeCommand","delayBeforeWriteMs","setTimeout","chunk","chunksOf","frame","written","writeChunk","writeTo","value","withoutResponse","writeCharacteristicWithoutResponseForService","serviceUuid","characteristicUuid","writeCharacteristicWithResponseForService","size","Math","max","chunks","start","length","push","slice","attempt","isConnected","hexToBase64","join","sentryLogger","Error","message","deviceName","name","slog","exports"],"sourceRoot":"../../../../../../src","sources":["modules/bt-management/services/devices/bt-command-writer.ts"],"mappings":";;;;;;AAEA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,aAAA,GAAAD,OAAA;AAEA,IAAAE,UAAA,GAAAF,OAAA;AAEA,MAAMG,kBAAkB,GAAG,CAAC;;AAE5B;AACA,MAAMC,eAAe,GAAG,EAAE;;AAE1B;AACA,MAAMC,sBAAsB,GAAG,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G,MAAM;EACf,CAAC;;EAED;AACF;AACA;AACA;AACA;AACA;AACA;EACUX,UAAU,GAAG,MAAAA,CACnBR,OAAsB,EACtBI,KAAwB,KACH;IACrB,KAAK,IAAIoB,OAAO,GAAG,CAAC,EAAEA,OAAO,IAAI7C,kBAAkB,EAAE6C,OAAO,EAAE,EAAE;MAC9D,IAAI;QACF,MAAMC,WAAW,GAAG,MAAM,IAAI,CAACrC,MAAM,CAACqC,WAAW,CAAC,CAAC;QAEnD,IAAI,CAACA,WAAW,EAAE;UAChB,OAAO,KAAK;QACd;QAEA,MAAM,IAAI,CAAChB,OAAO,CAACT,OAAO,EAAE,IAAA0B,sBAAW,EAACtB,KAAK,CAACuB,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC;QAExD,OAAO,IAAI;MACb,CAAC,CAAC,OAAO5B,KAAK,EAAE;QACd,IAAA6B,0BAAY,EAAC,OAAO,EAAE,+BAA+B,EAAE;UACrD7B,KAAK,EAAEA,KAAK,YAAY8B,KAAK,GAAG9B,KAAK,CAAC+B,OAAO,GAAG/B,KAAK;UACrDgC,UAAU,EAAE,IAAI,CAAC3C,MAAM,CAAC4C;QAC1B,CAAC,CAAC;QAEF,IAAIR,OAAO,KAAK7C,kBAAkB,EAAE;UAClC,IAAAsD,UAAI,EAAClC,KAAK,EAAE,8CAA8C,EAAE;YAC1DgC,UAAU,EAAE,IAAI,CAAC3C,MAAM,CAAC4C;UAC1B,CAAC,CAAC;QACJ;MACF;IACF;IAEA,OAAO,KAAK;EACd,CAAC;AACH;AAACE,OAAA,CAAApD,eAAA,GAAAA,eAAA","ignoreList":[]}
|
|
@@ -24,7 +24,7 @@ class BTConnectionHandler {
|
|
|
24
24
|
this.callbacks.onStatusChanged?.(_deviceStatus.DeviceStatus.CONNECTED);
|
|
25
25
|
await this.device.discoverAllServicesAndCharacteristics();
|
|
26
26
|
this.onDisconnectSubscription = this.device.onDisconnected(this.onDeviceDisconnected);
|
|
27
|
-
this.subscribeToAllCharacteristics();
|
|
27
|
+
await this.subscribeToAllCharacteristics();
|
|
28
28
|
} catch (error) {
|
|
29
29
|
(0, _sentryLogger.sentryLogger)("error", "BT_MANAGER: Error connecting to device", {
|
|
30
30
|
error: error instanceof Error ? error.message : error,
|