@ovok/native 1.4.0 → 1.5.1
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 +2 -2
- 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 +2 -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 +2 -1
- package/lib/commonjs/modules/bt-device/constants/device-instruction-pdfs.js.map +1 -1
- package/lib/commonjs/modules/bt-device/constants/supported-device-catalog-assets.js +3 -1
- package/lib/commonjs/modules/bt-device/constants/supported-device-catalog-assets.js.map +1 -1
- package/lib/commonjs/modules/bt-device/constants/supported-devices.js +55 -13
- package/lib/commonjs/modules/bt-device/constants/supported-devices.js.map +1 -1
- package/lib/commonjs/modules/bt-management/components/bt-provider-child-wrapper.js +13 -2
- 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/constants/measurement-field-catalog.js +88 -0
- package/lib/commonjs/modules/bt-management/constants/measurement-field-catalog.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/bt-manager.js +2 -0
- package/lib/commonjs/modules/bt-management/services/bt-manager.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/custom/compile-case-fields.js +3 -1
- package/lib/commonjs/modules/bt-management/services/custom/compile-case-fields.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/custom/compile-custom-case.js +2 -0
- package/lib/commonjs/modules/bt-management/services/custom/compile-custom-case.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/custom/compile-custom-field.js +2 -1
- package/lib/commonjs/modules/bt-management/services/custom/compile-custom-field.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/custom/compile-custom-lepu.js +24 -0
- package/lib/commonjs/modules/bt-management/services/custom/compile-custom-lepu.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/custom/compile-custom-monitor.js +8 -1
- package/lib/commonjs/modules/bt-management/services/custom/compile-custom-monitor.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/custom/define-custom-device.js +4 -0
- 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 +10 -2
- 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/bt-connection-handler.js +9 -3
- package/lib/commonjs/modules/bt-management/services/devices/bt-connection-handler.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/devices/bt-data-processor.js +5 -0
- package/lib/commonjs/modules/bt-management/services/devices/bt-data-processor.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/devices/bt-device-information.js +41 -0
- package/lib/commonjs/modules/bt-management/services/devices/bt-device-information.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/devices/bt-managed-device.js +30 -2
- package/lib/commonjs/modules/bt-management/services/devices/bt-managed-device.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/devices/custom/custom-lepu-sequencer.js +6 -1
- package/lib/commonjs/modules/bt-management/services/devices/custom/custom-lepu-sequencer.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/devices/custom/custom.device.js +20 -4
- package/lib/commonjs/modules/bt-management/services/devices/custom/custom.device.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/devices/frame-parser.js +13 -1
- package/lib/commonjs/modules/bt-management/services/devices/frame-parser.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.command-builder.js +6 -3
- package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.command-builder.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.file-transfer.js +12 -3
- 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.identity-gate.js +84 -38
- package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.identity-gate.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.transports.js +11 -1
- package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.transports.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/devices/spo/oxyfit.device.js +18 -0
- package/lib/commonjs/modules/bt-management/services/devices/spo/oxyfit.device.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/devices/standard-gatt/standard-gatt.devices.js +67 -11
- package/lib/commonjs/modules/bt-management/services/devices/standard-gatt/standard-gatt.devices.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/devices/standard-gatt/standard-gatt.profile.js +4 -2
- 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/mysense.device.js +78 -0
- package/lib/commonjs/modules/bt-management/services/devices/uebe/mysense.device.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/devices/uebe/mysense.frame-reader.js +83 -0
- package/lib/commonjs/modules/bt-management/services/devices/uebe/mysense.frame-reader.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/devices/uebe/mysense.sequencer.js +60 -0
- package/lib/commonjs/modules/bt-management/services/devices/uebe/mysense.sequencer.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/devices/viatom/viatom.ecg-files.js +18 -1
- package/lib/commonjs/modules/bt-management/services/devices/viatom/viatom.ecg-files.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/devices/viatom/viatom.ecg-recorders.js +4 -1
- 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.oximeters.js +54 -39
- package/lib/commonjs/modules/bt-management/services/devices/viatom/viatom.oximeters.js.map +1 -1
- package/lib/commonjs/modules/bt-management/types/integrated-devices.js +1 -0
- package/lib/commonjs/modules/bt-management/types/integrated-devices.js.map +1 -1
- package/lib/commonjs/modules/bt-management/utils/create-custom-field-parser.js +3 -0
- package/lib/commonjs/modules/bt-management/utils/create-custom-field-parser.js.map +1 -1
- package/lib/module/modules/auth/sign-in/components/social-logins/apple-login-button.js +2 -2
- 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 +2 -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 +2 -1
- package/lib/module/modules/bt-device/constants/device-instruction-pdfs.js.map +1 -1
- package/lib/module/modules/bt-device/constants/supported-device-catalog-assets.js +3 -1
- package/lib/module/modules/bt-device/constants/supported-device-catalog-assets.js.map +1 -1
- package/lib/module/modules/bt-device/constants/supported-devices.js +60 -18
- package/lib/module/modules/bt-device/constants/supported-devices.js.map +1 -1
- package/lib/module/modules/bt-management/components/bt-provider-child-wrapper.js +13 -2
- 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/constants/measurement-field-catalog.js +88 -0
- package/lib/module/modules/bt-management/constants/measurement-field-catalog.js.map +1 -1
- package/lib/module/modules/bt-management/services/bt-manager.js +2 -0
- package/lib/module/modules/bt-management/services/bt-manager.js.map +1 -1
- package/lib/module/modules/bt-management/services/custom/compile-case-fields.js +3 -1
- package/lib/module/modules/bt-management/services/custom/compile-case-fields.js.map +1 -1
- package/lib/module/modules/bt-management/services/custom/compile-custom-case.js +2 -0
- package/lib/module/modules/bt-management/services/custom/compile-custom-case.js.map +1 -1
- package/lib/module/modules/bt-management/services/custom/compile-custom-field.js +2 -1
- package/lib/module/modules/bt-management/services/custom/compile-custom-field.js.map +1 -1
- package/lib/module/modules/bt-management/services/custom/compile-custom-lepu.js +24 -0
- package/lib/module/modules/bt-management/services/custom/compile-custom-lepu.js.map +1 -1
- package/lib/module/modules/bt-management/services/custom/compile-custom-monitor.js +8 -1
- package/lib/module/modules/bt-management/services/custom/compile-custom-monitor.js.map +1 -1
- package/lib/module/modules/bt-management/services/custom/define-custom-device.js +4 -0
- 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 +10 -2
- 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/bt-connection-handler.js +9 -3
- package/lib/module/modules/bt-management/services/devices/bt-connection-handler.js.map +1 -1
- package/lib/module/modules/bt-management/services/devices/bt-data-processor.js +5 -0
- package/lib/module/modules/bt-management/services/devices/bt-data-processor.js.map +1 -1
- package/lib/module/modules/bt-management/services/devices/bt-device-information.js +37 -0
- package/lib/module/modules/bt-management/services/devices/bt-device-information.js.map +1 -0
- package/lib/module/modules/bt-management/services/devices/bt-managed-device.js +30 -2
- package/lib/module/modules/bt-management/services/devices/bt-managed-device.js.map +1 -1
- package/lib/module/modules/bt-management/services/devices/custom/custom-lepu-sequencer.js +6 -1
- package/lib/module/modules/bt-management/services/devices/custom/custom-lepu-sequencer.js.map +1 -1
- package/lib/module/modules/bt-management/services/devices/custom/custom.device.js +22 -6
- package/lib/module/modules/bt-management/services/devices/custom/custom.device.js.map +1 -1
- package/lib/module/modules/bt-management/services/devices/frame-parser.js +13 -1
- package/lib/module/modules/bt-management/services/devices/frame-parser.js.map +1 -1
- package/lib/module/modules/bt-management/services/devices/lepu/lepu.command-builder.js +6 -3
- package/lib/module/modules/bt-management/services/devices/lepu/lepu.command-builder.js.map +1 -1
- package/lib/module/modules/bt-management/services/devices/lepu/lepu.file-transfer.js +12 -3
- 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.identity-gate.js +84 -38
- package/lib/module/modules/bt-management/services/devices/lepu/lepu.identity-gate.js.map +1 -1
- package/lib/module/modules/bt-management/services/devices/lepu/lepu.transports.js +11 -1
- package/lib/module/modules/bt-management/services/devices/lepu/lepu.transports.js.map +1 -1
- package/lib/module/modules/bt-management/services/devices/spo/oxyfit.device.js +14 -0
- package/lib/module/modules/bt-management/services/devices/spo/oxyfit.device.js.map +1 -0
- package/lib/module/modules/bt-management/services/devices/standard-gatt/standard-gatt.devices.js +67 -11
- package/lib/module/modules/bt-management/services/devices/standard-gatt/standard-gatt.devices.js.map +1 -1
- package/lib/module/modules/bt-management/services/devices/standard-gatt/standard-gatt.profile.js +4 -2
- 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/mysense.device.js +73 -0
- package/lib/module/modules/bt-management/services/devices/uebe/mysense.device.js.map +1 -0
- package/lib/module/modules/bt-management/services/devices/uebe/mysense.frame-reader.js +78 -0
- package/lib/module/modules/bt-management/services/devices/uebe/mysense.frame-reader.js.map +1 -0
- package/lib/module/modules/bt-management/services/devices/uebe/mysense.sequencer.js +55 -0
- package/lib/module/modules/bt-management/services/devices/uebe/mysense.sequencer.js.map +1 -0
- package/lib/module/modules/bt-management/services/devices/viatom/viatom.ecg-files.js +17 -1
- package/lib/module/modules/bt-management/services/devices/viatom/viatom.ecg-files.js.map +1 -1
- package/lib/module/modules/bt-management/services/devices/viatom/viatom.ecg-recorders.js +4 -1
- 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.oximeters.js +54 -39
- 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/bt-management/types/integrated-devices.js +1 -0
- package/lib/module/modules/bt-management/types/integrated-devices.js.map +1 -1
- package/lib/module/modules/bt-management/utils/create-custom-field-parser.js +3 -0
- package/lib/module/modules/bt-management/utils/create-custom-field-parser.js.map +1 -1
- 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.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-device/constants/supported-device-catalog-assets.d.ts +3 -1
- package/lib/typescript/commonjs/src/modules/bt-device/constants/supported-device-catalog-assets.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-device/constants/supported-devices.d.ts +10 -1
- 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/bt-provider-child-wrapper.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/constants/integrated-devices-map.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/constants/measurement-field-catalog.d.ts +4 -0
- package/lib/typescript/commonjs/src/modules/bt-management/constants/measurement-field-catalog.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/bt-manager.d.ts +2 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/bt-manager.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/custom/compile-case-fields.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/custom/compile-custom-case.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/custom/compile-custom-field.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/custom/compile-custom-lepu.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/custom/compile-custom-monitor.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.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bt-connection-handler.d.ts +6 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bt-connection-handler.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bt-data-processor.d.ts +2 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bt-data-processor.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bt-device-information.d.ts +11 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bt-device-information.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bt-managed-device.d.ts +3 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bt-managed-device.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/custom/custom-lepu-sequencer.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/custom/custom.device.d.ts +3 -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/frame-parser.d.ts +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/frame-parser.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.command-builder.d.ts +6 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.command-builder.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.file-transfer.d.ts +4 -0
- 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.identity-gate.d.ts +10 -51
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.identity-gate.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.transports.d.ts +6 -0
- 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/spo/oxyfit.device.d.ts +9 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/spo/oxyfit.device.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.devices.d.ts +2 -3
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.devices.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.profile.d.ts +4 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.profile.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/uebe/mysense.device.d.ts +15 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/uebe/mysense.device.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/uebe/mysense.frame-reader.d.ts +8 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/uebe/mysense.frame-reader.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/uebe/mysense.sequencer.d.ts +17 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/uebe/mysense.sequencer.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/viatom/viatom.ecg-files.d.ts +3 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/viatom/viatom.ecg-files.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/viatom/viatom.ecg-recorders.d.ts +3 -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.oximeters.d.ts +4 -7
- 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/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/command-sequencer.d.ts +2 -0
- package/lib/typescript/commonjs/src/modules/bt-management/types/command-sequencer.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/types/create-device-params.d.ts +2 -0
- package/lib/typescript/commonjs/src/modules/bt-management/types/create-device-params.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/types/custom-device-definition.d.ts +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 +2 -0
- 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-field-encoding.d.ts +2 -1
- package/lib/typescript/commonjs/src/modules/bt-management/types/custom-field-encoding.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/types/custom-lepu-spec.d.ts +8 -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-data.d.ts +2 -0
- package/lib/typescript/commonjs/src/modules/bt-management/types/device-data.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/types/device-measurement-map.d.ts +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/types/device-measurement-map.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/types/integrated-devices.d.ts +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/types/integrated-devices.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/types/parsing-case.d.ts +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/types/parsing-case.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/utils/create-custom-field-parser.d.ts.map +1 -1
- 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.map +1 -1
- package/lib/typescript/module/src/modules/bt-device/constants/supported-device-catalog-assets.d.ts +3 -1
- package/lib/typescript/module/src/modules/bt-device/constants/supported-device-catalog-assets.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-device/constants/supported-devices.d.ts +10 -1
- 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/bt-provider-child-wrapper.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/constants/integrated-devices-map.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/constants/measurement-field-catalog.d.ts +4 -0
- package/lib/typescript/module/src/modules/bt-management/constants/measurement-field-catalog.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/bt-manager.d.ts +2 -0
- package/lib/typescript/module/src/modules/bt-management/services/bt-manager.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/custom/compile-case-fields.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/custom/compile-custom-case.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/custom/compile-custom-field.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/custom/compile-custom-lepu.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/custom/compile-custom-monitor.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.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/devices/bt-connection-handler.d.ts +6 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/bt-connection-handler.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/devices/bt-data-processor.d.ts +2 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/bt-data-processor.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/devices/bt-device-information.d.ts +11 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/bt-device-information.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/bt-managed-device.d.ts +3 -1
- package/lib/typescript/module/src/modules/bt-management/services/devices/bt-managed-device.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/devices/custom/custom-lepu-sequencer.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/devices/custom/custom.device.d.ts +3 -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/frame-parser.d.ts +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/frame-parser.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.command-builder.d.ts +6 -1
- package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.command-builder.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.file-transfer.d.ts +4 -0
- 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.identity-gate.d.ts +10 -51
- package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.identity-gate.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.transports.d.ts +6 -0
- 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/spo/oxyfit.device.d.ts +9 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/spo/oxyfit.device.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.devices.d.ts +2 -3
- package/lib/typescript/module/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.devices.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.profile.d.ts +4 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.profile.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/devices/uebe/mysense.device.d.ts +15 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/uebe/mysense.device.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/uebe/mysense.frame-reader.d.ts +8 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/uebe/mysense.frame-reader.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/uebe/mysense.sequencer.d.ts +17 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/uebe/mysense.sequencer.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/viatom/viatom.ecg-files.d.ts +3 -1
- package/lib/typescript/module/src/modules/bt-management/services/devices/viatom/viatom.ecg-files.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/devices/viatom/viatom.ecg-recorders.d.ts +3 -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.oximeters.d.ts +4 -7
- 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/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/command-sequencer.d.ts +2 -0
- package/lib/typescript/module/src/modules/bt-management/types/command-sequencer.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/types/create-device-params.d.ts +2 -0
- package/lib/typescript/module/src/modules/bt-management/types/create-device-params.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/types/custom-device-definition.d.ts +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 +2 -0
- 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-field-encoding.d.ts +2 -1
- package/lib/typescript/module/src/modules/bt-management/types/custom-field-encoding.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/types/custom-lepu-spec.d.ts +8 -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-data.d.ts +2 -0
- package/lib/typescript/module/src/modules/bt-management/types/device-data.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/types/device-measurement-map.d.ts +1 -0
- package/lib/typescript/module/src/modules/bt-management/types/device-measurement-map.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/types/integrated-devices.d.ts +1 -0
- package/lib/typescript/module/src/modules/bt-management/types/integrated-devices.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/types/parsing-case.d.ts +1 -0
- package/lib/typescript/module/src/modules/bt-management/types/parsing-case.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/utils/create-custom-field-parser.d.ts.map +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.readDeviceInformation = void 0;
|
|
7
|
+
var _sentryLogger = require("../../../helpers/utils/sentry-logger.js");
|
|
8
|
+
const readDeviceInformation = async (device, onDeviceInfo) => {
|
|
9
|
+
const read = device.readCharacteristicForService;
|
|
10
|
+
if (typeof read !== "function") {
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
const info = {};
|
|
14
|
+
const values = [["name", "00001800-0000-1000-8000-00805f9b34fb", "00002a00-0000-1000-8000-00805f9b34fb"], ["manufacturerName", "0000180a-0000-1000-8000-00805f9b34fb", "00002a29-0000-1000-8000-00805f9b34fb"], ["model", "0000180a-0000-1000-8000-00805f9b34fb", "00002a24-0000-1000-8000-00805f9b34fb"], ["serialNumber", "0000180a-0000-1000-8000-00805f9b34fb", "00002a25-0000-1000-8000-00805f9b34fb"]];
|
|
15
|
+
for (const [key, serviceUuid, characteristicUuid] of values) {
|
|
16
|
+
try {
|
|
17
|
+
const characteristic = await read.call(device, serviceUuid, characteristicUuid);
|
|
18
|
+
const value = characteristic?.value;
|
|
19
|
+
if (!value) {
|
|
20
|
+
continue;
|
|
21
|
+
}
|
|
22
|
+
const text = Buffer.from(value, "base64").toString("utf8").replace(/\0+$/, "").trim();
|
|
23
|
+
if (text) {
|
|
24
|
+
info[key] = text;
|
|
25
|
+
}
|
|
26
|
+
} catch (error) {
|
|
27
|
+
// Optional GAP/Device Information characteristics are not present on every device.
|
|
28
|
+
(0, _sentryLogger.sentryLogger)("info", "DEVICE: Optional device information unavailable", {
|
|
29
|
+
deviceId: device.id,
|
|
30
|
+
deviceName: device.name,
|
|
31
|
+
characteristicUuid,
|
|
32
|
+
error: error instanceof Error ? error.message : String(error)
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
if (Object.keys(info).length > 0) {
|
|
37
|
+
onDeviceInfo?.(info);
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
exports.readDeviceInformation = readDeviceInformation;
|
|
41
|
+
//# sourceMappingURL=bt-device-information.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_sentryLogger","require","readDeviceInformation","device","onDeviceInfo","read","readCharacteristicForService","info","values","key","serviceUuid","characteristicUuid","characteristic","call","value","text","Buffer","from","toString","replace","trim","error","sentryLogger","deviceId","id","deviceName","name","Error","message","String","Object","keys","length","exports"],"sourceRoot":"../../../../../../src","sources":["modules/bt-management/services/devices/bt-device-information.ts"],"mappings":";;;;;;AAEA,IAAAA,aAAA,GAAAC,OAAA;AASA,MAAMC,qBAAqB,GAAG,MAAAA,CAC5BC,MAAc,EACdC,YAAkD,KAChC;EAClB,MAAMC,IAAI,GAAGF,MAAM,CAACG,4BAA4B;EAEhD,IAAI,OAAOD,IAAI,KAAK,UAAU,EAAE;IAC9B;EACF;EAEA,MAAME,IAAyB,GAAG,CAAC,CAAC;EAEpC,MAAMC,MAA8D,GAAG,CACrE,CAAC,MAAM,EAAE,sCAAsC,EAAE,sCAAsC,CAAC,EACxF,CAAC,kBAAkB,EAAE,sCAAsC,EAAE,sCAAsC,CAAC,EACpG,CAAC,OAAO,EAAE,sCAAsC,EAAE,sCAAsC,CAAC,EACzF,CAAC,cAAc,EAAE,sCAAsC,EAAE,sCAAsC,CAAC,CACjG;EAED,KAAK,MAAM,CAACC,GAAG,EAAEC,WAAW,EAAEC,kBAAkB,CAAC,IAAIH,MAAM,EAAE;IAC3D,IAAI;MACF,MAAMI,cAAc,GAAG,MAAMP,IAAI,CAACQ,IAAI,CACpCV,MAAM,EACNO,WAAW,EACXC,kBACF,CAAC;MAED,MAAMG,KAAK,GAAGF,cAAc,EAAEE,KAAK;MAEnC,IAAI,CAACA,KAAK,EAAE;QACV;MACF;MAEA,MAAMC,IAAI,GAAGC,MAAM,CAACC,IAAI,CAACH,KAAK,EAAE,QAAQ,CAAC,CACtCI,QAAQ,CAAC,MAAM,CAAC,CAChBC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CACnBC,IAAI,CAAC,CAAC;MAET,IAAIL,IAAI,EAAE;QACRR,IAAI,CAACE,GAAG,CAAC,GAAGM,IAAI;MAClB;IACF,CAAC,CAAC,OAAOM,KAAK,EAAE;MACd;MACA,IAAAC,0BAAY,EAAC,MAAM,EAAE,iDAAiD,EAAE;QACtEC,QAAQ,EAAEpB,MAAM,CAACqB,EAAE;QACnBC,UAAU,EAAEtB,MAAM,CAACuB,IAAI;QACvBf,kBAAkB;QAClBU,KAAK,EAAEA,KAAK,YAAYM,KAAK,GAAGN,KAAK,CAACO,OAAO,GAAGC,MAAM,CAACR,KAAK;MAC9D,CAAC,CAAC;IACJ;EACF;EAEA,IAAIS,MAAM,CAACC,IAAI,CAACxB,IAAI,CAAC,CAACyB,MAAM,GAAG,CAAC,EAAE;IAChC5B,YAAY,GAAGG,IAAI,CAAC;EACtB;AACF,CAAC;AAAC0B,OAAA,CAAA/B,qBAAA,GAAAA,qBAAA","ignoreList":[]}
|
|
@@ -11,7 +11,11 @@ var _supportedMeasurementTypeKeys = require("../../utils/supported-measurement-t
|
|
|
11
11
|
var _btConnectionHandler = require("./bt-connection-handler.js");
|
|
12
12
|
var _btDataProcessor = require("./bt-data-processor.js");
|
|
13
13
|
var _pollingCommandSequencer = require("./polling-command-sequencer.js");
|
|
14
|
+
/* eslint-disable max-lines */
|
|
15
|
+
|
|
14
16
|
class BTManagedDevice {
|
|
17
|
+
resultReportedThisConnection = false;
|
|
18
|
+
|
|
15
19
|
/**
|
|
16
20
|
* The timeout in milliseconds for the stuck data.
|
|
17
21
|
*/
|
|
@@ -63,9 +67,11 @@ class BTManagedDevice {
|
|
|
63
67
|
onError: onErrorCallback,
|
|
64
68
|
onDeviceStatusChanged: onDeviceStatusChangedCallback,
|
|
65
69
|
onResult: onResultCallback,
|
|
66
|
-
onDeviceDisconnected: onDeviceDisconnectedCallback
|
|
70
|
+
onDeviceDisconnected: onDeviceDisconnectedCallback,
|
|
71
|
+
oneReadingPerConnection
|
|
67
72
|
}) {
|
|
68
73
|
this.device = device;
|
|
74
|
+
this.oneReadingPerConnection = oneReadingPerConnection === true;
|
|
69
75
|
(0, _sentryLogger.sentryLogger)("info", "BT_MANAGER: Creating BTManagedDevice", {
|
|
70
76
|
deviceId: device.id,
|
|
71
77
|
deviceName: deviceName
|
|
@@ -108,6 +114,10 @@ class BTManagedDevice {
|
|
|
108
114
|
caseType: _,
|
|
109
115
|
...data
|
|
110
116
|
}) => {
|
|
117
|
+
if (this.oneReadingPerConnection && this.resultReportedThisConnection) {
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
120
|
+
this.resultReportedThisConnection = true;
|
|
111
121
|
(0, _sentryLogger.sentryLogger)("info", "BT_MANAGER: Calling onResult callback", {
|
|
112
122
|
data: (0, _summariseMeasurementForLog.summariseMeasurementForLog)(data),
|
|
113
123
|
deviceData: this.deviceData,
|
|
@@ -132,6 +142,8 @@ class BTManagedDevice {
|
|
|
132
142
|
this.onResult = undefined;
|
|
133
143
|
};
|
|
134
144
|
connect = async () => {
|
|
145
|
+
this.resultReportedThisConnection = false;
|
|
146
|
+
|
|
135
147
|
// To access the abstract property in the constructor, we need to set it here
|
|
136
148
|
this.deviceData.measurementTypes = (0, _supportedMeasurementTypeKeys.supportedMeasurementTypeKeys)(this.mainServices);
|
|
137
149
|
const sequencer = this.createCommandSequencer?.() ?? (0, _pollingCommandSequencer.pollingSequencerFor)(this.mainServices);
|
|
@@ -147,7 +159,23 @@ class BTManagedDevice {
|
|
|
147
159
|
onDataReceived: (uuid, hexValue) => {
|
|
148
160
|
this.dataProcessor?.processData(uuid, hexValue);
|
|
149
161
|
},
|
|
150
|
-
|
|
162
|
+
onDeviceInfo: info => {
|
|
163
|
+
if (info.name) {
|
|
164
|
+
this.deviceData.localName = info.name;
|
|
165
|
+
}
|
|
166
|
+
if (info.manufacturerName) {
|
|
167
|
+
this.deviceData.manufacturerName = info.manufacturerName;
|
|
168
|
+
}
|
|
169
|
+
if (info.model) {
|
|
170
|
+
this.deviceData.model = info.model;
|
|
171
|
+
}
|
|
172
|
+
if (info.serialNumber) {
|
|
173
|
+
this.deviceData.sn = info.serialNumber;
|
|
174
|
+
}
|
|
175
|
+
},
|
|
176
|
+
initialCommands: () => sequencer.initialCommands(),
|
|
177
|
+
onCommandSent: () => this.dataProcessor?.armStuckTimeout(),
|
|
178
|
+
isNormalDisconnect: () => sequencer.isNormalDisconnect?.() ?? false
|
|
151
179
|
}, this.preferredMtu);
|
|
152
180
|
this.dataProcessor = new _btDataProcessor.BTDataProcessor(this.device, this.mainServices, this.stuckDataTimeout, {
|
|
153
181
|
onStatusChanged: this.onDeviceStatusChanged?.bind(this),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_sentryLogger","require","_deviceStatus","_summariseMeasurementForLog","_supportedMeasurementTypeKeys","_btConnectionHandler","_btDataProcessor","_pollingCommandSequencer","BTManagedDevice","constructor","device","deviceName","onError","onErrorCallback","onDeviceStatusChanged","onDeviceStatusChangedCallback","onResult","onResultCallback","onDeviceDisconnected","onDeviceDisconnectedCallback","sentryLogger","deviceId","id","deviceData","name","localName","manufacturerData","sn","measurementTypes","status","measurementTypeKey","error","Error","message","caseType","_","data","summariseMeasurementForLog","destroy","connectionHandler","dataProcessor","undefined","connect","supportedMeasurementTypeKeys","mainServices","sequencer","createCommandSequencer","pollingSequencerFor","BTConnectionHandler","onStatusChanged","bind","DeviceStatus","DISCONNECTED","onDataReceived","uuid","hexValue","processData","initialCommands","preferredMtu","BTDataProcessor","stuckDataTimeout","onStreamStart","validatePackage","parsedData","collectedValues","handleSuccessResult","nextCommand","frame","sendCommands","commands","handleDependentResult","frameReader","exports"],"sourceRoot":"../../../../../../src","sources":["modules/bt-management/services/devices/bt-managed-device.ts"],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"names":["_sentryLogger","require","_deviceStatus","_summariseMeasurementForLog","_supportedMeasurementTypeKeys","_btConnectionHandler","_btDataProcessor","_pollingCommandSequencer","BTManagedDevice","resultReportedThisConnection","constructor","device","deviceName","onError","onErrorCallback","onDeviceStatusChanged","onDeviceStatusChangedCallback","onResult","onResultCallback","onDeviceDisconnected","onDeviceDisconnectedCallback","oneReadingPerConnection","sentryLogger","deviceId","id","deviceData","name","localName","manufacturerData","sn","measurementTypes","status","measurementTypeKey","error","Error","message","caseType","_","data","summariseMeasurementForLog","destroy","connectionHandler","dataProcessor","undefined","connect","supportedMeasurementTypeKeys","mainServices","sequencer","createCommandSequencer","pollingSequencerFor","BTConnectionHandler","onStatusChanged","bind","DeviceStatus","DISCONNECTED","onDataReceived","uuid","hexValue","processData","onDeviceInfo","info","manufacturerName","model","serialNumber","initialCommands","onCommandSent","armStuckTimeout","isNormalDisconnect","preferredMtu","BTDataProcessor","stuckDataTimeout","onStreamStart","validatePackage","parsedData","collectedValues","handleSuccessResult","nextCommand","frame","sendCommands","commands","handleDependentResult","frameReader","exports"],"sourceRoot":"../../../../../../src","sources":["modules/bt-management/services/devices/bt-managed-device.ts"],"mappings":";;;;;;AAKA,IAAAA,aAAA,GAAAC,OAAA;AAOA,IAAAC,aAAA,GAAAD,OAAA;AAMA,IAAAE,2BAAA,GAAAF,OAAA;AACA,IAAAG,6BAAA,GAAAH,OAAA;AAEA,IAAAI,oBAAA,GAAAJ,OAAA;AACA,IAAAK,gBAAA,GAAAL,OAAA;AACA,IAAAM,wBAAA,GAAAN,OAAA;AAvBA;;AAyBO,MAAeO,eAAe,CAErC;EAQUC,4BAA4B,GAAG,KAAK;;EAG5C;AACF;AACA;;EAGE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;;EAOE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;EAGE;AACF;AACA;AACA;AACA;AACA;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MACpDC,YAAY,EAAGC,QAAQ,IACrB,KAAK,IAAI,CAACtC,iBAAiB,EAAEqC,YAAY,CAACC,QAAQ,CAAC;MACrDlE,OAAO,EAAE,IAAI,CAACA,OAAO,EAAEuC,IAAI,CAAC,IAAI,CAAC;MACjC4B,qBAAqB,EAAE,IAAI,CAACA,qBAAqB,EAAE5B,IAAI,CAAC,IAAI;IAC9D,CAAC,EACD,IAAI,CAAC6B,WACP,CAAC;IAED,MAAM,IAAI,CAACxC,iBAAiB,CAACG,OAAO,CAAC,CAAC;EACxC,CAAC;AACH;AAACsC,OAAA,CAAA1E,eAAA,GAAAA,eAAA","ignoreList":[]}
|
|
@@ -43,7 +43,12 @@ const createLepuSequencer = (lepu, report) => new _lepuIdentityGate.LepuIdentity
|
|
|
43
43
|
serviceUuid: lepu.write.serviceUuid,
|
|
44
44
|
characteristicUuid: lepu.write.characteristicUuid
|
|
45
45
|
},
|
|
46
|
-
builder: new _lepuCommandBuilder.LepuCommandBuilder(lepu.startBytes[0] ?? DEFAULT_START_BYTE
|
|
46
|
+
builder: new _lepuCommandBuilder.LepuCommandBuilder(lepu.requestStartByte ?? lepu.startBytes[0] ?? DEFAULT_START_BYTE, {
|
|
47
|
+
fixedSequence: lepu.protocol === "viatom-oxygen"
|
|
48
|
+
}),
|
|
49
|
+
protocol: lepu.protocol,
|
|
50
|
+
writeWithoutResponse: lepu.writeWithoutResponse,
|
|
51
|
+
setClockBeforeInfo: lepu.setClockBeforeInfo,
|
|
47
52
|
expectedDeviceTypes: lepu.expectedDeviceTypes,
|
|
48
53
|
...(lepu.pollCommand === undefined ? {} : {
|
|
49
54
|
pollCommand: lepu.pollCommand
|
package/lib/commonjs/modules/bt-management/services/devices/custom/custom-lepu-sequencer.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_sentryLogger","require","_lepuCommandBuilder","_lepuIdentityGate","DEFAULT_START_BYTE","recordLepuIdentity","deviceData","info","sn","serialNumber","sentryLogger","deviceId","id","deviceName","name","deviceType","branchCode","protocolMaxLength","exports","createLepuSequencer","lepu","report","LepuIdentityGate","write","serviceUuid","characteristicUuid","builder","LepuCommandBuilder","startBytes","expectedDeviceTypes","pollCommand","undefined","onIdentified","onRefused"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/custom/custom-lepu-sequencer.ts"],"mappings":";;;;;;AAAA,IAAAA,aAAA,GAAAC,OAAA;AAIA,IAAAC,mBAAA,GAAAD,OAAA;AAEA,IAAAE,iBAAA,GAAAF,OAAA;AAEA;AACA,MAAMG,kBAAkB,GAAG,IAAI;AAO/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,kBAAkB,GAAGA,CACzBC,UAAsB,EACtBC,IAAoB,KACX;EACTD,UAAU,CAACE,EAAE,GAAGD,IAAI,CAACE,YAAY;EAEjC,IAAAC,0BAAY,EAAC,MAAM,EAAE,sCAAsC,EAAE;IAC3DC,QAAQ,EAAEL,UAAU,CAACM,EAAE;IACvBC,UAAU,EAAEP,UAAU,CAACQ,IAAI;IAC3BC,UAAU,EAAER,IAAI,CAACQ,UAAU;IAC3BC,UAAU,EAAET,IAAI,CAACS,UAAU;IAC3BC,iBAAiB,EAAEV,IAAI,CAACU;EAC1B,CAAC,CAAC;AACJ,CAAC;AAACC,OAAA,CAAAb,kBAAA,GAAAA,kBAAA;AAEF,MAAMc,mBAAmB,GAAGA,CAC1BC,IAAoB,EACpBC,MAAsB,KAEtB,IAAIC,kCAAgB,CAAC;EACnBC,KAAK,EAAE;IACLC,WAAW,EAAEJ,IAAI,CAACG,KAAK,CAACC,WAAW;IACnCC,kBAAkB,EAAEL,IAAI,CAACG,KAAK,CAACE;EACjC,CAAC;EACDC,OAAO,EAAE,IAAIC,sCAAkB,CAACP,IAAI,CAACQ,UAAU,CAAC,CAAC,CAAC,
|
|
1
|
+
{"version":3,"names":["_sentryLogger","require","_lepuCommandBuilder","_lepuIdentityGate","DEFAULT_START_BYTE","recordLepuIdentity","deviceData","info","sn","serialNumber","sentryLogger","deviceId","id","deviceName","name","deviceType","branchCode","protocolMaxLength","exports","createLepuSequencer","lepu","report","LepuIdentityGate","write","serviceUuid","characteristicUuid","builder","LepuCommandBuilder","requestStartByte","startBytes","fixedSequence","protocol","writeWithoutResponse","setClockBeforeInfo","expectedDeviceTypes","pollCommand","undefined","onIdentified","onRefused"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/custom/custom-lepu-sequencer.ts"],"mappings":";;;;;;AAAA,IAAAA,aAAA,GAAAC,OAAA;AAIA,IAAAC,mBAAA,GAAAD,OAAA;AAEA,IAAAE,iBAAA,GAAAF,OAAA;AAEA;AACA,MAAMG,kBAAkB,GAAG,IAAI;AAO/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,kBAAkB,GAAGA,CACzBC,UAAsB,EACtBC,IAAoB,KACX;EACTD,UAAU,CAACE,EAAE,GAAGD,IAAI,CAACE,YAAY;EAEjC,IAAAC,0BAAY,EAAC,MAAM,EAAE,sCAAsC,EAAE;IAC3DC,QAAQ,EAAEL,UAAU,CAACM,EAAE;IACvBC,UAAU,EAAEP,UAAU,CAACQ,IAAI;IAC3BC,UAAU,EAAER,IAAI,CAACQ,UAAU;IAC3BC,UAAU,EAAET,IAAI,CAACS,UAAU;IAC3BC,iBAAiB,EAAEV,IAAI,CAACU;EAC1B,CAAC,CAAC;AACJ,CAAC;AAACC,OAAA,CAAAb,kBAAA,GAAAA,kBAAA;AAEF,MAAMc,mBAAmB,GAAGA,CAC1BC,IAAoB,EACpBC,MAAsB,KAEtB,IAAIC,kCAAgB,CAAC;EACnBC,KAAK,EAAE;IACLC,WAAW,EAAEJ,IAAI,CAACG,KAAK,CAACC,WAAW;IACnCC,kBAAkB,EAAEL,IAAI,CAACG,KAAK,CAACE;EACjC,CAAC;EACDC,OAAO,EAAE,IAAIC,sCAAkB,CAACP,IAAI,CAACQ,gBAAgB,IAAIR,IAAI,CAACS,UAAU,CAAC,CAAC,CAAC,IAAIzB,kBAAkB,EAAE;IACjG0B,aAAa,EAAEV,IAAI,CAACW,QAAQ,KAAK;EACnC,CAAC,CAAC;EACFA,QAAQ,EAAEX,IAAI,CAACW,QAAQ;EACvBC,oBAAoB,EAAEZ,IAAI,CAACY,oBAAoB;EAC/CC,kBAAkB,EAAEb,IAAI,CAACa,kBAAkB;EAC3CC,mBAAmB,EAAEd,IAAI,CAACc,mBAAmB;EAC7C,IAAId,IAAI,CAACe,WAAW,KAAKC,SAAS,GAAG,CAAC,CAAC,GAAG;IAAED,WAAW,EAAEf,IAAI,CAACe;EAAY,CAAC,CAAC;EAC5EE,YAAY,EAAEhB,MAAM,CAACgB,YAAY;EACjCC,SAAS,EAAEjB,MAAM,CAACiB;AACpB,CAAC,CAAC;AAACpB,OAAA,CAAAC,mBAAA,GAAAA,mBAAA","ignoreList":[]}
|
|
@@ -29,8 +29,12 @@ var _customLepuSequencer = require("./custom-lepu-sequencer.js");
|
|
|
29
29
|
class CustomDevice extends _btManagedDevice.BTManagedDevice {
|
|
30
30
|
validators = new Map();
|
|
31
31
|
constructor(device, params, definition) {
|
|
32
|
-
super(device,
|
|
32
|
+
super(device, {
|
|
33
|
+
...params,
|
|
34
|
+
oneReadingPerConnection: params.oneReadingPerConnection ?? definition.oneReadingPerConnection
|
|
35
|
+
});
|
|
33
36
|
this.definition = definition;
|
|
37
|
+
this.deliveredEcgFileNames = new Set(params.deliveredEcgFileNames ?? []);
|
|
34
38
|
this.mainServices = definition.mainServices;
|
|
35
39
|
this.stuckDataTimeout = definition.stuckDataTimeout;
|
|
36
40
|
if (definition.preferredMtu !== undefined) {
|
|
@@ -64,6 +68,12 @@ class CustomDevice extends _btManagedDevice.BTManagedDevice {
|
|
|
64
68
|
},
|
|
65
69
|
builder: new _lepuCommandBuilder.LepuCommandBuilder(lepu.startBytes[0] ?? "a5"),
|
|
66
70
|
onFile: this.reportViatomEcgFile,
|
|
71
|
+
skipFiles: this.deliveredEcgFileNames,
|
|
72
|
+
afterTransfer: lepu.pollCommand ? () => [{
|
|
73
|
+
serviceUuid: lepu.write.serviceUuid,
|
|
74
|
+
characteristicUuid: lepu.write.characteristicUuid,
|
|
75
|
+
frame: new _lepuCommandBuilder.LepuCommandBuilder(lepu.startBytes[0] ?? "a5").build(lepu.pollCommand)
|
|
76
|
+
}] : undefined,
|
|
67
77
|
onError: reason => this.onError?.(new Error(`Viatom ECG: ${reason}`))
|
|
68
78
|
});
|
|
69
79
|
}
|
|
@@ -82,9 +92,10 @@ class CustomDevice extends _btManagedDevice.BTManagedDevice {
|
|
|
82
92
|
this.onResult?.({
|
|
83
93
|
measurementTypeKey: _core.MeasurementTypeKey.ecg,
|
|
84
94
|
caseType: _caseType.CaseType.RESULT,
|
|
85
|
-
diagnosticResult: _core.EcgDiagnosticFlag.REGULAR,
|
|
86
95
|
diagramPoints: decoded.samples,
|
|
87
|
-
duration: decoded.duration
|
|
96
|
+
duration: decoded.duration,
|
|
97
|
+
recordedAt: (0, _viatomEcgFiles.recordedAtFromViatomFileName)(file.name),
|
|
98
|
+
recordingId: file.name
|
|
88
99
|
});
|
|
89
100
|
};
|
|
90
101
|
onIdentified = info => (0, _customLepuSequencer.recordLepuIdentity)(this.deviceData, info);
|
|
@@ -106,7 +117,9 @@ class CustomDevice extends _btManagedDevice.BTManagedDevice {
|
|
|
106
117
|
*/
|
|
107
118
|
handleDependentResult = data => {
|
|
108
119
|
try {
|
|
109
|
-
this.
|
|
120
|
+
if (this.shouldReportDependentResult(data)) {
|
|
121
|
+
this.reportFrame(data);
|
|
122
|
+
}
|
|
110
123
|
} catch (error) {
|
|
111
124
|
this.onError?.(error);
|
|
112
125
|
}
|
|
@@ -119,6 +132,9 @@ class CustomDevice extends _btManagedDevice.BTManagedDevice {
|
|
|
119
132
|
};
|
|
120
133
|
};
|
|
121
134
|
|
|
135
|
+
/** Lets a stateful protocol suppress a duplicate result while still answering its frame. */
|
|
136
|
+
shouldReportDependentResult = _data => true;
|
|
137
|
+
|
|
122
138
|
/**
|
|
123
139
|
* Stream frames reach this while the device is measuring. They carry no fields, and the
|
|
124
140
|
* readings themselves are reported from handleDependentResult, so there is nothing to do.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_core","require","_caseType","_createFrameValidator","_parseMeasurement","_rejectCustomReading","_btManagedDevice","_lepuCommandBuilder","_lepuFileTransfer","_lepuFrameReader","_viatomEcgFiles","_customLepuSequencer","CustomDevice","BTManagedDevice","validators","Map","constructor","device","params","definition","mainServices","stuckDataTimeout","preferredMtu","undefined","declareLepuProtocol","frames","forEach","frame","uuid","set","createFrameValidator","lepu","frameReader","LepuFrameReader","startBytes","createCommandSequencer","fileTransfer","LepuFileTransfer","write","serviceUuid","characteristicUuid","builder","LepuCommandBuilder","onFile","reportViatomEcgFile","onError","reason","Error","createLepuSequencer","onIdentified","onRefused","onIdentityRefused","file","decoded","decodeViatomEcgRecording","content","samples","length","name","onResult","measurementTypeKey","MeasurementTypeKey","ecg","caseType","CaseType","RESULT","
|
|
1
|
+
{"version":3,"names":["_core","require","_caseType","_createFrameValidator","_parseMeasurement","_rejectCustomReading","_btManagedDevice","_lepuCommandBuilder","_lepuFileTransfer","_lepuFrameReader","_viatomEcgFiles","_customLepuSequencer","CustomDevice","BTManagedDevice","validators","Map","constructor","device","params","definition","oneReadingPerConnection","deliveredEcgFileNames","Set","mainServices","stuckDataTimeout","preferredMtu","undefined","declareLepuProtocol","frames","forEach","frame","uuid","set","createFrameValidator","lepu","frameReader","LepuFrameReader","startBytes","createCommandSequencer","fileTransfer","LepuFileTransfer","write","serviceUuid","characteristicUuid","builder","LepuCommandBuilder","onFile","reportViatomEcgFile","skipFiles","afterTransfer","pollCommand","build","onError","reason","Error","createLepuSequencer","onIdentified","onRefused","onIdentityRefused","file","decoded","decodeViatomEcgRecording","content","samples","length","name","onResult","measurementTypeKey","MeasurementTypeKey","ecg","caseType","CaseType","RESULT","diagramPoints","duration","recordedAt","recordedAtFromViatomFileName","recordingId","info","recordLepuIdentity","deviceData","id","validatePackage","pkg","validate","get","String","toLowerCase","handleDependentResult","data","shouldReportDependentResult","reportFrame","error","parsingCase","OTHER","_data","handleSuccessResult","repeated","repeatedRecords","report","parsedData","records","Math","floor","from","recordBytes","record","parseMeasurement","measurements","discard","measurement","reportMeasurement","discardedReadingError","reading","fieldNames","rejection","map","rejectCustomReading","fields","find","message","exports"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/custom/custom.device.ts"],"mappings":";;;;;;AACA,IAAAA,KAAA,GAAAC,OAAA;AAGA,IAAAC,SAAA,GAAAD,OAAA;AAUA,IAAAE,qBAAA,GAAAF,OAAA;AACA,IAAAG,iBAAA,GAAAH,OAAA;AACA,IAAAI,oBAAA,GAAAJ,OAAA;AAIA,IAAAK,gBAAA,GAAAL,OAAA;AACA,IAAAM,mBAAA,GAAAN,OAAA;AAEA,IAAAO,iBAAA,GAAAP,OAAA;AACA,IAAAQ,gBAAA,GAAAR,OAAA;AACA,IAAAS,eAAA,GAAAT,OAAA;AAKA,IAAAU,oBAAA,GAAAV,OAAA;AA9BA;;AAsCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMW,YAAY,SAASC,gCAAe,CAAiB;EAO/CC,UAAU,GAAG,IAAIC,GAAG,CAAqC,CAAC;EAE3EC,WAAWA,CACTC,MAAc,EACdC,MAA0C,EAC1CC,UAAkC,EAClC;IACA,KAAK,CAACF,MAAM,EAAE;MACZ,GAAGC,MAAM;MACTE,uBAAuB,EACrBF,MAAM,CAACE,uBAAuB,IAAID,UAAU,CAACC;IACjD,CAAC,CAAC;IAEF,IAAI,CAACD,UAAU,GAAGA,UAAU;IAC5B,IAAI,CAACE,qBAAqB,GAAG,IAAIC,GAAG,CAACJ,MAAM,CAACG,qBAAqB,IAAI,EAAE,CAAC;IACxE,IA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AACI,UAAU,CAACrF,OAAO,CAAEoC,IAAI,IAAK;MACvCgD,OAAO,CAAChD,IAAI,CAAC,GAAGmC,UAAU,CAACnC,IAAI,CAAC;IAClC,CAAC,CAAC;IAEF,MAAMkD,SAAS,GAAGL,WAAW,CAACI,UAAU,CACrCE,GAAG,CAAEnD,IAAI,IACR,IAAAoD,wCAAmB,EACjB,IAAI,CAAClG,UAAU,CAACmG,MAAM,EACtBR,WAAW,CAAC3C,kBAAkB,EAC9BF,IAAI,EACJgD,OAAO,CAAChD,IAAI,CACd,CACF,CAAC,CACAsD,IAAI,CAAEC,OAAO,IAAKA,OAAO,KAAK9F,SAAS,CAAC;IAE3C,IAAIyF,SAAS,EAAE;MACb,IAAI,CAACN,OAAO,CAACM,SAAS,EAAEF,OAAO,CAAC;MAEhC;IACF;IAEA,IAAI,CAAC/C,QAAQ,GAAG+C,OAAO,CAAC;EAC1B;AAEF;AAACQ,OAAA,CAAA7G,YAAA,GAAAA,YAAA","ignoreList":[]}
|
|
@@ -23,7 +23,7 @@ class FrameParser {
|
|
|
23
23
|
return;
|
|
24
24
|
}
|
|
25
25
|
const caseValue = this.readCaseValue(parsingModel, frame);
|
|
26
|
-
const parsingCase = parsingModel.cases?.find(declared => declared.caseValue === caseValue);
|
|
26
|
+
const parsingCase = parsingModel.cases?.find(declared => frame.length >= (declared.minLengthBytes ?? 0) && (declared.caseValue === "*" || this.matchesSelector(declared.caseValue, caseValue)));
|
|
27
27
|
if (!parsingCase) {
|
|
28
28
|
return;
|
|
29
29
|
}
|
|
@@ -47,6 +47,18 @@ class FrameParser {
|
|
|
47
47
|
}
|
|
48
48
|
return undefined;
|
|
49
49
|
}
|
|
50
|
+
matchesSelector(pattern, value) {
|
|
51
|
+
if (pattern.length !== value.length) {
|
|
52
|
+
return false;
|
|
53
|
+
}
|
|
54
|
+
for (let index = 0; index < pattern.length; index++) {
|
|
55
|
+
const expected = pattern[index];
|
|
56
|
+
if (expected !== "?" && expected !== value[index]) {
|
|
57
|
+
return false;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
return true;
|
|
61
|
+
}
|
|
50
62
|
readCaseValue(parsingModel, frame) {
|
|
51
63
|
return parsingModel.caseValuePosition?.map(index => frame[index]).join("") || "";
|
|
52
64
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_parseMeasurement","require","FrameParser","constructor","mainServices","parse","uuid","frame","parsingModel","findParsingModel","caseValue","readCaseValue","parsingCase","cases","find","declared","parsedData","parseMeasurement","measurementTypeKey","mainService","characteristic","monitorUuids","monitored","toLowerCase","undefined","
|
|
1
|
+
{"version":3,"names":["_parseMeasurement","require","FrameParser","constructor","mainServices","parse","uuid","frame","parsingModel","findParsingModel","caseValue","readCaseValue","parsingCase","cases","find","declared","length","minLengthBytes","matchesSelector","parsedData","parseMeasurement","measurementTypeKey","mainService","characteristic","monitorUuids","monitored","toLowerCase","undefined","pattern","value","index","expected","caseValuePosition","map","join","exports"],"sourceRoot":"../../../../../../src","sources":["modules/bt-management/services/devices/frame-parser.ts"],"mappings":";;;;;;AAMA,IAAAA,iBAAA,GAAAC,OAAA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMC,WAAW,CAAwB;EAC9CC,WAAWA,CAAkBC,YAA2C,EAAE;IAAA,KAA7CA,YAA2C,GAA3CA,YAA2C;EAAG;EAEpEC,KAAKA,CACVC,IAAY,EACZC,KAAe,EAC8B;IAC7C,MAAMC,YAAY,GAAG,IAAI,CAACC,gBAAgB,CAACH,IAAI,CAAC;IAEhD,IAAI,CAACE,YAAY,EAAE;MACjB;IACF;IAEA,MAAME,SAAS,GAAG,IAAI,CAACC,aAAa,CAACH,YAAY,EAAED,KAAK,CAAC;IAEzD,MAAMK,WAAW,GAAGJ,YAAY,CAACK,KAAK,EAAEC,IAAI,CACzCC,QAAQ,IACPR,KAAK,CAACS,MAAM,KAAKD,QAAQ,CAACE,cAAc,IAAI,CAAC,CAAC,KAC7CF,QAAQ,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iB,EAAEC,GAAG,CAAEH,KAAK,IAAKvB,KAAK,CAACuB,KAAK,CAAC,CAAC,CAACI,IAAI,CAAC,EAAE,CAAC,IACrE,EAAE;EAEN;AACF;AAACC,OAAA,CAAAjC,WAAA,GAAAA,WAAA","ignoreList":[]}
|
|
@@ -31,13 +31,16 @@ const toHex = byte => (byte & BYTE_MASK).toString(16).padStart(2, "0");
|
|
|
31
31
|
*/
|
|
32
32
|
class LepuCommandBuilder {
|
|
33
33
|
sequenceNumber = 0;
|
|
34
|
-
constructor(startByte = "a5") {
|
|
34
|
+
constructor(startByte = "a5", options = {}) {
|
|
35
35
|
this.startByte = startByte;
|
|
36
|
+
this.options = options;
|
|
36
37
|
}
|
|
37
38
|
build(command, payload = []) {
|
|
38
|
-
const header = [this.startByte, toHex(command), toHex(~command), toHex(REQUEST_TYPE), toHex(this.sequenceNumber), toHex(payload.length), toHex(Math.floor(payload.length / BYTE_VALUES))];
|
|
39
|
+
const header = [this.startByte, toHex(command), toHex(~command), toHex(REQUEST_TYPE), toHex(this.options.fixedSequence ? 0 : this.sequenceNumber), toHex(payload.length), toHex(Math.floor(payload.length / BYTE_VALUES))];
|
|
39
40
|
const frame = [...header, ...payload.map(toHex)];
|
|
40
|
-
this.
|
|
41
|
+
if (!this.options.fixedSequence) {
|
|
42
|
+
this.advanceSequence();
|
|
43
|
+
}
|
|
41
44
|
return [...frame, toHex((0, _calculateCrc.calculateCrc8)(frame, frame.length))];
|
|
42
45
|
}
|
|
43
46
|
advanceSequence() {
|
package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.command-builder.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_calculateCrc","require","REQUEST_TYPE","BYTE_MASK","BYTE_VALUES","MAX_SEQUENCE_NUMBER","toHex","byte","toString","padStart","LepuCommandBuilder","sequenceNumber","constructor","startByte","build","command","payload","header","length","Math","floor","frame","map","advanceSequence","calculateCrc8","exports"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/lepu/lepu.command-builder.ts"],"mappings":";;;;;;AAAA,IAAAA,aAAA,GAAAC,OAAA;AAEA,MAAMC,YAAY,GAAG,IAAI;AACzB,MAAMC,SAAS,GAAG,IAAI;AACtB,MAAMC,WAAW,GAAG,KAAK;;AAEzB;AACA,MAAMC,mBAAmB,GAAG,GAAG;
|
|
1
|
+
{"version":3,"names":["_calculateCrc","require","REQUEST_TYPE","BYTE_MASK","BYTE_VALUES","MAX_SEQUENCE_NUMBER","toHex","byte","toString","padStart","LepuCommandBuilder","sequenceNumber","constructor","startByte","options","build","command","payload","header","fixedSequence","length","Math","floor","frame","map","advanceSequence","calculateCrc8","exports"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/lepu/lepu.command-builder.ts"],"mappings":";;;;;;AAAA,IAAAA,aAAA,GAAAC,OAAA;AAEA,MAAMC,YAAY,GAAG,IAAI;AACzB,MAAMC,SAAS,GAAG,IAAI;AACtB,MAAMC,WAAW,GAAG,KAAK;;AAEzB;AACA,MAAMC,mBAAmB,GAAG,GAAG;AAM/B,MAAMC,KAAK,GAAIC,IAAY,IACzB,CAACA,IAAI,GAAGJ,SAAS,EAAEK,QAAQ,CAAC,EAAE,CAAC,CAACC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC;;AAElD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMC,kBAAkB,CAAC;EACtBC,cAAc,GAAG,CAAC;EAEnBC,WAAWA,CACCC,SAAiB,GAAG,IAAI,EACxBC,OAAkC,GAAG,CAAC,CAAC,EACxD;IAAA,KAFiBD,SAAiB,GAAjBA,SAAiB;IAAA,KACjBC,OAAkC,GAAlCA,OAAkC;EAClD;EAEIC,KAAKA,CAACC,OAAe,EAAEC,OAA0B,GAAG,EAAE,EAAY;IACvE,MAAMC,MAAM,GAAG,CACb,IAAI,CAACL,SAAS,EACdP,KAAK,CAACU,OAAO,CAAC,EACdV,KAAK,CAAC,CAACU,OAAO,CAAC,EACfV,KAAK,CAACJ,YAAY,CAAC,EACnBI,KAAK,CAAC,IAAI,CAACQ,OAAO,CAACK,aAAa,GAAG,CAAC,GAAG,IAAI,CAACR,cAAc,CAAC,EAC3DL,KAAK,CAACW,OAAO,CAACG,MAAM,CAAC,EACrBd,KAAK,CAACe,IAAI,CAACC,KAAK,CAACL,OAAO,CAACG,MAAM,GAAGhB,WAAW,CAAC,CAAC,CAChD;IAED,MAAMmB,KAAK,GAAG,CAAC,GAAGL,MAAM,EAAE,GAAGD,OAAO,CAACO,GAAG,CAAClB,KAAK,CAAC,CAAC;IAEhD,IAAI,CAAC,IAAI,CAACQ,OAAO,CAACK,aAAa,EAAE;MAC/B,IAAI,CAACM,eAAe,CAAC,CAAC;IACxB;IAEA,OAAO,CAAC,GAAGF,KAAK,EAAEjB,KAAK,CAAC,IAAAoB,2BAAa,EAACH,KAAK,EAAEA,KAAK,CAACH,MAAM,CAAC,CAAC,CAAC;EAC9D;EAEQK,eAAeA,CAAA,EAAS;IAC9B,IAAI,CAACd,cAAc,GACjB,IAAI,CAACA,cAAc,IAAIN,mBAAmB,GAAG,CAAC,GAAG,IAAI,CAACM,cAAc,GAAG,CAAC;EAC5E;AACF;AAACgB,OAAA,CAAAjB,kBAAA,GAAAA,kBAAA","ignoreList":[]}
|
|
@@ -10,6 +10,8 @@ var _lepuCommands = require("./lepu.commands.js");
|
|
|
10
10
|
var _lepuFileNames = require("./lepu.file-names.js");
|
|
11
11
|
var _lepuFrame = require("./lepu.frame.js");
|
|
12
12
|
var _lepuResponseType = require("./lepu.response-type.js");
|
|
13
|
+
/* eslint-disable max-lines */
|
|
14
|
+
|
|
13
15
|
const FILE_SIZE_OFFSET = 0;
|
|
14
16
|
|
|
15
17
|
/**
|
|
@@ -50,7 +52,10 @@ class LepuFileTransfer {
|
|
|
50
52
|
initialCommands = () => [this.commandFor(_lepuCommands.LepuCommand.GET_FILE_LIST)];
|
|
51
53
|
nextCommand = frame => {
|
|
52
54
|
const command = (0, _lepuFrame.lepuCommandOf)(frame);
|
|
53
|
-
if (this.isDone
|
|
55
|
+
if (this.isDone) {
|
|
56
|
+
return this.params.afterTransfer?.();
|
|
57
|
+
}
|
|
58
|
+
if (!TRANSFER_COMMANDS.includes(command)) {
|
|
54
59
|
return undefined;
|
|
55
60
|
}
|
|
56
61
|
if (!(0, _lepuResponseType.isLepuSuccess)(frame)) {
|
|
@@ -70,10 +75,14 @@ class LepuFileTransfer {
|
|
|
70
75
|
return this.closedFile();
|
|
71
76
|
};
|
|
72
77
|
openNextFile = () => {
|
|
73
|
-
|
|
78
|
+
let name = this.files[this.fileIndex];
|
|
79
|
+
while (name !== undefined && this.params.skipFiles?.has(name)) {
|
|
80
|
+
this.fileIndex++;
|
|
81
|
+
name = this.files[this.fileIndex];
|
|
82
|
+
}
|
|
74
83
|
if (name === undefined) {
|
|
75
84
|
this.isDone = true;
|
|
76
|
-
return
|
|
85
|
+
return this.params.afterTransfer?.();
|
|
77
86
|
}
|
|
78
87
|
this.name = name;
|
|
79
88
|
this.totalBytes = 0;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_le32FromHex","require","_le32ToBytes","_lepuCommands","_lepuFileNames","_lepuFrame","_lepuResponseType","FILE_SIZE_OFFSET","MAX_FILE_BYTES","TRANSFER_COMMANDS","LepuCommand","GET_FILE_LIST","READ_FILE_START","READ_FILE_DATA","READ_FILE_END","LepuFileTransfer","files","fileIndex","name","totalBytes","content","isSessionOpen","isDone","constructor","params","initialCommands","commandFor","nextCommand","frame","command","lepuCommandOf","includes","undefined","isLepuSuccess","fail","describeLepuResponseType","lepuNamesFrom","lepuPayloadOf","openNextFile","openedFile","appendChunk","closedFile","lepuNameBytes","le32ToBytes","payload","le32FromHex","limit","maxFileBytes","closeFile","length","push","onProgress","receivedBytes","onFile","reason","onError","write","builder","build","exports"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/lepu/lepu.file-transfer.ts"],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"names":["_le32FromHex","require","_le32ToBytes","_lepuCommands","_lepuFileNames","_lepuFrame","_lepuResponseType","FILE_SIZE_OFFSET","MAX_FILE_BYTES","TRANSFER_COMMANDS","LepuCommand","GET_FILE_LIST","READ_FILE_START","READ_FILE_DATA","READ_FILE_END","LepuFileTransfer","files","fileIndex","name","totalBytes","content","isSessionOpen","isDone","constructor","params","initialCommands","commandFor","nextCommand","frame","command","lepuCommandOf","afterTransfer","includes","undefined","isLepuSuccess","fail","describeLepuResponseType","lepuNamesFrom","lepuPayloadOf","openNextFile","openedFile","appendChunk","closedFile","skipFiles","has","lepuNameBytes","le32ToBytes","payload","le32FromHex","limit","maxFileBytes","closeFile","length","push","onProgress","receivedBytes","onFile","reason","onError","write","builder","build","exports"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/lepu/lepu.file-transfer.ts"],"mappings":";;;;;;AAIA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAGA,IAAAE,aAAA,GAAAF,OAAA;AACA,IAAAG,cAAA,GAAAH,OAAA;AACA,IAAAI,UAAA,GAAAJ,OAAA;AACA,IAAAK,iBAAA,GAAAL,OAAA;AAXA;;AAaA,MAAMM,gBAAgB,GAAG,CAAC;;AAE1B;AACA;AACA;AACA;AACA;AACA,MAAMC,cAAc,GAAG,OAAO;AAE9B,MAAMC,iBAAoC,GAAG,CAC3CC,yBAAW,CAACC,aAAa,EACzBD,yBAAW,CAACE,eAAe,EAC3BF,yBAAW,CAACG,cAAc,EAC1BH,yBAAW,CAACI,aAAa,CAC1B;AAqCD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,gBAAgB,CAA6B;EACzCC,KAAK,GAAa,EAAE;EACpBC,SAAS,GAAG,CAAC;EACbC,IAAI,GAAG,EAAE;EACTC,UAAU,GAAG,C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AACE,OAAO,CAACgC,MAAM,OAAO,IAAI,CAACjC,UAAU,QACtE,CAAC;IACH;IAEA,IAAI,IAAI,CAACA,UAAU,GAAG,CAAC,EAAE;MACvB,IAAI,CAACK,MAAM,CAACgC,MAAM,CAAC;QAAEtC,IAAI,EAAE,IAAI,CAACA,IAAI;QAAEE,OAAO,EAAE,IAAI,CAACA;MAAQ,CAAC,CAAC;IAChE;IAEA,IAAI,CAACH,SAAS,EAAE;IAEhB,OAAO,IAAI,CAACsB,YAAY,CAAC,CAAC;EAC5B,CAAC;EAEOY,SAAS,GAAGA,CAAA,KAAgC,CAClD,IAAI,CAACzB,UAAU,CAAChB,yBAAW,CAACI,aAAa,CAAC,CAC3C;;EAED;AACF;AACA;AACA;AACA;AACA;EACUqB,IAAI,GAAIsB,MAAc,IAA2C;IACvE,IAAI,CAACjC,MAAM,CAACkC,OAAO,CAACD,MAAM,CAAC;IAC3B,IAAI,CAACnC,MAAM,GAAG,IAAI;IAElB,IAAI,CAAC,IAAI,CAACD,aAAa,EAAE;MACvB,OAAOY,SAAS;IAClB;IAEA,IAAI,CAACZ,aAAa,GAAG,KAAK;IAE1B,OAAO,IAAI,CAAC8B,SAAS,CAAC,CAAC;EACzB,CAAC;EAEOzB,UAAU,GAAGA,CACnBG,OAAe,EACfkB,OAA0B,GAAG,EAAE,MACZ;IACnB,GAAG,IAAI,CAACvB,MAAM,CAACmC,KAAK;IACpB/B,KAAK,EAAE,IAAI,CAACJ,MAAM,CAACoC,OAAO,CAACC,KAAK,CAAChC,OAAO,EAAEkB,OAAO;EACnD,CAAC,CAAC;AACJ;AAACe,OAAA,CAAA/C,gBAAA,GAAAA,gBAAA","ignoreList":[]}
|
|
@@ -9,40 +9,28 @@ var _lepuCommands = require("./lepu.commands.js");
|
|
|
9
9
|
var _lepuDeviceInfo = require("./lepu.device-info.js");
|
|
10
10
|
var _lepuResponseType = require("./lepu.response-type.js");
|
|
11
11
|
const COMMAND_INDEX = 1;
|
|
12
|
+
const VIATOM_OXYGEN_INFO = 0x14;
|
|
12
13
|
|
|
13
|
-
/**
|
|
14
|
-
* Asks a Lepu device what it is before sending it anything that acts.
|
|
15
|
-
*
|
|
16
|
-
* The family shares one frame format, one checksum and one opcode space, but not one
|
|
17
|
-
* meaning: `0x08` polls realtime data on a BP2, starts a blood-pressure measurement on an
|
|
18
|
-
* AirBp and starts an ECG on a Lepod. A frame built for the wrong device is therefore
|
|
19
|
-
* perfectly well-formed - the CRC is computed the same way on every one of them - so
|
|
20
|
-
* nothing in the protocol catches a driver bound to the wrong hardware. What comes back is
|
|
21
|
-
* a cuff inflating on someone's arm because a name matched during a scan.
|
|
22
|
-
*
|
|
23
|
-
* `GET_INFO` is the one command that cannot cause that: it is generic, inert, and answered
|
|
24
|
-
* identically family-wide. So it goes first, and everything else waits on its reply.
|
|
25
|
-
*
|
|
26
|
-
* A declaration that names the models it was written for is refused permanently when the
|
|
27
|
-
* device answers with a different one. A declaration that names none is identified by the
|
|
28
|
-
* advertised name it already matched, which is the basis the vendor's own SDK binds every
|
|
29
|
-
* one of its products on; it is asked what it is anyway, and the answer reported, because
|
|
30
|
-
* that is the only place these model numbers exist - the vendor never reads the field back,
|
|
31
|
-
* so there is no table of them to copy.
|
|
32
|
-
*
|
|
33
|
-
* A reply that never arrives leaves the gate closed and nothing sent, which the data
|
|
34
|
-
* processor's stuck-data timeout reports and disconnects on. That is the watchdog for this
|
|
35
|
-
* too - the protocol has no retry of its own, so a dropped reply is recovered by
|
|
36
|
-
* reconnecting rather than by asking again.
|
|
37
|
-
*/
|
|
14
|
+
/** Identifies a device before sending it a model-specific command. */
|
|
38
15
|
class LepuIdentityGate {
|
|
39
16
|
isIdentified = false;
|
|
40
17
|
isRefused = false;
|
|
41
18
|
constructor(params) {
|
|
42
19
|
this.params = params;
|
|
43
20
|
}
|
|
44
|
-
initialCommands = () =>
|
|
21
|
+
initialCommands = () => {
|
|
22
|
+
if (this.params.protocol === "viatom-oxygen") {
|
|
23
|
+
const command = this.params.setClockBeforeInfo ? this.commandFor(0x16, oxyClockPayload()) : this.commandFor(VIATOM_OXYGEN_INFO);
|
|
24
|
+
this.pendingCommand = this.params.setClockBeforeInfo ? 0x16 : VIATOM_OXYGEN_INFO;
|
|
25
|
+
return [command];
|
|
26
|
+
}
|
|
27
|
+
this.pendingCommand = _lepuCommands.LepuCommand.GET_INFO;
|
|
28
|
+
return [this.commandFor(_lepuCommands.LepuCommand.GET_INFO)];
|
|
29
|
+
};
|
|
45
30
|
nextCommand = frame => {
|
|
31
|
+
if (this.params.protocol === "viatom-oxygen") {
|
|
32
|
+
return this.nextViatomOxygenCommand(frame);
|
|
33
|
+
}
|
|
46
34
|
if (this.isRefused) {
|
|
47
35
|
return undefined;
|
|
48
36
|
}
|
|
@@ -52,16 +40,7 @@ class LepuIdentityGate {
|
|
|
52
40
|
return this.admit(frame);
|
|
53
41
|
};
|
|
54
42
|
|
|
55
|
-
/**
|
|
56
|
-
* Decides on the reply to `GET_INFO`.
|
|
57
|
-
*
|
|
58
|
-
* A frame that is not that reply leaves the gate as it was rather than provoking another
|
|
59
|
-
* command, because the only command outstanding is the one still being waited on.
|
|
60
|
-
*
|
|
61
|
-
* A reply that is that command but carries an error type is refused rather than parsed.
|
|
62
|
-
* The payload of an error is the reason for it, so reading a model number out of it would
|
|
63
|
-
* identify the hardware from an error code.
|
|
64
|
-
*/
|
|
43
|
+
/** Decides on the reply to the generic `GET_INFO` command. */
|
|
65
44
|
admit = frame => {
|
|
66
45
|
if ((0, _hexToByte.hexToByte)(frame[COMMAND_INDEX] ?? "0") !== _lepuCommands.LepuCommand.GET_INFO) {
|
|
67
46
|
return undefined;
|
|
@@ -94,10 +73,77 @@ class LepuIdentityGate {
|
|
|
94
73
|
|
|
95
74
|
/** Nothing, for a declaration that asks what the device is and stops there. */
|
|
96
75
|
poll = () => this.params.pollCommand === undefined ? undefined : [this.commandFor(this.params.pollCommand)];
|
|
97
|
-
commandFor = command => ({
|
|
76
|
+
commandFor = (command, payload = [], delayBeforeWriteMs) => ({
|
|
98
77
|
...this.params.write,
|
|
99
|
-
frame: this.params.builder.build(command)
|
|
78
|
+
frame: this.params.builder.build(command, payload),
|
|
79
|
+
...(this.params.writeWithoutResponse ? {
|
|
80
|
+
withoutResponse: true
|
|
81
|
+
} : {}),
|
|
82
|
+
...(delayBeforeWriteMs === undefined ? {} : {
|
|
83
|
+
delayBeforeWriteMs
|
|
84
|
+
})
|
|
100
85
|
});
|
|
86
|
+
nextViatomOxygenCommand = frame => {
|
|
87
|
+
if (this.isRefused || this.pendingCommand === undefined) {
|
|
88
|
+
return undefined;
|
|
89
|
+
}
|
|
90
|
+
const status = (0, _hexToByte.hexToByte)(frame[1] ?? "ff");
|
|
91
|
+
if (status !== 0) {
|
|
92
|
+
if (this.pendingCommand === 0x17 && this.isIdentified) {
|
|
93
|
+
return [this.commandFor(0x17, [], 3_000)];
|
|
94
|
+
}
|
|
95
|
+
return this.refuse(`the device rejected command 0x${this.pendingCommand.toString(16).padStart(2, "0")} with status 0x${status.toString(16).padStart(2, "0")}`);
|
|
96
|
+
}
|
|
97
|
+
switch (this.pendingCommand) {
|
|
98
|
+
case 0x16:
|
|
99
|
+
this.pendingCommand = VIATOM_OXYGEN_INFO;
|
|
100
|
+
return [this.commandFor(VIATOM_OXYGEN_INFO)];
|
|
101
|
+
case VIATOM_OXYGEN_INFO:
|
|
102
|
+
{
|
|
103
|
+
const info = parseViatomOxygenDeviceInfo(frame);
|
|
104
|
+
if (!info) {
|
|
105
|
+
return this.refuse("the device answered INFO without a JSON model number");
|
|
106
|
+
}
|
|
107
|
+
this.params.onIdentified?.(info);
|
|
108
|
+
if (this.params.expectedDeviceTypes.length > 0 && !this.params.expectedDeviceTypes.includes(info.deviceType)) {
|
|
109
|
+
return this.refuse(`the hardware reported model ${info.deviceType}, which this declaration was not written for`);
|
|
110
|
+
}
|
|
111
|
+
this.isIdentified = true;
|
|
112
|
+
this.pendingCommand = 0x17;
|
|
113
|
+
return [this.commandFor(0x17, [], 1_000)];
|
|
114
|
+
}
|
|
115
|
+
case 0x17:
|
|
116
|
+
return [this.commandFor(0x17, [], 1_000)];
|
|
117
|
+
default:
|
|
118
|
+
return undefined;
|
|
119
|
+
}
|
|
120
|
+
};
|
|
101
121
|
}
|
|
102
122
|
exports.LepuIdentityGate = LepuIdentityGate;
|
|
123
|
+
const oxyClockPayload = () => {
|
|
124
|
+
const now = new Date();
|
|
125
|
+
const pad = value => String(value).padStart(2, "0");
|
|
126
|
+
const payload = JSON.stringify({
|
|
127
|
+
SetTIME: `${now.getFullYear()}-${pad(now.getMonth() + 1)}-${pad(now.getDate())},${pad(now.getHours())}:${pad(now.getMinutes())}:${pad(now.getSeconds())}`
|
|
128
|
+
});
|
|
129
|
+
return Array.from(new TextEncoder().encode(payload));
|
|
130
|
+
};
|
|
131
|
+
const parseViatomOxygenDeviceInfo = frame => {
|
|
132
|
+
try {
|
|
133
|
+
const text = frame.slice(7, -1).map(byte => String.fromCharCode((0, _hexToByte.hexToByte)(byte))).join("").replace(/\0+$/, "");
|
|
134
|
+
const info = JSON.parse(text);
|
|
135
|
+
const deviceType = Number(info.Model);
|
|
136
|
+
if (!Number.isInteger(deviceType)) {
|
|
137
|
+
return undefined;
|
|
138
|
+
}
|
|
139
|
+
return {
|
|
140
|
+
deviceType,
|
|
141
|
+
protocolMaxLength: 0,
|
|
142
|
+
branchCode: String(info.Branch ?? ""),
|
|
143
|
+
serialNumber: String(info.SN ?? info.SerialNumber ?? "")
|
|
144
|
+
};
|
|
145
|
+
} catch {
|
|
146
|
+
return undefined;
|
|
147
|
+
}
|
|
148
|
+
};
|
|
103
149
|
//# sourceMappingURL=lepu.identity-gate.js.map
|