@ovok/native 0.4.6 → 0.4.8
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 +3 -1
- package/lib/commonjs/modules/bt-device/constants/device-instruction-pdfs.js.map +1 -1
- package/lib/commonjs/modules/bt-management/constants/integrated-devices-map.js +1 -1
- package/lib/commonjs/modules/bt-management/constants/integrated-devices-map.js.map +1 -1
- package/lib/commonjs/modules/bt-management/index.js +220 -0
- package/lib/commonjs/modules/bt-management/index.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/custom/compile-case-fields.js +49 -0
- package/lib/commonjs/modules/bt-management/services/custom/compile-case-fields.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/custom/compile-case-shape.js +52 -0
- package/lib/commonjs/modules/bt-management/services/custom/compile-case-shape.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/custom/compile-custom-case.js +53 -41
- 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 +3 -0
- 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-frame.js +48 -2
- package/lib/commonjs/modules/bt-management/services/custom/compile-custom-frame.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/custom/compile-custom-lepu.js +98 -0
- package/lib/commonjs/modules/bt-management/services/custom/compile-custom-lepu.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/custom/define-custom-device.js +24 -1
- package/lib/commonjs/modules/bt-management/services/custom/define-custom-device.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/device-creator.js +19 -8
- package/lib/commonjs/modules/bt-management/services/device-creator.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/devices/aoj/aoj.thermometers.js +85 -0
- package/lib/commonjs/modules/bt-management/services/devices/aoj/aoj.thermometers.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/devices/bp2/bp2.frame-reader.js +8 -74
- package/lib/commonjs/modules/bt-management/services/devices/bp2/bp2.frame-reader.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/devices/bt-command-writer.js +155 -0
- package/lib/commonjs/modules/bt-management/services/devices/bt-command-writer.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/devices/bt-connection-handler.js +9 -49
- 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 +17 -6
- 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 +21 -14
- 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 +55 -0
- package/lib/commonjs/modules/bt-management/services/devices/custom/custom-lepu-sequencer.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/devices/custom/custom.device.js +82 -29
- 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 +2 -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 +48 -0
- package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.command-builder.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.commands.js +37 -0
- package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.commands.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.device-info.js +83 -0
- package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.device-info.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.device-names.js +26 -0
- package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.device-names.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.file-names.js +36 -0
- package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.file-names.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.file-transfer.js +155 -0
- package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.file-transfer.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.frame-reader.js +98 -0
- package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.frame-reader.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.frame.js +29 -0
- package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.frame.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.identity-gate.js +103 -0
- package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.identity-gate.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.name-match.js +32 -0
- package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.name-match.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.response-type.js +64 -0
- package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.response-type.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.transports.js +143 -0
- package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.transports.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/devices/polling-command-sequencer.js +38 -0
- package/lib/commonjs/modules/bt-management/services/devices/polling-command-sequencer.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/devices/sentinel-frame-reader.js +84 -0
- package/lib/commonjs/modules/bt-management/services/devices/sentinel-frame-reader.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/devices/standard-gatt/standard-gatt.devices.js +130 -0
- package/lib/commonjs/modules/bt-management/services/devices/standard-gatt/standard-gatt.devices.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/devices/standard-gatt/standard-gatt.profile.js +55 -0
- package/lib/commonjs/modules/bt-management/services/devices/standard-gatt/standard-gatt.profile.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/devices/veroval/veroval.bp-monitors.js +43 -0
- package/lib/commonjs/modules/bt-management/services/devices/veroval/veroval.bp-monitors.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/devices/veroval/veroval.duo-control-device.js +113 -0
- package/lib/commonjs/modules/bt-management/services/devices/veroval/veroval.duo-control-device.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/devices/veroval/veroval.duo-control-sequencer.js +120 -0
- package/lib/commonjs/modules/bt-management/services/devices/veroval/veroval.duo-control-sequencer.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/devices/veroval/veroval.ecg-device.js +92 -0
- package/lib/commonjs/modules/bt-management/services/devices/veroval/veroval.ecg-device.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/devices/veroval/veroval.ecg-samples.js +64 -0
- package/lib/commonjs/modules/bt-management/services/devices/veroval/veroval.ecg-samples.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/devices/veroval/veroval.ecg-transfer.js +94 -0
- package/lib/commonjs/modules/bt-management/services/devices/veroval/veroval.ecg-transfer.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/devices/viatom/viatom.bp-monitors.js +124 -0
- package/lib/commonjs/modules/bt-management/services/devices/viatom/viatom.bp-monitors.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/devices/viatom/viatom.ecg-recorders.js +113 -0
- package/lib/commonjs/modules/bt-management/services/devices/viatom/viatom.ecg-recorders.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/devices/viatom/viatom.lepod.js +117 -0
- package/lib/commonjs/modules/bt-management/services/devices/viatom/viatom.lepod.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/devices/viatom/viatom.oximeters.js +82 -0
- package/lib/commonjs/modules/bt-management/services/devices/viatom/viatom.oximeters.js.map +1 -0
- package/lib/commonjs/modules/bt-management/types/command-sequencer.js +6 -0
- package/lib/commonjs/modules/bt-management/types/command-sequencer.js.map +1 -0
- package/lib/commonjs/modules/bt-management/types/custom-checksum-algorithm.js +2 -0
- package/lib/commonjs/modules/bt-management/types/custom-checksum-algorithm.js.map +1 -0
- package/lib/commonjs/modules/bt-management/types/custom-checksum-spec.js +6 -0
- package/lib/commonjs/modules/bt-management/types/custom-checksum-spec.js.map +1 -0
- package/lib/commonjs/modules/bt-management/types/custom-lepu-spec.js +2 -0
- package/lib/commonjs/modules/bt-management/types/custom-lepu-spec.js.map +1 -0
- package/lib/commonjs/modules/bt-management/types/custom-measurement-spec.js +6 -0
- package/lib/commonjs/modules/bt-management/types/custom-measurement-spec.js.map +1 -0
- package/lib/commonjs/modules/bt-management/types/device-command.js +2 -0
- package/lib/commonjs/modules/bt-management/types/device-command.js.map +1 -0
- package/lib/commonjs/modules/bt-management/types/integrated-devices.js +2 -0
- package/lib/commonjs/modules/bt-management/types/integrated-devices.js.map +1 -1
- package/lib/commonjs/modules/bt-management/types/measurement-group.js +6 -0
- package/lib/commonjs/modules/bt-management/types/measurement-group.js.map +1 -0
- package/lib/commonjs/modules/bt-management/utils/calculate-checksum.js +49 -0
- package/lib/commonjs/modules/bt-management/utils/calculate-checksum.js.map +1 -0
- package/lib/commonjs/modules/bt-management/utils/create-custom-field-parser.js +21 -0
- package/lib/commonjs/modules/bt-management/utils/create-custom-field-parser.js.map +1 -1
- package/lib/commonjs/modules/bt-management/utils/create-frame-validator.js +9 -0
- package/lib/commonjs/modules/bt-management/utils/create-frame-validator.js.map +1 -1
- package/lib/commonjs/modules/bt-management/utils/hex-to-bytes.js +19 -0
- package/lib/commonjs/modules/bt-management/utils/hex-to-bytes.js.map +1 -0
- package/lib/commonjs/modules/bt-management/utils/le-32-to-bytes.js +13 -0
- package/lib/commonjs/modules/bt-management/utils/le-32-to-bytes.js.map +1 -0
- package/lib/commonjs/modules/bt-management/utils/parse-measurement.js +10 -7
- package/lib/commonjs/modules/bt-management/utils/parse-measurement.js.map +1 -1
- package/lib/commonjs/modules/bt-management/utils/reject-custom-reading.js +34 -0
- package/lib/commonjs/modules/bt-management/utils/reject-custom-reading.js.map +1 -0
- package/lib/commonjs/modules/bt-management/utils/summarise-measurement-for-log.js +22 -0
- package/lib/commonjs/modules/bt-management/utils/summarise-measurement-for-log.js.map +1 -0
- package/lib/commonjs/modules/bt-management/utils/supported-measurement-type-keys.js +18 -0
- package/lib/commonjs/modules/bt-management/utils/supported-measurement-type-keys.js.map +1 -0
- package/lib/module/modules/bt-device/constants/device-instruction-pdfs.js +3 -1
- package/lib/module/modules/bt-device/constants/device-instruction-pdfs.js.map +1 -1
- package/lib/module/modules/bt-management/constants/integrated-devices-map.js +1 -1
- package/lib/module/modules/bt-management/constants/integrated-devices-map.js.map +1 -1
- package/lib/module/modules/bt-management/index.js +20 -0
- package/lib/module/modules/bt-management/index.js.map +1 -1
- package/lib/module/modules/bt-management/services/custom/compile-case-fields.js +44 -0
- package/lib/module/modules/bt-management/services/custom/compile-case-fields.js.map +1 -0
- package/lib/module/modules/bt-management/services/custom/compile-case-shape.js +48 -0
- package/lib/module/modules/bt-management/services/custom/compile-case-shape.js.map +1 -0
- package/lib/module/modules/bt-management/services/custom/compile-custom-case.js +53 -41
- 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 +3 -0
- 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-frame.js +48 -2
- package/lib/module/modules/bt-management/services/custom/compile-custom-frame.js.map +1 -1
- package/lib/module/modules/bt-management/services/custom/compile-custom-lepu.js +93 -0
- package/lib/module/modules/bt-management/services/custom/compile-custom-lepu.js.map +1 -0
- package/lib/module/modules/bt-management/services/custom/define-custom-device.js +24 -1
- 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 +20 -8
- package/lib/module/modules/bt-management/services/device-creator.js.map +1 -1
- package/lib/module/modules/bt-management/services/devices/aoj/aoj.thermometers.js +81 -0
- package/lib/module/modules/bt-management/services/devices/aoj/aoj.thermometers.js.map +1 -0
- package/lib/module/modules/bt-management/services/devices/bp2/bp2.frame-reader.js +8 -73
- package/lib/module/modules/bt-management/services/devices/bp2/bp2.frame-reader.js.map +1 -1
- package/lib/module/modules/bt-management/services/devices/bt-command-writer.js +150 -0
- package/lib/module/modules/bt-management/services/devices/bt-command-writer.js.map +1 -0
- package/lib/module/modules/bt-management/services/devices/bt-connection-handler.js +9 -49
- 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 +17 -6
- 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 +21 -14
- 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 +51 -0
- package/lib/module/modules/bt-management/services/devices/custom/custom-lepu-sequencer.js.map +1 -0
- package/lib/module/modules/bt-management/services/devices/custom/custom.device.js +82 -29
- 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 +2 -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 +43 -0
- package/lib/module/modules/bt-management/services/devices/lepu/lepu.command-builder.js.map +1 -0
- package/lib/module/modules/bt-management/services/devices/lepu/lepu.commands.js +33 -0
- package/lib/module/modules/bt-management/services/devices/lepu/lepu.commands.js.map +1 -0
- package/lib/module/modules/bt-management/services/devices/lepu/lepu.device-info.js +79 -0
- package/lib/module/modules/bt-management/services/devices/lepu/lepu.device-info.js.map +1 -0
- package/lib/module/modules/bt-management/services/devices/lepu/lepu.device-names.js +22 -0
- package/lib/module/modules/bt-management/services/devices/lepu/lepu.device-names.js.map +1 -0
- package/lib/module/modules/bt-management/services/devices/lepu/lepu.file-names.js +32 -0
- package/lib/module/modules/bt-management/services/devices/lepu/lepu.file-names.js.map +1 -0
- package/lib/module/modules/bt-management/services/devices/lepu/lepu.file-transfer.js +150 -0
- package/lib/module/modules/bt-management/services/devices/lepu/lepu.file-transfer.js.map +1 -0
- package/lib/module/modules/bt-management/services/devices/lepu/lepu.frame-reader.js +93 -0
- package/lib/module/modules/bt-management/services/devices/lepu/lepu.frame-reader.js.map +1 -0
- package/lib/module/modules/bt-management/services/devices/lepu/lepu.frame.js +24 -0
- package/lib/module/modules/bt-management/services/devices/lepu/lepu.frame.js.map +1 -0
- package/lib/module/modules/bt-management/services/devices/lepu/lepu.identity-gate.js +98 -0
- package/lib/module/modules/bt-management/services/devices/lepu/lepu.identity-gate.js.map +1 -0
- package/lib/module/modules/bt-management/services/devices/lepu/lepu.name-match.js +27 -0
- package/lib/module/modules/bt-management/services/devices/lepu/lepu.name-match.js.map +1 -0
- package/lib/module/modules/bt-management/services/devices/lepu/lepu.response-type.js +59 -0
- package/lib/module/modules/bt-management/services/devices/lepu/lepu.response-type.js.map +1 -0
- package/lib/module/modules/bt-management/services/devices/lepu/lepu.transports.js +140 -0
- package/lib/module/modules/bt-management/services/devices/lepu/lepu.transports.js.map +1 -0
- package/lib/module/modules/bt-management/services/devices/polling-command-sequencer.js +34 -0
- package/lib/module/modules/bt-management/services/devices/polling-command-sequencer.js.map +1 -0
- package/lib/module/modules/bt-management/services/devices/sentinel-frame-reader.js +79 -0
- package/lib/module/modules/bt-management/services/devices/sentinel-frame-reader.js.map +1 -0
- package/lib/module/modules/bt-management/services/devices/standard-gatt/standard-gatt.devices.js +123 -0
- package/lib/module/modules/bt-management/services/devices/standard-gatt/standard-gatt.devices.js.map +1 -0
- package/lib/module/modules/bt-management/services/devices/standard-gatt/standard-gatt.profile.js +50 -0
- package/lib/module/modules/bt-management/services/devices/standard-gatt/standard-gatt.profile.js.map +1 -0
- package/lib/module/modules/bt-management/services/devices/veroval/veroval.bp-monitors.js +38 -0
- package/lib/module/modules/bt-management/services/devices/veroval/veroval.bp-monitors.js.map +1 -0
- package/lib/module/modules/bt-management/services/devices/veroval/veroval.duo-control-device.js +108 -0
- package/lib/module/modules/bt-management/services/devices/veroval/veroval.duo-control-device.js.map +1 -0
- package/lib/module/modules/bt-management/services/devices/veroval/veroval.duo-control-sequencer.js +116 -0
- package/lib/module/modules/bt-management/services/devices/veroval/veroval.duo-control-sequencer.js.map +1 -0
- package/lib/module/modules/bt-management/services/devices/veroval/veroval.ecg-device.js +87 -0
- package/lib/module/modules/bt-management/services/devices/veroval/veroval.ecg-device.js.map +1 -0
- package/lib/module/modules/bt-management/services/devices/veroval/veroval.ecg-samples.js +60 -0
- package/lib/module/modules/bt-management/services/devices/veroval/veroval.ecg-samples.js.map +1 -0
- package/lib/module/modules/bt-management/services/devices/veroval/veroval.ecg-transfer.js +89 -0
- package/lib/module/modules/bt-management/services/devices/veroval/veroval.ecg-transfer.js.map +1 -0
- package/lib/module/modules/bt-management/services/devices/viatom/viatom.bp-monitors.js +118 -0
- package/lib/module/modules/bt-management/services/devices/viatom/viatom.bp-monitors.js.map +1 -0
- package/lib/module/modules/bt-management/services/devices/viatom/viatom.ecg-recorders.js +108 -0
- package/lib/module/modules/bt-management/services/devices/viatom/viatom.ecg-recorders.js.map +1 -0
- package/lib/module/modules/bt-management/services/devices/viatom/viatom.lepod.js +114 -0
- package/lib/module/modules/bt-management/services/devices/viatom/viatom.lepod.js.map +1 -0
- package/lib/module/modules/bt-management/services/devices/viatom/viatom.oximeters.js +79 -0
- package/lib/module/modules/bt-management/services/devices/viatom/viatom.oximeters.js.map +1 -0
- package/lib/module/modules/bt-management/types/command-sequencer.js +4 -0
- package/lib/module/modules/bt-management/types/command-sequencer.js.map +1 -0
- package/lib/module/modules/bt-management/types/custom-checksum-algorithm.js +2 -0
- package/lib/module/modules/bt-management/types/custom-checksum-algorithm.js.map +1 -0
- package/lib/module/modules/bt-management/types/custom-checksum-spec.js +4 -0
- package/lib/module/modules/bt-management/types/custom-checksum-spec.js.map +1 -0
- package/lib/module/modules/bt-management/types/custom-device-definition.js.map +1 -1
- package/lib/module/modules/bt-management/types/custom-lepu-spec.js +2 -0
- package/lib/module/modules/bt-management/types/custom-lepu-spec.js.map +1 -0
- package/lib/module/modules/bt-management/types/custom-measurement-spec.js +4 -0
- package/lib/module/modules/bt-management/types/custom-measurement-spec.js.map +1 -0
- package/lib/module/modules/bt-management/types/device-command.js +2 -0
- package/lib/module/modules/bt-management/types/device-command.js.map +1 -0
- package/lib/module/modules/bt-management/types/device-measurement-map.js +3 -3
- package/lib/module/modules/bt-management/types/device-measurement-map.js.map +1 -1
- package/lib/module/modules/bt-management/types/integrated-devices.js +2 -0
- package/lib/module/modules/bt-management/types/integrated-devices.js.map +1 -1
- package/lib/module/modules/bt-management/types/measurement-group.js +4 -0
- package/lib/module/modules/bt-management/types/measurement-group.js.map +1 -0
- package/lib/module/modules/bt-management/utils/calculate-checksum.js +44 -0
- package/lib/module/modules/bt-management/utils/calculate-checksum.js.map +1 -0
- package/lib/module/modules/bt-management/utils/create-custom-field-parser.js +21 -0
- package/lib/module/modules/bt-management/utils/create-custom-field-parser.js.map +1 -1
- package/lib/module/modules/bt-management/utils/create-frame-validator.js +9 -0
- package/lib/module/modules/bt-management/utils/create-frame-validator.js.map +1 -1
- package/lib/module/modules/bt-management/utils/hex-to-bytes.js +14 -0
- package/lib/module/modules/bt-management/utils/hex-to-bytes.js.map +1 -0
- package/lib/module/modules/bt-management/utils/le-32-to-bytes.js +8 -0
- package/lib/module/modules/bt-management/utils/le-32-to-bytes.js.map +1 -0
- package/lib/module/modules/bt-management/utils/parse-measurement.js +10 -7
- package/lib/module/modules/bt-management/utils/parse-measurement.js.map +1 -1
- package/lib/module/modules/bt-management/utils/reject-custom-reading.js +29 -0
- package/lib/module/modules/bt-management/utils/reject-custom-reading.js.map +1 -0
- package/lib/module/modules/bt-management/utils/summarise-measurement-for-log.js +17 -0
- package/lib/module/modules/bt-management/utils/summarise-measurement-for-log.js.map +1 -0
- package/lib/module/modules/bt-management/utils/supported-measurement-type-keys.js +13 -0
- package/lib/module/modules/bt-management/utils/supported-measurement-type-keys.js.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-device/constants/device-instruction-pdfs.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 +20 -0
- package/lib/typescript/commonjs/src/modules/bt-management/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/custom/compile-case-fields.d.ts +13 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/custom/compile-case-fields.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/custom/compile-case-shape.d.ts +19 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/custom/compile-case-shape.d.ts.map +1 -0
- 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-frame.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/custom/compile-custom-lepu.d.ts +11 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/custom/compile-custom-lepu.d.ts.map +1 -0
- 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/aoj/aoj.thermometers.d.ts +24 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/aoj/aoj.thermometers.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bp2/bp2.frame-reader.d.ts +5 -8
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bp2/bp2.frame-reader.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bt-command-writer.d.ts +74 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bt-command-writer.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bt-connection-handler.d.ts +6 -4
- 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 +20 -1
- 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 +12 -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 +30 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/custom/custom-lepu-sequencer.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/custom/custom.device.d.ts +32 -2
- 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.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.command-builder.d.ts +24 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.command-builder.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.commands.d.ts +32 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.commands.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.device-info.d.ts +27 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.device-info.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.device-names.d.ts +20 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.device-names.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.file-names.d.ts +14 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.file-names.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.file-transfer.d.ts +75 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.file-transfer.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.frame-reader.d.ts +28 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.frame-reader.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.frame.d.ts +12 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.frame.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.identity-gate.d.ts +81 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.identity-gate.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.name-match.d.ts +17 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.name-match.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.response-type.d.ts +33 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.response-type.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.transports.d.ts +85 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.transports.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/polling-command-sequencer.d.ts +27 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/polling-command-sequencer.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/sentinel-frame-reader.d.ts +52 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/sentinel-frame-reader.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.devices.d.ts +53 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.devices.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.profile.d.ts +45 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.profile.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/veroval/veroval.bp-monitors.d.ts +18 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/veroval/veroval.bp-monitors.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/veroval/veroval.duo-control-device.d.ts +19 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/veroval/veroval.duo-control-device.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/veroval/veroval.duo-control-sequencer.d.ts +45 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/veroval/veroval.duo-control-sequencer.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/veroval/veroval.ecg-device.d.ts +30 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/veroval/veroval.ecg-device.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/veroval/veroval.ecg-samples.d.ts +39 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/veroval/veroval.ecg-samples.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/veroval/veroval.ecg-transfer.d.ts +35 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/veroval/veroval.ecg-transfer.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/viatom/viatom.bp-monitors.d.ts +44 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/viatom/viatom.bp-monitors.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/viatom/viatom.ecg-recorders.d.ts +32 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/viatom/viatom.ecg-recorders.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/viatom/viatom.lepod.d.ts +25 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/viatom/viatom.lepod.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/viatom/viatom.oximeters.d.ts +39 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/viatom/viatom.oximeters.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/types/command-sequencer.d.ts +26 -0
- package/lib/typescript/commonjs/src/modules/bt-management/types/command-sequencer.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/types/custom-case-spec.d.ts +43 -0
- package/lib/typescript/commonjs/src/modules/bt-management/types/custom-case-spec.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/types/custom-checksum-algorithm.d.ts +10 -0
- package/lib/typescript/commonjs/src/modules/bt-management/types/custom-checksum-algorithm.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/types/custom-checksum-spec.d.ts +23 -0
- package/lib/typescript/commonjs/src/modules/bt-management/types/custom-checksum-spec.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/types/custom-device-definition.d.ts +5 -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 +12 -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 +7 -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-frame-spec.d.ts +8 -0
- package/lib/typescript/commonjs/src/modules/bt-management/types/custom-frame-spec.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/types/custom-lepu-spec.d.ts +44 -0
- package/lib/typescript/commonjs/src/modules/bt-management/types/custom-lepu-spec.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/types/custom-measurement-spec.d.ts +9 -0
- package/lib/typescript/commonjs/src/modules/bt-management/types/custom-measurement-spec.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/types/dependent-result-handler-params.d.ts +7 -0
- package/lib/typescript/commonjs/src/modules/bt-management/types/dependent-result-handler-params.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/types/device-command.d.ts +27 -0
- package/lib/typescript/commonjs/src/modules/bt-management/types/device-command.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/types/device-measurement-map.d.ts +2 -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 +3 -1
- 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/measurement-group.d.ts +14 -0
- package/lib/typescript/commonjs/src/modules/bt-management/types/measurement-group.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/types/parsing-case.d.ts +17 -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/calculate-checksum.d.ts +13 -0
- package/lib/typescript/commonjs/src/modules/bt-management/utils/calculate-checksum.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/utils/create-custom-field-parser.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/utils/create-frame-validator.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/utils/hex-to-bytes.d.ts +10 -0
- package/lib/typescript/commonjs/src/modules/bt-management/utils/hex-to-bytes.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/utils/le-32-to-bytes.d.ts +3 -0
- package/lib/typescript/commonjs/src/modules/bt-management/utils/le-32-to-bytes.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/utils/parse-measurement.d.ts +4 -1
- package/lib/typescript/commonjs/src/modules/bt-management/utils/parse-measurement.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/utils/reject-custom-reading.d.ts +15 -0
- package/lib/typescript/commonjs/src/modules/bt-management/utils/reject-custom-reading.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/utils/summarise-measurement-for-log.d.ts +9 -0
- package/lib/typescript/commonjs/src/modules/bt-management/utils/summarise-measurement-for-log.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/utils/supported-measurement-type-keys.d.ts +10 -0
- package/lib/typescript/commonjs/src/modules/bt-management/utils/supported-measurement-type-keys.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-device/constants/device-instruction-pdfs.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 +20 -0
- package/lib/typescript/module/src/modules/bt-management/index.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/custom/compile-case-fields.d.ts +13 -0
- package/lib/typescript/module/src/modules/bt-management/services/custom/compile-case-fields.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/custom/compile-case-shape.d.ts +19 -0
- package/lib/typescript/module/src/modules/bt-management/services/custom/compile-case-shape.d.ts.map +1 -0
- 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-frame.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/custom/compile-custom-lepu.d.ts +11 -0
- package/lib/typescript/module/src/modules/bt-management/services/custom/compile-custom-lepu.d.ts.map +1 -0
- 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/aoj/aoj.thermometers.d.ts +24 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/aoj/aoj.thermometers.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/bp2/bp2.frame-reader.d.ts +5 -8
- package/lib/typescript/module/src/modules/bt-management/services/devices/bp2/bp2.frame-reader.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/devices/bt-command-writer.d.ts +74 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/bt-command-writer.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/bt-connection-handler.d.ts +6 -4
- 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 +20 -1
- 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 +12 -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 +30 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/custom/custom-lepu-sequencer.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/custom/custom.device.d.ts +32 -2
- 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.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.command-builder.d.ts +24 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.command-builder.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.commands.d.ts +32 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.commands.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.device-info.d.ts +27 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.device-info.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.device-names.d.ts +20 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.device-names.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.file-names.d.ts +14 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.file-names.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.file-transfer.d.ts +75 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.file-transfer.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.frame-reader.d.ts +28 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.frame-reader.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.frame.d.ts +12 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.frame.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.identity-gate.d.ts +81 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.identity-gate.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.name-match.d.ts +17 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.name-match.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.response-type.d.ts +33 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.response-type.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.transports.d.ts +85 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.transports.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/polling-command-sequencer.d.ts +27 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/polling-command-sequencer.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/sentinel-frame-reader.d.ts +52 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/sentinel-frame-reader.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.devices.d.ts +53 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.devices.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.profile.d.ts +45 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.profile.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/veroval/veroval.bp-monitors.d.ts +18 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/veroval/veroval.bp-monitors.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/veroval/veroval.duo-control-device.d.ts +19 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/veroval/veroval.duo-control-device.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/veroval/veroval.duo-control-sequencer.d.ts +45 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/veroval/veroval.duo-control-sequencer.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/veroval/veroval.ecg-device.d.ts +30 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/veroval/veroval.ecg-device.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/veroval/veroval.ecg-samples.d.ts +39 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/veroval/veroval.ecg-samples.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/veroval/veroval.ecg-transfer.d.ts +35 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/veroval/veroval.ecg-transfer.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/viatom/viatom.bp-monitors.d.ts +44 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/viatom/viatom.bp-monitors.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/viatom/viatom.ecg-recorders.d.ts +32 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/viatom/viatom.ecg-recorders.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/viatom/viatom.lepod.d.ts +25 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/viatom/viatom.lepod.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/viatom/viatom.oximeters.d.ts +39 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/viatom/viatom.oximeters.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/types/command-sequencer.d.ts +26 -0
- package/lib/typescript/module/src/modules/bt-management/types/command-sequencer.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/types/custom-case-spec.d.ts +43 -0
- package/lib/typescript/module/src/modules/bt-management/types/custom-case-spec.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/types/custom-checksum-algorithm.d.ts +10 -0
- package/lib/typescript/module/src/modules/bt-management/types/custom-checksum-algorithm.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/types/custom-checksum-spec.d.ts +23 -0
- package/lib/typescript/module/src/modules/bt-management/types/custom-checksum-spec.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/types/custom-device-definition.d.ts +5 -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 +12 -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 +7 -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-frame-spec.d.ts +8 -0
- package/lib/typescript/module/src/modules/bt-management/types/custom-frame-spec.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/types/custom-lepu-spec.d.ts +44 -0
- package/lib/typescript/module/src/modules/bt-management/types/custom-lepu-spec.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/types/custom-measurement-spec.d.ts +9 -0
- package/lib/typescript/module/src/modules/bt-management/types/custom-measurement-spec.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/types/dependent-result-handler-params.d.ts +7 -0
- package/lib/typescript/module/src/modules/bt-management/types/dependent-result-handler-params.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/types/device-command.d.ts +27 -0
- package/lib/typescript/module/src/modules/bt-management/types/device-command.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/types/device-measurement-map.d.ts +2 -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 +3 -1
- 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/measurement-group.d.ts +14 -0
- package/lib/typescript/module/src/modules/bt-management/types/measurement-group.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/types/parsing-case.d.ts +17 -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/calculate-checksum.d.ts +13 -0
- package/lib/typescript/module/src/modules/bt-management/utils/calculate-checksum.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/utils/create-custom-field-parser.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/utils/create-frame-validator.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/utils/hex-to-bytes.d.ts +10 -0
- package/lib/typescript/module/src/modules/bt-management/utils/hex-to-bytes.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/utils/le-32-to-bytes.d.ts +3 -0
- package/lib/typescript/module/src/modules/bt-management/utils/le-32-to-bytes.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/utils/parse-measurement.d.ts +4 -1
- package/lib/typescript/module/src/modules/bt-management/utils/parse-measurement.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/utils/reject-custom-reading.d.ts +15 -0
- package/lib/typescript/module/src/modules/bt-management/utils/reject-custom-reading.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/utils/summarise-measurement-for-log.d.ts +9 -0
- package/lib/typescript/module/src/modules/bt-management/utils/summarise-measurement-for-log.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/utils/supported-measurement-type-keys.d.ts +10 -0
- package/lib/typescript/module/src/modules/bt-management/utils/supported-measurement-type-keys.d.ts.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_core","require","_defineCustomDevice","_customDevice","_sentinelFrameReader","_verovalDuoControlSequencer","SERVICE","NOTIFY","WRITE","STX","ETX","ACK","NAK","RECORD_BYTES","TAG_BYTES","DATA_REPLY","COUNT_REPLY","MAX_REPLY_BYTES","STUCK_TIMEOUT_MS","asciiField","name","from","unit","byteIndexes","encoding","duoControlDefinition","defineCustomDevice","id","nameMatch","stuckDataTimeoutMs","services","uuid","monitor","frame","minLengthBytes","caseSelectorBytes","cases","selector","kind","measurementTypeKey","MeasurementTypeKey","bloodPressure","description","repeatedRecords","recordBytes","fields","VerovalDuoControlDevice","CustomDevice","constructor","device","params","frameReader","SentinelFrameReader","start","terminator","maxFrameBytes","standaloneBytes","createCommandSequencer","VerovalDuoControlSequencer","write","serviceUuid","characteristicUuid","onRefused","reason","onError","Error","exports"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/veroval/veroval.duo-control-device.ts"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AAKA,IAAAC,mBAAA,GAAAD,OAAA;AACA,IAAAE,aAAA,GAAAF,OAAA;AACA,IAAAG,oBAAA,GAAAH,OAAA;AAEA,IAAAI,2BAAA,GAAAJ,OAAA;AAEA,MAAMK,OAAO,GAAG,sCAAsC;AACtD,MAAMC,MAAM,GAAG,sCAAsC;AACrD,MAAMC,KAAK,GAAG,sCAAsC;AAEpD,MAAMC,GAAG,GAAG,IAAI;AAChB,MAAMC,GAAG,GAAG,IAAI;AAChB,MAAMC,GAAG,GAAG,IAAI;AAChB,MAAMC,GAAG,GAAG,IAAI;;AAEhB;AACA,MAAMC,YAAY,GAAG,EAAE;;AAEvB;AACA,MAAMC,SAAS,GAAG,CAAC;;AAEnB;AACA,MAAMC,UAAU,GAAG,UAAU;;AAE7B;AACA,MAAMC,WAAW,GAAG,UAAU;;AAE9B;AACA,MAAMC,eAAe,GAAG,KAAK;;AAE7B;AACA,MAAMC,gBAAgB,GAAG,OAAO;AAEhC,MAAMC,UAAU,GAAGA,CAACC,IAAY,EAAEC,IAAY,EAAEC,IAAY,MAAM;EAChEF,IAAI;EACJG,WAAW,EAAE,CAACF,IAAI,EAAEA,IAAI,GAAG,CAAC,EAAEA,IAAI,GAAG,CAAC,CAAC;EACvCG,QAAQ,EAAE,OAAgB;EAC1BF;AACF,CA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IC,wCAAmB,CAAC;MACzCC,KAAK,EAAE5C,GAAG;MACV6C,UAAU,EAAE5C,GAAG;MACf6C,aAAa,EAAEtC,eAAe;MAC9BuC,eAAe,EAAE,CAAC7C,GAAG,EAAEC,GAAG;IAC5B,CAAC,CAAC;IAEF,IAAI,CAAC6C,sBAAsB,GAAG,MAC5B,IAAIC,sDAA0B,CAAC;MAC7BC,KAAK,EAAE;QAAEC,WAAW,EAAEtD,OAAO;QAAEuD,kBAAkB,EAAErD;MAAM,CAAC;MAC1DsD,SAAS,EAAGC,MAAM,IAChB,IAAI,CAACC,OAAO,GAAG,IAAIC,KAAK,CAAC,wBAAwBF,MAAM,GAAG,CAAC;IAC/D,CAAC,CAAC;EACN;AACF;AAACG,OAAA,CAAApB,uBAAA,GAAAA,uBAAA","ignoreList":[]}
|
package/lib/commonjs/modules/bt-management/services/devices/veroval/veroval.duo-control-sequencer.js
ADDED
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.VerovalDuoControlSequencer = void 0;
|
|
7
|
+
var _hexToByte = require("../../../utils/hex-to-byte.js");
|
|
8
|
+
/** The control bytes of the serial protocol this device speaks over BLE. */
|
|
9
|
+
const ACK = 0x06;
|
|
10
|
+
const NAK = 0x15;
|
|
11
|
+
const ENQ = "05";
|
|
12
|
+
|
|
13
|
+
/** The device holds two user memories, and each is asked for a count and then its data. */
|
|
14
|
+
const STEPS = ["?MRN1", "?MDR1A", "?MRN2", "?MDR2A"];
|
|
15
|
+
|
|
16
|
+
/** A reply echoes the four-character command it answers, after the byte the reader strips. */
|
|
17
|
+
const TAG_FROM = 0;
|
|
18
|
+
const TAG_BYTES = 4;
|
|
19
|
+
const COUNT_BYTES = 3;
|
|
20
|
+
const ASCII_ZERO = 0x30;
|
|
21
|
+
const ASCII_NINE = 0x39;
|
|
22
|
+
const asciiOf = (frame, from, count) => frame.slice(from, from + count).map(byte => String.fromCharCode((0, _hexToByte.hexToByte)(byte))).join("");
|
|
23
|
+
const asciiNumberOf = (frame, from, count) => {
|
|
24
|
+
const codes = frame.slice(from, from + count).map(byte => (0, _hexToByte.hexToByte)(byte));
|
|
25
|
+
if (codes.length !== count || codes.some(code => code < ASCII_ZERO || code > ASCII_NINE)) {
|
|
26
|
+
return undefined;
|
|
27
|
+
}
|
|
28
|
+
return Number(codes.map(code => code - ASCII_ZERO).join(""));
|
|
29
|
+
};
|
|
30
|
+
const asciiCommand = (write, text) => ({
|
|
31
|
+
...write,
|
|
32
|
+
frame: [...text].map(character => character.charCodeAt(0).toString(16).padStart(2, "0")),
|
|
33
|
+
withoutResponse: true
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Walks the Veroval duo control through its stored history.
|
|
38
|
+
*
|
|
39
|
+
* The device answers one request at a time and holds two user memories, so the exchange is
|
|
40
|
+
* a fixed walk: ask user one how many records it has, read them, then user two. A memory
|
|
41
|
+
* that reports none is skipped rather than read.
|
|
42
|
+
*
|
|
43
|
+
* Two of its replies are not payload at all. A bare `ACK` means the device has more to send
|
|
44
|
+
* and is waiting to be asked, which is what `ENQ` does - so an acknowledgement provokes an
|
|
45
|
+
* enquiry rather than advancing the walk. A bare `NAK` is a refusal and ends it.
|
|
46
|
+
*
|
|
47
|
+
* Everything here is derived from HARTMANN's own application. The one part that is an
|
|
48
|
+
* inference rather than a reading is `ENQ` as flow control: the app writes it on receiving
|
|
49
|
+
* `ACK`, which is what that pair means in the serial protocol this is descended from, but
|
|
50
|
+
* the pacing was not observed on hardware.
|
|
51
|
+
*/
|
|
52
|
+
class VerovalDuoControlSequencer {
|
|
53
|
+
step = 0;
|
|
54
|
+
isDone = false;
|
|
55
|
+
constructor(params) {
|
|
56
|
+
this.params = params;
|
|
57
|
+
}
|
|
58
|
+
initialCommands = () => [this.commandFor(0)];
|
|
59
|
+
nextCommand = frame => {
|
|
60
|
+
if (this.isDone) {
|
|
61
|
+
return undefined;
|
|
62
|
+
}
|
|
63
|
+
if (frame.length === 1) {
|
|
64
|
+
return this.answerControlByte((0, _hexToByte.hexToByte)(frame[0] ?? "0"));
|
|
65
|
+
}
|
|
66
|
+
const tag = asciiOf(frame, TAG_FROM, TAG_BYTES);
|
|
67
|
+
if (tag === "?MRN") {
|
|
68
|
+
return this.answerCount(frame);
|
|
69
|
+
}
|
|
70
|
+
return tag === "?MDR" ? this.advance() : undefined;
|
|
71
|
+
};
|
|
72
|
+
answerControlByte = code => {
|
|
73
|
+
if (code === ACK) {
|
|
74
|
+
return [asciiCommandFromHex(this.params.write, ENQ)];
|
|
75
|
+
}
|
|
76
|
+
if (code === NAK) {
|
|
77
|
+
return this.stop("the device refused the request");
|
|
78
|
+
}
|
|
79
|
+
return undefined;
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* A memory reporting no records is skipped. Asking for the data of an empty memory is a
|
|
84
|
+
* request the device answers with nothing, which would stall the walk on its own reply.
|
|
85
|
+
*/
|
|
86
|
+
answerCount = frame => {
|
|
87
|
+
const count = asciiNumberOf(frame, TAG_BYTES, COUNT_BYTES);
|
|
88
|
+
if (count === undefined) {
|
|
89
|
+
return this.stop("the device answered a record count that was not a number");
|
|
90
|
+
}
|
|
91
|
+
return count > 0 ? this.advance() : this.skipMemory();
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
/** Past this memory's data command, to the next memory's count. */
|
|
95
|
+
skipMemory = () => {
|
|
96
|
+
this.step += 1;
|
|
97
|
+
return this.advance();
|
|
98
|
+
};
|
|
99
|
+
advance = () => {
|
|
100
|
+
this.step += 1;
|
|
101
|
+
if (this.step >= STEPS.length) {
|
|
102
|
+
this.isDone = true;
|
|
103
|
+
return undefined;
|
|
104
|
+
}
|
|
105
|
+
return [this.commandFor(this.step)];
|
|
106
|
+
};
|
|
107
|
+
stop = reason => {
|
|
108
|
+
this.isDone = true;
|
|
109
|
+
this.params.onRefused(reason);
|
|
110
|
+
return undefined;
|
|
111
|
+
};
|
|
112
|
+
commandFor = step => asciiCommand(this.params.write, STEPS[step] ?? "");
|
|
113
|
+
}
|
|
114
|
+
exports.VerovalDuoControlSequencer = VerovalDuoControlSequencer;
|
|
115
|
+
const asciiCommandFromHex = (write, hex) => ({
|
|
116
|
+
...write,
|
|
117
|
+
frame: [hex],
|
|
118
|
+
withoutResponse: true
|
|
119
|
+
});
|
|
120
|
+
//# sourceMappingURL=veroval.duo-control-sequencer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_hexToByte","require","ACK","NAK","ENQ","STEPS","TAG_FROM","TAG_BYTES","COUNT_BYTES","ASCII_ZERO","ASCII_NINE","asciiOf","frame","from","count","slice","map","byte","String","fromCharCode","hexToByte","join","asciiNumberOf","codes","length","some","code","undefined","Number","asciiCommand","write","text","character","charCodeAt","toString","padStart","withoutResponse","VerovalDuoControlSequencer","step","isDone","constructor","params","initialCommands","commandFor","nextCommand","answerControlByte","tag","answerCount","advance","asciiCommandFromHex","stop","skipMemory","reason","onRefused","exports","hex"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/veroval/veroval.duo-control-sequencer.ts"],"mappings":";;;;;;AAEA,IAAAA,UAAA,GAAAC,OAAA;AAEA;AACA,MAAMC,GAAG,GAAG,IAAI;AAChB,MAAMC,GAAG,GAAG,IAAI;AAChB,MAAMC,GAAG,GAAG,IAAI;;AAEhB;AACA,MAAMC,KAAK,GAAG,CAAC,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,CAAU;;AAE7D;AACA,MAAMC,QAAQ,GAAG,CAAC;AAClB,MAAMC,SAAS,GAAG,CAAC;AACnB,MAAMC,WAAW,GAAG,CAAC;AACrB,MAAMC,UAAU,GAAG,IAAI;AACvB,MAAMC,UAAU,GAAG,IAAI;AAEvB,MAAMC,OAAO,GAAGA,CAACC,KAAwB,EAAEC,IAAY,EAAEC,KAAa,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OAAOpC,KAAK,GAAG,CAAC,GAAG,IAAI,CAACkC,OAAO,CAAC,CAAC,GAAG,IAAI,CAACG,UAAU,CAAC,CAAC;EACvD,CAAC;;EAED;EACQA,UAAU,GAAGA,CAAA,KAA4C;IAC/D,IAAI,CAACb,IAAI,IAAI,CAAC;IAEd,OAAO,IAAI,CAACU,OAAO,CAAC,CAAC;EACvB,CAAC;EAEOA,OAAO,GAAGA,CAAA,KAA4C;IAC5D,IAAI,CAACV,IAAI,IAAI,CAAC;IAEd,IAAI,IAAI,CAACA,IAAI,IAAIjC,KAAK,CAACmB,MAAM,EAAE;MAC7B,IAAI,CAACe,MAAM,GAAG,IAAI;MAElB,OAAOZ,SAAS;IAClB;IAEA,OAAO,CAAC,IAAI,CAACgB,UAAU,CAAC,IAAI,CAACL,IAAI,CAAC,CAAC;EACrC,CAAC;EAEOY,IAAI,GAAIE,MAAc,IAAgB;IAC5C,IAAI,CAACb,MAAM,GAAG,IAAI;IAClB,IAAI,CAACE,MAAM,CAACY,SAAS,CAACD,MAAM,CAAC;IAE7B,OAAOzB,SAAS;EAClB,CAAC;EAEOgB,UAAU,GAAIL,IAAY,IAChCT,YAAY,CAAC,IAAI,CAACY,MAAM,CAACX,KAAK,EAAEzB,KAAK,CAACiC,IAAI,CAAC,IAAI,EAAE,CAAC;AACtD;AAACgB,OAAA,CAAAjB,0BAAA,GAAAA,0BAAA;AAED,MAAMY,mBAAmB,GAAGA,CAC1BnB,KAAmC,EACnCyB,GAAW,MACQ;EAAE,GAAGzB,KAAK;EAAElB,KAAK,EAAE,CAAC2C,GAAG,CAAC;EAAEnB,eAAe,EAAE;AAAK,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.VerovalEcgDevice = void 0;
|
|
7
|
+
var _core = require("@ovok/core");
|
|
8
|
+
var _caseType = require("../../../types/case-type.js");
|
|
9
|
+
var _btManagedDevice = require("../bt-managed-device.js");
|
|
10
|
+
var _verovalEcgSamples = require("./veroval.ecg-samples.js");
|
|
11
|
+
var _verovalEcgTransfer = require("./veroval.ecg-transfer.js");
|
|
12
|
+
const SERVICE = "0000a000-0000-1000-8000-00805f9b34fb";
|
|
13
|
+
|
|
14
|
+
/** Requests go to one characteristic and every reply arrives on the other. */
|
|
15
|
+
const CONTROL_POINT = "00002a37-0000-1000-8000-00805f9b34fb";
|
|
16
|
+
const NOTIFY = "00002a36-0000-1000-8000-00805f9b34fb";
|
|
17
|
+
|
|
18
|
+
/** A recording is thirty-four seconds, and the device waits on a person before sending it. */
|
|
19
|
+
const STUCK_TIMEOUT_MS = 180_000;
|
|
20
|
+
const PREFERRED_MTU = 247;
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Every notification matches this, and none of them is a measurement.
|
|
24
|
+
*
|
|
25
|
+
* The transfer assembles the recording itself and reports it once, so the parser is given a
|
|
26
|
+
* case that matches anything and decodes nothing. Without it each of the five hundred odd
|
|
27
|
+
* packets would be logged as a frame nothing declared.
|
|
28
|
+
*/
|
|
29
|
+
const acceptEverything = {
|
|
30
|
+
caseValuePosition: [],
|
|
31
|
+
cases: [{
|
|
32
|
+
caseValue: "",
|
|
33
|
+
caseType: _caseType.CaseType.OTHER,
|
|
34
|
+
parseDefinitions: [],
|
|
35
|
+
description: "A packet of a download, assembled by the transfer"
|
|
36
|
+
}]
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* The Veroval ECG.
|
|
41
|
+
*
|
|
42
|
+
* Reading it is a download rather than a decode, so the whole recording is assembled before
|
|
43
|
+
* anything is reported: thirty-four seconds of samples at 128 Hz, two bytes each, converted
|
|
44
|
+
* to millivolts with the device's own calibration.
|
|
45
|
+
*
|
|
46
|
+
* The vendor's app plots a thirty-second window of this with a baseline-wander filter
|
|
47
|
+
* applied. That is a display transform, not calibration, so it is deliberately not
|
|
48
|
+
* reproduced here - what is reported is what the device recorded.
|
|
49
|
+
*/
|
|
50
|
+
class VerovalEcgDevice extends _btManagedDevice.BTManagedDevice {
|
|
51
|
+
stuckDataTimeout = STUCK_TIMEOUT_MS;
|
|
52
|
+
preferredMtu = PREFERRED_MTU;
|
|
53
|
+
onStreamStart = undefined;
|
|
54
|
+
mainServices = [{
|
|
55
|
+
uuid: SERVICE,
|
|
56
|
+
monitorUuids: [{
|
|
57
|
+
uuid: NOTIFY,
|
|
58
|
+
parsingModel: acceptEverything
|
|
59
|
+
}]
|
|
60
|
+
}];
|
|
61
|
+
validatePackage = () => true;
|
|
62
|
+
createCommandSequencer = () => new _verovalEcgTransfer.VerovalEcgTransfer({
|
|
63
|
+
write: {
|
|
64
|
+
serviceUuid: SERVICE,
|
|
65
|
+
characteristicUuid: CONTROL_POINT
|
|
66
|
+
},
|
|
67
|
+
onRecording: this.reportRecording
|
|
68
|
+
});
|
|
69
|
+
constructor(device, params) {
|
|
70
|
+
super(device, params);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/** Nothing is reported per packet; the transfer reports the recording when it is whole. */
|
|
74
|
+
handleSuccessResult() {
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
reportRecording = bytes => {
|
|
78
|
+
const diagramPoints = (0, _verovalEcgSamples.decodeVerovalEcgSamples)(bytes);
|
|
79
|
+
if (diagramPoints.length === 0) {
|
|
80
|
+
this.onError?.(new Error("Veroval ECG: the recording held no samples."));
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
this.onResult?.({
|
|
84
|
+
measurementTypeKey: _core.MeasurementTypeKey.ecg,
|
|
85
|
+
caseType: _caseType.CaseType.RESULT,
|
|
86
|
+
diagramPoints,
|
|
87
|
+
duration: diagramPoints.length / _verovalEcgSamples.VEROVAL_ECG_SAMPLE_RATE_HZ
|
|
88
|
+
});
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
exports.VerovalEcgDevice = VerovalEcgDevice;
|
|
92
|
+
//# sourceMappingURL=veroval.ecg-device.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_core","require","_caseType","_btManagedDevice","_verovalEcgSamples","_verovalEcgTransfer","SERVICE","CONTROL_POINT","NOTIFY","STUCK_TIMEOUT_MS","PREFERRED_MTU","acceptEverything","caseValuePosition","cases","caseValue","caseType","CaseType","OTHER","parseDefinitions","description","VerovalEcgDevice","BTManagedDevice","stuckDataTimeout","preferredMtu","onStreamStart","undefined","mainServices","uuid","monitorUuids","parsingModel","validatePackage","createCommandSequencer","VerovalEcgTransfer","write","serviceUuid","characteristicUuid","onRecording","reportRecording","constructor","device","params","handleSuccessResult","bytes","diagramPoints","decodeVerovalEcgSamples","length","onError","Error","onResult","measurementTypeKey","MeasurementTypeKey","ecg","RESULT","duration","VEROVAL_ECG_SAMPLE_RATE_HZ","exports"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/veroval/veroval.ecg-device.ts"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AAGA,IAAAC,SAAA,GAAAD,OAAA;AAIA,IAAAE,gBAAA,GAAAF,OAAA;AAEA,IAAAG,kBAAA,GAAAH,OAAA;AAIA,IAAAI,mBAAA,GAAAJ,OAAA;AAEA,MAAMK,OAAO,GAAG,sCAAsC;;AAEtD;AACA,MAAMC,aAAa,GAAG,sCAAsC;AAC5D,MAAMC,MAAM,GAAG,sCAAsC;;AAErD;AACA,MAAMC,gBAAgB,GAAG,OAAO;AAEhC,MAAMC,aAAa,GAAG,GAAG;;AAEzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,gBAAgB,GAAG;EACvBC,iBAAiB,EAAE,EAAE;EACrBC,KAAK,EAAE,CACL;IACEC,SAAS,EAAE,EAAE;IACbC,QAAQ,EAAEC,kBAAQ,CAACC,KAAK;IACxBC,gBAAgB,EAAE,EAAE;IACpBC,WAAW,EAAE;EACf,CAAC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 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.decodeVerovalEcgSamples = exports.VEROVAL_ECG_SAMPLE_RATE_HZ = exports.DEFAULT_CALIBRATION = void 0;
|
|
7
|
+
var _hexToByte = require("../../../utils/hex-to-byte.js");
|
|
8
|
+
const SAMPLE_BYTES = 2;
|
|
9
|
+
const BYTE_BITS = 8;
|
|
10
|
+
const SIGN_BIT = 0x8000;
|
|
11
|
+
const SIGNED_16_RANGE = 0x10000;
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* How fast the device samples.
|
|
15
|
+
*
|
|
16
|
+
* Not taken on trust: the vendor's own plotting step works out to two two-hundred-and-fifty
|
|
17
|
+
* sixths of a second, and its transfer is thirty-four segments of sixteen packets of sixteen
|
|
18
|
+
* bytes - which is 256 bytes, 128 samples, one second per segment. Both say 128 Hz.
|
|
19
|
+
*/
|
|
20
|
+
const VEROVAL_ECG_SAMPLE_RATE_HZ = exports.VEROVAL_ECG_SAMPLE_RATE_HZ = 128;
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* The calibration the recording is read with.
|
|
24
|
+
*
|
|
25
|
+
* This is the EDF convention - a linear map from counts onto a physical range - and the
|
|
26
|
+
* device states its own in the header it sends before the curve. These are the values the
|
|
27
|
+
* vendor's app falls back to, and are what the SDK uses until a header supplies otherwise:
|
|
28
|
+
* the full signed sixteen-bit range spans plus or minus 27.68 mV.
|
|
29
|
+
*/
|
|
30
|
+
const DEFAULT_CALIBRATION = exports.DEFAULT_CALIBRATION = {
|
|
31
|
+
physicalMinimumMicrovolts: -27_680,
|
|
32
|
+
physicalMaximumMicrovolts: 27_680,
|
|
33
|
+
digitalMinimum: -32_768,
|
|
34
|
+
digitalMaximum: 32_767
|
|
35
|
+
};
|
|
36
|
+
const MICROVOLTS_PER_MILLIVOLT = 1000;
|
|
37
|
+
/** Samples are two bytes, most significant first, and signed. */
|
|
38
|
+
const signedSampleAt = (bytes, index) => {
|
|
39
|
+
const raw = (0, _hexToByte.hexToByte)(bytes[index] ?? "0") << BYTE_BITS | (0, _hexToByte.hexToByte)(bytes[index + 1] ?? "0");
|
|
40
|
+
return raw & SIGN_BIT ? raw - SIGNED_16_RANGE : raw;
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Turns the bytes of a recording into millivolts.
|
|
45
|
+
*
|
|
46
|
+
* A trailing odd byte is ignored: half a sample is not a sample. The conversion is the
|
|
47
|
+
* device's own, applied as it states it rather than reduced to a single factor, so a header
|
|
48
|
+
* that reports a different range still decodes correctly.
|
|
49
|
+
*/
|
|
50
|
+
const decodeVerovalEcgSamples = (bytes, calibration = DEFAULT_CALIBRATION) => {
|
|
51
|
+
const physicalRange = calibration.physicalMaximumMicrovolts - calibration.physicalMinimumMicrovolts;
|
|
52
|
+
const digitalRange = calibration.digitalMaximum - calibration.digitalMinimum;
|
|
53
|
+
const samples = [];
|
|
54
|
+
if (digitalRange === 0) {
|
|
55
|
+
return samples;
|
|
56
|
+
}
|
|
57
|
+
for (let index = 0; index + 1 < bytes.length; index += SAMPLE_BYTES) {
|
|
58
|
+
const counts = signedSampleAt(bytes, index) - calibration.digitalMinimum;
|
|
59
|
+
samples.push((counts * physicalRange / digitalRange + calibration.physicalMinimumMicrovolts) / MICROVOLTS_PER_MILLIVOLT);
|
|
60
|
+
}
|
|
61
|
+
return samples;
|
|
62
|
+
};
|
|
63
|
+
exports.decodeVerovalEcgSamples = decodeVerovalEcgSamples;
|
|
64
|
+
//# sourceMappingURL=veroval.ecg-samples.js.map
|
package/lib/commonjs/modules/bt-management/services/devices/veroval/veroval.ecg-samples.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_hexToByte","require","SAMPLE_BYTES","BYTE_BITS","SIGN_BIT","SIGNED_16_RANGE","VEROVAL_ECG_SAMPLE_RATE_HZ","exports","DEFAULT_CALIBRATION","physicalMinimumMicrovolts","physicalMaximumMicrovolts","digitalMinimum","digitalMaximum","MICROVOLTS_PER_MILLIVOLT","signedSampleAt","bytes","index","raw","hexToByte","decodeVerovalEcgSamples","calibration","physicalRange","digitalRange","samples","length","counts","push"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/veroval/veroval.ecg-samples.ts"],"mappings":";;;;;;AAAA,IAAAA,UAAA,GAAAC,OAAA;AAEA,MAAMC,YAAY,GAAG,CAAC;AACtB,MAAMC,SAAS,GAAG,CAAC;AACnB,MAAMC,QAAQ,GAAG,MAAM;AACvB,MAAMC,eAAe,GAAG,OAAO;;AAE/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,0BAA0B,GAAAC,OAAA,CAAAD,0BAAA,GAAG,GAAG;;AAEtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAME,mBAAmB,GAAAD,OAAA,CAAAC,mBAAA,GAAG;EAC1BC,yBAAyB,EAAE,CAAC,MAAM;EAClCC,yBAAyB,EAAE,MAAM;EACjCC,cAAc,EAAE,CAAC,MAAM;EACvBC,cAAc,EAAE;AAClB,CAAU;AAEV,MAAMC,wBAAwB,GAAG,IAAI;AASrC;AACA,MAAMC,cAAc,GAAGA,CAACC,KAAwB,EAAEC,KAAa,KAAa;EAC1E,MAAMC,GAAG,GACN,IAAAC,oBAAS,EAACH,KAAK,CAACC,KAAK,CAAC,IAAI,GAAG,CAAC,IAAIb,SAAS,GAC5C,IAAAe,oBAAS,EAACH,KAAK,CAACC,KAAK,GAAG,CAAC,CAAC,IAAI,GAAG,CAAC;EAEpC,OAAOC,GAAG,GAAGb,QAAQ,GAAGa,GAAG,GAAGZ,eAAe,GAAGY,GAAG;AACrD,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAME,uBAAuB,GAAGA,CAC9BJ,KAAwB,EACxBK,WAA2B,GAAGZ,mBAAmB,KACpC;EACb,MAAMa,aAAa,GACjBD,WAAW,CAACV,yBAAyB,GAAGU,WAAW,CAACX,yBAAyB;EAE/E,MAAMa,YAAY,GAAGF,WAAW,CAACR,cAAc,GAAGQ,WAAW,CAACT,cAAc;EAC5E,MAAMY,OAAiB,GAAG,EAAE;EAE5B,IAAID,YAAY,KAAK,CAAC,EAAE;IACtB,OAAOC,OAAO;EAChB;EAEA,KAAK,IAAIP,KAAK,GAAG,CAAC,EAAEA,KAAK,GAAG,CAAC,GAAGD,KAAK,CAACS,MAAM,EAAER,KAAK,IAAId,YAAY,EAAE;IACnE,MAAMuB,MAAM,GAAGX,cAAc,CAACC,KAAK,EAAEC,KAAK,CAAC,GAAGI,WAAW,CAACT,cAAc;IAExEY,OAAO,CAACG,IAAI,CACV,CAAED,MAAM,GAAGJ,aAAa,GAAIC,YAAY,GACtCF,WAAW,CAACX,yBAAyB,IACrCI,wBACJ,CAAC;EACH;EAEA,OAAOU,OAAO;AAChB,CAAC;AAAChB,OAAA,CAAAY,uBAAA,GAAAA,uBAAA","ignoreList":[]}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.VerovalEcgTransfer = void 0;
|
|
7
|
+
/** Every request is a fixed twenty-byte packet, zero filled but for its group and command. */
|
|
8
|
+
const PACKET_BYTES = 20;
|
|
9
|
+
const GROUP_INDEX = 1;
|
|
10
|
+
const COMMAND_INDEX = 2;
|
|
11
|
+
const PARAMETER_INDEX = 3;
|
|
12
|
+
const DOWNLOAD_GROUP = 4;
|
|
13
|
+
const DOWNLOAD_MODE = 1;
|
|
14
|
+
const DOWNLOAD_HEADER = 2;
|
|
15
|
+
const DOWNLOAD_RAW = 3;
|
|
16
|
+
|
|
17
|
+
/** The transfer's shape, from the vendor's own device table. */
|
|
18
|
+
const PAYLOAD_FROM = 4;
|
|
19
|
+
const PAYLOAD_BYTES = 16;
|
|
20
|
+
const HEADER_PACKETS = 5;
|
|
21
|
+
const PACKETS_PER_SEGMENT = 16;
|
|
22
|
+
const SEGMENTS = 34;
|
|
23
|
+
const BYTE_MASK = 0xff;
|
|
24
|
+
const BYTE_BITS = 8;
|
|
25
|
+
const toHex = byte => (byte & BYTE_MASK).toString(16).padStart(2, "0");
|
|
26
|
+
const packet = (write, command, parameters = []) => {
|
|
27
|
+
const bytes = new Array(PACKET_BYTES).fill(0);
|
|
28
|
+
bytes[GROUP_INDEX] = DOWNLOAD_GROUP;
|
|
29
|
+
bytes[COMMAND_INDEX] = command;
|
|
30
|
+
parameters.forEach((value, index) => {
|
|
31
|
+
bytes[PARAMETER_INDEX + index] = value;
|
|
32
|
+
});
|
|
33
|
+
return {
|
|
34
|
+
...write,
|
|
35
|
+
frame: bytes.map(toHex)
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
const segmentParameters = segment => [segment & BYTE_MASK, segment >> BYTE_BITS & BYTE_MASK, segment >> BYTE_BITS * 2 & BYTE_MASK];
|
|
39
|
+
/**
|
|
40
|
+
* Downloads a recording from the Veroval ECG.
|
|
41
|
+
*
|
|
42
|
+
* The exchange is a fixed walk rather than a conversation: ask for the download mode, then
|
|
43
|
+
* the header, then each second of the recording in turn. The device answers each request
|
|
44
|
+
* with a known number of twenty-byte packets, sixteen payload bytes each, so the transfer is
|
|
45
|
+
* paced by counting them - which is how the vendor's own app paces it, and is the only thing
|
|
46
|
+
* that distinguishes one phase's packets from another's.
|
|
47
|
+
*
|
|
48
|
+
* A recording is thirty-four seconds at 128 Hz. Nothing is reported until all of it has
|
|
49
|
+
* arrived: a partial ECG that looked whole would be worse than none, and the count is what
|
|
50
|
+
* says it is whole.
|
|
51
|
+
*/
|
|
52
|
+
class VerovalEcgTransfer {
|
|
53
|
+
phase = "mode";
|
|
54
|
+
packets = 0;
|
|
55
|
+
segment = 0;
|
|
56
|
+
recording = [];
|
|
57
|
+
constructor(params) {
|
|
58
|
+
this.params = params;
|
|
59
|
+
}
|
|
60
|
+
initialCommands = () => [packet(this.params.write, DOWNLOAD_MODE)];
|
|
61
|
+
nextCommand = frame => {
|
|
62
|
+
if (this.phase === "done") {
|
|
63
|
+
return undefined;
|
|
64
|
+
}
|
|
65
|
+
if (this.phase === "mode") {
|
|
66
|
+
this.phase = "header";
|
|
67
|
+
this.packets = 0;
|
|
68
|
+
return [packet(this.params.write, DOWNLOAD_HEADER)];
|
|
69
|
+
}
|
|
70
|
+
this.packets += 1;
|
|
71
|
+
if (this.phase === "header") {
|
|
72
|
+
return this.packets < HEADER_PACKETS ? undefined : this.requestSegment(0);
|
|
73
|
+
}
|
|
74
|
+
this.recording.push(...frame.slice(PAYLOAD_FROM, PAYLOAD_FROM + PAYLOAD_BYTES));
|
|
75
|
+
return this.packets < PACKETS_PER_SEGMENT ? undefined : this.finishSegment();
|
|
76
|
+
};
|
|
77
|
+
finishSegment = () => {
|
|
78
|
+
this.segment += 1;
|
|
79
|
+
if (this.segment < SEGMENTS) {
|
|
80
|
+
return this.requestSegment(this.segment);
|
|
81
|
+
}
|
|
82
|
+
this.phase = "done";
|
|
83
|
+
this.params.onRecording(this.recording);
|
|
84
|
+
return undefined;
|
|
85
|
+
};
|
|
86
|
+
requestSegment = segment => {
|
|
87
|
+
this.phase = "raw";
|
|
88
|
+
this.packets = 0;
|
|
89
|
+
this.segment = segment;
|
|
90
|
+
return [packet(this.params.write, DOWNLOAD_RAW, segmentParameters(segment))];
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
exports.VerovalEcgTransfer = VerovalEcgTransfer;
|
|
94
|
+
//# sourceMappingURL=veroval.ecg-transfer.js.map
|
package/lib/commonjs/modules/bt-management/services/devices/veroval/veroval.ecg-transfer.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["PACKET_BYTES","GROUP_INDEX","COMMAND_INDEX","PARAMETER_INDEX","DOWNLOAD_GROUP","DOWNLOAD_MODE","DOWNLOAD_HEADER","DOWNLOAD_RAW","PAYLOAD_FROM","PAYLOAD_BYTES","HEADER_PACKETS","PACKETS_PER_SEGMENT","SEGMENTS","BYTE_MASK","BYTE_BITS","toHex","byte","toString","padStart","packet","write","command","parameters","bytes","Array","fill","forEach","value","index","frame","map","segmentParameters","segment","VerovalEcgTransfer","phase","packets","recording","constructor","params","initialCommands","nextCommand","undefined","requestSegment","push","slice","finishSegment","onRecording","exports"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/veroval/veroval.ecg-transfer.ts"],"mappings":";;;;;;AAGA;AACA,MAAMA,YAAY,GAAG,EAAE;AACvB,MAAMC,WAAW,GAAG,CAAC;AACrB,MAAMC,aAAa,GAAG,CAAC;AACvB,MAAMC,eAAe,GAAG,CAAC;AAEzB,MAAMC,cAAc,GAAG,CAAC;AACxB,MAAMC,aAAa,GAAG,CAAC;AACvB,MAAMC,eAAe,GAAG,CAAC;AACzB,MAAMC,YAAY,GAAG,CAAC;;AAEtB;AACA,MAAMC,YAAY,GAAG,CAAC;AACtB,MAAMC,aAAa,GAAG,EAAE;AACxB,MAAMC,cAAc,GAAG,CAAC;AACxB,MAAMC,mBAAmB,GAAG,EAAE;AAC9B,MAAMC,QAAQ,GAAG,EAAE;AAEnB,MAAMC,SAAS,GAAG,IAAI;AACtB,MAAMC,SAAS,GAAG,CAAC;AAEnB,MAAMC,KAAK,GAAIC,IAAY,IACzB,CAACA,IAAI,GAAGH,SAAS,EAAEI,QAAQ,CAAC,EAAE,CAAC,CAACC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC;AAElD,MAAMC,MAAM,GAAGA,CACbC,KAAmC,EACnCC,OAAe,EACfC,UAA6B,GAAG,EAAE,KAChB;EAClB,MAAMC,KAAK,GAAG,IAAIC,KAAK,CAASxB,YAAY,CAAC,CAACyB,IAAI,CAAC,CAAC,CAAC;EAErDF,KAAK,CAACtB,WAAW,CAAC,GAAGG,cAAc;EACnCmB,KAAK,CAACrB,aAAa,CAAC,GA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3B,OAAO,IAAI,CAACC,OAAO,GAAGzB,cAAc,GAAG+B,SAAS,GAAG,IAAI,CAACC,cAAc,CAAC,CAAC,CAAC;IAC3E;IAEA,IAAI,CAACN,SAAS,CAACO,IAAI,CACjB,GAAGd,KAAK,CAACe,KAAK,CAACpC,YAAY,EAAEA,YAAY,GAAGC,aAAa,CAC3D,CAAC;IAED,OAAO,IAAI,CAAC0B,OAAO,GAAGxB,mBAAmB,GACrC8B,SAAS,GACT,IAAI,CAACI,aAAa,CAAC,CAAC;EAC1B,CAAC;EAEOA,aAAa,GAAGA,CAAA,KAA4C;IAClE,IAAI,CAACb,OAAO,IAAI,CAAC;IAEjB,IAAI,IAAI,CAACA,OAAO,GAAGpB,QAAQ,EAAE;MAC3B,OAAO,IAAI,CAAC8B,cAAc,CAAC,IAAI,CAACV,OAAO,CAAC;IAC1C;IAEA,IAAI,CAACE,KAAK,GAAG,MAAM;IACnB,IAAI,CAACI,MAAM,CAACQ,WAAW,CAAC,IAAI,CAACV,SAAS,CAAC;IAEvC,OAAOK,SAAS;EAClB,CAAC;EAEOC,cAAc,GAAIV,OAAe,IAA+B;IACtE,IAAI,CAACE,KAAK,GAAG,KAAK;IAClB,IAAI,CAACC,OAAO,GAAG,CAAC;IAChB,IAAI,CAACH,OAAO,GAAGA,OAAO;IAEtB,OAAO,CACLb,MAAM,CAAC,IAAI,CAACmB,MAAM,CAAClB,KAAK,EAAEb,YAAY,EAAEwB,iBAAiB,CAACC,OAAO,CAAC,CAAC,CACpE;EACH,CAAC;AACH;AAACe,OAAA,CAAAd,kBAAA,GAAAA,kBAAA","ignoreList":[]}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.viatomBpMonitor = exports.bp2wMonitor = exports.bp2tMonitor = exports.bp2aMonitor = exports.BP3_MODEL_NAMES = void 0;
|
|
7
|
+
var _core = require("@ovok/core");
|
|
8
|
+
var _lepuNameMatch = require("../lepu/lepu.name-match.js");
|
|
9
|
+
var _lepuTransports = require("../lepu/lepu.transports.js");
|
|
10
|
+
/**
|
|
11
|
+
* The Viatom blood-pressure monitors that report a reading over the realtime channel.
|
|
12
|
+
*
|
|
13
|
+
* The vendor documents BP2, BP2A and BP2T as one product group on one set of characteristics
|
|
14
|
+
* with one API, and the SDK's own BP2 device class has run against that protocol on real
|
|
15
|
+
* hardware. The byte offsets below are that class's, unchanged.
|
|
16
|
+
*
|
|
17
|
+
* BP2W and the BP3 range decode the same struct rather than merely sharing a transport:
|
|
18
|
+
* their interfaces build `Bp2BleRtData`, which holds the device state in its first nine
|
|
19
|
+
* bytes and the result immediately after, and all of them answer the same `RT_DATA` opcode.
|
|
20
|
+
* That is still one step short of BP2A and BP2T, which the vendor groups with BP2 outright.
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
/** Realtime data. Inert on this series: it reads state, it does not start a measurement. */
|
|
24
|
+
const RT_DATA = 0x08;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* The command byte and the device's state byte together pick the case.
|
|
28
|
+
*
|
|
29
|
+
* The state is the first byte of the realtime payload and is what says whether the numbers
|
|
30
|
+
* that follow are a finished reading or a cuff still inflating.
|
|
31
|
+
*/
|
|
32
|
+
const CASE_SELECTOR_BYTES = [1, 7];
|
|
33
|
+
|
|
34
|
+
/** Header, realtime state, and the result struct through its pulse-rate field. */
|
|
35
|
+
const MIN_LENGTH_BYTES = 28;
|
|
36
|
+
const READING = [{
|
|
37
|
+
name: "systolic",
|
|
38
|
+
byteIndexes: [20, 21],
|
|
39
|
+
byteOrder: "little",
|
|
40
|
+
encoding: "uint",
|
|
41
|
+
unit: "mmHg"
|
|
42
|
+
}, {
|
|
43
|
+
name: "diastolic",
|
|
44
|
+
byteIndexes: [22, 23],
|
|
45
|
+
byteOrder: "little",
|
|
46
|
+
encoding: "uint",
|
|
47
|
+
unit: "mmHg"
|
|
48
|
+
}, {
|
|
49
|
+
name: "heartRate",
|
|
50
|
+
byteIndexes: [26, 27],
|
|
51
|
+
byteOrder: "little",
|
|
52
|
+
encoding: "uint",
|
|
53
|
+
unit: "bpm"
|
|
54
|
+
}];
|
|
55
|
+
const result = (selector, description) => ({
|
|
56
|
+
selector,
|
|
57
|
+
kind: "result",
|
|
58
|
+
measurementTypeKey: _core.MeasurementTypeKey.bloodPressure,
|
|
59
|
+
fields: [...READING],
|
|
60
|
+
description
|
|
61
|
+
});
|
|
62
|
+
const measuring = (selector, description) => ({
|
|
63
|
+
selector,
|
|
64
|
+
kind: "stream",
|
|
65
|
+
description
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* The states the series reports, and what each means for a reading.
|
|
70
|
+
*
|
|
71
|
+
* A finished measurement keeps reporting itself for as long as the device sits on the
|
|
72
|
+
* result screen, so the same numbers arrive on every poll. The state transition is what
|
|
73
|
+
* separates one measurement from the next, which is why the states in between are declared
|
|
74
|
+
* rather than ignored.
|
|
75
|
+
*/
|
|
76
|
+
const BP2_CASES = [measuring("0804", "Cuff inflating or deflating"), result("0805", "Measurement finished"), measuring("080f", "Averaging run: a measurement is in progress"), measuring("0810", "Averaging run: waiting between measurements"), result("0811", "Averaging run finished, carrying the same payload")];
|
|
77
|
+
/**
|
|
78
|
+
* Declares one monitor of the BP2 series.
|
|
79
|
+
*
|
|
80
|
+
* `advertisedName` is the name the vendor's SDK matches - `BP2A`, `BP2T` - and the matcher
|
|
81
|
+
* derived from it excludes every longer name in the family, so a declaration for `BP2`
|
|
82
|
+
* cannot pick up a `BP2W`.
|
|
83
|
+
*/
|
|
84
|
+
const viatomBpMonitor = (advertisedName, params) => (0, _lepuTransports.lepuDevice)({
|
|
85
|
+
id: params.id,
|
|
86
|
+
nameMatch: params.nameMatch ?? (0, _lepuNameMatch.lepuNameMatch)(advertisedName),
|
|
87
|
+
pollCommand: RT_DATA,
|
|
88
|
+
minLengthBytes: MIN_LENGTH_BYTES,
|
|
89
|
+
caseSelectorBytes: CASE_SELECTOR_BYTES,
|
|
90
|
+
cases: BP2_CASES.map(each => ({
|
|
91
|
+
...each
|
|
92
|
+
})),
|
|
93
|
+
...(params.expectedDeviceTypes ? {
|
|
94
|
+
expectedDeviceTypes: params.expectedDeviceTypes
|
|
95
|
+
} : {})
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
/** BP2A, the arm-cuff monitor of the series. */
|
|
99
|
+
exports.viatomBpMonitor = viatomBpMonitor;
|
|
100
|
+
const bp2aMonitor = params => viatomBpMonitor("BP2A", params);
|
|
101
|
+
|
|
102
|
+
/** BP2T, documented by the vendor alongside BP2 and BP2A as the same protocol. */
|
|
103
|
+
exports.bp2aMonitor = bp2aMonitor;
|
|
104
|
+
const bp2tMonitor = params => viatomBpMonitor("BP2T", params);
|
|
105
|
+
|
|
106
|
+
/** BP2W. Documented in its own section, but decoding the same realtime struct. */
|
|
107
|
+
exports.bp2tMonitor = bp2tMonitor;
|
|
108
|
+
const bp2wMonitor = params => viatomBpMonitor("BP2W", params);
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* The names the BP3 range advertises.
|
|
112
|
+
*
|
|
113
|
+
* Fifteen products differing in cuff and casing rather than in protocol, so declaring the
|
|
114
|
+
* range is one line per name:
|
|
115
|
+
*
|
|
116
|
+
* ```typescript
|
|
117
|
+
* const bp3Devices = BP3_MODEL_NAMES.map((name) =>
|
|
118
|
+
* viatomBpMonitor(name, { id: `viatom-${name.toLowerCase()}` }),
|
|
119
|
+
* );
|
|
120
|
+
* ```
|
|
121
|
+
*/
|
|
122
|
+
exports.bp2wMonitor = bp2wMonitor;
|
|
123
|
+
const BP3_MODEL_NAMES = exports.BP3_MODEL_NAMES = ["BP3", "BP3-B", "BP3-C1", "BP3-C2", "BP3A", "BP3B", "BP3C", "BP3D", "BP3E", "BP3F", "BP3G", "BP3H", "BP3K", "BP3L", "BP3Z"];
|
|
124
|
+
//# sourceMappingURL=viatom.bp-monitors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_core","require","_lepuNameMatch","_lepuTransports","RT_DATA","CASE_SELECTOR_BYTES","MIN_LENGTH_BYTES","READING","name","byteIndexes","byteOrder","encoding","unit","result","selector","description","kind","measurementTypeKey","MeasurementTypeKey","bloodPressure","fields","measuring","BP2_CASES","viatomBpMonitor","advertisedName","params","lepuDevice","id","nameMatch","lepuNameMatch","pollCommand","minLengthBytes","caseSelectorBytes","cases","map","each","expectedDeviceTypes","exports","bp2aMonitor","bp2tMonitor","bp2wMonitor","BP3_MODEL_NAMES"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/viatom/viatom.bp-monitors.ts"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AAKA,IAAAC,cAAA,GAAAD,OAAA;AACA,IAAAE,eAAA,GAAAF,OAAA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,MAAMG,OAAO,GAAG,IAAI;;AAEpB;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,mBAAmB,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC;;AAElC;AACA,MAAMC,gBAAgB,GAAG,EAAE;AAE3B,MAAMC,OAA0B,GAAG,CACjC;EACEC,IAAI,EAAE,UAAU;EAChBC,WAAW,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC;EACrBC,SAAS,EAAE,QAAQ;EACnBC,QAAQ,EAAE,MAAM;EAChBC,IAAI,EAAE;AACR,CAAC,EACD;EACEJ,IAAI,EAAE,WAAW;EACjBC,WAAW,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC;EACrBC,SAAS,EAAE,QAAQ;EACnBC,QAAQ,EAAE,MAAM;EAChBC,IAAI,EAAE;AACR,CAAC,EACD;EACEJ,IAAI,EAAE,WAAW;EACjBC,WAAW,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC;EACrBC,SA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CAAC,CAAC;AACR,CAAC,CAAC;;AAEJ;AAAAC,OAAA,CAAAd,eAAA,GAAAA,eAAA;AACA,MAAMe,WAAW,GAAIb,MAAsB,IACzCF,eAAe,CAAC,MAAM,EAAEE,MAAM,CAAC;;AAEjC;AAAAY,OAAA,CAAAC,WAAA,GAAAA,WAAA;AACA,MAAMC,WAAW,GAAId,MAAsB,IACzCF,eAAe,CAAC,MAAM,EAAEE,MAAM,CAAC;;AAEjC;AAAAY,OAAA,CAAAE,WAAA,GAAAA,WAAA;AACA,MAAMC,WAAW,GAAIf,MAAsB,IACzCF,eAAe,CAAC,MAAM,EAAEE,MAAM,CAAC;;AAEjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAXAY,OAAA,CAAAG,WAAA,GAAAA,WAAA;AAYA,MAAMC,eAAkC,GAAAJ,OAAA,CAAAI,eAAA,GAAG,CACzC,KAAK,EACL,OAAO,EACP,QAAQ,EACR,QAAQ,EACR,MAAM,EACN,MAAM,EACN,MAAM,EACN,MAAM,EACN,MAAM,EACN,MAAM,EACN,MAAM,EACN,MAAM,EACN,MAAM,EACN,MAAM,EACN,MAAM,CACP","ignoreList":[]}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.er3Recorder = exports.er2Recorder = exports.er1Recorder = exports.ER2_MODEL_NAMES = exports.ER1_MODEL_NAMES = void 0;
|
|
7
|
+
var _core = require("@ovok/core");
|
|
8
|
+
var _lepuNameMatch = require("../lepu/lepu.name-match.js");
|
|
9
|
+
var _lepuTransports = require("../lepu/lepu.transports.js");
|
|
10
|
+
/**
|
|
11
|
+
* The Viatom ECG recorders - ER1, ER2 and ER3.
|
|
12
|
+
*
|
|
13
|
+
* **What a declaration gets from these is the heart rate, not the waveform.** The ECG itself
|
|
14
|
+
* arrives as a stream of samples assembled across many notifications and belongs to a device
|
|
15
|
+
* class; the recorders also report a heart rate in the same realtime frame, at a fixed
|
|
16
|
+
* offset, and that is a reading a declaration can carry on its own.
|
|
17
|
+
*
|
|
18
|
+
* Their stored recordings are a separate matter and are reachable: these devices use the
|
|
19
|
+
* family's generic file opcodes, so `LepuFileTransfer` downloads their records unchanged.
|
|
20
|
+
* Turning a downloaded recording into a measurement still needs a device class.
|
|
21
|
+
*
|
|
22
|
+
* ## A note on the opcodes
|
|
23
|
+
*
|
|
24
|
+
* This range numbers its commands low, in the space where the family's meanings diverge
|
|
25
|
+
* most, so the poll is chosen deliberately rather than taken from whatever the vendor's SDK
|
|
26
|
+
* calls first:
|
|
27
|
+
*
|
|
28
|
+
* - `RT_PARAM` is `0x02` here and **`CALIBRATION_SLOPE` on a BP2**, a factory command that
|
|
29
|
+
* silently biases every subsequent blood-pressure reading. It is never sent, even though
|
|
30
|
+
* it would be the cheaper poll - it returns the parameters without the waveform.
|
|
31
|
+
* - `START_ECG` is `0x08` on a Lepod and `RT_DATA` on a BP2. It is never sent either.
|
|
32
|
+
*
|
|
33
|
+
* `RT_DATA` is a read on every one of them, which is why it is the poll here. The advertised
|
|
34
|
+
* name is what keeps these opcodes pointed at the right hardware, so a matcher for one of
|
|
35
|
+
* these devices should be narrowed, never widened.
|
|
36
|
+
*/
|
|
37
|
+
|
|
38
|
+
/** Reads the realtime parameters and waveform. A read on every device in this range. */
|
|
39
|
+
const RT_DATA = 0x03;
|
|
40
|
+
|
|
41
|
+
/** The ER3 answers its realtime data on a different opcode from the rest of the range. */
|
|
42
|
+
const ER3_RT_DATA = 0x06;
|
|
43
|
+
const HEART_RATE_UNIT = "bpm";
|
|
44
|
+
/** ER1, ER2 and ER3 share one parameter block: the heart rate opens it. */
|
|
45
|
+
const ER_HEART_RATE_BYTES = [7, 8];
|
|
46
|
+
/**
|
|
47
|
+
* Declares one recorder, reporting the heart rate from its realtime frame.
|
|
48
|
+
*
|
|
49
|
+
* A recorder that is not against the skin reports a rate outside what a heart can beat at,
|
|
50
|
+
* so it is discarded rather than reported. The device marks that condition in bits of a
|
|
51
|
+
* status byte, which a declaration cannot select on, so a recorder left connected and unworn
|
|
52
|
+
* reports a decoding failure on each poll. Reading those bits quietly needs a device class.
|
|
53
|
+
*/
|
|
54
|
+
const declareRecorder = (advertisedName, profile, params) => (0, _lepuTransports.lepuDevice)({
|
|
55
|
+
id: params.id,
|
|
56
|
+
nameMatch: params.nameMatch ?? (0, _lepuNameMatch.lepuNameMatch)(advertisedName),
|
|
57
|
+
transport: profile.transport,
|
|
58
|
+
pollCommand: profile.pollCommand,
|
|
59
|
+
minLengthBytes: profile.heartRateBytes[1] + 1,
|
|
60
|
+
caseSelectorBytes: [1],
|
|
61
|
+
cases: [{
|
|
62
|
+
selector: profile.pollCommand.toString(16).padStart(2, "0"),
|
|
63
|
+
kind: "result",
|
|
64
|
+
measurementTypeKey: _core.MeasurementTypeKey.heartRate,
|
|
65
|
+
description: "Realtime parameters and waveform",
|
|
66
|
+
fields: [{
|
|
67
|
+
name: "heartRate",
|
|
68
|
+
byteIndexes: [...profile.heartRateBytes],
|
|
69
|
+
byteOrder: "little",
|
|
70
|
+
encoding: "uint",
|
|
71
|
+
unit: HEART_RATE_UNIT
|
|
72
|
+
}]
|
|
73
|
+
}],
|
|
74
|
+
...(params.expectedDeviceTypes ? {
|
|
75
|
+
expectedDeviceTypes: params.expectedDeviceTypes
|
|
76
|
+
} : {})
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
/** The ER1, and the handheld recorders sold under other names on the same protocol. */
|
|
80
|
+
const er1Recorder = (advertisedName, params) => declareRecorder(advertisedName, {
|
|
81
|
+
pollCommand: RT_DATA,
|
|
82
|
+
heartRateBytes: ER_HEART_RATE_BYTES,
|
|
83
|
+
transport: "standard"
|
|
84
|
+
}, params);
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* The ER2, which reads the same block but over a link that grants nothing beyond the
|
|
88
|
+
* minimum. Asking it for the MTU the rest of the family grants is what the vendor's own SDK
|
|
89
|
+
* declines to do, and a command longer than the link carries is truncated rather than
|
|
90
|
+
* refused.
|
|
91
|
+
*/
|
|
92
|
+
exports.er1Recorder = er1Recorder;
|
|
93
|
+
const er2Recorder = (advertisedName, params) => declareRecorder(advertisedName, {
|
|
94
|
+
pollCommand: RT_DATA,
|
|
95
|
+
heartRateBytes: ER_HEART_RATE_BYTES,
|
|
96
|
+
transport: "standardSmallMtu"
|
|
97
|
+
}, params);
|
|
98
|
+
|
|
99
|
+
/** The ER3, which reads the same parameter block from a different opcode. */
|
|
100
|
+
exports.er2Recorder = er2Recorder;
|
|
101
|
+
const er3Recorder = (advertisedName, params) => declareRecorder(advertisedName, {
|
|
102
|
+
pollCommand: ER3_RT_DATA,
|
|
103
|
+
heartRateBytes: ER_HEART_RATE_BYTES,
|
|
104
|
+
transport: "standard"
|
|
105
|
+
}, params);
|
|
106
|
+
|
|
107
|
+
/** The names the ER1 recorders advertise. */
|
|
108
|
+
exports.er3Recorder = er3Recorder;
|
|
109
|
+
const ER1_MODEL_NAMES = exports.ER1_MODEL_NAMES = ["ER1", "ER1-H", "ER1-L", "ER1-S", "ER1-SP", "ER1-W", "ER1S", "HHM1"];
|
|
110
|
+
|
|
111
|
+
/** The names the ER2 recorders advertise, all of them on the small-MTU link. */
|
|
112
|
+
const ER2_MODEL_NAMES = exports.ER2_MODEL_NAMES = ["ER2", "ER2-S", "HHM2", "HHM3", "LP ER2"];
|
|
113
|
+
//# sourceMappingURL=viatom.ecg-recorders.js.map
|