@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":["le32FromHex","le32ToBytes","LepuCommand","lepuNameBytes","lepuNamesFrom","lepuCommandOf","lepuPayloadOf","describeLepuResponseType","isLepuSuccess","FILE_SIZE_OFFSET","MAX_FILE_BYTES","TRANSFER_COMMANDS","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","includes","undefined","fail","openNextFile","openedFile","appendChunk","closedFile","payload","limit","maxFileBytes","closeFile","length","push","onProgress","receivedBytes","onFile","reason","onError","write","builder","build"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/lepu/lepu.file-transfer.ts"],"mappings":";;
|
|
1
|
+
{"version":3,"names":["le32FromHex","le32ToBytes","LepuCommand","lepuNameBytes","lepuNamesFrom","lepuCommandOf","lepuPayloadOf","describeLepuResponseType","isLepuSuccess","FILE_SIZE_OFFSET","MAX_FILE_BYTES","TRANSFER_COMMANDS","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","afterTransfer","includes","undefined","fail","openNextFile","openedFile","appendChunk","closedFile","skipFiles","has","payload","limit","maxFileBytes","closeFile","length","push","onProgress","receivedBytes","onFile","reason","onError","write","builder","build"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/lepu/lepu.file-transfer.ts"],"mappings":";;AAAA;;AAIA,SAASA,WAAW,QAAQ,kCAA+B;AAC3D,SAASC,WAAW,QAAQ,kCAA+B;AAG3D,SAASC,WAAW,QAAQ,oBAAiB;AAC7C,SAASC,aAAa,EAAEC,aAAa,QAAQ,sBAAmB;AAChE,SAASC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A0B,GAAG,EAAE,MACZ;IACnB,GAAG,IAAI,CAAChB,MAAM,CAAC2B,KAAK;IACpBvB,KAAK,EAAE,IAAI,CAACJ,MAAM,CAAC4B,OAAO,CAACC,KAAK,CAACxB,OAAO,EAAEW,OAAO;EACnD,CAAC,CAAC;AACJ;AAEA,SAASzB,gBAAgB","ignoreList":[]}
|
|
@@ -5,40 +5,28 @@ import { LepuCommand } from "./lepu.commands.js";
|
|
|
5
5
|
import { parseLepuDeviceInfo } from "./lepu.device-info.js";
|
|
6
6
|
import { describeLepuResponseType, isLepuSuccess } from "./lepu.response-type.js";
|
|
7
7
|
const COMMAND_INDEX = 1;
|
|
8
|
+
const VIATOM_OXYGEN_INFO = 0x14;
|
|
8
9
|
|
|
9
|
-
/**
|
|
10
|
-
* Asks a Lepu device what it is before sending it anything that acts.
|
|
11
|
-
*
|
|
12
|
-
* The family shares one frame format, one checksum and one opcode space, but not one
|
|
13
|
-
* meaning: `0x08` polls realtime data on a BP2, starts a blood-pressure measurement on an
|
|
14
|
-
* AirBp and starts an ECG on a Lepod. A frame built for the wrong device is therefore
|
|
15
|
-
* perfectly well-formed - the CRC is computed the same way on every one of them - so
|
|
16
|
-
* nothing in the protocol catches a driver bound to the wrong hardware. What comes back is
|
|
17
|
-
* a cuff inflating on someone's arm because a name matched during a scan.
|
|
18
|
-
*
|
|
19
|
-
* `GET_INFO` is the one command that cannot cause that: it is generic, inert, and answered
|
|
20
|
-
* identically family-wide. So it goes first, and everything else waits on its reply.
|
|
21
|
-
*
|
|
22
|
-
* A declaration that names the models it was written for is refused permanently when the
|
|
23
|
-
* device answers with a different one. A declaration that names none is identified by the
|
|
24
|
-
* advertised name it already matched, which is the basis the vendor's own SDK binds every
|
|
25
|
-
* one of its products on; it is asked what it is anyway, and the answer reported, because
|
|
26
|
-
* that is the only place these model numbers exist - the vendor never reads the field back,
|
|
27
|
-
* so there is no table of them to copy.
|
|
28
|
-
*
|
|
29
|
-
* A reply that never arrives leaves the gate closed and nothing sent, which the data
|
|
30
|
-
* processor's stuck-data timeout reports and disconnects on. That is the watchdog for this
|
|
31
|
-
* too - the protocol has no retry of its own, so a dropped reply is recovered by
|
|
32
|
-
* reconnecting rather than by asking again.
|
|
33
|
-
*/
|
|
10
|
+
/** Identifies a device before sending it a model-specific command. */
|
|
34
11
|
export class LepuIdentityGate {
|
|
35
12
|
isIdentified = false;
|
|
36
13
|
isRefused = false;
|
|
37
14
|
constructor(params) {
|
|
38
15
|
this.params = params;
|
|
39
16
|
}
|
|
40
|
-
initialCommands = () =>
|
|
17
|
+
initialCommands = () => {
|
|
18
|
+
if (this.params.protocol === "viatom-oxygen") {
|
|
19
|
+
const command = this.params.setClockBeforeInfo ? this.commandFor(0x16, oxyClockPayload()) : this.commandFor(VIATOM_OXYGEN_INFO);
|
|
20
|
+
this.pendingCommand = this.params.setClockBeforeInfo ? 0x16 : VIATOM_OXYGEN_INFO;
|
|
21
|
+
return [command];
|
|
22
|
+
}
|
|
23
|
+
this.pendingCommand = LepuCommand.GET_INFO;
|
|
24
|
+
return [this.commandFor(LepuCommand.GET_INFO)];
|
|
25
|
+
};
|
|
41
26
|
nextCommand = frame => {
|
|
27
|
+
if (this.params.protocol === "viatom-oxygen") {
|
|
28
|
+
return this.nextViatomOxygenCommand(frame);
|
|
29
|
+
}
|
|
42
30
|
if (this.isRefused) {
|
|
43
31
|
return undefined;
|
|
44
32
|
}
|
|
@@ -48,16 +36,7 @@ export class LepuIdentityGate {
|
|
|
48
36
|
return this.admit(frame);
|
|
49
37
|
};
|
|
50
38
|
|
|
51
|
-
/**
|
|
52
|
-
* Decides on the reply to `GET_INFO`.
|
|
53
|
-
*
|
|
54
|
-
* A frame that is not that reply leaves the gate as it was rather than provoking another
|
|
55
|
-
* command, because the only command outstanding is the one still being waited on.
|
|
56
|
-
*
|
|
57
|
-
* A reply that is that command but carries an error type is refused rather than parsed.
|
|
58
|
-
* The payload of an error is the reason for it, so reading a model number out of it would
|
|
59
|
-
* identify the hardware from an error code.
|
|
60
|
-
*/
|
|
39
|
+
/** Decides on the reply to the generic `GET_INFO` command. */
|
|
61
40
|
admit = frame => {
|
|
62
41
|
if (hexToByte(frame[COMMAND_INDEX] ?? "0") !== LepuCommand.GET_INFO) {
|
|
63
42
|
return undefined;
|
|
@@ -90,9 +69,76 @@ export class LepuIdentityGate {
|
|
|
90
69
|
|
|
91
70
|
/** Nothing, for a declaration that asks what the device is and stops there. */
|
|
92
71
|
poll = () => this.params.pollCommand === undefined ? undefined : [this.commandFor(this.params.pollCommand)];
|
|
93
|
-
commandFor = command => ({
|
|
72
|
+
commandFor = (command, payload = [], delayBeforeWriteMs) => ({
|
|
94
73
|
...this.params.write,
|
|
95
|
-
frame: this.params.builder.build(command)
|
|
74
|
+
frame: this.params.builder.build(command, payload),
|
|
75
|
+
...(this.params.writeWithoutResponse ? {
|
|
76
|
+
withoutResponse: true
|
|
77
|
+
} : {}),
|
|
78
|
+
...(delayBeforeWriteMs === undefined ? {} : {
|
|
79
|
+
delayBeforeWriteMs
|
|
80
|
+
})
|
|
96
81
|
});
|
|
82
|
+
nextViatomOxygenCommand = frame => {
|
|
83
|
+
if (this.isRefused || this.pendingCommand === undefined) {
|
|
84
|
+
return undefined;
|
|
85
|
+
}
|
|
86
|
+
const status = hexToByte(frame[1] ?? "ff");
|
|
87
|
+
if (status !== 0) {
|
|
88
|
+
if (this.pendingCommand === 0x17 && this.isIdentified) {
|
|
89
|
+
return [this.commandFor(0x17, [], 3_000)];
|
|
90
|
+
}
|
|
91
|
+
return this.refuse(`the device rejected command 0x${this.pendingCommand.toString(16).padStart(2, "0")} with status 0x${status.toString(16).padStart(2, "0")}`);
|
|
92
|
+
}
|
|
93
|
+
switch (this.pendingCommand) {
|
|
94
|
+
case 0x16:
|
|
95
|
+
this.pendingCommand = VIATOM_OXYGEN_INFO;
|
|
96
|
+
return [this.commandFor(VIATOM_OXYGEN_INFO)];
|
|
97
|
+
case VIATOM_OXYGEN_INFO:
|
|
98
|
+
{
|
|
99
|
+
const info = parseViatomOxygenDeviceInfo(frame);
|
|
100
|
+
if (!info) {
|
|
101
|
+
return this.refuse("the device answered INFO without a JSON model number");
|
|
102
|
+
}
|
|
103
|
+
this.params.onIdentified?.(info);
|
|
104
|
+
if (this.params.expectedDeviceTypes.length > 0 && !this.params.expectedDeviceTypes.includes(info.deviceType)) {
|
|
105
|
+
return this.refuse(`the hardware reported model ${info.deviceType}, which this declaration was not written for`);
|
|
106
|
+
}
|
|
107
|
+
this.isIdentified = true;
|
|
108
|
+
this.pendingCommand = 0x17;
|
|
109
|
+
return [this.commandFor(0x17, [], 1_000)];
|
|
110
|
+
}
|
|
111
|
+
case 0x17:
|
|
112
|
+
return [this.commandFor(0x17, [], 1_000)];
|
|
113
|
+
default:
|
|
114
|
+
return undefined;
|
|
115
|
+
}
|
|
116
|
+
};
|
|
97
117
|
}
|
|
118
|
+
const oxyClockPayload = () => {
|
|
119
|
+
const now = new Date();
|
|
120
|
+
const pad = value => String(value).padStart(2, "0");
|
|
121
|
+
const payload = JSON.stringify({
|
|
122
|
+
SetTIME: `${now.getFullYear()}-${pad(now.getMonth() + 1)}-${pad(now.getDate())},${pad(now.getHours())}:${pad(now.getMinutes())}:${pad(now.getSeconds())}`
|
|
123
|
+
});
|
|
124
|
+
return Array.from(new TextEncoder().encode(payload));
|
|
125
|
+
};
|
|
126
|
+
const parseViatomOxygenDeviceInfo = frame => {
|
|
127
|
+
try {
|
|
128
|
+
const text = frame.slice(7, -1).map(byte => String.fromCharCode(hexToByte(byte))).join("").replace(/\0+$/, "");
|
|
129
|
+
const info = JSON.parse(text);
|
|
130
|
+
const deviceType = Number(info.Model);
|
|
131
|
+
if (!Number.isInteger(deviceType)) {
|
|
132
|
+
return undefined;
|
|
133
|
+
}
|
|
134
|
+
return {
|
|
135
|
+
deviceType,
|
|
136
|
+
protocolMaxLength: 0,
|
|
137
|
+
branchCode: String(info.Branch ?? ""),
|
|
138
|
+
serialNumber: String(info.SN ?? info.SerialNumber ?? "")
|
|
139
|
+
};
|
|
140
|
+
} catch {
|
|
141
|
+
return undefined;
|
|
142
|
+
}
|
|
143
|
+
};
|
|
98
144
|
//# sourceMappingURL=lepu.identity-gate.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["hexToByte","LepuCommand","parseLepuDeviceInfo","describeLepuResponseType","isLepuSuccess","COMMAND_INDEX","LepuIdentityGate","isIdentified","isRefused","constructor","params","initialCommands","commandFor","GET_INFO","nextCommand","frame","undefined","poll","admit","refuse","info","onIdentified","pollCommand","isNarrowed","expectedDeviceTypes","length","includes","deviceType","branchCode","reason","onRefused","
|
|
1
|
+
{"version":3,"names":["hexToByte","LepuCommand","parseLepuDeviceInfo","describeLepuResponseType","isLepuSuccess","COMMAND_INDEX","VIATOM_OXYGEN_INFO","LepuIdentityGate","isIdentified","isRefused","constructor","params","initialCommands","protocol","command","setClockBeforeInfo","commandFor","oxyClockPayload","pendingCommand","GET_INFO","nextCommand","frame","nextViatomOxygenCommand","undefined","poll","admit","refuse","info","onIdentified","pollCommand","isNarrowed","expectedDeviceTypes","length","includes","deviceType","branchCode","reason","onRefused","payload","delayBeforeWriteMs","write","builder","build","writeWithoutResponse","withoutResponse","status","toString","padStart","parseViatomOxygenDeviceInfo","now","Date","pad","value","String","JSON","stringify","SetTIME","getFullYear","getMonth","getDate","getHours","getMinutes","getSeconds","Array","from","TextEncoder","encode","text","slice","map","byte","fromCharCode","join","replace","parse","Number","Model","isInteger","protocolMaxLength","Branch","serialNumber","SN","SerialNumber"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/lepu/lepu.identity-gate.ts"],"mappings":";;AAEA,SAASA,SAAS,QAAQ,+BAA4B;AAGtD,SAASC,WAAW,QAAQ,oBAAiB;AAC7C,SAAyBC,mBAAmB,QAAQ,uBAAoB;AACxE,SACEC,wBAAwB,EACxBC,aAAa,QACR,yBAAsB;AA2B7B,MAAMC,aAAa,GAAG,CAAC;AACvB,MAAMC,kBAAkB,GAAG,IA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AACF,GAAG,CAACW,QAAQ,CAAC,CAAC,CAAC,IAAIT,GAAG,CAACF,GAAG,CAACY,UAAU,CAAC,CAAC,CAAC,IAAIV,GAAG,CAACF,GAAG,CAACa,UAAU,CAAC,CAAC,CAAC;EACzJ,CAAC,CAAC;EAEF,OAAOC,KAAK,CAACC,IAAI,CAAC,IAAIC,WAAW,CAAC,CAAC,CAACC,MAAM,CAAC5B,OAAO,CAAC,CAAC;AACtD,CAAC;AAED,MAAMU,2BAA2B,GAC/B3B,KAAwB,IACO;EAC/B,IAAI;IACF,MAAM8C,IAAI,GAAG9C,KAAK,CACf+C,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CACZC,GAAG,CAAEC,IAAI,IAAKjB,MAAM,CAACkB,YAAY,CAACvE,SAAS,CAACsE,IAAI,CAAC,CAAC,CAAC,CACnDE,IAAI,CAAC,EAAE,CAAC,CACRC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC;IAEtB,MAAM9C,IAAI,GAAG2B,IAAI,CAACoB,KAAK,CAACP,IAAI,CAA4B;IACxD,MAAMjC,UAAU,GAAGyC,MAAM,CAAChD,IAAI,CAACiD,KAAK,CAAC;IAErC,IAAI,CAACD,MAAM,CAACE,SAAS,CAAC3C,UAAU,CAAC,EAAE;MACjC,OAAOX,SAAS;IAClB;IAEA,OAAO;MACLW,UAAU;MACV4C,iBAAiB,EAAE,CAAC;MACpB3C,UAAU,EAAEkB,MAAM,CAAC1B,IAAI,CAACoD,MAAM,IAAI,EAAE,CAAC;MACrCC,YAAY,EAAE3B,MAAM,CAAC1B,IAAI,CAACsD,EAAE,IAAItD,IAAI,CAACuD,YAAY,IAAI,EAAE;IACzD,CAAC;EACH,CAAC,CAAC,MAAM;IACN,OAAO3D,SAAS;EAClB;AACF,CAAC","ignoreList":[]}
|
|
@@ -107,13 +107,17 @@ const lepuTransports = {
|
|
|
107
107
|
const COMMAND_BYTE = 1;
|
|
108
108
|
const lepuDevice = params => {
|
|
109
109
|
const transport = lepuTransports[params.transport ?? "standard"];
|
|
110
|
+
const viatomOxygen = params.protocol === "viatom-oxygen";
|
|
110
111
|
return defineCustomDevice({
|
|
111
112
|
id: params.id ?? "lepu-device",
|
|
112
113
|
nameMatch: params.nameMatch,
|
|
114
|
+
matchByService: params.nameMatch === undefined,
|
|
113
115
|
stuckDataTimeoutMs: params.stuckDataTimeoutMs ?? DEFAULT_STUCK_TIMEOUT_MS,
|
|
114
116
|
preferredMtu: transport.preferredMtu,
|
|
115
117
|
lepu: {
|
|
116
|
-
|
|
118
|
+
protocol: params.protocol,
|
|
119
|
+
startBytes: [viatomOxygen ? "55" : START_BYTE],
|
|
120
|
+
requestStartByte: viatomOxygen ? "aa" : START_BYTE,
|
|
117
121
|
write: {
|
|
118
122
|
serviceUuid: transport.serviceUuid,
|
|
119
123
|
characteristicUuid: transport.writeUuid
|
|
@@ -124,6 +128,12 @@ const lepuDevice = params => {
|
|
|
124
128
|
}),
|
|
125
129
|
...(params.pollCommand === undefined ? {} : {
|
|
126
130
|
pollCommand: params.pollCommand
|
|
131
|
+
}),
|
|
132
|
+
...(params.writeWithoutResponse === undefined ? {} : {
|
|
133
|
+
writeWithoutResponse: params.writeWithoutResponse
|
|
134
|
+
}),
|
|
135
|
+
...(params.setClockBeforeInfo === undefined ? {} : {
|
|
136
|
+
setClockBeforeInfo: params.setClockBeforeInfo
|
|
127
137
|
})
|
|
128
138
|
},
|
|
129
139
|
services: [{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["defineCustomDevice","STANDARD_SERVICE","STANDARD_WRITE","STANDARD_NOTIFY","AW1_SERVICE","AW1_WRITE","AW1_NOTIFY","DING_SERVICE","DING_WRITE","DING_NOTIFY","AI_TELE_SERVICE","AI_TELE_WRITE","AI_TELE_NOTIFY","PREFERRED_MTU","MINIMUM_MTU","DEFAULT_STUCK_TIMEOUT_MS","START_BYTE","lepuTransports","standard","serviceUuid","notifyUuid","writeUuid","preferredMtu","standardSmallMtu","aw1","ding","aiTele","COMMAND_BYTE","lepuDevice","params","transport","id","nameMatch","stuckDataTimeoutMs","lepu","startBytes","write","characteristicUuid","expectedDeviceTypes","fileTransfer","
|
|
1
|
+
{"version":3,"names":["defineCustomDevice","STANDARD_SERVICE","STANDARD_WRITE","STANDARD_NOTIFY","AW1_SERVICE","AW1_WRITE","AW1_NOTIFY","DING_SERVICE","DING_WRITE","DING_NOTIFY","AI_TELE_SERVICE","AI_TELE_WRITE","AI_TELE_NOTIFY","PREFERRED_MTU","MINIMUM_MTU","DEFAULT_STUCK_TIMEOUT_MS","START_BYTE","lepuTransports","standard","serviceUuid","notifyUuid","writeUuid","preferredMtu","standardSmallMtu","aw1","ding","aiTele","COMMAND_BYTE","lepuDevice","params","transport","viatomOxygen","protocol","id","nameMatch","matchByService","undefined","stuckDataTimeoutMs","lepu","startBytes","requestStartByte","write","characteristicUuid","expectedDeviceTypes","fileTransfer","pollCommand","writeWithoutResponse","setClockBeforeInfo","services","uuid","monitor","frame","minLengthBytes","caseSelectorBytes","cases"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/lepu/lepu.transports.ts"],"mappings":";;AAEA,SAASA,kBAAkB,QAAQ,sCAAmC;;AAEtE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,gBAAgB,GAAG,sCAAsC;AAC/D,MAAMC,cAAc,GAAG,sCAAsC;AAC7D,MAAMC,eAAe,GAAG,sCAAsC;;AAE9D;AACA,MAAMC,WAAW,GAAG,sCAAsC;AAC1D,MAAMC,SAAS,GAAG,sCAAsC;AACxD,MAAMC,UAAU,GAAG,sCAAsC;;AAEzD;AACA;AACA;AACA;AACA,MAAMC,YAAY,GAAG,sCAAsC;AAC3D,MAAMC,UAAU,GAAG,sCAAsC;AACzD,MAAMC,WAAW,GAAG,sCAAsC;;AA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B,SAAS,CAACV,UAAU;QAC1B+B,KAAK,EAAE;UAAEC,cAAc,EAAEvB,MAAM,CAACuB;QAAe,CAAC;QAChDC,iBAAiB,EAAExB,MAAM,CAACwB,iBAAiB,IAAI,CAAC1B,YAAY,CAAC;QAC7D2B,KAAK,EAAEzB,MAAM,CAACyB;MAChB,CAAC;IAEL,CAAC;EAEL,CAAC,CAAC;AACJ,CAAC;AAED,SAAS1B,UAAU,EAAEX,cAAc","ignoreList":[]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { CustomDevice } from "../custom/custom.device.js";
|
|
4
|
+
import { viatomOximeter } from "../viatom/viatom.oximeters.js";
|
|
5
|
+
|
|
6
|
+
/** Keeps the legacy IntegratedDevices.SPO2 entry on the working Viatom protocol. */
|
|
7
|
+
export class OxyfitDevice extends CustomDevice {
|
|
8
|
+
constructor(device, params) {
|
|
9
|
+
super(device, params, viatomOximeter("Oxyfit", {
|
|
10
|
+
id: "integrated-oxyfit"
|
|
11
|
+
}));
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=oxyfit.device.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["CustomDevice","viatomOximeter","OxyfitDevice","constructor","device","params","id"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/spo/oxyfit.device.ts"],"mappings":";;AAKA,SAASA,YAAY,QAAQ,4BAAyB;AACtD,SAASC,cAAc,QAAQ,+BAA4B;;AAE3D;AACA,OAAO,MAAMC,YAAY,SAASF,YAAY,CAAC;EACtCG,WAAWA,CAChBC,MAAc,EACdC,MAAkD,EAClD;IACA,KAAK,CACHD,MAAM,EACNC,MAAM,EACNJ,cAAc,CAAC,QAAQ,EAAE;MAAEK,EAAE,EAAE;IAAoB,CAAC,CACtD,CAAC;EACH;AACF","ignoreList":[]}
|
package/lib/module/modules/bt-management/services/devices/standard-gatt/standard-gatt.devices.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
/* eslint-disable max-lines */
|
|
4
|
+
|
|
3
5
|
import { MeasurementTypeKey } from "@ovok/core";
|
|
4
6
|
import { declareProfile, littleEndian } from "./standard-gatt.profile.js";
|
|
5
7
|
|
|
@@ -69,9 +71,35 @@ const standardThermometerDevice = params => declareProfile(params, {
|
|
|
69
71
|
characteristic: "2a1c",
|
|
70
72
|
minLengthBytes: 5,
|
|
71
73
|
measurementTypeKey: MeasurementTypeKey.temperature,
|
|
72
|
-
/**
|
|
73
|
-
selectors: ["00", "02"],
|
|
74
|
-
fields: [littleEndian("bodyTemp", [1, 2, 3, 4], "Cel", "float")]
|
|
74
|
+
/** All combinations of Fahrenheit, timestamp and temperature type flags. */
|
|
75
|
+
selectors: ["00", "02", "04", "06", "01", "03", "05", "07"],
|
|
76
|
+
fields: [littleEndian("bodyTemp", [1, 2, 3, 4], "Cel", "float")],
|
|
77
|
+
fieldsBySelector: {
|
|
78
|
+
"01": [{
|
|
79
|
+
...littleEndian("bodyTemp", [1, 2, 3, 4], "Cel", "float"),
|
|
80
|
+
scale: 5 / 9,
|
|
81
|
+
offset: -160 / 9,
|
|
82
|
+
decimals: 2
|
|
83
|
+
}],
|
|
84
|
+
"03": [{
|
|
85
|
+
...littleEndian("bodyTemp", [1, 2, 3, 4], "Cel", "float"),
|
|
86
|
+
scale: 5 / 9,
|
|
87
|
+
offset: -160 / 9,
|
|
88
|
+
decimals: 2
|
|
89
|
+
}],
|
|
90
|
+
"05": [{
|
|
91
|
+
...littleEndian("bodyTemp", [1, 2, 3, 4], "Cel", "float"),
|
|
92
|
+
scale: 5 / 9,
|
|
93
|
+
offset: -160 / 9,
|
|
94
|
+
decimals: 2
|
|
95
|
+
}],
|
|
96
|
+
"07": [{
|
|
97
|
+
...littleEndian("bodyTemp", [1, 2, 3, 4], "Cel", "float"),
|
|
98
|
+
scale: 5 / 9,
|
|
99
|
+
offset: -160 / 9,
|
|
100
|
+
decimals: 2
|
|
101
|
+
}]
|
|
102
|
+
}
|
|
75
103
|
});
|
|
76
104
|
|
|
77
105
|
/** The SI weight resolution the specification fixes at five grams per count. */
|
|
@@ -87,13 +115,25 @@ const standardWeightScaleDevice = params => declareProfile(params, {
|
|
|
87
115
|
characteristic: "2a9d",
|
|
88
116
|
minLengthBytes: 3,
|
|
89
117
|
measurementTypeKey: MeasurementTypeKey.bodyWeight,
|
|
90
|
-
/**
|
|
91
|
-
selectors:
|
|
118
|
+
/** Unit, timestamp, user-id and BMI/height flags may all follow the value. */
|
|
119
|
+
selectors: Array.from({
|
|
120
|
+
length: 16
|
|
121
|
+
}, (_, flags) => flags.toString(16).padStart(2, "0")),
|
|
92
122
|
fields: [{
|
|
93
123
|
...littleEndian("bodyWeight", [1, 2], "kg", "uint"),
|
|
94
124
|
scale: WEIGHT_KG_PER_COUNT,
|
|
95
125
|
decimals: 3
|
|
96
|
-
}]
|
|
126
|
+
}],
|
|
127
|
+
fieldsBySelector: Object.fromEntries(Array.from({
|
|
128
|
+
length: 16
|
|
129
|
+
}, (_, flags) => {
|
|
130
|
+
const selector = flags.toString(16).padStart(2, "0");
|
|
131
|
+
return [selector, [{
|
|
132
|
+
...littleEndian("bodyWeight", [1, 2], "kg", "uint"),
|
|
133
|
+
scale: flags & 1 ? 0.01 * 0.45359237 : WEIGHT_KG_PER_COUNT,
|
|
134
|
+
decimals: 3
|
|
135
|
+
}]];
|
|
136
|
+
}))
|
|
97
137
|
});
|
|
98
138
|
|
|
99
139
|
/**
|
|
@@ -114,22 +154,38 @@ const standardPulseOximeterDevice = params => declareProfile(params, {
|
|
|
114
154
|
/**
|
|
115
155
|
* Heart Rate Service 0x180D, Heart Rate Measurement 0x2A37.
|
|
116
156
|
*
|
|
117
|
-
*
|
|
118
|
-
*
|
|
119
|
-
* is left out rather than made to displace it.
|
|
157
|
+
* Both heart-rate layouts are declared. A contact-not-detected frame is idle, so it cannot
|
|
158
|
+
* become a false reading while the strap is off the body.
|
|
120
159
|
*/
|
|
121
160
|
const standardHeartRateDevice = params => declareProfile(params, {
|
|
122
161
|
service: "180d",
|
|
123
162
|
characteristic: "2a37",
|
|
124
163
|
minLengthBytes: 2,
|
|
125
164
|
measurementTypeKey: MeasurementTypeKey.heartRate,
|
|
126
|
-
selectors:
|
|
165
|
+
selectors: Array.from({
|
|
166
|
+
length: 32
|
|
167
|
+
}, (_, flags) => flags).filter(flags => (flags & 0x06) !== 0x04).map(flags => flags.toString(16).padStart(2, "0")),
|
|
127
168
|
fields: [{
|
|
128
169
|
name: "heartRate",
|
|
129
170
|
byteIndexes: [1],
|
|
130
171
|
encoding: "uint",
|
|
131
172
|
unit: "bpm"
|
|
132
|
-
}]
|
|
173
|
+
}],
|
|
174
|
+
fieldsBySelector: Object.fromEntries(Array.from({
|
|
175
|
+
length: 32
|
|
176
|
+
}, (_, flags) => flags).filter(flags => (flags & 0x01) === 0x01).filter(flags => (flags & 0x06) !== 0x04).map(flags => [flags.toString(16).padStart(2, "0"), [{
|
|
177
|
+
name: "heartRate",
|
|
178
|
+
byteIndexes: [1, 2],
|
|
179
|
+
byteOrder: "little",
|
|
180
|
+
encoding: "uint",
|
|
181
|
+
unit: "bpm"
|
|
182
|
+
}]])),
|
|
183
|
+
optionalFields: Object.fromEntries(Array.from({
|
|
184
|
+
length: 32
|
|
185
|
+
}, (_, flags) => flags).filter(flags => (flags & 0x01) === 0x01).filter(flags => (flags & 0x06) !== 0x04).map(flags => [flags.toString(16).padStart(2, "0"), {
|
|
186
|
+
fields: [],
|
|
187
|
+
minLengthBytes: 3
|
|
188
|
+
}]))
|
|
133
189
|
});
|
|
134
190
|
export { standardBloodPressureDevice, standardHeartRateDevice, standardPulseOximeterDevice, standardThermometerDevice, standardWeightScaleDevice };
|
|
135
191
|
//# sourceMappingURL=standard-gatt.devices.js.map
|
package/lib/module/modules/bt-management/services/devices/standard-gatt/standard-gatt.devices.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["MeasurementTypeKey","declareProfile","littleEndian","pulseAfterMeanPressure","fields","minLengthBytes","pulseAfterTimestamp","standardBloodPressureDevice","params","service","characteristic","measurementTypeKey","bloodPressure","selectors","optionalFields","standardThermometerDevice","temperature","WEIGHT_KG_PER_COUNT","standardWeightScaleDevice","bodyWeight","
|
|
1
|
+
{"version":3,"names":["MeasurementTypeKey","declareProfile","littleEndian","pulseAfterMeanPressure","fields","minLengthBytes","pulseAfterTimestamp","standardBloodPressureDevice","params","service","characteristic","measurementTypeKey","bloodPressure","selectors","optionalFields","standardThermometerDevice","temperature","fieldsBySelector","scale","offset","decimals","WEIGHT_KG_PER_COUNT","standardWeightScaleDevice","bodyWeight","Array","from","length","_","flags","toString","padStart","Object","fromEntries","selector","standardPulseOximeterDevice","bloodOxygenPulseRate","standardHeartRateDevice","heartRate","filter","map","name","byteIndexes","encoding","unit","byteOrder"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/standard-gatt/standard-gatt.devices.ts"],"mappings":";;AAAA;;AAEA,SAASA,kBAAkB,QAAQ,YAAY;AAI/C,SACEC,cAAc,EACdC,YAAY,QAEP,4BAAyB;;AAEhC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,sBAAsB,GAAG;EAC7BC,MAAM,EAAE,CAACF,YAAY,CAAC,WAAW,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC;EAC5DG,cAAc,EAAE;AAClB,CAAC;;AAED;AACA,MAAMC,mBAAmB,GAAG;EAC1BF,MAAM,EAAE,CAACF,YAAY,CAAC,WAAW,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC;EAC9DG,cAAc,EAAE;AAClB,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AAEC,KAAK,KAAKA,KAAK,CAAC,CAC5CU,MAAM,CAAEV,KAAK,IAAK,CAACA,KAAK,GAAG,IAAI,MAAM,IAAI,CAAC,CAC1CU,MAAM,CAAEV,KAAK,IAAK,CAACA,KAAK,GAAG,IAAI,MAAM,IAAI,CAAC,CAC1CW,GAAG,CAAEX,KAAK,IAAK,CACdA,KAAK,CAACC,QAAQ,CAAC,EAAE,CAAC,CAACC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,EACnC,CACE;IACEU,IAAI,EAAE,WAAW;IACjBC,WAAW,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;IACnBG,SAAS,EAAE,QAAiB;IAC5BF,QAAQ,EAAE,MAAe;IACzBC,IAAI,EAAE;EACR,CAAC,CACF,CACF,CACL,CAAC;EACD7B,cAAc,EAAEiB,MAAM,CAACC,WAAW,CAChCR,KAAK,CAACC,IAAI,CAAC;IAAEC,MAAM,EAAE;EAAG,CAAC,EAAE,CAACC,CAAC,EAAEC,KAAK,KAAKA,KAAK,CAAC,CAC5CU,MAAM,CAAEV,KAAK,IAAK,CAACA,KAAK,GAAG,IAAI,MAAM,IAAI,CAAC,CAC1CU,MAAM,CAAEV,KAAK,IAAK,CAACA,KAAK,GAAG,IAAI,MAAM,IAAI,CAAC,CAC1CW,GAAG,CAAEX,KAAK,IAAK,CAACA,KAAK,CAACC,QAAQ,CAAC,EAAE,CAAC,CAACC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE;IACpD1B,MAAM,EAAE,EAAE;IACVC,cAAc,EAAE;EAClB,CAAC,CAAC,CACN;AACF,CAAC,CAAC;AAEJ,SACEE,2BAA2B,EAC3B6B,uBAAuB,EACvBF,2BAA2B,EAC3BnB,yBAAyB,EACzBO,yBAAyB","ignoreList":[]}
|
package/lib/module/modules/bt-management/services/devices/standard-gatt/standard-gatt.profile.js
CHANGED
|
@@ -15,7 +15,8 @@ const sigUuid = assigned => `0000${assigned}-0000-1000-8000-00805f9b34fb`;
|
|
|
15
15
|
const declareProfile = (params, profile) => defineCustomDevice({
|
|
16
16
|
id: params.id ?? `standard-${profile.measurementTypeKey}`,
|
|
17
17
|
nameMatch: params.nameMatch,
|
|
18
|
-
matchByService:
|
|
18
|
+
matchByService: params.nameMatch === undefined,
|
|
19
|
+
oneReadingPerConnection: params.oneReadingPerConnection,
|
|
19
20
|
stuckDataTimeoutMs: params.stuckDataTimeoutMs ?? SPOT_CHECK_TIMEOUT_MS,
|
|
20
21
|
services: [{
|
|
21
22
|
uuid: sigUuid(profile.service),
|
|
@@ -27,11 +28,12 @@ const declareProfile = (params, profile) => defineCustomDevice({
|
|
|
27
28
|
caseSelectorBytes: [0],
|
|
28
29
|
cases: profile.selectors.map(selector => {
|
|
29
30
|
const optional = profile.optionalFields?.[selector];
|
|
31
|
+
const fields = profile.fieldsBySelector?.[selector] ?? profile.fields;
|
|
30
32
|
return {
|
|
31
33
|
selector,
|
|
32
34
|
kind: "result",
|
|
33
35
|
measurementTypeKey: profile.measurementTypeKey,
|
|
34
|
-
fields: [...
|
|
36
|
+
fields: [...fields, ...(optional?.fields ?? [])],
|
|
35
37
|
...(optional ? {
|
|
36
38
|
minLengthBytes: optional.minLengthBytes
|
|
37
39
|
} : {})
|
package/lib/module/modules/bt-management/services/devices/standard-gatt/standard-gatt.profile.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["defineCustomDevice","SPOT_CHECK_TIMEOUT_MS","sigUuid","assigned","declareProfile","params","profile","id","measurementTypeKey","nameMatch","matchByService","stuckDataTimeoutMs","services","uuid","service","monitor","characteristic","frame","minLengthBytes","caseSelectorBytes","cases","selectors","map","selector","optional","optionalFields","
|
|
1
|
+
{"version":3,"names":["defineCustomDevice","SPOT_CHECK_TIMEOUT_MS","sigUuid","assigned","declareProfile","params","profile","id","measurementTypeKey","nameMatch","matchByService","undefined","oneReadingPerConnection","stuckDataTimeoutMs","services","uuid","service","monitor","characteristic","frame","minLengthBytes","caseSelectorBytes","cases","selectors","map","selector","optional","optionalFields","fields","fieldsBySelector","kind","littleEndian","name","byteIndexes","unit","encoding","byteOrder"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/standard-gatt/standard-gatt.profile.ts"],"mappings":";;AAIA,SAASA,kBAAkB,QAAQ,sCAAmC;;AAEtE;AACA,MAAMC,qBAAqB,GAAG,MAAM;AAiDpC,MAAMC,OAAO,GAAIC,QAAgB,IAC/B,OAAOA,QAAQ,8BAA8B;;AAE/C;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,cAAc,GAAGA,CACrBC,MAA4B,EAC5BC,OAAoB,KAEpBN,kBAAkB,CAAC;EACjBO,EAAE,EAAEF,MAAM,CAACE,EAAE,IAAI,YAAYD,OAAO,CAACE,kBAAkB,EAAE;EACzDC,SAAS,EAAEJ,MAAM,CAACI,SAAS;EAC3BC,cAAc,EAAEL,MAAM,CAACI,SAAS,KAAKE,SAAS;EAC9CC,uBAAuB,EAAEP,MAAM,CAACO,uBAAuB;EACvDC,kBAAkB,EAAER,MAAM,CAACQ,kBAAkB,IAAIZ,qBAAqB;EACtEa,QAAQ,EAAE,CACR;IACEC,IAAI,EAAEb,OAAO,CAACI,OAAO,CAACU,OAAO,CAAC;IAC9BC,OAAO,EAAE,CACP;MACEF,IAAI,EAAEb,OAAO,CAACI,OAAO,CAACY,cAAc,CAAC;MACrCC,KAAK,EAAE;QAAEC,cAAc,EAAEd,OAAO,CAACc;MAAe,CAAC;MACjDC,iBAAiB,EAAE,CAAC,CAAC,CAAC;MACtBC,KAAK,EAAEhB,OAAO,CAACiB,SAAS,CAACC,GAAG,CAAEC,QAAQ,IAAK;QACzC,MAAMC,QAAQ,GAAGpB,OAAO,CAACqB,cAAc,GAAGF,QAAQ,CAAC;QAEnD,MAAMG,MAAM,GACVtB,OAAO,CAACuB,gBAAgB,GAAGJ,QAAQ,CAAC,IAAInB,OAAO,CAACsB,MAAM;QAExD,OAAO;UACLH,QAAQ;UACRK,IAAI,EAAE,QAAiB;UACvBtB,kBAAkB,EAAEF,OAAO,CAACE,kBAAkB;UAC9CoB,MAAM,EAAE,CAAC,GAAGA,MAAM,EAAE,IAAIF,QAAQ,EAAEE,MAAM,IAAI,EAAE,CAAC,CAAC;UAChD,IAAIF,QAAQ,GACR;YAAEN,cAAc,EAAEM,QAAQ,CAACN;UAAe,CAAC,GAC3C,CAAC,CAAC;QACR,CAAC;MACH,CAAC;IACH,CAAC;EAEL,CAAC;AAEL,CAAC,CAAC;AAEJ,MAAMW,YAAY,GAAGA,CACnBC,IAAY,EACZC,WAAqB,EACrBC,IAAY,EACZC,QAAqC,MAChB;EACrBH,IAAI;EACJC,WAAW;EACXG,SAAS,EAAE,QAAQ;EACnBD,QAAQ;EACRD;AACF,CAAC,CAAC;AAEF,SAAS9B,cAAc,EAAE2B,YAAY,EAAE7B,OAAO","ignoreList":[]}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { MeasurementTypeKey } from "@ovok/core";
|
|
4
|
+
import { defineCustomDevice } from "../../custom/define-custom-device.js";
|
|
5
|
+
import { CustomDevice } from "../custom/custom.device.js";
|
|
6
|
+
import { MySenseFrameReader } from "./mysense.frame-reader.js";
|
|
7
|
+
import { MySenseSequencer } from "./mysense.sequencer.js";
|
|
8
|
+
const SERVICE = "0000fff0-0000-1000-8000-00805f9b34fb";
|
|
9
|
+
const NOTIFY = "0000fff1-0000-1000-8000-00805f9b34fb";
|
|
10
|
+
const definition = defineCustomDevice({
|
|
11
|
+
id: "cyclotest-mysense",
|
|
12
|
+
nameMatch: "mySense",
|
|
13
|
+
stuckDataTimeoutMs: 30_000,
|
|
14
|
+
services: [{
|
|
15
|
+
uuid: SERVICE,
|
|
16
|
+
monitor: [{
|
|
17
|
+
uuid: NOTIFY,
|
|
18
|
+
frame: {
|
|
19
|
+
minLengthBytes: 17
|
|
20
|
+
},
|
|
21
|
+
caseSelectorBytes: [4],
|
|
22
|
+
cases: [{
|
|
23
|
+
selector: "a1",
|
|
24
|
+
kind: "idle",
|
|
25
|
+
minLengthBytes: 20,
|
|
26
|
+
description: "mySense greeting"
|
|
27
|
+
}, {
|
|
28
|
+
selector: "a3",
|
|
29
|
+
kind: "result",
|
|
30
|
+
minLengthBytes: 17,
|
|
31
|
+
repeatedRecords: {
|
|
32
|
+
recordBytes: 9,
|
|
33
|
+
from: 8
|
|
34
|
+
},
|
|
35
|
+
measurementTypeKey: MeasurementTypeKey.temperature,
|
|
36
|
+
description: "mySense stored temperature history",
|
|
37
|
+
fields: [{
|
|
38
|
+
name: "bodyTemp",
|
|
39
|
+
byteIndexes: [5, 6],
|
|
40
|
+
encoding: "decimal-pair",
|
|
41
|
+
unit: "Cel",
|
|
42
|
+
decimals: 2
|
|
43
|
+
}]
|
|
44
|
+
}]
|
|
45
|
+
}]
|
|
46
|
+
}]
|
|
47
|
+
});
|
|
48
|
+
export class MySenseDevice extends CustomDevice {
|
|
49
|
+
reportedHistory = false;
|
|
50
|
+
constructor(device, params) {
|
|
51
|
+
super(device, params, definition);
|
|
52
|
+
this.frameReader = new MySenseFrameReader();
|
|
53
|
+
this.createCommandSequencer = () => {
|
|
54
|
+
this.reportedHistory = false;
|
|
55
|
+
return new MySenseSequencer({
|
|
56
|
+
onGreeting: frame => {
|
|
57
|
+
this.deviceData.sn = frame.slice(5, 11).join(":");
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
shouldReportDependentResult = data => {
|
|
63
|
+
if (data.parsingCase.caseValue !== "a3") {
|
|
64
|
+
return true;
|
|
65
|
+
}
|
|
66
|
+
if (this.reportedHistory) {
|
|
67
|
+
return false;
|
|
68
|
+
}
|
|
69
|
+
this.reportedHistory = true;
|
|
70
|
+
return true;
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
//# sourceMappingURL=mysense.device.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["MeasurementTypeKey","defineCustomDevice","CustomDevice","MySenseFrameReader","MySenseSequencer","SERVICE","NOTIFY","definition","id","nameMatch","stuckDataTimeoutMs","services","uuid","monitor","frame","minLengthBytes","caseSelectorBytes","cases","selector","kind","description","repeatedRecords","recordBytes","from","measurementTypeKey","temperature","fields","name","byteIndexes","encoding","unit","decimals","MySenseDevice","reportedHistory","constructor","device","params","frameReader","createCommandSequencer","onGreeting","deviceData","sn","slice","join","shouldReportDependentResult","data","parsingCase","caseValue"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/uebe/mysense.device.ts"],"mappings":";;AAAA,SAASA,kBAAkB,QAAQ,YAAY;AAQ/C,SAASC,kBAAkB,QAAQ,sCAAmC;AACtE,SAASC,YAAY,QAAQ,4BAAyB;AAEtD,SAASC,kBAAkB,QAAQ,2BAAwB;AAC3D,SAASC,gBAAgB,QAAQ,wBAAqB;AAEtD,MAAMC,OAAO,GAAG,sCAAsC;AACtD,MAAMC,MAAM,GAAG,sCAAsC;AAMrD,MAAMC,UAAU,GAAGN,kBAAkB,CAAC;EACpCO,EAAE,EAAE,mBAAmB;EACvBC,SAAS,EAAE,SAAS;EACpBC,kBAAkB,EAAE,MAAM;EAC1BC,QAAQ,EAAE,CACR;IACEC,IAAI,EAAEP,OAAO;IACbQ,OAAO,EAAE,CACP;MACED,IAAI,EAAEN,MAAM;MACZQ,KAAK,EAAE;QAAEC,cAAc,EAAE;MAAG,CAAC;MAC7BC,iBAAiB,EAAE,CAAC,CAAC,CAAC;MACtBC,KAAK,EAAE,CACL;QACEC,QAAQ,EAAE,IAAI;QACdC,IAAI,EAAE,MAAM;QACZJ,cAAc,EAAE,EAAE;QAClBK,WAAW,EAAE;MACf,CAAC,EACD;QACEF,QAAQ,EAAE,IAAI;QACdC,IAAI,EAAE,QAAQ;QACdJ,cAAc,EAAE,EAAE;QAClBM,eAAe,EAAE;UAAEC,WAAW,EAAE,CAAC;UAAEC,IAAI,EAAE;QAAE,CAAC;QAC5CC,kBAAkB,EAAExB,kBAAkB,CAACyB,WAAW;QAClDL,WAAW,EAAE,oCAAoC;QACjDM,MAAM,EAAE,CACN;UACEC,IAAI,EAAE,UAAU;UAChBC,WAAW,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;UACnBC,QAAQ,EAAE,cAAc;UACxBC,IAAI,EAAE,KAAK;UACXC,QAAQ,EAAE;QACZ,CAAC;MAEL,CAAC;IAEL,CAAC;EAEL,CAAC;AAEL,CAAC,CAAC;AAEF,OAAO,MAAMC,aAAa,SAAS9B,YAAY,CAAC;EACtC+B,eAAe,GAAG,KAAK;EAExBC,WAAWA,CAChBC,MAAc,EACdC,MAAqD,EACrD;IACA,KAAK,CACHD,MAAM,EACNC,MAAM,EACN7B,UACF,CAAC;IAED,IAAI,CAAC8B,WAAW,GAAG,IAAIlC,kBAAkB,CAAC,CAAC;IAC3C,IAAI,CAACmC,sBAAsB,GAAG,MAAM;MAClC,IAAI,CAACL,eAAe,GAAG,KAAK;MAE5B,OAAO,IAAI7B,gBAAgB,CAAC;QAC1BmC,UAAU,EAAGzB,KAAK,IAAK;UACrB,IAAI,CAAC0B,UAAU,CAACC,EAAE,GAAG3B,KAAK,CAAC4B,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAACC,IAAI,CAAC,GAAG,CAAC;QACnD;MACF,CAAC,CAAC;IACJ,CAAC;EACH;EAEUC,2BAA2B,GAAIC,IAAmB,IAAc;IACxE,IAAIA,IAAI,CAACC,WAAW,CAACC,SAAS,KAAK,IAAI,EAAE;MACvC,OAAO,IAAI;IACb;IAEA,IAAI,IAAI,CAACd,eAAe,EAAE;MACxB,OAAO,KAAK;IACd;IAEA,IAAI,CAACA,eAAe,GAAG,IAAI;IAE3B,OAAO,IAAI;EACb,CAAC;AACH","ignoreList":[]}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { FrameReadStatus } from "../../../types/frame-read-status.js";
|
|
4
|
+
import { hexToByte } from "../../../utils/hex-to-byte.js";
|
|
5
|
+
const START = "4d";
|
|
6
|
+
const HEADER_BYTES = 4;
|
|
7
|
+
const MAX_FRAME_BYTES = 512;
|
|
8
|
+
const A3 = 0xa3;
|
|
9
|
+
const byteAt = (frame, index) => hexToByte(frame[index] ?? "0");
|
|
10
|
+
|
|
11
|
+
/** Reads mySense frames by their big-endian length, independent of notification boundaries. */
|
|
12
|
+
export class MySenseFrameReader {
|
|
13
|
+
readFrame(buffer) {
|
|
14
|
+
const start = buffer.findIndex(byte => byte.toLowerCase() === START);
|
|
15
|
+
if (start === -1) {
|
|
16
|
+
return {
|
|
17
|
+
status: FrameReadStatus.INCOMPLETE,
|
|
18
|
+
consumedBytes: Math.max(0, buffer.length - 1)
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
if (start + HEADER_BYTES > buffer.length) {
|
|
22
|
+
return {
|
|
23
|
+
status: FrameReadStatus.INCOMPLETE,
|
|
24
|
+
consumedBytes: start
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
const payloadLength = byteAt(buffer, start + 2) << 8 | byteAt(buffer, start + 3);
|
|
28
|
+
const frameLength = HEADER_BYTES + payloadLength;
|
|
29
|
+
if (payloadLength < 2 || frameLength > MAX_FRAME_BYTES) {
|
|
30
|
+
return {
|
|
31
|
+
status: FrameReadStatus.CORRUPT,
|
|
32
|
+
consumedBytes: start + 1
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
if (start + frameLength > buffer.length) {
|
|
36
|
+
return {
|
|
37
|
+
status: FrameReadStatus.INCOMPLETE,
|
|
38
|
+
consumedBytes: start
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
const frame = buffer.slice(start, start + frameLength);
|
|
42
|
+
if (!this.isValid(frame)) {
|
|
43
|
+
return {
|
|
44
|
+
status: FrameReadStatus.CORRUPT,
|
|
45
|
+
consumedBytes: start + 1
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
return {
|
|
49
|
+
status: FrameReadStatus.COMPLETE,
|
|
50
|
+
consumedBytes: start + frameLength,
|
|
51
|
+
frame
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
isValid(frame) {
|
|
55
|
+
const declared = byteAt(frame, frame.length - 1);
|
|
56
|
+
const actual = frame.slice(0, -1).reduce((sum, _, index, bytes) => sum + byteAt(bytes, index) & 0xff, 0);
|
|
57
|
+
if (declared !== actual) {
|
|
58
|
+
return false;
|
|
59
|
+
}
|
|
60
|
+
if (byteAt(frame, 4) !== A3) {
|
|
61
|
+
return true;
|
|
62
|
+
}
|
|
63
|
+
const count = byteAt(frame, 6) << 8 | byteAt(frame, 7);
|
|
64
|
+
const recordsStart = 8;
|
|
65
|
+
if (frame.length !== recordsStart + count * 9 + 1) {
|
|
66
|
+
return false;
|
|
67
|
+
}
|
|
68
|
+
for (let record = 0; record < count; record++) {
|
|
69
|
+
const from = recordsStart + record * 9;
|
|
70
|
+
const recordSum = frame.slice(from, from + 8).reduce((sum, _, index, bytes) => sum + byteAt(bytes, index) & 0xff, 0);
|
|
71
|
+
if (recordSum !== byteAt(frame, from + 8)) {
|
|
72
|
+
return false;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
return true;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
//# sourceMappingURL=mysense.frame-reader.js.map
|