@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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["integratedDevicesMap","IntegratedDevices","isCustomDeviceDefinition","BC01Device","BloodGlucoseDevice","BP2Device","CustomDevice","F4Device","SPO2Device","VerovalDuoControlDevice","VerovalEcgDevice","DEVICE_CLASSES","BP2","F4","PC60WF","BC01","TAIDOC_GLUCOSE","GLUCOCHECK","BGM","VEROVAL_DUO_CONTROL","VEROVAL_ECG","collectCustomDevices","acceptedDevices","customDevices","Map","matchers","Set","forEach","entry","index","Error","has","id","matchByService","nameMatch","source","set","add","DeviceCreator","deviceNameCache","CACHE_MAX_SIZE","constructor","acceptedDeviceNames","getDeviceName","foundName","serviceUUIDs","normalizedServices","map","uuid","toLowerCase","size","undefined","matchDeviceName","get","matched","cacheDeviceName","createDevice","params","String","deviceName","trim","device","name","localName","custom","deviceClass","Object","keys","join","destroy","clear","regex","deviceType","test","some","values","
|
|
1
|
+
{"version":3,"names":["integratedDevicesMap","IntegratedDevices","isCustomDeviceDefinition","BC01Device","BloodGlucoseDevice","BP2Device","CustomDevice","F4Device","OxyfitDevice","SPO2Device","MySenseDevice","VerovalDuoControlDevice","VerovalEcgDevice","DEVICE_CLASSES","BP2","F4","PC60WF","SPO2","MYSENSE","BC01","TAIDOC_GLUCOSE","GLUCOCHECK","BGM","VEROVAL_DUO_CONTROL","VEROVAL_ECG","collectCustomDevices","acceptedDevices","customDevices","Map","matchers","Set","forEach","entry","index","Error","has","id","matchByService","nameMatch","source","set","add","DeviceCreator","deviceNameCache","CACHE_MAX_SIZE","constructor","acceptedDeviceNames","getDeviceName","foundName","serviceUUIDs","normalizedServices","map","uuid","toLowerCase","size","undefined","matchDeviceName","get","matched","cacheDeviceName","createDevice","params","String","deviceName","trim","device","name","localName","custom","deviceClass","Object","keys","join","destroy","clear","regex","deviceType","test","some","values","mainServices","service","firstKey","next","value","delete"],"sourceRoot":"../../../../../src","sources":["modules/bt-management/services/device-creator.ts"],"mappings":";;AAAA,SAASA,oBAAoB,QAAQ,wCAAqC;AAM1E,SAASC,iBAAiB,QAAQ,gCAA6B;AAC/D,SAASC,wBAAwB,QAAQ,yCAAsC;AAE/E,SAASC,UAAU,QAAQ,+BAA4B;AACvD,SAASC,kBAAkB,QAAQ,iDAA8C;AACjF,SAASC,SAAS,QAAQ,6BAA0B;AAEpD,SAASC,YAAY,QAAQ,mCAAgC;AAC7D,SAASC,QAAQ,QAAQ,2BAAwB;AACjD,SAASC,YAAY,QAAQ,gCAA6B;AAC1D,SAASC,UAAU,QAAQ,8BAA2B;AACtD,SAASC,aAAa,QAAQ,kCAA+B;AAC7D,SAASC,uBAAuB,QAAQ,iDAA8C;AACtF,SAASC,gBAAgB,QAAQ,yCAAsC;;AAEvE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,cAAc,GAAG;EACrB,CAACZ,iBAAiB,CAACa,GAAG,GAAGT,SAAS;EAClC,CAACJ,iBAAiB,CAACc,EAAE,GAAGR,QAAQ;EAChC,CAACN,iBAAiB,CAACe,MAAM,GAAGP,UAAU;EACtC,CAACR,iBAAiB,CAACgB,IAAI,GAAGT,YAAY;EACtC,CAACP,iBAAiB,CAACiB,OAAO,GAAGR,aAAa;EAC1C,CAACT,iBAAiB,CAACkB,IAAI,GAAGhB,UAAU;EACpC,CAACF,iBAAiB,CAACmB,cAAc,GAAGhB,kBAAkB;EACtD,CAACH,iBAAiB,CAACoB,UAAU,GAAGjB,kBAAkB;EAClD,CAACH,iBAAiB,CAACqB,GAAG,GAAGlB,kBAAkB;EAC3C,CAACH,iBAAiB,CAACsB,mBAAmB,GAAGZ,uBAAuB;EAChE,CAACV,iBAAiB,CAACuB,WAAW,GAAGZ;AACnC,CAAC;AAID,MAAMa,oBAAoB,GACxBC,eAA0C,IACF;EACxC,MAAMC,aAAa,GAAG,IAAIC,GAAG,CAAiC,CAAC;EAC/D,MAAMC,QAAQ,GA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CAACX,MAAM,CAAC/B,cAAc,IAAI0B,UAAU,IAAIK,MAAM,CAAC9B,SAAS,CAACuC,IAAI,CAACd,UAAU,CAAC,EAAE;QAC7E,OAAOK,MAAM,CAAChC,EAAE;MAClB;IACF;IAEA,KAAK,MAAMgC,MAAM,IAAI,IAAI,CAACzC,aAAa,CAACoD,MAAM,CAAC,CAAC,EAAE;MAChD,IACEX,MAAM,CAAC/B,cAAc,IACrB+B,MAAM,CAACY,YAAY,CAACF,IAAI,CAAEG,OAAO,IAC/BhC,YAAY,CAACd,GAAG,CAAC8C,OAAO,CAAC7B,IAAI,CAACC,WAAW,CAAC,CAAC,CAC7C,CAAC,EACD;QACA,OAAOe,MAAM,CAAChC,EAAE;MAClB;IACF;IAEA,OAAOmB,SAAS;EAClB,CAAC;EAEOI,eAAeA,CACrBI,UAAkB,EAClBa,UAA4B,EACtB;IACN;IACA,IAAI,IAAI,CAACjC,eAAe,CAACW,IAAI,IAAI,IAAI,CAACV,cAAc,EAAE;MACpD,MAAMsC,QAAQ,GAAG,IAAI,CAACvC,eAAe,CAAC4B,IAAI,CAAC,CAAC,CAACY,IAAI,CAAC,CAAC,CAACC,KAAK;MAEzD,IAAIF,QAAQ,KAAK3B,SAAS,EAAE;QAC1B,IAAI,CAACZ,eAAe,CAAC0C,MAAM,CAACH,QAAQ,CAAC;MACvC;IACF;IAEA,IAAI,CAACvC,eAAe,CAACH,GAAG,CAACuB,UAAU,EAAEa,UAAU,CAAC;EAClD;AACF","ignoreList":[]}
|
|
@@ -46,7 +46,7 @@ const SPOT_CHECK_TIMEOUT_MS = 60_000;
|
|
|
46
46
|
*/
|
|
47
47
|
export const aoj20aThermometer = params => defineCustomDevice({
|
|
48
48
|
id: params.id ?? "aoj-20a-thermometer",
|
|
49
|
-
nameMatch: params.nameMatch,
|
|
49
|
+
nameMatch: params.nameMatch ?? /^AOJ-20A$/i,
|
|
50
50
|
stuckDataTimeoutMs: params.stuckDataTimeoutMs ?? SPOT_CHECK_TIMEOUT_MS,
|
|
51
51
|
services: [{
|
|
52
52
|
uuid: "ffe0",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["MeasurementTypeKey","defineCustomDevice","FRAME_HEADER","COMMAND_BYTE","FRAME_BYTES","CHECKSUM_INDEX","CHECKSUM_FROM","PAYLOAD","TEMPERATURE_REPLY","TEMPERATURE_SCALE","TEMPERATURE_DECIMALS","SPOT_CHECK_TIMEOUT_MS","aoj20aThermometer","params","id","nameMatch","stuckDataTimeoutMs","services","uuid","monitor","frame","header","minLengthBytes","checksum","algorithm","index","from","caseSelectorBytes","cases","selector","kind","measurementTypeKey","temperature","fields","name","byteIndexes","byteOrder","unit","scale","decimals"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/aoj/aoj.thermometers.ts"],"mappings":";;AAAA,SAASA,kBAAkB,QAAQ,YAAY;AAG/C,SAASC,kBAAkB,QAAQ,sCAAmC;;AAEtE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,MAAMC,YAAY,GAAG,CAAC,IAAI,EAAE,IAAI,CAAC;AAEjC,MAAMC,YAAY,GAAG,CAAC;;AAEtB;AACA,MAAMC,WAAW,GAAG,CAAC;AACrB,MAAMC,cAAc,GAAG,CAAC;;AAExB;AACA,MAAMC,aAAa,GAAG,CAAC;AAEvB,MAAMC,OAAO,GAAG,CAAC;;AAEjB;AACA,MAAMC,iBAAiB,GAAG,IAAI;;AAE9B;AACA,MAAMC,iBAAiB,GAAG,IAAI;AAC9B,MAAMC,oBAAoB,GAAG,CAAC;AAE9B,MAAMC,qBAAqB,GAAG,MAAM;AAapC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,iBAAiB,GAC5BC,MAAuB,IAEvBZ,kBAAkB,CAAC;EACjBa,EAAE,EAAED,MAAM,CAACC,EAAE,IAAI,qBAAqB;EACtCC,SAAS,EAAEF,MAAM,CAACE,SAAS;
|
|
1
|
+
{"version":3,"names":["MeasurementTypeKey","defineCustomDevice","FRAME_HEADER","COMMAND_BYTE","FRAME_BYTES","CHECKSUM_INDEX","CHECKSUM_FROM","PAYLOAD","TEMPERATURE_REPLY","TEMPERATURE_SCALE","TEMPERATURE_DECIMALS","SPOT_CHECK_TIMEOUT_MS","aoj20aThermometer","params","id","nameMatch","stuckDataTimeoutMs","services","uuid","monitor","frame","header","minLengthBytes","checksum","algorithm","index","from","caseSelectorBytes","cases","selector","kind","measurementTypeKey","temperature","fields","name","byteIndexes","byteOrder","unit","scale","decimals"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/aoj/aoj.thermometers.ts"],"mappings":";;AAAA,SAASA,kBAAkB,QAAQ,YAAY;AAG/C,SAASC,kBAAkB,QAAQ,sCAAmC;;AAEtE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,MAAMC,YAAY,GAAG,CAAC,IAAI,EAAE,IAAI,CAAC;AAEjC,MAAMC,YAAY,GAAG,CAAC;;AAEtB;AACA,MAAMC,WAAW,GAAG,CAAC;AACrB,MAAMC,cAAc,GAAG,CAAC;;AAExB;AACA,MAAMC,aAAa,GAAG,CAAC;AAEvB,MAAMC,OAAO,GAAG,CAAC;;AAEjB;AACA,MAAMC,iBAAiB,GAAG,IAAI;;AAE9B;AACA,MAAMC,iBAAiB,GAAG,IAAI;AAC9B,MAAMC,oBAAoB,GAAG,CAAC;AAE9B,MAAMC,qBAAqB,GAAG,MAAM;AAapC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,iBAAiB,GAC5BC,MAAuB,IAEvBZ,kBAAkB,CAAC;EACjBa,EAAE,EAAED,MAAM,CAACC,EAAE,IAAI,qBAAqB;EACtCC,SAAS,EAAEF,MAAM,CAACE,SAAS,IAAI,YAAY;EAC3CC,kBAAkB,EAAEH,MAAM,CAACG,kBAAkB,IAAIL,qBAAqB;EACtEM,QAAQ,EAAE,CACR;IACEC,IAAI,EAAE,MAAM;IACZC,OAAO,EAAE,CACP;MACED,IAAI,EAAE,MAAM;MACZE,KAAK,EAAE;QACLC,MAAM,EAAEnB,YAAY;QACpBoB,cAAc,EAAElB,WAAW;QAC3BmB,QAAQ,EAAE;UACRC,SAAS,EAAE,KAAK;UAChBC,KAAK,EAAEpB,cAAc;UACrBqB,IAAI,EAAEpB;QACR;MACF,CAAC;MACDqB,iBAAiB,EAAE,CAACxB,YAAY,CAAC;MACjCyB,KAAK,EAAE,CACL;QACEC,QAAQ,EAAErB,iBAAiB;QAC3BsB,IAAI,EAAE,QAAQ;QACdC,kBAAkB,EAAE/B,kBAAkB,CAACgC,WAAW;QAClDC,MAAM,EAAE,CACN;UACEC,IAAI,EAAE,UAAU;UAChBC,WAAW,EAAE,CAAC5B,OAAO,EAAEA,OAAO,GAAG,CAAC,CAAC;UACnC6B,SAAS,EAAE,KAAK;UAChBC,IAAI,EAAE,KAAK;UACXC,KAAK,EAAE7B,iBAAiB;UACxB8B,QAAQ,EAAE7B;QACZ,CAAC;MAEL,CAAC;IAEL,CAAC;EAEL,CAAC;AAEL,CAAC,CAAC","ignoreList":[]}
|
|
@@ -4,6 +4,7 @@ import { sentryLogger } from "../../../helpers/utils/sentry-logger.js";
|
|
|
4
4
|
import { DeviceStatus } from "../../types/device-status.js";
|
|
5
5
|
import { base64ToHex } from "../../utils/base-64-to-hex.js";
|
|
6
6
|
import { BTCommandWriter } from "./bt-command-writer.js";
|
|
7
|
+
import { readDeviceInformation } from "./bt-device-information.js";
|
|
7
8
|
export class BTConnectionHandler {
|
|
8
9
|
characteristicSubscriptions = [];
|
|
9
10
|
constructor(device, mainServices, callbacks, preferredMtu) {
|
|
@@ -17,8 +18,9 @@ export class BTConnectionHandler {
|
|
|
17
18
|
try {
|
|
18
19
|
await this.connectWithRetries();
|
|
19
20
|
await this.requestPreferredMtu();
|
|
20
|
-
this.callbacks.onStatusChanged?.(DeviceStatus.CONNECTED);
|
|
21
21
|
await this.device.discoverAllServicesAndCharacteristics();
|
|
22
|
+
await readDeviceInformation(this.device, this.callbacks.onDeviceInfo);
|
|
23
|
+
this.callbacks.onStatusChanged?.(DeviceStatus.CONNECTED);
|
|
22
24
|
this.onDisconnectSubscription = this.device.onDisconnected(this.onDeviceDisconnected);
|
|
23
25
|
await this.subscribeToAllCharacteristics();
|
|
24
26
|
} catch (error) {
|
|
@@ -104,7 +106,7 @@ export class BTConnectionHandler {
|
|
|
104
106
|
error: error instanceof Error ? error.message : error,
|
|
105
107
|
deviceName: this.device.name
|
|
106
108
|
});
|
|
107
|
-
if (error) {
|
|
109
|
+
if (error && !this.callbacks.isNormalDisconnect?.()) {
|
|
108
110
|
this.callbacks.onError?.(error);
|
|
109
111
|
}
|
|
110
112
|
|
|
@@ -136,7 +138,11 @@ export class BTConnectionHandler {
|
|
|
136
138
|
this.characteristicSubscriptions.push(subscription);
|
|
137
139
|
}
|
|
138
140
|
}
|
|
139
|
-
|
|
141
|
+
const initialCommands = this.callbacks.initialCommands?.() ?? [];
|
|
142
|
+
if (initialCommands.length > 0) {
|
|
143
|
+
await this.sendCommands(initialCommands);
|
|
144
|
+
this.callbacks.onCommandSent?.();
|
|
145
|
+
}
|
|
140
146
|
} catch (error) {
|
|
141
147
|
sentryLogger("error", "DEVICE: Error subscribing to all characteristics", {
|
|
142
148
|
error: error instanceof Error ? error.message : error,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["sentryLogger","DeviceStatus","base64ToHex","BTCommandWriter","BTConnectionHandler","characteristicSubscriptions","constructor","device","mainServices","callbacks","preferredMtu","writer","onError","connect","connectWithRetries","requestPreferredMtu","
|
|
1
|
+
{"version":3,"names":["sentryLogger","DeviceStatus","base64ToHex","BTCommandWriter","readDeviceInformation","BTConnectionHandler","characteristicSubscriptions","constructor","device","mainServices","callbacks","preferredMtu","writer","onError","connect","connectWithRetries","requestPreferredMtu","discoverAllServicesAndCharacteristics","onDeviceInfo","onStatusChanged","CONNECTED","onDisconnectSubscription","onDisconnected","onDeviceDisconnected","subscribeToAllCharacteristics","error","Error","message","deviceName","name","DISCONNECTED","destroy","forEach","sub","remove","reset","sendCommands","commands","send","negotiated","requestMTU","useNegotiatedMtu","mtu","deviceId","id","requestedMtu","String","maxRetries","retryDelay","maxDelay","connected","retryCount","isConnected","errorCode","willRetry","Promise","resolve","setTimeout","Math","min","pow","isNormalDisconnect","mainService","monitorUuid","monitorUuids","subscription","monitorCharacteristicForService","uuid","result","value","hexValue","onDataReceived","push","initialCommands","length","onCommandSent"],"sourceRoot":"../../../../../../src","sources":["modules/bt-management/services/devices/bt-connection-handler.ts"],"mappings":";;AAEA,SAASA,YAAY,QAAQ,yCAAsC;AAEnE,SAASC,YAAY,QAAQ,8BAA2B;AAExD,SAASC,WAAW,QAAQ,+BAA4B;AAExD,SAASC,eAAe,QAAQ,wBAAqB;AACrD,SAASC,qBAAqB,QAAQ,4BAAyB;AAkB/D,OAAO,MAAMC,mBAAmB,CAAC;EAEvBC,2BAA2B,GAAmB,EAAE;EAGxDC,WAAWA,CACQC,MAAc,EACdC,YAA2C,EAC3CC,SAAqC,EACrCC,YAAqB,EACtC;IAAA,KAJiBH,MAAc,GAAdA,MAAc;IAAA,KACdC,YAA2C,GAA3CA,YAA2C;IAAA,KAC3CC,SAAqC,GAArCA,SAAqC;IAAA,KACrCC,YAAqB,GAArBA,YAAqB;IAEtC,IAAI,CAACC,MAAM,GAAG,IAAIT,eAAe,CAACK,MAAM,EAAEE,SAAS,CAACG,OAAO,CAAC;EAC9D;EAEOC,OAAO,GAAG,MAAAA,CAAA,KAAY;IAC3B,IAAI;MACF,MAAM,IAAI,CAACC,kBAAkB,CAAC,CAAC;MAC/B,MAAM,IAAI,CAACC,mBAAmB,CAAC,CAAC;MAEhC,MAAM,IAAI,CAACR,MAAM,CAACS,qCAAqC,CAAC,CAAC;MACzD,MAAMb,qBAAqB,CAAC,IAAI,CAACI,MAAM,EAAE,IAAI,CAACE,SAAS,CAACQ,YA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AAI,CAACpB,MAAM,CAACqB;MAC1B,CACF,CAAC;MACD,IAAI,CAACnB,SAAS,CAACG,OAAO,GAAGY,KAAyB,CAAC;IACrD;EACF,CAAC;AACH","ignoreList":[]}
|
|
@@ -49,6 +49,11 @@ export class BTDataProcessor {
|
|
|
49
49
|
this.readWholeBuffer(uuid, buffer);
|
|
50
50
|
};
|
|
51
51
|
|
|
52
|
+
/** Starts the connection watchdog once a device has received its first command. */
|
|
53
|
+
armStuckTimeout = () => {
|
|
54
|
+
this.startStuckTimeout();
|
|
55
|
+
};
|
|
56
|
+
|
|
52
57
|
/**
|
|
53
58
|
* Drains every complete frame the buffer holds.
|
|
54
59
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["sentryLogger","CaseType","FrameReadStatus","FrameParser","MeasurementStateMachine","BTDataProcessor","buffers","Map","constructor","device","mainServices","stuckDataTimeoutDuration","callbacks","frameReader","frameParser","measurementState","onStatusChanged","onStreamStart","onResult","currentUuid","destroy","clear","reset","clearTimeout","stuckDataTimeout","undefined","processData","uuid","hexValue","String","toLowerCase","buffer","get","push","set","startStuckTimeout","readFramesFromBuffer","readWholeBuffer","reader","length","result","readFrame","hasProgressed","consumedBytes","splice","status","COMPLETE","handleFrame","frame","answerFrame","CORRUPT","reportCorruptFrame","INCOMPLETE","validatePackage","commands","nextCommand","sendCommands","data","parse","join","dependentData","parsingCase","caseType","DEPENDENT","handleDependentResult","advance","onError","Error","cause","message","setTimeout","cancelConnection"],"sourceRoot":"../../../../../../src","sources":["modules/bt-management/services/devices/bt-data-processor.ts"],"mappings":";;AAGA,SAASA,YAAY,QAAQ,yCAAsC;AACnE,SAASC,QAAQ,QAAQ,0BAAuB;AAIhD,SAASC,eAAe,QAAQ,kCAA+B;AAK/D,SAASC,WAAW,QAAQ,mBAAgB;AAC5C,SAASC,uBAAuB,QAAQ,gCAA6B;AAgCrE,OAAO,MAAMC,eAAe,CAAwB;EAClD;AACF;AACA;AACA;AACA;AACA;AACA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IAAI,CAACI,iBAAiB,CAAC,CAAC;IAExB,IAAI,IAAI,CAACtB,WAAW,EAAE;MACpB,IAAI,CAACuB,oBAAoB,CAAC,IAAI,CAACvB,WAAW,EAAEc,IAAI,EAAEI,MAAM,CAAC;MAEzD;IACF;IAEA,IAAI,CAACM,eAAe,CAACV,IAAI,EAAEI,MAAM,CAAC;EACpC,CAAC;;EAED;AACF;AACA;AACA;AACA;AACA;AACA;
|
|
1
|
+
{"version":3,"names":["sentryLogger","CaseType","FrameReadStatus","FrameParser","MeasurementStateMachine","BTDataProcessor","buffers","Map","constructor","device","mainServices","stuckDataTimeoutDuration","callbacks","frameReader","frameParser","measurementState","onStatusChanged","onStreamStart","onResult","currentUuid","destroy","clear","reset","clearTimeout","stuckDataTimeout","undefined","processData","uuid","hexValue","String","toLowerCase","buffer","get","push","set","startStuckTimeout","readFramesFromBuffer","readWholeBuffer","armStuckTimeout","reader","length","result","readFrame","hasProgressed","consumedBytes","splice","status","COMPLETE","handleFrame","frame","answerFrame","CORRUPT","reportCorruptFrame","INCOMPLETE","validatePackage","commands","nextCommand","sendCommands","data","parse","join","dependentData","parsingCase","caseType","DEPENDENT","handleDependentResult","advance","onError","Error","cause","message","setTimeout","cancelConnection"],"sourceRoot":"../../../../../../src","sources":["modules/bt-management/services/devices/bt-data-processor.ts"],"mappings":";;AAGA,SAASA,YAAY,QAAQ,yCAAsC;AACnE,SAASC,QAAQ,QAAQ,0BAAuB;AAIhD,SAASC,eAAe,QAAQ,kCAA+B;AAK/D,SAASC,WAAW,QAAQ,mBAAgB;AAC5C,SAASC,uBAAuB,QAAQ,gCAA6B;AAgCrE,OAAO,MAAMC,eAAe,CAAwB;EAClD;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACUC,OAAO,GAAG,IAAIC,GAAG,CAAmB,CAAC;EAI7CC,WAAWA,CACQC,MAAc,EAC/BC,YAA2C,EAC1BC,wBAAgC,EAChCC,SAAoC,EACpCC,WAAyB,EAC1C;IAAA,KAL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;EACUnC,iBAAiB,GAAGA,CAAA,KAAM;IAChC,IAAI,IAAI,CAACX,gBAAgB,EAAE;MACzBD,YAAY,CAAC,IAAI,CAACC,gBAAgB,CAAC;IACrC;IAEA,IAAI,CAACA,gBAAgB,GAAG+C,UAAU,CAAC,MAAM;MACvC,IAAI,CAAC3D,SAAS,CAACuD,OAAO,GACpB,IAAIC,KAAK,CAAC,2CAA2C,EAAE;QACrDC,KAAK,EAAE;UACLC,OAAO,EAAE;QACX;MACF,CAAC,CACH,CAAC;MACD,IAAI,CAAC7D,MAAM,CAAC+D,gBAAgB,GAAG,CAAC;IAClC,CAAC,EAAE,IAAI,CAAC7D,wBAAwB,CAAC;EACnC,CAAC;AACH","ignoreList":[]}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { sentryLogger } from "../../../helpers/utils/sentry-logger.js";
|
|
4
|
+
const readDeviceInformation = async (device, onDeviceInfo) => {
|
|
5
|
+
const read = device.readCharacteristicForService;
|
|
6
|
+
if (typeof read !== "function") {
|
|
7
|
+
return;
|
|
8
|
+
}
|
|
9
|
+
const info = {};
|
|
10
|
+
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"]];
|
|
11
|
+
for (const [key, serviceUuid, characteristicUuid] of values) {
|
|
12
|
+
try {
|
|
13
|
+
const characteristic = await read.call(device, serviceUuid, characteristicUuid);
|
|
14
|
+
const value = characteristic?.value;
|
|
15
|
+
if (!value) {
|
|
16
|
+
continue;
|
|
17
|
+
}
|
|
18
|
+
const text = Buffer.from(value, "base64").toString("utf8").replace(/\0+$/, "").trim();
|
|
19
|
+
if (text) {
|
|
20
|
+
info[key] = text;
|
|
21
|
+
}
|
|
22
|
+
} catch (error) {
|
|
23
|
+
// Optional GAP/Device Information characteristics are not present on every device.
|
|
24
|
+
sentryLogger("info", "DEVICE: Optional device information unavailable", {
|
|
25
|
+
deviceId: device.id,
|
|
26
|
+
deviceName: device.name,
|
|
27
|
+
characteristicUuid,
|
|
28
|
+
error: error instanceof Error ? error.message : String(error)
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
if (Object.keys(info).length > 0) {
|
|
33
|
+
onDeviceInfo?.(info);
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
export { readDeviceInformation };
|
|
37
|
+
//# sourceMappingURL=bt-device-information.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["sentryLogger","readDeviceInformation","device","onDeviceInfo","read","readCharacteristicForService","info","values","key","serviceUuid","characteristicUuid","characteristic","call","value","text","Buffer","from","toString","replace","trim","error","deviceId","id","deviceName","name","Error","message","String","Object","keys","length"],"sourceRoot":"../../../../../../src","sources":["modules/bt-management/services/devices/bt-device-information.ts"],"mappings":";;AAEA,SAASA,YAAY,QAAQ,yCAAsC;AASnE,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;MACApB,YAAY,CAAC,MAAM,EAAE,iDAAiD,EAAE;QACtEqB,QAAQ,EAAEnB,MAAM,CAACoB,EAAE;QACnBC,UAAU,EAAErB,MAAM,CAACsB,IAAI;QACvBd,kBAAkB;QAClBU,KAAK,EAAEA,KAAK,YAAYK,KAAK,GAAGL,KAAK,CAACM,OAAO,GAAGC,MAAM,CAACP,KAAK;MAC9D,CAAC,CAAC;IACJ;EACF;EAEA,IAAIQ,MAAM,CAACC,IAAI,CAACvB,IAAI,CAAC,CAACwB,MAAM,GAAG,CAAC,EAAE;IAChC3B,YAAY,GAAGG,IAAI,CAAC;EACtB;AACF,CAAC;AAED,SAASL,qBAAqB","ignoreList":[]}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
/* eslint-disable max-lines */
|
|
4
|
+
|
|
3
5
|
import { sentryLogger } from "../../../helpers/utils/sentry-logger.js";
|
|
4
6
|
import { DeviceStatus } from "../../types/device-status.js";
|
|
5
7
|
import { summariseMeasurementForLog } from "../../utils/summarise-measurement-for-log.js";
|
|
@@ -8,6 +10,8 @@ import { BTConnectionHandler } from "./bt-connection-handler.js";
|
|
|
8
10
|
import { BTDataProcessor } from "./bt-data-processor.js";
|
|
9
11
|
import { pollingSequencerFor } from "./polling-command-sequencer.js";
|
|
10
12
|
export class BTManagedDevice {
|
|
13
|
+
resultReportedThisConnection = false;
|
|
14
|
+
|
|
11
15
|
/**
|
|
12
16
|
* The timeout in milliseconds for the stuck data.
|
|
13
17
|
*/
|
|
@@ -59,9 +63,11 @@ export class BTManagedDevice {
|
|
|
59
63
|
onError: onErrorCallback,
|
|
60
64
|
onDeviceStatusChanged: onDeviceStatusChangedCallback,
|
|
61
65
|
onResult: onResultCallback,
|
|
62
|
-
onDeviceDisconnected: onDeviceDisconnectedCallback
|
|
66
|
+
onDeviceDisconnected: onDeviceDisconnectedCallback,
|
|
67
|
+
oneReadingPerConnection
|
|
63
68
|
}) {
|
|
64
69
|
this.device = device;
|
|
70
|
+
this.oneReadingPerConnection = oneReadingPerConnection === true;
|
|
65
71
|
sentryLogger("info", "BT_MANAGER: Creating BTManagedDevice", {
|
|
66
72
|
deviceId: device.id,
|
|
67
73
|
deviceName: deviceName
|
|
@@ -104,6 +110,10 @@ export class BTManagedDevice {
|
|
|
104
110
|
caseType: _,
|
|
105
111
|
...data
|
|
106
112
|
}) => {
|
|
113
|
+
if (this.oneReadingPerConnection && this.resultReportedThisConnection) {
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
this.resultReportedThisConnection = true;
|
|
107
117
|
sentryLogger("info", "BT_MANAGER: Calling onResult callback", {
|
|
108
118
|
data: summariseMeasurementForLog(data),
|
|
109
119
|
deviceData: this.deviceData,
|
|
@@ -128,6 +138,8 @@ export class BTManagedDevice {
|
|
|
128
138
|
this.onResult = undefined;
|
|
129
139
|
};
|
|
130
140
|
connect = async () => {
|
|
141
|
+
this.resultReportedThisConnection = false;
|
|
142
|
+
|
|
131
143
|
// To access the abstract property in the constructor, we need to set it here
|
|
132
144
|
this.deviceData.measurementTypes = supportedMeasurementTypeKeys(this.mainServices);
|
|
133
145
|
const sequencer = this.createCommandSequencer?.() ?? pollingSequencerFor(this.mainServices);
|
|
@@ -143,7 +155,23 @@ export class BTManagedDevice {
|
|
|
143
155
|
onDataReceived: (uuid, hexValue) => {
|
|
144
156
|
this.dataProcessor?.processData(uuid, hexValue);
|
|
145
157
|
},
|
|
146
|
-
|
|
158
|
+
onDeviceInfo: info => {
|
|
159
|
+
if (info.name) {
|
|
160
|
+
this.deviceData.localName = info.name;
|
|
161
|
+
}
|
|
162
|
+
if (info.manufacturerName) {
|
|
163
|
+
this.deviceData.manufacturerName = info.manufacturerName;
|
|
164
|
+
}
|
|
165
|
+
if (info.model) {
|
|
166
|
+
this.deviceData.model = info.model;
|
|
167
|
+
}
|
|
168
|
+
if (info.serialNumber) {
|
|
169
|
+
this.deviceData.sn = info.serialNumber;
|
|
170
|
+
}
|
|
171
|
+
},
|
|
172
|
+
initialCommands: () => sequencer.initialCommands(),
|
|
173
|
+
onCommandSent: () => this.dataProcessor?.armStuckTimeout(),
|
|
174
|
+
isNormalDisconnect: () => sequencer.isNormalDisconnect?.() ?? false
|
|
147
175
|
}, this.preferredMtu);
|
|
148
176
|
this.dataProcessor = new BTDataProcessor(this.device, this.mainServices, this.stuckDataTimeout, {
|
|
149
177
|
onStatusChanged: this.onDeviceStatusChanged?.bind(this),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["sentryLogger","DeviceStatus","summariseMeasurementForLog","supportedMeasurementTypeKeys","BTConnectionHandler","BTDataProcessor","pollingSequencerFor","BTManagedDevice","constructor","device","deviceName","onError","onErrorCallback","onDeviceStatusChanged","onDeviceStatusChangedCallback","onResult","onResultCallback","onDeviceDisconnected","onDeviceDisconnectedCallback","deviceId","id","deviceData","name","localName","manufacturerData","sn","measurementTypes","status","measurementTypeKey","error","Error","message","caseType","_","data","destroy","connectionHandler","dataProcessor","undefined","connect","mainServices","sequencer","createCommandSequencer","onStatusChanged","bind","DISCONNECTED","onDataReceived","uuid","hexValue","processData","initialCommands","preferredMtu","stuckDataTimeout","onStreamStart","validatePackage","parsedData","collectedValues","handleSuccessResult","nextCommand","frame","sendCommands","commands","handleDependentResult","frameReader"],"sourceRoot":"../../../../../../src","sources":["modules/bt-management/services/devices/bt-managed-device.ts"],"mappings":";;
|
|
1
|
+
{"version":3,"names":["sentryLogger","DeviceStatus","summariseMeasurementForLog","supportedMeasurementTypeKeys","BTConnectionHandler","BTDataProcessor","pollingSequencerFor","BTManagedDevice","resultReportedThisConnection","constructor","device","deviceName","onError","onErrorCallback","onDeviceStatusChanged","onDeviceStatusChangedCallback","onResult","onResultCallback","onDeviceDisconnected","onDeviceDisconnectedCallback","oneReadingPerConnection","deviceId","id","deviceData","name","localName","manufacturerData","sn","measurementTypes","status","measurementTypeKey","error","Error","message","caseType","_","data","destroy","connectionHandler","dataProcessor","undefined","connect","mainServices","sequencer","createCommandSequencer","onStatusChanged","bind","DISCONNECTED","onDataReceived","uuid","hexValue","processData","onDeviceInfo","info","manufacturerName","model","serialNumber","initialCommands","onCommandSent","armStuckTimeout","isNormalDisconnect","preferredMtu","stuckDataTimeout","onStreamStart","validatePackage","parsedData","collectedValues","handleSuccessResult","nextCommand","frame","sendCommands","commands","handleDependentResult","frameReader"],"sourceRoot":"../../../../../../src","sources":["modules/bt-management/services/devices/bt-managed-device.ts"],"mappings":";;AAAA;;AAKA,SAASA,YAAY,QAAQ,yCAAsC;AAOnE,SAASC,YAAY,QAAQ,8BAA2B;AAMxD,SAASC,0BAA0B,QAAQ,8CAA2C;AACtF,SAASC,4BAA4B,QAAQ,gDAA6C;AAE1F,SAASC,mBAAmB,QAAQ,4BAAyB;AAC7D,SAASC,eAAe,QAAQ,wBAAqB;AACrD,SAASC,mBAAmB,QAAQ,gCAA6B;AAEjE,OAAO,MAAeC,eAAe,CAErC;EAQUC,4BAA4B,GAAG,KAAK;;EAG5C;AACF;AACA;;EAGE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;;EAO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AAW,CAACC,KAAK,CAAC;MACpDC,YAAY,EAAGC,QAAQ,IACrB,KAAK,IAAI,CAACjC,iBAAiB,EAAEgC,YAAY,CAACC,QAAQ,CAAC;MACrD3D,OAAO,EAAE,IAAI,CAACA,OAAO,EAAEkC,IAAI,CAAC,IAAI,CAAC;MACjC0B,qBAAqB,EAAE,IAAI,CAACA,qBAAqB,EAAE1B,IAAI,CAAC,IAAI;IAC9D,CAAC,EACD,IAAI,CAAC2B,WACP,CAAC;IAED,MAAM,IAAI,CAACnC,iBAAiB,CAACG,OAAO,CAAC,CAAC;EACxC,CAAC;AACH","ignoreList":[]}
|
|
@@ -39,7 +39,12 @@ const createLepuSequencer = (lepu, report) => new LepuIdentityGate({
|
|
|
39
39
|
serviceUuid: lepu.write.serviceUuid,
|
|
40
40
|
characteristicUuid: lepu.write.characteristicUuid
|
|
41
41
|
},
|
|
42
|
-
builder: new LepuCommandBuilder(lepu.startBytes[0] ?? DEFAULT_START_BYTE
|
|
42
|
+
builder: new LepuCommandBuilder(lepu.requestStartByte ?? lepu.startBytes[0] ?? DEFAULT_START_BYTE, {
|
|
43
|
+
fixedSequence: lepu.protocol === "viatom-oxygen"
|
|
44
|
+
}),
|
|
45
|
+
protocol: lepu.protocol,
|
|
46
|
+
writeWithoutResponse: lepu.writeWithoutResponse,
|
|
47
|
+
setClockBeforeInfo: lepu.setClockBeforeInfo,
|
|
43
48
|
expectedDeviceTypes: lepu.expectedDeviceTypes,
|
|
44
49
|
...(lepu.pollCommand === undefined ? {} : {
|
|
45
50
|
pollCommand: lepu.pollCommand
|
package/lib/module/modules/bt-management/services/devices/custom/custom-lepu-sequencer.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["sentryLogger","LepuCommandBuilder","LepuIdentityGate","DEFAULT_START_BYTE","recordLepuIdentity","deviceData","info","sn","serialNumber","deviceId","id","deviceName","name","deviceType","branchCode","protocolMaxLength","createLepuSequencer","lepu","report","write","serviceUuid","characteristicUuid","builder","startBytes","expectedDeviceTypes","pollCommand","undefined","onIdentified","onRefused"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/custom/custom-lepu-sequencer.ts"],"mappings":";;AAAA,SAASA,YAAY,QAAQ,4CAAyC;AAItE,SAASC,kBAAkB,QAAQ,iCAA8B;AAEjE,SAASC,gBAAgB,QAAQ,+BAA4B;;AAE7D;AACA,MAAMC,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;EAEjCR,YAAY,CAAC,MAAM,EAAE,sCAAsC,EAAE;IAC3DS,QAAQ,EAAEJ,UAAU,CAACK,EAAE;IACvBC,UAAU,EAAEN,UAAU,CAACO,IAAI;IAC3BC,UAAU,EAAEP,IAAI,CAACO,UAAU;IAC3BC,UAAU,EAAER,IAAI,CAACQ,UAAU;IAC3BC,iBAAiB,EAAET,IAAI,CAACS;EAC1B,CAAC,CAAC;AACJ,CAAC;AAED,MAAMC,mBAAmB,GAAGA,CAC1BC,IAAoB,EACpBC,MAAsB,KAEtB,IAAIhB,gBAAgB,CAAC;EACnBiB,KAAK,EAAE;IACLC,WAAW,EAAEH,IAAI,CAACE,KAAK,CAACC,WAAW;IACnCC,kBAAkB,EAAEJ,IAAI,CAACE,KAAK,CAACE;EACjC,CAAC;EACDC,OAAO,EAAE,IAAIrB,kBAAkB,CAACgB,IAAI,CAACM,UAAU,CAAC,CAAC,CAAC,
|
|
1
|
+
{"version":3,"names":["sentryLogger","LepuCommandBuilder","LepuIdentityGate","DEFAULT_START_BYTE","recordLepuIdentity","deviceData","info","sn","serialNumber","deviceId","id","deviceName","name","deviceType","branchCode","protocolMaxLength","createLepuSequencer","lepu","report","write","serviceUuid","characteristicUuid","builder","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,SAASA,YAAY,QAAQ,4CAAyC;AAItE,SAASC,kBAAkB,QAAQ,iCAA8B;AAEjE,SAASC,gBAAgB,QAAQ,+BAA4B;;AAE7D;AACA,MAAMC,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;EAEjCR,YAAY,CAAC,MAAM,EAAE,sCAAsC,EAAE;IAC3DS,QAAQ,EAAEJ,UAAU,CAACK,EAAE;IACvBC,UAAU,EAAEN,UAAU,CAACO,IAAI;IAC3BC,UAAU,EAAEP,IAAI,CAACO,UAAU;IAC3BC,UAAU,EAAER,IAAI,CAACQ,UAAU;IAC3BC,iBAAiB,EAAET,IAAI,CAACS;EAC1B,CAAC,CAAC;AACJ,CAAC;AAED,MAAMC,mBAAmB,GAAGA,CAC1BC,IAAoB,EACpBC,MAAsB,KAEtB,IAAIhB,gBAAgB,CAAC;EACnBiB,KAAK,EAAE;IACLC,WAAW,EAAEH,IAAI,CAACE,KAAK,CAACC,WAAW;IACnCC,kBAAkB,EAAEJ,IAAI,CAACE,KAAK,CAACE;EACjC,CAAC;EACDC,OAAO,EAAE,IAAIrB,kBAAkB,CAACgB,IAAI,CAACM,gBAAgB,IAAIN,IAAI,CAACO,UAAU,CAAC,CAAC,CAAC,IAAIrB,kBAAkB,EAAE;IACjGsB,aAAa,EAAER,IAAI,CAACS,QAAQ,KAAK;EACnC,CAAC,CAAC;EACFA,QAAQ,EAAET,IAAI,CAACS,QAAQ;EACvBC,oBAAoB,EAAEV,IAAI,CAACU,oBAAoB;EAC/CC,kBAAkB,EAAEX,IAAI,CAACW,kBAAkB;EAC3CC,mBAAmB,EAAEZ,IAAI,CAACY,mBAAmB;EAC7C,IAAIZ,IAAI,CAACa,WAAW,KAAKC,SAAS,GAAG,CAAC,CAAC,GAAG;IAAED,WAAW,EAAEb,IAAI,CAACa;EAAY,CAAC,CAAC;EAC5EE,YAAY,EAAEd,MAAM,CAACc,YAAY;EACjCC,SAAS,EAAEf,MAAM,CAACe;AACpB,CAAC,CAAC;AAEJ,SAASjB,mBAAmB,EAAEZ,kBAAkB","ignoreList":[]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
/* eslint-disable max-lines */
|
|
4
|
-
import {
|
|
4
|
+
import { MeasurementTypeKey } from "@ovok/core";
|
|
5
5
|
import { CaseType } from "../../../types/case-type.js";
|
|
6
6
|
import { createFrameValidator } from "../../../utils/create-frame-validator.js";
|
|
7
7
|
import { parseMeasurement } from "../../../utils/parse-measurement.js";
|
|
@@ -10,7 +10,7 @@ import { BTManagedDevice } from "../bt-managed-device.js";
|
|
|
10
10
|
import { LepuCommandBuilder } from "../lepu/lepu.command-builder.js";
|
|
11
11
|
import { LepuFileTransfer } from "../lepu/lepu.file-transfer.js";
|
|
12
12
|
import { LepuFrameReader } from "../lepu/lepu.frame-reader.js";
|
|
13
|
-
import { decodeViatomEcgRecording } from "../viatom/viatom.ecg-files.js";
|
|
13
|
+
import { decodeViatomEcgRecording, recordedAtFromViatomFileName } from "../viatom/viatom.ecg-files.js";
|
|
14
14
|
import { createLepuSequencer, recordLepuIdentity } from "./custom-lepu-sequencer.js";
|
|
15
15
|
/**
|
|
16
16
|
* Runs a device registered with defineCustomDevice.
|
|
@@ -24,8 +24,12 @@ import { createLepuSequencer, recordLepuIdentity } from "./custom-lepu-sequencer
|
|
|
24
24
|
export class CustomDevice extends BTManagedDevice {
|
|
25
25
|
validators = new Map();
|
|
26
26
|
constructor(device, params, definition) {
|
|
27
|
-
super(device,
|
|
27
|
+
super(device, {
|
|
28
|
+
...params,
|
|
29
|
+
oneReadingPerConnection: params.oneReadingPerConnection ?? definition.oneReadingPerConnection
|
|
30
|
+
});
|
|
28
31
|
this.definition = definition;
|
|
32
|
+
this.deliveredEcgFileNames = new Set(params.deliveredEcgFileNames ?? []);
|
|
29
33
|
this.mainServices = definition.mainServices;
|
|
30
34
|
this.stuckDataTimeout = definition.stuckDataTimeout;
|
|
31
35
|
if (definition.preferredMtu !== undefined) {
|
|
@@ -59,6 +63,12 @@ export class CustomDevice extends BTManagedDevice {
|
|
|
59
63
|
},
|
|
60
64
|
builder: new LepuCommandBuilder(lepu.startBytes[0] ?? "a5"),
|
|
61
65
|
onFile: this.reportViatomEcgFile,
|
|
66
|
+
skipFiles: this.deliveredEcgFileNames,
|
|
67
|
+
afterTransfer: lepu.pollCommand ? () => [{
|
|
68
|
+
serviceUuid: lepu.write.serviceUuid,
|
|
69
|
+
characteristicUuid: lepu.write.characteristicUuid,
|
|
70
|
+
frame: new LepuCommandBuilder(lepu.startBytes[0] ?? "a5").build(lepu.pollCommand)
|
|
71
|
+
}] : undefined,
|
|
62
72
|
onError: reason => this.onError?.(new Error(`Viatom ECG: ${reason}`))
|
|
63
73
|
});
|
|
64
74
|
}
|
|
@@ -77,9 +87,10 @@ export class CustomDevice extends BTManagedDevice {
|
|
|
77
87
|
this.onResult?.({
|
|
78
88
|
measurementTypeKey: MeasurementTypeKey.ecg,
|
|
79
89
|
caseType: CaseType.RESULT,
|
|
80
|
-
diagnosticResult: EcgDiagnosticFlag.REGULAR,
|
|
81
90
|
diagramPoints: decoded.samples,
|
|
82
|
-
duration: decoded.duration
|
|
91
|
+
duration: decoded.duration,
|
|
92
|
+
recordedAt: recordedAtFromViatomFileName(file.name),
|
|
93
|
+
recordingId: file.name
|
|
83
94
|
});
|
|
84
95
|
};
|
|
85
96
|
onIdentified = info => recordLepuIdentity(this.deviceData, info);
|
|
@@ -101,7 +112,9 @@ export class CustomDevice extends BTManagedDevice {
|
|
|
101
112
|
*/
|
|
102
113
|
handleDependentResult = data => {
|
|
103
114
|
try {
|
|
104
|
-
this.
|
|
115
|
+
if (this.shouldReportDependentResult(data)) {
|
|
116
|
+
this.reportFrame(data);
|
|
117
|
+
}
|
|
105
118
|
} catch (error) {
|
|
106
119
|
this.onError?.(error);
|
|
107
120
|
}
|
|
@@ -114,6 +127,9 @@ export class CustomDevice extends BTManagedDevice {
|
|
|
114
127
|
};
|
|
115
128
|
};
|
|
116
129
|
|
|
130
|
+
/** Lets a stateful protocol suppress a duplicate result while still answering its frame. */
|
|
131
|
+
shouldReportDependentResult = _data => true;
|
|
132
|
+
|
|
117
133
|
/**
|
|
118
134
|
* Stream frames reach this while the device is measuring. They carry no fields, and the
|
|
119
135
|
* readings themselves are reported from handleDependentResult, so there is nothing to do.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["MeasurementTypeKey","CaseType","createFrameValidator","parseMeasurement","discardedReadingError","rejectCustomReading","BTManagedDevice","LepuCommandBuilder","LepuFileTransfer","LepuFrameReader","decodeViatomEcgRecording","recordedAtFromViatomFileName","createLepuSequencer","recordLepuIdentity","CustomDevice","validators","Map","constructor","device","params","definition","oneReadingPerConnection","deliveredEcgFileNames","Set","mainServices","stuckDataTimeout","preferredMtu","undefined","declareLepuProtocol","frames","forEach","frame","uuid","set","lepu","frameReader","startBytes","createCommandSequencer","fileTransfer","write","serviceUuid","characteristicUuid","builder","onFile","reportViatomEcgFile","skipFiles","afterTransfer","pollCommand","build","onError","reason","Error","onIdentified","onRefused","onIdentityRefused","file","decoded","content","samples","length","name","onResult","measurementTypeKey","ecg","caseType","RESULT","diagramPoints","duration","recordedAt","recordingId","info","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","measurements","discard","measurement","reportMeasurement","reading","fieldNames","rejection","map","fields","find","message"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/custom/custom.device.ts"],"mappings":";;AAAA;AACA,SAASA,kBAAkB,QAAQ,YAAY;AAG/C,SAASC,QAAQ,QAAQ,6BAA0B;AAUnD,SAASC,oBAAoB,QAAQ,0CAAuC;AAC5E,SAASC,gBAAgB,QAAQ,qCAAkC;AACnE,SACEC,qBAAqB,EACrBC,mBAAmB,QACd,yCAAsC;AAC7C,SAASC,eAAe,QAAQ,yBAAsB;AACtD,SAASC,kBAAkB,QAAQ,iCAA8B;AAEjE,SAAmBC,gBAAgB,QAAQ,+BAA4B;AACvE,SAASC,eAAe,QAAQ,8BAA2B;AAC3D,SACEC,wBAAwB,EACxBC,4BAA4B,QACvB,+BAA4B;AAEnC,SACEC,mBAAmB,EACnBC,kBAAkB,QACb,4BAAyB;AAKhC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,YAAY,SAASR,eAAe,CAAiB;EAO/CS,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,IAAI,CAACE,YAAY,GAAGJ,UAAU,CAACI,YAAY;IAC3C,IAAI,CAACC,gBAAgB,GAAGL,UAAU,CAACK,gBAAgB;IAEnD,IAAIL,UAAU,CAACM,YAAY,KAAKC,SAAS,EAAE;MACzC,IAAI,CAACD,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,CAAE7C,IAAI,IACRvD,mBAAmB,CACjB,IAAI,CAACe,UAAU,CAACsF,MAAM,EACtBN,WAAW,CAACtC,kBAAkB,EAC9BF,IAAI,EACJ0C,OAAO,CAAC1C,IAAI,CACd,CACF,CAAC,CACA+C,IAAI,CAAEC,OAAO,IAAKA,OAAO,KAAKjF,SAAS,CAAC;IAE3C,IAAI6E,SAAS,EAAE;MACb,IAAI,CAACL,OAAO,CAACK,SAAS,EAAEF,OAAO,CAAC;MAEhC;IACF;IAEA,IAAI,CAACzC,QAAQ,GAAGyC,OAAO,CAAC;EAC1B;AAEF","ignoreList":[]}
|
|
@@ -20,7 +20,7 @@ export class FrameParser {
|
|
|
20
20
|
return;
|
|
21
21
|
}
|
|
22
22
|
const caseValue = this.readCaseValue(parsingModel, frame);
|
|
23
|
-
const parsingCase = parsingModel.cases?.find(declared => declared.caseValue === caseValue);
|
|
23
|
+
const parsingCase = parsingModel.cases?.find(declared => frame.length >= (declared.minLengthBytes ?? 0) && (declared.caseValue === "*" || this.matchesSelector(declared.caseValue, caseValue)));
|
|
24
24
|
if (!parsingCase) {
|
|
25
25
|
return;
|
|
26
26
|
}
|
|
@@ -44,6 +44,18 @@ export class FrameParser {
|
|
|
44
44
|
}
|
|
45
45
|
return undefined;
|
|
46
46
|
}
|
|
47
|
+
matchesSelector(pattern, value) {
|
|
48
|
+
if (pattern.length !== value.length) {
|
|
49
|
+
return false;
|
|
50
|
+
}
|
|
51
|
+
for (let index = 0; index < pattern.length; index++) {
|
|
52
|
+
const expected = pattern[index];
|
|
53
|
+
if (expected !== "?" && expected !== value[index]) {
|
|
54
|
+
return false;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
return true;
|
|
58
|
+
}
|
|
47
59
|
readCaseValue(parsingModel, frame) {
|
|
48
60
|
return parsingModel.caseValuePosition?.map(index => frame[index]).join("") || "";
|
|
49
61
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["parseMeasurement","FrameParser","constructor","mainServices","parse","uuid","frame","parsingModel","findParsingModel","caseValue","readCaseValue","parsingCase","cases","find","declared","parsedData","measurementTypeKey","mainService","characteristic","monitorUuids","monitored","toLowerCase","undefined","
|
|
1
|
+
{"version":3,"names":["parseMeasurement","FrameParser","constructor","mainServices","parse","uuid","frame","parsingModel","findParsingModel","caseValue","readCaseValue","parsingCase","cases","find","declared","length","minLengthBytes","matchesSelector","parsedData","measurementTypeKey","mainService","characteristic","monitorUuids","monitored","toLowerCase","undefined","pattern","value","index","expected","caseValuePosition","map","join"],"sourceRoot":"../../../../../../src","sources":["modules/bt-management/services/devices/frame-parser.ts"],"mappings":";;AAMA,SAASA,gBAAgB,QAAQ,kCAA+B;;AAEhE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,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,CAACL,SAAS,KAAK,GAAG,IACzB,IAAI,CAACQ,eAAe,CAACH,QAAQ,CAACL,SAAS,EAAEA,SAAS,CAAC,CACzD,CAAC;IAED,IAAI,CAACE,WAAW,EAAE;MAChB;IACF;IAEA,MAAMO,UAAU,GAAGlB,gBAAgB,CAACM,KAAK,EAAEK,WAAW,CAAC;IAEvD,IAAI,CAACO,UAAU,EAAE;MACf;IACF;IAEA,OAAO;MACLP,WAAW;MACXQ,kBAAkB,EAAER,WAAW,CAACQ,kBAAkB;MAClDD,UAAU,EAAEA,UAAwC;MACpDZ;IACF,CAAC;EACH;EAEQE,gBAAgBA,CAACH,IAAY,EAA4B;IAC/D,KAAK,MAAMe,WAAW,IAAI,IAAI,CAACjB,YAAY,EAAE;MAC3C,MAAMkB,cAAc,GAAGD,WAAW,CAACE,YAAY,CAACT,IAAI,CACjDU,SAAS,IAAKA,SAAS,CAAClB,IAAI,CAACmB,WAAW,CAAC,CAAC,KAAKnB,IAAI,CAACmB,WAAW,CAAC,CACnE,CAAC;MAED,IAAIH,cAAc,EAAE;QAClB,OAAOA,cAAc,CAACd,YAAY;MACpC;IACF;IAEA,OAAOkB,SAAS;EAClB;EAEQR,eAAeA,CAACS,OAAe,EAAEC,KAAa,EAAW;IAC/D,IAAID,OAAO,CAACX,MAAM,KAAKY,KAAK,CAACZ,MAAM,EAAE;MACnC,OAAO,KAAK;IACd;IAEA,KAAK,IAAIa,KAAK,GAAG,CAAC,EAAEA,KAAK,GAAGF,OAAO,CAACX,MAAM,EAAEa,KAAK,EAAE,EAAE;MACnD,MAAMC,QAAQ,GAAGH,OAAO,CAACE,KAAK,CAAC;MAE/B,IAAIC,QAAQ,KAAK,GAAG,IAAIA,QAAQ,KAAKF,KAAK,CAACC,KAAK,CAAC,EAAE;QACjD,OAAO,KAAK;MACd;IACF;IAEA,OAAO,IAAI;EACb;EAEQlB,aAAaA,CAACH,YAA0B,EAAED,KAAe,EAAU;IACzE,OACEC,YAAY,CAACuB,iBAAiB,EAAEC,GAAG,CAAEH,KAAK,IAAKtB,KAAK,CAACsB,KAAK,CAAC,CAAC,CAACI,IAAI,CAAC,EAAE,CAAC,IACrE,EAAE;EAEN;AACF","ignoreList":[]}
|
|
@@ -27,13 +27,16 @@ const toHex = byte => (byte & BYTE_MASK).toString(16).padStart(2, "0");
|
|
|
27
27
|
*/
|
|
28
28
|
export class LepuCommandBuilder {
|
|
29
29
|
sequenceNumber = 0;
|
|
30
|
-
constructor(startByte = "a5") {
|
|
30
|
+
constructor(startByte = "a5", options = {}) {
|
|
31
31
|
this.startByte = startByte;
|
|
32
|
+
this.options = options;
|
|
32
33
|
}
|
|
33
34
|
build(command, payload = []) {
|
|
34
|
-
const header = [this.startByte, toHex(command), toHex(~command), toHex(REQUEST_TYPE), toHex(this.sequenceNumber), toHex(payload.length), toHex(Math.floor(payload.length / BYTE_VALUES))];
|
|
35
|
+
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))];
|
|
35
36
|
const frame = [...header, ...payload.map(toHex)];
|
|
36
|
-
this.
|
|
37
|
+
if (!this.options.fixedSequence) {
|
|
38
|
+
this.advanceSequence();
|
|
39
|
+
}
|
|
37
40
|
return [...frame, toHex(calculateCrc8(frame, frame.length))];
|
|
38
41
|
}
|
|
39
42
|
advanceSequence() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["calculateCrc8","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"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/lepu/lepu.command-builder.ts"],"mappings":";;AAAA,SAASA,aAAa,QAAQ,mCAAgC;AAE9D,MAAMC,YAAY,GAAG,IAAI;AACzB,MAAMC,SAAS,GAAG,IAAI;AACtB,MAAMC,WAAW,GAAG,KAAK;;AAEzB;AACA,MAAMC,mBAAmB,GAAG,GAAG;
|
|
1
|
+
{"version":3,"names":["calculateCrc8","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"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/lepu/lepu.command-builder.ts"],"mappings":";;AAAA,SAASA,aAAa,QAAQ,mCAAgC;AAE9D,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;AACA,OAAO,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,CAACL,aAAa,CAACsB,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","ignoreList":[]}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
/* eslint-disable max-lines */
|
|
4
|
+
|
|
3
5
|
import { le32FromHex } from "../../../utils/le-32-from-hex.js";
|
|
4
6
|
import { le32ToBytes } from "../../../utils/le-32-to-bytes.js";
|
|
5
7
|
import { LepuCommand } from "./lepu.commands.js";
|
|
@@ -46,7 +48,10 @@ class LepuFileTransfer {
|
|
|
46
48
|
initialCommands = () => [this.commandFor(LepuCommand.GET_FILE_LIST)];
|
|
47
49
|
nextCommand = frame => {
|
|
48
50
|
const command = lepuCommandOf(frame);
|
|
49
|
-
if (this.isDone
|
|
51
|
+
if (this.isDone) {
|
|
52
|
+
return this.params.afterTransfer?.();
|
|
53
|
+
}
|
|
54
|
+
if (!TRANSFER_COMMANDS.includes(command)) {
|
|
50
55
|
return undefined;
|
|
51
56
|
}
|
|
52
57
|
if (!isLepuSuccess(frame)) {
|
|
@@ -66,10 +71,14 @@ class LepuFileTransfer {
|
|
|
66
71
|
return this.closedFile();
|
|
67
72
|
};
|
|
68
73
|
openNextFile = () => {
|
|
69
|
-
|
|
74
|
+
let name = this.files[this.fileIndex];
|
|
75
|
+
while (name !== undefined && this.params.skipFiles?.has(name)) {
|
|
76
|
+
this.fileIndex++;
|
|
77
|
+
name = this.files[this.fileIndex];
|
|
78
|
+
}
|
|
70
79
|
if (name === undefined) {
|
|
71
80
|
this.isDone = true;
|
|
72
|
-
return
|
|
81
|
+
return this.params.afterTransfer?.();
|
|
73
82
|
}
|
|
74
83
|
this.name = name;
|
|
75
84
|
this.totalBytes = 0;
|