@ovok/native 1.6.32 → 1.6.34
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/bt-device/constants/device-instruction-pdfs.js +4 -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-device-catalog-entries.js +1 -1
- package/lib/commonjs/modules/bt-device/constants/supported-device-catalog-entries.js.map +1 -1
- package/lib/commonjs/modules/bt-device/constants/supported-devices.js +25 -0
- package/lib/commonjs/modules/bt-device/constants/supported-devices.js.map +1 -1
- package/lib/commonjs/modules/bt-management/constants/integrated-devices-map.js +2 -1
- package/lib/commonjs/modules/bt-management/constants/integrated-devices-map.js.map +1 -1
- package/lib/commonjs/modules/bt-management/index.js +77 -0
- package/lib/commonjs/modules/bt-management/index.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/background-sync/background-service-uuids.js +4 -0
- package/lib/commonjs/modules/bt-management/services/background-sync/background-service-uuids.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/custom/define-custom-device.js +20 -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 +7 -1
- package/lib/commonjs/modules/bt-management/services/device-creator.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/devices/a606/a606.command-sequencer.js +68 -0
- package/lib/commonjs/modules/bt-management/services/devices/a606/a606.command-sequencer.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/devices/a606/a606.device.js +55 -0
- package/lib/commonjs/modules/bt-management/services/devices/a606/a606.device.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/devices/a606/a606.frame-parser.js +36 -0
- package/lib/commonjs/modules/bt-management/services/devices/a606/a606.frame-parser.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/devices/a606/a606.frame-reader.js +68 -0
- package/lib/commonjs/modules/bt-management/services/devices/a606/a606.frame-reader.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/devices/a606/a606.main-services.js +31 -0
- package/lib/commonjs/modules/bt-management/services/devices/a606/a606.main-services.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/devices/bpw1/bpw1.command-sequencer.js +73 -0
- package/lib/commonjs/modules/bt-management/services/devices/bpw1/bpw1.command-sequencer.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/devices/bpw1/bpw1.device.js +55 -0
- package/lib/commonjs/modules/bt-management/services/devices/bpw1/bpw1.device.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/devices/bpw1/bpw1.frame-parser.js +53 -0
- package/lib/commonjs/modules/bt-management/services/devices/bpw1/bpw1.frame-parser.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/devices/bpw1/bpw1.frame-reader.js +55 -0
- package/lib/commonjs/modules/bt-management/services/devices/bpw1/bpw1.frame-reader.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/devices/bpw1/bpw1.main-services.js +30 -0
- package/lib/commonjs/modules/bt-management/services/devices/bpw1/bpw1.main-services.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/devices/bt-data-processor.js +1 -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-managed-device.js +4 -0
- package/lib/commonjs/modules/bt-management/services/devices/bt-managed-device.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/devices/checkme/checkme.device.js +57 -0
- package/lib/commonjs/modules/bt-management/services/devices/checkme/checkme.device.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/devices/checkme/checkme.protocol.js +263 -0
- package/lib/commonjs/modules/bt-management/services/devices/checkme/checkme.protocol.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/devices/checkme/checkme.sequencer.js +255 -0
- package/lib/commonjs/modules/bt-management/services/devices/checkme/checkme.sequencer.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/devices/custom/custom.device.js +87 -6
- package/lib/commonjs/modules/bt-management/services/devices/custom/custom.device.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.transports.js +3 -0
- package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.transports.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/devices/measurement-state-machine.js +1 -0
- package/lib/commonjs/modules/bt-management/services/devices/measurement-state-machine.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/devices/viatom/viatom.ecg-recorders.js +4 -0
- package/lib/commonjs/modules/bt-management/services/devices/viatom/viatom.ecg-recorders.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/devices/viatom/viatom.lepod.js +4 -0
- package/lib/commonjs/modules/bt-management/services/devices/viatom/viatom.lepod.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/devices/viatom/viatom.oximeters.js +10 -0
- package/lib/commonjs/modules/bt-management/services/devices/viatom/viatom.oximeters.js.map +1 -1
- package/lib/commonjs/modules/bt-management/types/clock-sync.js +1 -0
- package/lib/commonjs/modules/bt-management/types/clock-sync.js.map +1 -1
- package/lib/commonjs/modules/bt-management/types/custom-session-policy.js +2 -0
- package/lib/commonjs/modules/bt-management/types/custom-session-policy.js.map +1 -0
- package/lib/commonjs/modules/bt-management/types/integrated-devices.js +3 -0
- package/lib/commonjs/modules/bt-management/types/integrated-devices.js.map +1 -1
- package/lib/module/modules/bt-device/constants/device-instruction-pdfs.js +4 -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-device-catalog-entries.js +1 -1
- package/lib/module/modules/bt-device/constants/supported-device-catalog-entries.js.map +1 -1
- package/lib/module/modules/bt-device/constants/supported-devices.js +26 -1
- package/lib/module/modules/bt-device/constants/supported-devices.js.map +1 -1
- package/lib/module/modules/bt-management/constants/integrated-devices-map.js +2 -1
- package/lib/module/modules/bt-management/constants/integrated-devices-map.js.map +1 -1
- package/lib/module/modules/bt-management/index.js +7 -0
- package/lib/module/modules/bt-management/index.js.map +1 -1
- package/lib/module/modules/bt-management/services/background-sync/background-service-uuids.js +4 -0
- package/lib/module/modules/bt-management/services/background-sync/background-service-uuids.js.map +1 -1
- package/lib/module/modules/bt-management/services/custom/define-custom-device.js +20 -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 +7 -1
- package/lib/module/modules/bt-management/services/device-creator.js.map +1 -1
- package/lib/module/modules/bt-management/services/devices/a606/a606.command-sequencer.js +61 -0
- package/lib/module/modules/bt-management/services/devices/a606/a606.command-sequencer.js.map +1 -0
- package/lib/module/modules/bt-management/services/devices/a606/a606.device.js +45 -0
- package/lib/module/modules/bt-management/services/devices/a606/a606.device.js.map +1 -0
- package/lib/module/modules/bt-management/services/devices/a606/a606.frame-parser.js +32 -0
- package/lib/module/modules/bt-management/services/devices/a606/a606.frame-parser.js.map +1 -0
- package/lib/module/modules/bt-management/services/devices/a606/a606.frame-reader.js +63 -0
- package/lib/module/modules/bt-management/services/devices/a606/a606.frame-reader.js.map +1 -0
- package/lib/module/modules/bt-management/services/devices/a606/a606.main-services.js +28 -0
- package/lib/module/modules/bt-management/services/devices/a606/a606.main-services.js.map +1 -0
- package/lib/module/modules/bt-management/services/devices/bpw1/bpw1.command-sequencer.js +66 -0
- package/lib/module/modules/bt-management/services/devices/bpw1/bpw1.command-sequencer.js.map +1 -0
- package/lib/module/modules/bt-management/services/devices/bpw1/bpw1.device.js +45 -0
- package/lib/module/modules/bt-management/services/devices/bpw1/bpw1.device.js.map +1 -0
- package/lib/module/modules/bt-management/services/devices/bpw1/bpw1.frame-parser.js +48 -0
- package/lib/module/modules/bt-management/services/devices/bpw1/bpw1.frame-parser.js.map +1 -0
- package/lib/module/modules/bt-management/services/devices/bpw1/bpw1.frame-reader.js +50 -0
- package/lib/module/modules/bt-management/services/devices/bpw1/bpw1.frame-reader.js.map +1 -0
- package/lib/module/modules/bt-management/services/devices/bpw1/bpw1.main-services.js +26 -0
- package/lib/module/modules/bt-management/services/devices/bpw1/bpw1.main-services.js.map +1 -0
- package/lib/module/modules/bt-management/services/devices/bt-data-processor.js +1 -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-managed-device.js +4 -0
- package/lib/module/modules/bt-management/services/devices/bt-managed-device.js.map +1 -1
- package/lib/module/modules/bt-management/services/devices/checkme/checkme.device.js +53 -0
- package/lib/module/modules/bt-management/services/devices/checkme/checkme.device.js.map +1 -0
- package/lib/module/modules/bt-management/services/devices/checkme/checkme.protocol.js +247 -0
- package/lib/module/modules/bt-management/services/devices/checkme/checkme.protocol.js.map +1 -0
- package/lib/module/modules/bt-management/services/devices/checkme/checkme.sequencer.js +245 -0
- package/lib/module/modules/bt-management/services/devices/checkme/checkme.sequencer.js.map +1 -0
- package/lib/module/modules/bt-management/services/devices/custom/custom.device.js +87 -6
- package/lib/module/modules/bt-management/services/devices/custom/custom.device.js.map +1 -1
- package/lib/module/modules/bt-management/services/devices/lepu/lepu.transports.js +3 -0
- package/lib/module/modules/bt-management/services/devices/lepu/lepu.transports.js.map +1 -1
- package/lib/module/modules/bt-management/services/devices/measurement-state-machine.js +1 -0
- package/lib/module/modules/bt-management/services/devices/measurement-state-machine.js.map +1 -1
- package/lib/module/modules/bt-management/services/devices/viatom/viatom.ecg-recorders.js +4 -0
- package/lib/module/modules/bt-management/services/devices/viatom/viatom.ecg-recorders.js.map +1 -1
- package/lib/module/modules/bt-management/services/devices/viatom/viatom.lepod.js +4 -0
- package/lib/module/modules/bt-management/services/devices/viatom/viatom.lepod.js.map +1 -1
- package/lib/module/modules/bt-management/services/devices/viatom/viatom.oximeters.js +10 -0
- package/lib/module/modules/bt-management/services/devices/viatom/viatom.oximeters.js.map +1 -1
- package/lib/module/modules/bt-management/types/clock-sync.js +1 -0
- package/lib/module/modules/bt-management/types/clock-sync.js.map +1 -1
- package/lib/module/modules/bt-management/types/custom-device-definition.js.map +1 -1
- package/lib/module/modules/bt-management/types/custom-session-policy.js +2 -0
- package/lib/module/modules/bt-management/types/custom-session-policy.js.map +1 -0
- package/lib/module/modules/bt-management/types/device-measurement-map.js.map +1 -1
- package/lib/module/modules/bt-management/types/integrated-devices.js +3 -0
- package/lib/module/modules/bt-management/types/integrated-devices.js.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-device-catalog-entries.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-device/constants/supported-devices.d.ts +7 -0
- package/lib/typescript/commonjs/src/modules/bt-device/constants/supported-devices.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/index.d.ts +7 -0
- package/lib/typescript/commonjs/src/modules/bt-management/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/background-sync/background-service-uuids.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/a606/a606.command-sequencer.d.ts +22 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/a606/a606.command-sequencer.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/a606/a606.device.d.ts +24 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/a606/a606.device.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/a606/a606.frame-parser.d.ts +10 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/a606/a606.frame-parser.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/a606/a606.frame-reader.d.ts +9 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/a606/a606.frame-reader.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/a606/a606.main-services.d.ts +4 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/a606/a606.main-services.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bpw1/bpw1.command-sequencer.d.ts +21 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bpw1/bpw1.command-sequencer.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bpw1/bpw1.device.d.ts +22 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bpw1/bpw1.device.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bpw1/bpw1.frame-parser.d.ts +9 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bpw1/bpw1.frame-parser.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bpw1/bpw1.frame-reader.d.ts +8 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bpw1/bpw1.frame-reader.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bpw1/bpw1.main-services.d.ts +4 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bpw1/bpw1.main-services.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bt-data-processor.d.ts +1 -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-managed-device.d.ts +2 -0
- 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/checkme/checkme.device.d.ts +18 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/checkme/checkme.device.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/checkme/checkme.protocol.d.ts +79 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/checkme/checkme.protocol.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/checkme/checkme.sequencer.d.ts +52 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/checkme/checkme.sequencer.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/custom/custom.device.d.ts +10 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/custom/custom.device.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.transports.d.ts +3 -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/measurement-state-machine.d.ts +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/measurement-state-machine.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/viatom/viatom.ecg-recorders.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/viatom/viatom.lepod.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/viatom/viatom.oximeters.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/types/clock-sync.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/types/custom-device-definition.d.ts +2 -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 +3 -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-session-policy.d.ts +13 -0
- package/lib/typescript/commonjs/src/modules/bt-management/types/custom-session-policy.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/types/device-measurement-map.d.ts +8 -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 +4 -1
- package/lib/typescript/commonjs/src/modules/bt-management/types/integrated-devices.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-device-catalog-entries.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-device/constants/supported-devices.d.ts +7 -0
- package/lib/typescript/module/src/modules/bt-device/constants/supported-devices.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/index.d.ts +7 -0
- package/lib/typescript/module/src/modules/bt-management/index.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/background-sync/background-service-uuids.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/a606/a606.command-sequencer.d.ts +22 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/a606/a606.command-sequencer.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/a606/a606.device.d.ts +24 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/a606/a606.device.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/a606/a606.frame-parser.d.ts +10 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/a606/a606.frame-parser.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/a606/a606.frame-reader.d.ts +9 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/a606/a606.frame-reader.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/a606/a606.main-services.d.ts +4 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/a606/a606.main-services.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/bpw1/bpw1.command-sequencer.d.ts +21 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/bpw1/bpw1.command-sequencer.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/bpw1/bpw1.device.d.ts +22 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/bpw1/bpw1.device.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/bpw1/bpw1.frame-parser.d.ts +9 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/bpw1/bpw1.frame-parser.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/bpw1/bpw1.frame-reader.d.ts +8 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/bpw1/bpw1.frame-reader.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/bpw1/bpw1.main-services.d.ts +4 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/bpw1/bpw1.main-services.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/bt-data-processor.d.ts +1 -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-managed-device.d.ts +2 -0
- 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/checkme/checkme.device.d.ts +18 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/checkme/checkme.device.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/checkme/checkme.protocol.d.ts +79 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/checkme/checkme.protocol.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/checkme/checkme.sequencer.d.ts +52 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/checkme/checkme.sequencer.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/custom/custom.device.d.ts +10 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/custom/custom.device.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.transports.d.ts +3 -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/measurement-state-machine.d.ts +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/measurement-state-machine.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/devices/viatom/viatom.ecg-recorders.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/devices/viatom/viatom.lepod.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/devices/viatom/viatom.oximeters.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/types/clock-sync.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/types/custom-device-definition.d.ts +2 -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 +3 -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-session-policy.d.ts +13 -0
- package/lib/typescript/module/src/modules/bt-management/types/custom-session-policy.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/types/device-measurement-map.d.ts +8 -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 +4 -1
- package/lib/typescript/module/src/modules/bt-management/types/integrated-devices.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_customDeviceBrand","require","_integratedDevices","_compileCustomLepu","_compileCustomMonitor","_customDeviceError","_normalizeBleUuid","MIN_STUCK_TIMEOUT_MS","MIN_MTU","MAX_MTU","MAX_STUCK_TIMEOUT_MS","HEX_BYTES","assertIdentity","spec","id","trim","customDeviceError","String","builtIn","Object","values","IntegratedDevices","find","name","toLowerCase","compileNameMatch","nameMatch","RegExp","global","sticky","exact","matchByService","replace","assertStuckTimeout","timeout","stuckDataTimeoutMs","Number","isInteger","assertPreferredMtu","mtu","preferredMtu","undefined","compileWrite","path","write","commandHex","test","uuid","normalizeBleUuid","mainCommandUuid","defineCustomDevice","options","stuckDataTimeout","Array","isArray","services","length","fields","Map","frames","seenCharacteristics","Set","mainServices","map","service","serviceIndex","monitor","monitorUuids","monitorIndex","monitorPath","characteristic","frame","compileCustomMonitor","has","add","set","writeUuid","lepu","compileCustomLepu","CUSTOM_DEVICE_BRAND","oneReadingPerConnection","clockSync","setClockBeforeInfo","decorateReading","exports"],"sourceRoot":"../../../../../../src","sources":["modules/bt-management/services/custom/define-custom-device.ts"],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"names":["_customDeviceBrand","require","_integratedDevices","_compileCustomLepu","_compileCustomMonitor","_customDeviceError","_normalizeBleUuid","MIN_STUCK_TIMEOUT_MS","MIN_MTU","MAX_MTU","MAX_STUCK_TIMEOUT_MS","HEX_BYTES","assertIdentity","spec","id","trim","customDeviceError","String","builtIn","Object","values","IntegratedDevices","find","name","toLowerCase","compileNameMatch","nameMatch","RegExp","global","sticky","exact","matchByService","replace","assertStuckTimeout","timeout","stuckDataTimeoutMs","Number","isInteger","assertPreferredMtu","mtu","preferredMtu","undefined","assertSessionPolicy","policy","minSamples","emit","compileWrite","path","write","commandHex","test","uuid","normalizeBleUuid","mainCommandUuid","defineCustomDevice","options","stuckDataTimeout","sessionPolicy","Array","isArray","services","length","fields","Map","frames","seenCharacteristics","Set","mainServices","map","service","serviceIndex","monitor","monitorUuids","monitorIndex","monitorPath","characteristic","frame","compileCustomMonitor","has","add","set","writeUuid","lepu","compileCustomLepu","CUSTOM_DEVICE_BRAND","oneReadingPerConnection","clockSync","setClockBeforeInfo","decorateReading","exports"],"sourceRoot":"../../../../../../src","sources":["modules/bt-management/services/custom/define-custom-device.ts"],"mappings":";;;;;;AAEA,IAAAA,kBAAA,GAAAC,OAAA;AASA,IAAAC,kBAAA,GAAAD,OAAA;AAGA,IAAAE,kBAAA,GAAAF,OAAA;AACA,IAAAG,qBAAA,GAAAH,OAAA;AACA,IAAAI,kBAAA,GAAAJ,OAAA;AACA,IAAAK,iBAAA,GAAAL,OAAA;AAjBA;;AAmBA,MAAMM,oBAAoB,GAAG,KAAK;;AAElC;AACA,MAAMC,OAAO,GAAG,EAAE;AAClB,MAAMC,OAAO,GAAG,GAAG;;AAEnB;AACA,MAAMC,oBAAoB,GAAG,SAAS;AACtC,MAAMC,SAAS,GAAG,kBAAkB;AAEpC,MAAMC,cAAc,GAAIC,IAAsB,IAAa;EACzD,MAAMC,EAAE,GAAG,OAAOD,IAAI,EAAEC,EAAE,KAAK,QAAQ,GAAGD,IAAI,CAACC,EAAE,CAACC,IAAI,CAAC,CAAC,GAAG,oBAAoB;EAE/E,IAAI,CAACD,EAAE,EAAE;IACP,MAAM,IAAAE,oCAAiB,EAACC,MAAM,CAACJ,IAAI,EAAEC,EAAE,CAAC,EAAE,IAAI,EAAE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,GAAG,CAAC,CAAC,GAAG;MAAEyC;IAAK,CAAC,CAAC;IACvC,IAAI3B,OAAO,CAACiC,eAAe,KAAK/C,SAAS,GACrC,CAAC,CAAC,GACF;MAAE+C,eAAe,EAAEjC,OAAO,CAACiC;IAAgB,CAAC;EAClD,CAAC;AACH,CAAC;AAACC,OAAA,CAAAnC,kBAAA,GAAAA,kBAAA","ignoreList":[]}
|
|
@@ -7,10 +7,13 @@ exports.DeviceCreator = void 0;
|
|
|
7
7
|
var _resolveDeviceKey = require("../core/resolve-device-key.js");
|
|
8
8
|
var _integratedDevices = require("../types/integrated-devices.js");
|
|
9
9
|
var _isCustomDeviceDefinition = require("../utils/is-custom-device-definition.js");
|
|
10
|
+
var _a606Device = require("./devices/a606/a606.device.js");
|
|
10
11
|
var _aojDevice = require("./devices/aoj/aoj.device.js");
|
|
11
12
|
var _bc01Device = require("./devices/bc01/bc01.device.js");
|
|
12
13
|
var _bloodGlucoseDevice = require("./devices/blood-glucose/blood-glucose.device.js");
|
|
13
14
|
var _bp2Device = require("./devices/bp2/bp2.device.js");
|
|
15
|
+
var _bpw1Device = require("./devices/bpw1/bpw1.device.js");
|
|
16
|
+
var _checkmeDevice = require("./devices/checkme/checkme.device.js");
|
|
14
17
|
var _customDevice = require("./devices/custom/custom.device.js");
|
|
15
18
|
var _f4Device = require("./devices/f4/f4.device.js");
|
|
16
19
|
var _genialT31Device = require("./devices/genial-t31/genial-t31.device.js");
|
|
@@ -41,7 +44,10 @@ const DEVICE_CLASSES = {
|
|
|
41
44
|
[_integratedDevices.IntegratedDevices.VEROVAL_DUO_CONTROL]: _verovalDuoControlDevice.VerovalDuoControlDevice,
|
|
42
45
|
[_integratedDevices.IntegratedDevices.VEROVAL_ECG]: _verovalEcgDevice.VerovalEcgDevice,
|
|
43
46
|
[_integratedDevices.IntegratedDevices.VEROVAL_ACTIVITY]: _verovalActivityDevice.VerovalActivityDevice,
|
|
44
|
-
[_integratedDevices.IntegratedDevices.GENIAL_T31]: _genialT31Device.GenialT31Device
|
|
47
|
+
[_integratedDevices.IntegratedDevices.GENIAL_T31]: _genialT31Device.GenialT31Device,
|
|
48
|
+
[_integratedDevices.IntegratedDevices.ZH_SG_A606]: _a606Device.A606Device,
|
|
49
|
+
[_integratedDevices.IntegratedDevices.BPW1]: _bpw1Device.Bpw1Device,
|
|
50
|
+
[_integratedDevices.IntegratedDevices.CHECKME]: _checkmeDevice.CheckmeProDevice
|
|
45
51
|
};
|
|
46
52
|
const collectCustomDevices = acceptedDevices => {
|
|
47
53
|
const customDevices = new Map();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_resolveDeviceKey","require","_integratedDevices","_isCustomDeviceDefinition","_aojDevice","_bc01Device","_bloodGlucoseDevice","_bp2Device","_customDevice","_f4Device","_genialT31Device","_oxyfitDevice","_spo2Device","_mysenseDevice","_verovalActivityDevice","_verovalDuoControlDevice","_verovalEcgDevice","DEVICE_CLASSES","IntegratedDevices","BP2","BP2Device","F4","F4Device","PC60WF","SPO2Device","SPO2","OxyfitDevice","MYSENSE","MySenseDevice","BC01","BC01Device","AOJ20A","Aoj20aDevice","TAIDOC_GLUCOSE","BloodGlucoseDevice","GLUCOCHECK","BGM","VEROVAL_DUO_CONTROL","VerovalDuoControlDevice","VEROVAL_ECG","VerovalEcgDevice","VEROVAL_ACTIVITY","VerovalActivityDevice","GENIAL_T31","GenialT31Device","collectCustomDevices","acceptedDevices","customDevices","Map","matchers","Set","forEach","entry","index","isCustomDeviceDefinition","Error","has","id","matchByService","nameMatch","source","set","add","DeviceCreator","deviceNameCache","CACHE_MAX_SIZE","constructor","acceptedDeviceNames","getDeviceName","foundName","serviceUUIDs","normalizedServices","map","uuid","toLowerCase","size","undefined","matchDeviceName","get","matched","cacheDeviceName","createDevice","params","String","deviceName","trim","device","name","localName","custom","CustomDevice","deviceClass","Object","keys","join","destroy","clear","resolveDeviceKey","deviceType","firstKey","next","value","delete","exports"],"sourceRoot":"../../../../../src","sources":["modules/bt-management/services/device-creator.ts"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,OAAA;AAMA,IAAAC,kBAAA,GAAAD,OAAA;AACA,IAAAE,yBAAA,GAAAF,OAAA;AAEA,IAAAG,
|
|
1
|
+
{"version":3,"names":["_resolveDeviceKey","require","_integratedDevices","_isCustomDeviceDefinition","_a606Device","_aojDevice","_bc01Device","_bloodGlucoseDevice","_bp2Device","_bpw1Device","_checkmeDevice","_customDevice","_f4Device","_genialT31Device","_oxyfitDevice","_spo2Device","_mysenseDevice","_verovalActivityDevice","_verovalDuoControlDevice","_verovalEcgDevice","DEVICE_CLASSES","IntegratedDevices","BP2","BP2Device","F4","F4Device","PC60WF","SPO2Device","SPO2","OxyfitDevice","MYSENSE","MySenseDevice","BC01","BC01Device","AOJ20A","Aoj20aDevice","TAIDOC_GLUCOSE","BloodGlucoseDevice","GLUCOCHECK","BGM","VEROVAL_DUO_CONTROL","VerovalDuoControlDevice","VEROVAL_ECG","VerovalEcgDevice","VEROVAL_ACTIVITY","VerovalActivityDevice","GENIAL_T31","GenialT31Device","ZH_SG_A606","A606Device","BPW1","Bpw1Device","CHECKME","CheckmeProDevice","collectCustomDevices","acceptedDevices","customDevices","Map","matchers","Set","forEach","entry","index","isCustomDeviceDefinition","Error","has","id","matchByService","nameMatch","source","set","add","DeviceCreator","deviceNameCache","CACHE_MAX_SIZE","constructor","acceptedDeviceNames","getDeviceName","foundName","serviceUUIDs","normalizedServices","map","uuid","toLowerCase","size","undefined","matchDeviceName","get","matched","cacheDeviceName","createDevice","params","String","deviceName","trim","device","name","localName","custom","CustomDevice","deviceClass","Object","keys","join","destroy","clear","resolveDeviceKey","deviceType","firstKey","next","value","delete","exports"],"sourceRoot":"../../../../../src","sources":["modules/bt-management/services/device-creator.ts"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,OAAA;AAMA,IAAAC,kBAAA,GAAAD,OAAA;AACA,IAAAE,yBAAA,GAAAF,OAAA;AAEA,IAAAG,WAAA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AAEiB,UAAU,EAAE,CAAC,GAAGd,YAAY,CAAC,CAE3D;EAEPU,eAAeA,CACrBI,UAAkB,EAClBc,UAA4B,EACtB;IACN;IACA,IAAI,IAAI,CAAClC,eAAe,CAACW,IAAI,IAAI,IAAI,CAACV,cAAc,EAAE;MACpD,MAAMkC,QAAQ,GAAG,IAAI,CAACnC,eAAe,CAAC6B,IAAI,CAAC,CAAC,CAACO,IAAI,CAAC,CAAC,CAACC,KAAK;MAEzD,IAAIF,QAAQ,KAAKvB,SAAS,EAAE;QAC1B,IAAI,CAACZ,eAAe,CAACsC,MAAM,CAACH,QAAQ,CAAC;MACvC;IACF;IAEA,IAAI,CAACnC,eAAe,CAACH,GAAG,CAACuB,UAAU,EAAEc,UAAU,CAAC;EAClD;AACF;AAACK,OAAA,CAAAxC,aAAA,GAAAA,aAAA","ignoreList":[]}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.buildA606UploadCommand = exports.buildA606TimeCommand = exports.buildA606ConnectedCommand = exports.A606_WRITE = exports.A606_SERVICE = exports.A606_NOTIFY = exports.A606CommandSequencer = void 0;
|
|
7
|
+
var _clockSync = require("../../../types/clock-sync.js");
|
|
8
|
+
var _hexToByte = require("../../../utils/hex-to-byte.js");
|
|
9
|
+
const SERVICE = exports.A606_SERVICE = "0000ff00-0000-1000-8000-00805f9b34fb";
|
|
10
|
+
const WRITE = exports.A606_WRITE = "0000ff01-0000-1000-8000-00805f9b34fb";
|
|
11
|
+
const NOTIFY = exports.A606_NOTIFY = "0000ff02-0000-1000-8000-00805f9b34fb";
|
|
12
|
+
const TYPE_GET = 0x43;
|
|
13
|
+
const TYPE_UPLOAD = 0x44;
|
|
14
|
+
const CMD_UPDATE_TIME = 0x54;
|
|
15
|
+
const CMD_UPLOAD_DATA = 0x45;
|
|
16
|
+
const byte = value => (value & 0xff).toString(16).padStart(2, "0");
|
|
17
|
+
const frameFor = values => {
|
|
18
|
+
const frame = values.map(byte);
|
|
19
|
+
const checksum = frame.reduce((sum, value) => sum + (0, _hexToByte.hexToByte)(value) & 0xff, 0);
|
|
20
|
+
return [...frame, byte(checksum)];
|
|
21
|
+
};
|
|
22
|
+
const commandFor = frame => ({
|
|
23
|
+
serviceUuid: SERVICE,
|
|
24
|
+
characteristicUuid: WRITE,
|
|
25
|
+
frame
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
/** The vendor's post-connect command for the ZH-SG family. */
|
|
29
|
+
const buildA606ConnectedCommand = () => frameFor([0x26, TYPE_UPLOAD, 0x03, 0x46, 0x20, 0x01, 0x20]);
|
|
30
|
+
|
|
31
|
+
/** Writes the local clock in the six-byte YY MM DD hh mm ss payload. */
|
|
32
|
+
exports.buildA606ConnectedCommand = buildA606ConnectedCommand;
|
|
33
|
+
const buildA606TimeCommand = now => {
|
|
34
|
+
const parts = (0, _clockSync.getClockParts)(now);
|
|
35
|
+
return frameFor([0x26, TYPE_GET, CMD_UPDATE_TIME, 0x20, parts.year % 100, parts.month, parts.day, parts.hours, parts.minutes, parts.seconds, 0x20]);
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
/** Requests the next stored record after the current one was accepted. */
|
|
39
|
+
exports.buildA606TimeCommand = buildA606TimeCommand;
|
|
40
|
+
const buildA606UploadCommand = (ack = false) => frameFor([0x26, TYPE_UPLOAD, CMD_UPLOAD_DATA, 0x20, ack ? 0x53 : 0x46, 0x20]);
|
|
41
|
+
exports.buildA606UploadCommand = buildA606UploadCommand;
|
|
42
|
+
class A606CommandSequencer {
|
|
43
|
+
phase = "connected";
|
|
44
|
+
constructor(clockSync) {
|
|
45
|
+
this.clockSync = clockSync;
|
|
46
|
+
}
|
|
47
|
+
initialCommands = () => [commandFor(buildA606ConnectedCommand())];
|
|
48
|
+
isHistoryTransfer = () => true;
|
|
49
|
+
nextCommand = frame => {
|
|
50
|
+
const type = (0, _hexToByte.hexToByte)(frame[1] ?? "00");
|
|
51
|
+
const command = (0, _hexToByte.hexToByte)(frame[2] ?? "00");
|
|
52
|
+
if (type === TYPE_GET && command === CMD_UPDATE_TIME) {
|
|
53
|
+
if (this.phase === "connected" && (0, _clockSync.isClockSyncEnabled)(this.clockSync) && (0, _hexToByte.hexToByte)(frame[4] ?? "ff") === 0) {
|
|
54
|
+
this.phase = "clock";
|
|
55
|
+
return [commandFor(buildA606TimeCommand(this.clockSync?.now?.() ?? new Date()))];
|
|
56
|
+
}
|
|
57
|
+
this.phase = "records";
|
|
58
|
+
return undefined;
|
|
59
|
+
}
|
|
60
|
+
if (type === TYPE_UPLOAD && command === CMD_UPLOAD_DATA) {
|
|
61
|
+
this.phase = "records";
|
|
62
|
+
return [commandFor(buildA606UploadCommand(false))];
|
|
63
|
+
}
|
|
64
|
+
return undefined;
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
exports.A606CommandSequencer = A606CommandSequencer;
|
|
68
|
+
//# sourceMappingURL=a606.command-sequencer.js.map
|
package/lib/commonjs/modules/bt-management/services/devices/a606/a606.command-sequencer.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_clockSync","require","_hexToByte","SERVICE","exports","A606_SERVICE","WRITE","A606_WRITE","NOTIFY","A606_NOTIFY","TYPE_GET","TYPE_UPLOAD","CMD_UPDATE_TIME","CMD_UPLOAD_DATA","byte","value","toString","padStart","frameFor","values","frame","map","checksum","reduce","sum","hexToByte","commandFor","serviceUuid","characteristicUuid","buildA606ConnectedCommand","buildA606TimeCommand","now","parts","getClockParts","year","month","day","hours","minutes","seconds","buildA606UploadCommand","ack","A606CommandSequencer","phase","constructor","clockSync","initialCommands","isHistoryTransfer","nextCommand","type","command","isClockSyncEnabled","Date","undefined"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/a606/a606.command-sequencer.ts"],"mappings":";;;;;;AAAA,IAAAA,UAAA,GAAAC,OA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AClC,IAAApB,oBAAS,EAACL,KAAK,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,KAAK,CAAC,EACjC;QACA,IAAI,CAACuB,KAAK,GAAG,OAAO;QAEpB,OAAO,CAACjB,UAAU,CAACI,oBAAoB,CAAC,IAAI,CAACe,SAAS,EAAEd,GAAG,GAAG,CAAC,IAAI,IAAIqB,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;MAClF;MAEA,IAAI,CAACT,KAAK,GAAG,SAAS;MAEtB,OAAOU,SAAS;IAClB;IAEA,IAAIJ,IAAI,KAAKtC,WAAW,IAAIuC,OAAO,KAAKrC,eAAe,EAAE;MACvD,IAAI,CAAC8B,KAAK,GAAG,SAAS;MAEtB,OAAO,CAACjB,UAAU,CAACc,sBAAsB,CAAC,KAAK,CAAC,CAAC,CAAC;IACpD;IAEA,OAAOa,SAAS;EAClB,CAAC;AACH;AAACjD,OAAA,CAAAsC,oBAAA,GAAAA,oBAAA","ignoreList":[]}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.A606Device = void 0;
|
|
7
|
+
Object.defineProperty(exports, "a606MainServices", {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
get: function () {
|
|
10
|
+
return _a606MainServices.a606MainServices;
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
var _core = require("@ovok/core");
|
|
14
|
+
var _caseType = require("../../../types/case-type.js");
|
|
15
|
+
var _btManagedDevice = require("../bt-managed-device.js");
|
|
16
|
+
var _a606CommandSequencer = require("./a606.command-sequencer.js");
|
|
17
|
+
var _a606FrameParser = require("./a606.frame-parser.js");
|
|
18
|
+
var _a606FrameReader = require("./a606.frame-reader.js");
|
|
19
|
+
var _a606MainServices = require("./a606.main-services.js");
|
|
20
|
+
/** Viatom/Lepu ZH-SG-A606 meter, which uploads stored records after connection. */
|
|
21
|
+
class A606Device extends _btManagedDevice.BTManagedDevice {
|
|
22
|
+
mainServices = _a606MainServices.a606MainServices;
|
|
23
|
+
stuckDataTimeout = 120_000;
|
|
24
|
+
onStreamStart = undefined;
|
|
25
|
+
frameReader = new _a606FrameReader.A606FrameReader();
|
|
26
|
+
constructor(device, params) {
|
|
27
|
+
super(device, params);
|
|
28
|
+
this.createCommandSequencer = () => new _a606CommandSequencer.A606CommandSequencer(params.clockSync);
|
|
29
|
+
}
|
|
30
|
+
handleDependentResult = data => {
|
|
31
|
+
if (data.frame) {
|
|
32
|
+
const record = (0, _a606FrameParser.parseA606Record)(data.frame);
|
|
33
|
+
if (record) {
|
|
34
|
+
this.onResult?.({
|
|
35
|
+
caseType: _caseType.CaseType.RESULT,
|
|
36
|
+
measurementTypeKey: _core.MeasurementTypeKey.bloodGlucose,
|
|
37
|
+
bloodGlucose: record.bloodGlucose,
|
|
38
|
+
recordedAt: record.recordedAt
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
return {
|
|
43
|
+
...data,
|
|
44
|
+
parsingCase: {
|
|
45
|
+
...data.parsingCase,
|
|
46
|
+
caseType: _caseType.CaseType.OTHER
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
handleSuccessResult() {
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
exports.A606Device = A606Device;
|
|
55
|
+
//# sourceMappingURL=a606.device.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_core","require","_caseType","_btManagedDevice","_a606CommandSequencer","_a606FrameParser","_a606FrameReader","_a606MainServices","A606Device","BTManagedDevice","mainServices","a606MainServices","stuckDataTimeout","onStreamStart","undefined","frameReader","A606FrameReader","constructor","device","params","createCommandSequencer","A606CommandSequencer","clockSync","handleDependentResult","data","frame","record","parseA606Record","onResult","caseType","CaseType","RESULT","measurementTypeKey","MeasurementTypeKey","bloodGlucose","recordedAt","parsingCase","OTHER","handleSuccessResult","exports"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/a606/a606.device.ts"],"mappings":";;;;;;;;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AAGA,IAAAC,SAAA,GAAAD,OAAA;AAQA,IAAAE,gBAAA,GAAAF,OAAA;AAEA,IAAAG,qBAAA,GAAAH,OAAA;AACA,IAAAI,gBAAA,GAAAJ,OAAA;AACA,IAAAK,gBAAA,GAAAL,OAAA;AACA,IAAAM,iBAAA,GAAAN,OAAA;AAMA;AACA,MAAMO,UAAU,SAASC,gCAAe,CAA+B;EAC3DC,YAAY,GAAeC,kCAAgB;EAC3CC,gBAAgB,GAAG,OAAO;EAC1BC,aAAa,GAAGC,SAAS;EACzBC,WAAW,GAAG,IAAIC,gCAAe,CAAC,CAAC;EAEtCC,WAAWA,CAChBC,MAAc,EACdC,MAAwD,EACxD;IACA,KAAK,CAACD,MAAM,EAAEC,MAAM,CAAC;IACrB,IAAI,CAACC,sBAAsB,GAAG,MAC5B,IAAIC,0CAAoB,CAACF,MAAM,CAACG,SAAS,CAAC;EAC9C;EAEUC,qBAAqB,GAC7BC,IAAmD,IACD;IAClD,IAAIA,IAAI,CAACC,KAAK,EAAE;MACd,MAAMC,MAAM,GAAG,IAAAC,gCAAe,EAACH,IAAI,CAACC,KAAK,CAAC;MAE1C,IAAIC,MAAM,EAAE;QACV,IAAI,CAACE,QAAQ,GAAG;UACdC,QAAQ,EAAEC,kBAAQ,CAACC,MAAM;UACzBC,kBAAkB,EAAEC,wBAAkB,CAACC,YAAY;UACnDA,YAAY,EAAER,MAAM,CAACQ,YAAY;UACjCC,UAAU,EAAET,MAAM,CAACS;QACrB,CAAwE,CAAC;MAC3E;IACF;IAEA,OAAO;MACL,GAAGX,IAAI;MACPY,WAAW,EAAE;QAAE,GAAGZ,IAAI,CAACY,WAAW;QAAEP,QAAQ,EAAEC,kBAAQ,CAACO;MAAM;IAC/D,CAAC;EACH,CAAC;EAESC,mBAAmBA,CAAA,EAAmB;IAC9C;EACF;AACF;AAACC,OAAA,CAAA/B,UAAA,GAAAA,UAAA","ignoreList":[]}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.parseA606Record = void 0;
|
|
7
|
+
var _hexToByte = require("../../../utils/hex-to-byte.js");
|
|
8
|
+
const bigEndian = (frame, from) => ((0, _hexToByte.hexToByte)(frame[from] ?? "00") << 8) + (0, _hexToByte.hexToByte)(frame[from + 1] ?? "00");
|
|
9
|
+
|
|
10
|
+
/** Decodes the 12-byte glucose payload inside a verified 16-byte ZH-SG record. */
|
|
11
|
+
const parseA606Record = frame => {
|
|
12
|
+
if (frame.length < 16 || (0, _hexToByte.hexToByte)(frame[0] ?? "00") !== 0x26 || (0, _hexToByte.hexToByte)(frame[1] ?? "00") !== 0x44 || (0, _hexToByte.hexToByte)(frame[2] ?? "00") !== 0x45) {
|
|
13
|
+
return undefined;
|
|
14
|
+
}
|
|
15
|
+
const year = 2000 + (0, _hexToByte.hexToByte)(frame[8] ?? "00");
|
|
16
|
+
const month = (0, _hexToByte.hexToByte)(frame[9] ?? "00");
|
|
17
|
+
const day = (0, _hexToByte.hexToByte)(frame[10] ?? "00");
|
|
18
|
+
const hour = (0, _hexToByte.hexToByte)(frame[11] ?? "00");
|
|
19
|
+
const minute = (0, _hexToByte.hexToByte)(frame[12] ?? "00");
|
|
20
|
+
const second = (0, _hexToByte.hexToByte)(frame[13] ?? "00");
|
|
21
|
+
const recordedAt = new Date(year, month - 1, day, hour, minute, second, 0);
|
|
22
|
+
if (month < 1 || month > 12 || day < 1 || day > 31 || hour > 23 || minute > 59 || second > 59 || recordedAt.getFullYear() !== year || recordedAt.getMonth() !== month - 1 || recordedAt.getDate() !== day || recordedAt.getHours() !== hour || recordedAt.getMinutes() !== minute || recordedAt.getSeconds() !== second) {
|
|
23
|
+
return undefined;
|
|
24
|
+
}
|
|
25
|
+
const bloodGlucose = bigEndian(frame, 6);
|
|
26
|
+
if (bloodGlucose === 0) {
|
|
27
|
+
return undefined;
|
|
28
|
+
}
|
|
29
|
+
return {
|
|
30
|
+
bloodGlucose,
|
|
31
|
+
recordedAt,
|
|
32
|
+
dataPosition: bigEndian(frame, 4)
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
exports.parseA606Record = parseA606Record;
|
|
36
|
+
//# sourceMappingURL=a606.frame-parser.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_hexToByte","require","bigEndian","frame","from","hexToByte","parseA606Record","length","undefined","year","month","day","hour","minute","second","recordedAt","Date","getFullYear","getMonth","getDate","getHours","getMinutes","getSeconds","bloodGlucose","dataPosition","exports"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/a606/a606.frame-parser.ts"],"mappings":";;;;;;AAAA,IAAAA,UAAA,GAAAC,OAAA;AAQA,MAAMC,SAAS,GAAGA,CAACC,KAAwB,EAAEC,IAAY,KACvD,CAAC,IAAAC,oBAAS,EAACF,KAAK,CAACC,IAAI,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,IAAAC,oBAAS,EAACF,KAAK,CAACC,IAAI,GAAG,CAAC,CAAC,IAAI,IAAI,CAAC;;AAE5E;AACA,MAAME,eAAe,GAAIH,KAAwB,IAA6B;EAC5E,IACEA,KAAK,CAACI,MAAM,GAAG,EAAE,IACjB,IAAAF,oBAAS,EAACF,KAAK,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,KAAK,IAAI,IACpC,IAAAE,oBAAS,EAACF,KAAK,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,KAAK,IAAI,IACpC,IAAAE,oBAAS,EAACF,KAAK,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,KAAK,IAAI,EACpC;IACA,OAAOK,SAAS;EAClB;EAEA,MAAMC,IA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S,CAACC,KAAK,EAAE,CAAC,CAAC;EAExC,IAAIoB,YAAY,KAAK,CAAC,EAAE;IACtB,OAAOf,SAAS;EAClB;EAEA,OAAO;IACLe,YAAY;IACZR,UAAU;IACVS,YAAY,EAAEtB,SAAS,CAACC,KAAK,EAAE,CAAC;EAClC,CAAC;AACH,CAAC;AAACsB,OAAA,CAAAnB,eAAA,GAAAA,eAAA","ignoreList":[]}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.A606FrameReader = void 0;
|
|
7
|
+
var _frameReadStatus = require("../../../types/frame-read-status.js");
|
|
8
|
+
var _hexToByte = require("../../../utils/hex-to-byte.js");
|
|
9
|
+
const START = 0x26;
|
|
10
|
+
const TYPE_GET = 0x43;
|
|
11
|
+
const TYPE_UPLOAD = 0x44;
|
|
12
|
+
const TYPE_INDEX = 1;
|
|
13
|
+
const CHECKSUM_BYTES = 1;
|
|
14
|
+
|
|
15
|
+
/** Reads the `& C/D ... checksum` frames used by Viatom's ZH-SG glucose protocol. */
|
|
16
|
+
class A606FrameReader {
|
|
17
|
+
readFrame(buffer) {
|
|
18
|
+
const start = this.findStart(buffer);
|
|
19
|
+
if (start < 0) {
|
|
20
|
+
return {
|
|
21
|
+
status: _frameReadStatus.FrameReadStatus.INCOMPLETE,
|
|
22
|
+
consumedBytes: Math.max(0, buffer.length - 1)
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
const type = (0, _hexToByte.hexToByte)(buffer[start + TYPE_INDEX] ?? "00");
|
|
26
|
+
const frameLength = type === TYPE_UPLOAD ? 16 : type === TYPE_GET ? 7 : 0;
|
|
27
|
+
if (frameLength === 0) {
|
|
28
|
+
return {
|
|
29
|
+
status: _frameReadStatus.FrameReadStatus.CORRUPT,
|
|
30
|
+
consumedBytes: start + 1
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
if (start + frameLength > buffer.length) {
|
|
34
|
+
return {
|
|
35
|
+
status: _frameReadStatus.FrameReadStatus.INCOMPLETE,
|
|
36
|
+
consumedBytes: start
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
const frame = buffer.slice(start, start + frameLength);
|
|
40
|
+
if (!this.hasValidChecksum(frame)) {
|
|
41
|
+
return {
|
|
42
|
+
status: _frameReadStatus.FrameReadStatus.CORRUPT,
|
|
43
|
+
consumedBytes: start + 1
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
return {
|
|
47
|
+
status: _frameReadStatus.FrameReadStatus.COMPLETE,
|
|
48
|
+
consumedBytes: start + frameLength,
|
|
49
|
+
frame
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
findStart(buffer) {
|
|
53
|
+
for (let index = 0; index + 2 < buffer.length; index++) {
|
|
54
|
+
const type = (0, _hexToByte.hexToByte)(buffer[index + TYPE_INDEX] ?? "00");
|
|
55
|
+
if ((0, _hexToByte.hexToByte)(buffer[index] ?? "00") === START && (type === TYPE_GET || type === TYPE_UPLOAD)) {
|
|
56
|
+
return index;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
return -1;
|
|
60
|
+
}
|
|
61
|
+
hasValidChecksum(frame) {
|
|
62
|
+
const checksumIndex = frame.length - CHECKSUM_BYTES;
|
|
63
|
+
const checksum = frame.slice(0, checksumIndex).reduce((sum, byte) => sum + (0, _hexToByte.hexToByte)(byte) & 0xff, 0);
|
|
64
|
+
return checksum === (0, _hexToByte.hexToByte)(frame[checksumIndex] ?? "00");
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
exports.A606FrameReader = A606FrameReader;
|
|
68
|
+
//# sourceMappingURL=a606.frame-reader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_frameReadStatus","require","_hexToByte","START","TYPE_GET","TYPE_UPLOAD","TYPE_INDEX","CHECKSUM_BYTES","A606FrameReader","readFrame","buffer","start","findStart","status","FrameReadStatus","INCOMPLETE","consumedBytes","Math","max","length","type","hexToByte","frameLength","CORRUPT","frame","slice","hasValidChecksum","COMPLETE","index","checksumIndex","checksum","reduce","sum","byte","exports"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/a606/a606.frame-reader.ts"],"mappings":";;;;;;AACA,IAAAA,gBAAA,GAAAC,OAAA;AAEA,IAAAC,UAAA,GAAAD,OAAA;AAEA,MAAME,KAAK,GAAG,IAAI;AAClB,MAAMC,QAAQ,GAAG,IAAI;AACrB,MAAMC,WAAW,GAAG,IAAI;AACxB,MAAMC,UAAU,GAAG,CAAC;AACpB,MAAMC,cAAc,GAAG,CAAC;;AAExB;AACO,MAAMC,eAAe,CAAwB;EAC3CC,SAASA,CAACC,MAAyB,EAAmB;IAC3D,MAAMC,KAAK,GAAG,IAAI,CAACC,SAAS,CAACF,MAAM,CAAC;IAEpC,IAAIC,KAAK,GAAG,CAAC,EAAE;MACb,OAAO;QACLE,MAAM,EAAEC,gCAAe,CAACC,UAAU;QAClCC,aAAa,EAAEC,IAAI,CAACC,GAAG,CAAC,CAAC,EAAER,MAAM,CAACS,MAAM,GAAG,CAAC;MAC9C,CAAC;IACH;IAEA,MAAMC,IAAI,GAAG,IAAAC,oBAAS,EAACX,MAAM,CAACC,KAAK,GAAGL,UAAU,CAAC,IAAI,IAAI,CAAC;IAC1D,MAAMgB,WAAW,GAAGF,IAAI,KAAKf,WAAW,GAAG,EAAE,GAAGe,IAAI,KAAKhB,QAAQ,GAAG,CAAC,GAAG,CAAC;IAEzE,IAAIkB,WAAW,KAAK,CAAC,EAAE;MAErB,OAAO;QACLT,MAAM,EAAEC,gCAAe,CAACS,OAAO;QAC/BP,aAAa,EAAEL,KAAK,GAAG;MACzB,CAAC;IACH;IAEA,IAAIA,KAAK,GAAGW,WAAW,GAAGZ,MAAM,CAACS,MAAM,EAAE;MACvC,OAAO;QAAEN,MAAM,EAAEC,gCAAe,CAACC,UAAU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KAAK,CAACK,aAAa,CAAC,IAAI,IAAI,CAAC;EAC7D;AACF;AAACK,OAAA,CAAA1B,eAAA,GAAAA,eAAA","ignoreList":[]}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.a606MainServices = void 0;
|
|
7
|
+
var _core = require("@ovok/core");
|
|
8
|
+
var _caseType = require("../../../types/case-type.js");
|
|
9
|
+
var _a606CommandSequencer = require("./a606.command-sequencer.js");
|
|
10
|
+
/** ZH-SG's fixed GATT profile and its 16-byte stored glucose record. */
|
|
11
|
+
const a606MainServices = exports.a606MainServices = [{
|
|
12
|
+
uuid: _a606CommandSequencer.A606_SERVICE,
|
|
13
|
+
writeUuid: {
|
|
14
|
+
uuid: _a606CommandSequencer.A606_WRITE,
|
|
15
|
+
mainCommandUuid: "26440346200120"
|
|
16
|
+
},
|
|
17
|
+
monitorUuids: [{
|
|
18
|
+
uuid: _a606CommandSequencer.A606_NOTIFY,
|
|
19
|
+
parsingModel: {
|
|
20
|
+
caseValuePosition: [1, 2],
|
|
21
|
+
cases: [{
|
|
22
|
+
caseValue: "4445",
|
|
23
|
+
caseType: _caseType.CaseType.DEPENDENT,
|
|
24
|
+
measurementTypeKey: _core.MeasurementTypeKey.bloodGlucose,
|
|
25
|
+
minLengthBytes: 16,
|
|
26
|
+
parseDefinitions: []
|
|
27
|
+
}]
|
|
28
|
+
}
|
|
29
|
+
}]
|
|
30
|
+
}];
|
|
31
|
+
//# sourceMappingURL=a606.main-services.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_core","require","_caseType","_a606CommandSequencer","a606MainServices","exports","uuid","A606_SERVICE","writeUuid","A606_WRITE","mainCommandUuid","monitorUuids","A606_NOTIFY","parsingModel","caseValuePosition","cases","caseValue","caseType","CaseType","DEPENDENT","measurementTypeKey","MeasurementTypeKey","bloodGlucose","minLengthBytes","parseDefinitions"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/a606/a606.main-services.ts"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AAEA,IAAAC,SAAA,GAAAD,OAAA;AAGA,IAAAE,qBAAA,GAAAF,OAAA;AAEA;AACO,MAAMG,gBAA4B,GAAAC,OAAA,CAAAD,gBAAA,GAAG,CAC1C;EACEE,IAAI,EAAEC,kCAAY;EAClBC,SAAS,EAAE;IACTF,IAAI,EAAEG,gCAAU;IAChBC,eAAe,EAAE;EACnB,CAAC;EACDC,YAAY,EAAE,CACZ;IACEL,IAAI,EAAEM,iCAAW;IACjBC,YAAY,EAAE;MACZC,iBAAiB,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;MACzBC,KAAK,EAAE,CACL;QACEC,SAAS,EAAE,MAAM;QACjBC,QAAQ,EAAEC,kBAAQ,CAACC,SAAS;QAC5BC,kBAAkB,EAAEC,wBAAkB,CAACC,YAAY;QACnDC,cAAc,EAAE,EAAE;QAClBC,gBAAgB,EAAE;MACpB,CAAC;IAEL;EACF,CAAC;AAEL,CAAC,CACF","ignoreList":[]}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.buildBpw1HistoryCommand = exports.buildBpw1FeatureCommand = exports.buildBpw1Ack = exports.Bpw1CommandSequencer = exports.BPW1_WRITE = exports.BPW1_SERVICE = exports.BPW1_HISTORY_TYPE = void 0;
|
|
7
|
+
var _hexToByte = require("../../../utils/hex-to-byte.js");
|
|
8
|
+
const SERVICE = exports.BPW1_SERVICE = "81eea003-e735-49ec-8a11-7e32cae1e14e";
|
|
9
|
+
const WRITE = exports.BPW1_WRITE = "81eea002-e735-49ec-8a11-7e32cae1e14e";
|
|
10
|
+
const FEATURE_TYPE = 0x00;
|
|
11
|
+
const SYNC_TYPE = 0x01;
|
|
12
|
+
const HISTORY_TYPE = exports.BPW1_HISTORY_TYPE = 0x03;
|
|
13
|
+
const FRAME_START = "e0";
|
|
14
|
+
const byte = value => (value & 0xff).toString(16).padStart(2, "0");
|
|
15
|
+
const withChecksum = frame => {
|
|
16
|
+
const checksum = frame.reduce((sum, value, index) => index === 3 ? sum : sum + (0, _hexToByte.hexToByte)(value) & 0xff, 0);
|
|
17
|
+
return [...frame.slice(0, 3), byte(checksum), ...frame.slice(3)];
|
|
18
|
+
};
|
|
19
|
+
const commandFor = (frame, delayBeforeWriteMs) => ({
|
|
20
|
+
serviceUuid: SERVICE,
|
|
21
|
+
characteristicUuid: WRITE,
|
|
22
|
+
frame,
|
|
23
|
+
...(delayBeforeWriteMs === undefined ? {} : {
|
|
24
|
+
delayBeforeWriteMs
|
|
25
|
+
})
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
/** Builds an LHZL command after applying the checksum inserted by the vendor BLE writer. */
|
|
29
|
+
const buildBpw1Command = (type, protocolVersion, key, payload) => {
|
|
30
|
+
const payloadLength = payload.length;
|
|
31
|
+
const frame = [FRAME_START, byte(payloadLength + 5 >> 8), byte(payloadLength + 5), byte(type), byte(protocolVersion), byte(key), byte(payloadLength >> 8), byte(payloadLength), ...payload.map(byte)];
|
|
32
|
+
return withChecksum(frame);
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
/** Builds the vendor's acknowledgement for one accepted LHZL frame. */
|
|
36
|
+
const buildBpw1Ack = frame => {
|
|
37
|
+
const type = (0, _hexToByte.hexToByte)(frame[4] ?? "00");
|
|
38
|
+
const protocolVersion = (0, _hexToByte.hexToByte)(frame[5] ?? "00");
|
|
39
|
+
const key = (0, _hexToByte.hexToByte)(frame[6] ?? "00");
|
|
40
|
+
return withChecksum(["0e", "00", "06", byte(type), byte(protocolVersion), byte(key), "00", "01", "00"]);
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
/** ViHealth's initial feature probe for the BPW1 LHZL profile. */
|
|
44
|
+
exports.buildBpw1Ack = buildBpw1Ack;
|
|
45
|
+
const buildBpw1FeatureCommand = () => buildBpw1Command(FEATURE_TYPE, 0, 0, [1]);
|
|
46
|
+
|
|
47
|
+
/** Requests all stored health-history packets after the feature reply. */
|
|
48
|
+
exports.buildBpw1FeatureCommand = buildBpw1FeatureCommand;
|
|
49
|
+
const buildBpw1HistoryCommand = protocolVersion => buildBpw1Command(SYNC_TYPE, protocolVersion, 0, [1]);
|
|
50
|
+
|
|
51
|
+
/** Answers the feature probe, then starts the vendor's all-history transfer. */
|
|
52
|
+
exports.buildBpw1HistoryCommand = buildBpw1HistoryCommand;
|
|
53
|
+
class Bpw1CommandSequencer {
|
|
54
|
+
protocolVersion = 0;
|
|
55
|
+
historyRequested = false;
|
|
56
|
+
initialCommands = () => [commandFor(buildBpw1FeatureCommand(), 300)];
|
|
57
|
+
nextCommand = frame => {
|
|
58
|
+
if (frame.length < 7) {
|
|
59
|
+
return undefined;
|
|
60
|
+
}
|
|
61
|
+
const type = (0, _hexToByte.hexToByte)(frame[4] ?? "00");
|
|
62
|
+
const acknowledgement = commandFor(buildBpw1Ack(frame));
|
|
63
|
+
if (type === FEATURE_TYPE && !this.historyRequested) {
|
|
64
|
+
this.protocolVersion = (0, _hexToByte.hexToByte)(frame[5] ?? "00");
|
|
65
|
+
this.historyRequested = true;
|
|
66
|
+
return [acknowledgement, commandFor(buildBpw1HistoryCommand(this.protocolVersion))];
|
|
67
|
+
}
|
|
68
|
+
return [acknowledgement];
|
|
69
|
+
};
|
|
70
|
+
isHistoryTransfer = () => true;
|
|
71
|
+
}
|
|
72
|
+
exports.Bpw1CommandSequencer = Bpw1CommandSequencer;
|
|
73
|
+
//# sourceMappingURL=bpw1.command-sequencer.js.map
|
package/lib/commonjs/modules/bt-management/services/devices/bpw1/bpw1.command-sequencer.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_hexToByte","require","SERVICE","exports","BPW1_SERVICE","WRITE","BPW1_WRITE","FEATURE_TYPE","SYNC_TYPE","HISTORY_TYPE","BPW1_HISTORY_TYPE","FRAME_START","byte","value","toString","padStart","withChecksum","frame","checksum","reduce","sum","index","hexToByte","slice","commandFor","delayBeforeWriteMs","serviceUuid","characteristicUuid","undefined","buildBpw1Command","type","protocolVersion","key","payload","payloadLength","length","map","buildBpw1Ack","buildBpw1FeatureCommand","buildBpw1HistoryCommand","Bpw1CommandSequencer","historyRequested","initialCommands","nextCommand","acknowledgement","isHistoryTransfer"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/bpw1/bpw1.command-sequencer.ts"],"mappings":";;;;;;AAEA,IAAAA,UAAA,GAAAC,OAAA;AAEA,MAAMC,OAAO,GAAAC,OAAA,CAAAC,YAAA,GAAG,sCAAsC;AACtD,MAAMC,KAAK,GAAAF,OAAA,CAAAG,UAAA,GAAG,sCAAsC;AACpD,MAAMC,YAAY,GAAG,IAAI;AACzB,MAAMC,SAAS,GAAG,IAAI;AACtB,MAAMC,YAAY,GAAAN,OAAA,CAAAO,iBAAA,GAAG,IAAI;AACzB,MAAMC,WAAW,GAAG,IAAI;AAExB,MAAMC,IAAI,GAAIC,KAAa,IACzB,CAACA,KAAK,GAAG,IAAI,EAAEC,QAAQ,CAAC,EAAE,CAAC,CAACC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC;AAE9C,MAAMC,YAAY,GAAIC,KAAwB,IAAe;EAC3D,MAAMC,QAAQ,GAAGD,KAAK,CAACE,MAAM,CAC3B,CAACC,GAAG,EAAEP,KAAK,EAAEQ,KAAK,KAChBA,KAAK,KAAK,CAAC,GAAGD,GAAG,GAAIA,GAAG,GAAG,IAAAE,oBAAS,EAACT,KAAK,CAAC,GAAI,IAAI,EACrD,CACF,CAAC;EAED,OAAO,CAAC,GAAGI,KAAK,CAACM,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,EAAEX,IAAI,CAACM,QAAQ,CAAC,EAAE,GAA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UAAU,CAACe,uBAAuB,CAAC,IAAI,CAACR,eAAe,CAAC,CAAC,CAC1D;IACH;IAEA,OAAO,CAACa,eAAe,CAAC;EAC1B,CAAC;EAEMC,iBAAiB,GAAGA,CAAA,KAAe,IAAI;AAChD;AAAC1C,OAAA,CAAAqC,oBAAA,GAAAA,oBAAA","ignoreList":[]}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.Bpw1Device = void 0;
|
|
7
|
+
Object.defineProperty(exports, "bpw1MainServices", {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
get: function () {
|
|
10
|
+
return _bpw1MainServices.bpw1MainServices;
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
var _core = require("@ovok/core");
|
|
14
|
+
var _caseType = require("../../../types/case-type.js");
|
|
15
|
+
var _btManagedDevice = require("../bt-managed-device.js");
|
|
16
|
+
var _bpw1CommandSequencer = require("./bpw1.command-sequencer.js");
|
|
17
|
+
var _bpw1FrameParser = require("./bpw1.frame-parser.js");
|
|
18
|
+
var _bpw1FrameReader = require("./bpw1.frame-reader.js");
|
|
19
|
+
var _bpw1MainServices = require("./bpw1.main-services.js");
|
|
20
|
+
/** Viatom BPW1 watch, including stored blood-pressure history. */
|
|
21
|
+
class Bpw1Device extends _btManagedDevice.BTManagedDevice {
|
|
22
|
+
mainServices = _bpw1MainServices.bpw1MainServices;
|
|
23
|
+
stuckDataTimeout = 120_000;
|
|
24
|
+
onStreamStart = undefined;
|
|
25
|
+
frameReader = new _bpw1FrameReader.Bpw1FrameReader();
|
|
26
|
+
constructor(device, params) {
|
|
27
|
+
super(device, params);
|
|
28
|
+
this.createCommandSequencer = () => new _bpw1CommandSequencer.Bpw1CommandSequencer();
|
|
29
|
+
}
|
|
30
|
+
handleDependentResult = data => {
|
|
31
|
+
if (data.frame) {
|
|
32
|
+
for (const record of (0, _bpw1FrameParser.parseBpw1BloodPressureRecords)(data.frame)) {
|
|
33
|
+
this.onResult?.({
|
|
34
|
+
caseType: _caseType.CaseType.RESULT,
|
|
35
|
+
measurementTypeKey: _core.MeasurementTypeKey.bloodPressure,
|
|
36
|
+
systolic: record.systolic,
|
|
37
|
+
diastolic: record.diastolic,
|
|
38
|
+
recordedAt: record.recordedAt
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
return {
|
|
43
|
+
...data,
|
|
44
|
+
parsingCase: {
|
|
45
|
+
...data.parsingCase,
|
|
46
|
+
caseType: _caseType.CaseType.OTHER
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
handleSuccessResult() {
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
exports.Bpw1Device = Bpw1Device;
|
|
55
|
+
//# sourceMappingURL=bpw1.device.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_core","require","_caseType","_btManagedDevice","_bpw1CommandSequencer","_bpw1FrameParser","_bpw1FrameReader","_bpw1MainServices","Bpw1Device","BTManagedDevice","mainServices","bpw1MainServices","stuckDataTimeout","onStreamStart","undefined","frameReader","Bpw1FrameReader","constructor","device","params","createCommandSequencer","Bpw1CommandSequencer","handleDependentResult","data","frame","record","parseBpw1BloodPressureRecords","onResult","caseType","CaseType","RESULT","measurementTypeKey","MeasurementTypeKey","bloodPressure","systolic","diastolic","recordedAt","parsingCase","OTHER","handleSuccessResult","exports"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/bpw1/bpw1.device.ts"],"mappings":";;;;;;;;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AAGA,IAAAC,SAAA,GAAAD,OAAA;AAQA,IAAAE,gBAAA,GAAAF,OAAA;AAEA,IAAAG,qBAAA,GAAAH,OAAA;AACA,IAAAI,gBAAA,GAAAJ,OAAA;AACA,IAAAK,gBAAA,GAAAL,OAAA;AACA,IAAAM,iBAAA,GAAAN,OAAA;AAIA;AACA,MAAMO,UAAU,SAASC,gCAAe,CAAyB;EACrDC,YAAY,GAAeC,kCAAgB;EAC3CC,gBAAgB,GAAG,OAAO;EAC1BC,aAAa,GAAGC,SAAS;EACzBC,WAAW,GAAG,IAAIC,gCAAe,CAAC,CAAC;EAEtCC,WAAWA,CAChBC,MAAc,EACdC,MAAkD,EAClD;IACA,KAAK,CAACD,MAAM,EAAEC,MAAM,CAAC;IACrB,IAAI,CAACC,sBAAsB,GAAG,MAC5B,IAAIC,0CAAoB,CAAC,CAAC;EAC9B;EAEUC,qBAAqB,GAC7BC,IAAmD,IACD;IAClD,IAAIA,IAAI,CAACC,KAAK,EAAE;MACd,KAAK,MAAMC,MAAM,IAAI,IAAAC,8CAA6B,EAACH,IAAI,CAACC,KAAK,CAAC,EAAE;QAC9D,IAAI,CAACG,QAAQ,GAAG;UACdC,QAAQ,EAAEC,kBAAQ,CAACC,MAAM;UACzBC,kBAAkB,EAAEC,wBAAkB,CAACC,aAAa;UACpDC,QAAQ,EAAET,MAAM,CAACS,QAAQ;UACzBC,SAAS,EAAEV,MAAM,CAACU,SAAS;UAC3BC,UAAU,EAAEX,MAAM,CAACW;QACrB,CAAyE,CAAC;MAC5E;IACF;IAEA,OAAO;MACL,GAAGb,IAAI;MACPc,WAAW,EAAE;QAAE,GAAGd,IAAI,CAACc,WAAW;QAAET,QAAQ,EAAEC,kBAAQ,CAACS;MAAM;IAC/D,CAAC;EACH,CAAC;EAESC,mBAAmBA,CAAA,EAAmB;IAC9C;EACF;AACF;AAACC,OAAA,CAAAhC,UAAA,GAAAA,UAAA","ignoreList":[]}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.parseBpw1BloodPressureRecords = void 0;
|
|
7
|
+
var _hexToByte = require("../../../utils/hex-to-byte.js");
|
|
8
|
+
const bigEndian = (frame, from) => (0, _hexToByte.hexToByte)(frame[from] ?? "00") << 24 | (0, _hexToByte.hexToByte)(frame[from + 1] ?? "00") << 16 | (0, _hexToByte.hexToByte)(frame[from + 2] ?? "00") << 8 | (0, _hexToByte.hexToByte)(frame[from + 3] ?? "00");
|
|
9
|
+
const validDate = (year, month, day) => {
|
|
10
|
+
if (month < 1 || month > 12 || day < 1 || day > 31) {
|
|
11
|
+
return undefined;
|
|
12
|
+
}
|
|
13
|
+
const date = new Date(year, month - 1, day);
|
|
14
|
+
return date.getFullYear() === year && date.getMonth() === month - 1 && date.getDate() === day ? date : undefined;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
/** Decodes BP records from ViHealth's generic LHZL health-history packet. */
|
|
18
|
+
const parseBpw1BloodPressureRecords = frame => {
|
|
19
|
+
if (frame.length < 21 || (0, _hexToByte.hexToByte)(frame[0] ?? "00") !== 0xe0 || (0, _hexToByte.hexToByte)(frame[4] ?? "00") !== 0x03 || (0, _hexToByte.hexToByte)(frame[6] ?? "00") !== 0x01) {
|
|
20
|
+
return [];
|
|
21
|
+
}
|
|
22
|
+
const year = 2000 + (((0, _hexToByte.hexToByte)(frame[9] ?? "00") & 0x7f) >> 1);
|
|
23
|
+
const month = ((0, _hexToByte.hexToByte)(frame[9] ?? "00") & 0x01) << 3 | ((0, _hexToByte.hexToByte)(frame[10] ?? "00") & 0xe0) >> 5;
|
|
24
|
+
const day = (0, _hexToByte.hexToByte)(frame[10] ?? "00") & 0x1f;
|
|
25
|
+
const date = validDate(year, month, day);
|
|
26
|
+
const count = (0, _hexToByte.hexToByte)(frame[11] ?? "00") << 8 | (0, _hexToByte.hexToByte)(frame[12] ?? "00");
|
|
27
|
+
if (!date || count === 0) {
|
|
28
|
+
return [];
|
|
29
|
+
}
|
|
30
|
+
const records = [];
|
|
31
|
+
for (let index = 0; index < count; index++) {
|
|
32
|
+
const offset = 13 + index * 8;
|
|
33
|
+
if (offset + 7 >= frame.length) {
|
|
34
|
+
break;
|
|
35
|
+
}
|
|
36
|
+
const secondsSinceMidnight = bigEndian(frame, offset);
|
|
37
|
+
const systolic = (0, _hexToByte.hexToByte)(frame[offset + 6] ?? "00");
|
|
38
|
+
const diastolic = (0, _hexToByte.hexToByte)(frame[offset + 7] ?? "00");
|
|
39
|
+
if (secondsSinceMidnight < 0 || secondsSinceMidnight >= 24 * 60 * 60 || systolic < 50 || systolic > 300 || diastolic < 30 || diastolic > 200) {
|
|
40
|
+
continue;
|
|
41
|
+
}
|
|
42
|
+
const recordedAt = new Date(date);
|
|
43
|
+
recordedAt.setSeconds(secondsSinceMidnight);
|
|
44
|
+
records.push({
|
|
45
|
+
systolic,
|
|
46
|
+
diastolic,
|
|
47
|
+
recordedAt
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
return records;
|
|
51
|
+
};
|
|
52
|
+
exports.parseBpw1BloodPressureRecords = parseBpw1BloodPressureRecords;
|
|
53
|
+
//# sourceMappingURL=bpw1.frame-parser.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_hexToByte","require","bigEndian","frame","from","hexToByte","validDate","year","month","day","undefined","date","Date","getFullYear","getMonth","getDate","parseBpw1BloodPressureRecords","length","count","records","index","offset","secondsSinceMidnight","systolic","diastolic","recordedAt","setSeconds","push","exports"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/bpw1/bpw1.frame-parser.ts"],"mappings":";;;;;;AAAA,IAAAA,UAAA,GAAAC,OAAA;AAQA,MAAMC,SAAS,GAAGA,CAACC,KAAwB,EAAEC,IAAY,KACtD,IAAAC,oBAAS,EAACF,KAAK,CAACC,IAAI,CAAC,IAAI,IAAI,CAAC,IAAI,EAAE,GACpC,IAAAC,oBAAS,EAACF,KAAK,CAACC,IAAI,GAAG,CAAC,CAAC,IAAI,IAAI,CAAC,IAAI,EAAG,GACzC,IAAAC,oBAAS,EAACF,KAAK,CAACC,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