@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,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.supportedMeasurementTypeKeys = void 0;
|
|
7
|
+
/**
|
|
8
|
+
* The measurement types a device's declared services can produce.
|
|
9
|
+
*
|
|
10
|
+
* Read from the parsing cases rather than stated separately, so a device cannot advertise a
|
|
11
|
+
* measurement it has no case to decode, or omit one it does.
|
|
12
|
+
*/
|
|
13
|
+
const supportedMeasurementTypeKeys = services => {
|
|
14
|
+
const declared = services.flatMap(service => service.monitorUuids.flatMap(monitor => monitor.parsingModel.cases.map(c => c.measurementTypeKey) || [])).filter(type => type !== undefined);
|
|
15
|
+
return [...new Set(declared.flat())];
|
|
16
|
+
};
|
|
17
|
+
exports.supportedMeasurementTypeKeys = supportedMeasurementTypeKeys;
|
|
18
|
+
//# sourceMappingURL=supported-measurement-type-keys.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["supportedMeasurementTypeKeys","services","declared","flatMap","service","monitorUuids","monitor","parsingModel","cases","map","c","measurementTypeKey","filter","type","undefined","Set","flat","exports"],"sourceRoot":"../../../../../src","sources":["modules/bt-management/utils/supported-measurement-type-keys.ts"],"mappings":";;;;;;AAIA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMA,4BAA4B,GACvCC,QAAuC,IACd;EACzB,MAAMC,QAAQ,GAAGD,QAAQ,CACtBE,OAAO,CAAEC,OAAO,IACfA,OAAO,CAACC,YAAY,CAACF,OAAO,CACzBG,OAAO,IACNA,OAAO,CAACC,YAAY,CAACC,KAAK,CAACC,GAAG,CAAEC,CAAC,IAAKA,CAAC,CAACC,kBAAkB,CAAC,IAAI,EACnE,CACF,CAAC,CACAC,MAAM,CAAEC,IAAI,IAAKA,IAAI,KAAKC,SAAS,CAAC;EAEvC,OAAO,CAAC,GAAG,IAAIC,GAAG,CAACb,QAAQ,CAACc,IAAI,CAAC,CAAC,CAAC,CAAC;AACtC,CAAC;AAACC,OAAA,CAAAjB,4BAAA,GAAAA,4BAAA","ignoreList":[]}
|
|
@@ -24,6 +24,8 @@ export const DEVICE_INSTRUCTION_PDFS = {
|
|
|
24
24
|
[IntegratedDevices.CMED]: "",
|
|
25
25
|
[IntegratedDevices.SP80B]: "",
|
|
26
26
|
[IntegratedDevices.S5]: "",
|
|
27
|
-
[IntegratedDevices.BGM]: ""
|
|
27
|
+
[IntegratedDevices.BGM]: "",
|
|
28
|
+
[IntegratedDevices.VEROVAL_DUO_CONTROL]: "",
|
|
29
|
+
[IntegratedDevices.VEROVAL_ECG]: ""
|
|
28
30
|
};
|
|
29
31
|
//# sourceMappingURL=device-instruction-pdfs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["IntegratedDevices","pdfBaseUrl","DEVICE_INSTRUCTION_PDFS","BP2","F4","SPO2","PC60WF","ALIVE_COR","COSINUSS","AOJ20A","TAIDOC_GLUCOSE","GLUCOCHECK","CLEVERTEMP","FORATEMP","ANDESFITTEMP","FORA_SCALE","BC01","RPM_SCALE","CMED","SP80B","S5","BGM"],"sourceRoot":"../../../../../src","sources":["modules/bt-device/constants/device-instruction-pdfs.ts"],"mappings":";;AAAA,SAASA,iBAAiB,QAAQ,8BAAqB;;AAEvD;AACA;AACA,MAAMC,UAAU,GACd,2EAA2E;AAE7E,OAAO,MAAMC,uBAA0D,GAAG;EACxE,CAACF,iBAAiB,CAACG,GAAG,GAAG,GAAGF,UAAU,yBAAyB;EAC/D,CAACD,iBAAiB,CAACI,EAAE,GAAG,GAAGH,UAAU,yBAAyB;EAC9D,CAACD,iBAAiB,CAACK,IAAI,GAAG,GAAGJ,UAAU,yBAAyB;EAChE,CAACD,iBAAiB,CAACM,MAAM,GAAG,GAAGL,UAAU,2BAA2B;EACpE,CAACD,iBAAiB,CAACO,SAAS,GAAG,GAAGN,UAAU,sBAAsB;EAClE,CAACD,iBAAiB,CAACQ,QAAQ,GAAG,GAAGP,UAAU,sBAAsB;EACjE,CAACD,iBAAiB,CAACS,MAAM,GAAG,GAAGR,UAAU,oBAAoB;EAC7D,CAACD,iBAAiB,CAACU,cAAc,GAAG,GAAGT,UAAU,oBAAoB;EACrE,CAACD,iBAAiB,CAACW,UAAU,GAAG,GAAGV,UAAU,iBAAiB;EAC9D,CAACD,iBAAiB,CAACY,UAAU,GAAG,GAAGX,UAAU,oBAAoB;EACjE,CAACD,iBAAiB,CAACa,QAAQ,GAAG,GAAGZ,UAAU,gBAAgB;EAC3D,CAACD,iBAAiB,CAACc,YAAY,GAAG,GAAGb,UAAU,oBAAoB;EACnE,CAACD,iBAAiB,CAACe,UAAU,GAAG,GAAGd,UAAU,gBAAgB;EAC7D,CAACD,iBAAiB,CAACgB,IAAI,GAAG,GAAGf,UAAU,YAAY;EACnD,CAACD,iBAAiB,CAACiB,SAAS,GAAG,GAAGhB,UAAU,wBAAwB;EACpE,CAACD,iBAAiB,CAACkB,IAAI,GAAG,EAAE;EAC5B,CAAClB,iBAAiB,CAACmB,KAAK,GAAG,EAAE;EAC7B,CAACnB,iBAAiB,CAACoB,EAAE,GAAG,EAAE;EAC1B,CAACpB,iBAAiB,CAACqB,GAAG,GAAG;
|
|
1
|
+
{"version":3,"names":["IntegratedDevices","pdfBaseUrl","DEVICE_INSTRUCTION_PDFS","BP2","F4","SPO2","PC60WF","ALIVE_COR","COSINUSS","AOJ20A","TAIDOC_GLUCOSE","GLUCOCHECK","CLEVERTEMP","FORATEMP","ANDESFITTEMP","FORA_SCALE","BC01","RPM_SCALE","CMED","SP80B","S5","BGM","VEROVAL_DUO_CONTROL","VEROVAL_ECG"],"sourceRoot":"../../../../../src","sources":["modules/bt-device/constants/device-instruction-pdfs.ts"],"mappings":";;AAAA,SAASA,iBAAiB,QAAQ,8BAAqB;;AAEvD;AACA;AACA,MAAMC,UAAU,GACd,2EAA2E;AAE7E,OAAO,MAAMC,uBAA0D,GAAG;EACxE,CAACF,iBAAiB,CAACG,GAAG,GAAG,GAAGF,UAAU,yBAAyB;EAC/D,CAACD,iBAAiB,CAACI,EAAE,GAAG,GAAGH,UAAU,yBAAyB;EAC9D,CAACD,iBAAiB,CAACK,IAAI,GAAG,GAAGJ,UAAU,yBAAyB;EAChE,CAACD,iBAAiB,CAACM,MAAM,GAAG,GAAGL,UAAU,2BAA2B;EACpE,CAACD,iBAAiB,CAACO,SAAS,GAAG,GAAGN,UAAU,sBAAsB;EAClE,CAACD,iBAAiB,CAACQ,QAAQ,GAAG,GAAGP,UAAU,sBAAsB;EACjE,CAACD,iBAAiB,CAACS,MAAM,GAAG,GAAGR,UAAU,oBAAoB;EAC7D,CAACD,iBAAiB,CAACU,cAAc,GAAG,GAAGT,UAAU,oBAAoB;EACrE,CAACD,iBAAiB,CAACW,UAAU,GAAG,GAAGV,UAAU,iBAAiB;EAC9D,CAACD,iBAAiB,CAACY,UAAU,GAAG,GAAGX,UAAU,oBAAoB;EACjE,CAACD,iBAAiB,CAACa,QAAQ,GAAG,GAAGZ,UAAU,gBAAgB;EAC3D,CAACD,iBAAiB,CAACc,YAAY,GAAG,GAAGb,UAAU,oBAAoB;EACnE,CAACD,iBAAiB,CAACe,UAAU,GAAG,GAAGd,UAAU,gBAAgB;EAC7D,CAACD,iBAAiB,CAACgB,IAAI,GAAG,GAAGf,UAAU,YAAY;EACnD,CAACD,iBAAiB,CAACiB,SAAS,GAAG,GAAGhB,UAAU,wBAAwB;EACpE,CAACD,iBAAiB,CAACkB,IAAI,GAAG,EAAE;EAC5B,CAAClB,iBAAiB,CAACmB,KAAK,GAAG,EAAE;EAC7B,CAACnB,iBAAiB,CAACoB,EAAE,GAAG,EAAE;EAC1B,CAACpB,iBAAiB,CAACqB,GAAG,GAAG,EAAE;EAC3B,CAACrB,iBAAiB,CAACsB,mBAAmB,GAAG,EAAE;EAC3C,CAACtB,iBAAiB,CAACuB,WAAW,GAAG;AACnC,CAAC","ignoreList":[]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
import { IntegratedDevices } from "../types/integrated-devices.js";
|
|
4
|
-
export const integratedDevicesMap = new Map([[/^BP2 \d{4}$/, IntegratedDevices.BP2], [/^F4$/, IntegratedDevices.F4], [/^Oxyfit \d{4}$/, IntegratedDevices.SPO2], [/^OxySmart \d{4}$/, IntegratedDevices.PC60WF], [/^AOJ-20A$/, IntegratedDevices.AOJ20A], [/^TAIDOC TD4216(?: \w+)?$/, IntegratedDevices.TAIDOC_GLUCOSE], [/^GlucoCheck Gold$/, IntegratedDevices.GLUCOCHECK], [/^FORA IR20$/, IntegratedDevices.FORATEMP], [/^TEMP$/, IntegratedDevices.ANDESFITTEMP], [/^two$/, IntegratedDevices.COSINUSS], [/^cmed$/, IntegratedDevices.CMED], [/^BC01\d{4}$/, IntegratedDevices.BC01], [/^FORA W550$/, IntegratedDevices.FORA_SCALE], [/^GBS-2012-B$/, IntegratedDevices.RPM_SCALE], [/^TAIDOC TD1107$/, IntegratedDevices.CLEVERTEMP], [/^PULMO80BEXPGC\d{6}$/, IntegratedDevices.SP80B], [/^Le S5$/, IntegratedDevices.S5], [/^TeleBGM Gen1 BLE$/, IntegratedDevices.BGM]]);
|
|
4
|
+
export const integratedDevicesMap = new Map([[/^BP2 \d{4}$/, IntegratedDevices.BP2], [/^F4$/, IntegratedDevices.F4], [/^Oxyfit \d{4}$/, IntegratedDevices.SPO2], [/^OxySmart \d{4}$/, IntegratedDevices.PC60WF], [/^AOJ-20A$/, IntegratedDevices.AOJ20A], [/^TAIDOC TD4216(?: \w+)?$/, IntegratedDevices.TAIDOC_GLUCOSE], [/^GlucoCheck Gold$/, IntegratedDevices.GLUCOCHECK], [/^FORA IR20$/, IntegratedDevices.FORATEMP], [/^TEMP$/, IntegratedDevices.ANDESFITTEMP], [/^two$/, IntegratedDevices.COSINUSS], [/^cmed$/, IntegratedDevices.CMED], [/^BC01\d{4}$/, IntegratedDevices.BC01], [/^FORA W550$/, IntegratedDevices.FORA_SCALE], [/^GBS-2012-B$/, IntegratedDevices.RPM_SCALE], [/^TAIDOC TD1107$/, IntegratedDevices.CLEVERTEMP], [/^PULMO80BEXPGC\d{6}$/, IntegratedDevices.SP80B], [/^Le S5$/, IntegratedDevices.S5], [/^TeleBGM Gen1 BLE$/, IntegratedDevices.BGM], [/^Veroval duo control$/i, IntegratedDevices.VEROVAL_DUO_CONTROL], [/^Veroval ECG$/i, IntegratedDevices.VEROVAL_ECG]]);
|
|
5
5
|
//# sourceMappingURL=integrated-devices-map.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["IntegratedDevices","integratedDevicesMap","Map","BP2","F4","SPO2","PC60WF","AOJ20A","TAIDOC_GLUCOSE","GLUCOCHECK","FORATEMP","ANDESFITTEMP","COSINUSS","CMED","BC01","FORA_SCALE","RPM_SCALE","CLEVERTEMP","SP80B","S5","BGM"],"sourceRoot":"../../../../../src","sources":["modules/bt-management/constants/integrated-devices-map.ts"],"mappings":";;AAAA,SAASA,iBAAiB,QAAQ,gCAA6B;AAE/D,OAAO,MAAMC,oBAAoB,GAAG,IAAIC,GAAG,CAA4B,CACrE,CAAC,aAAa,EAAEF,iBAAiB,CAACG,GAAG,CAAC,EACtC,CAAC,MAAM,EAAEH,iBAAiB,CAACI,EAAE,CAAC,EAC9B,CAAC,gBAAgB,EAAEJ,iBAAiB,CAACK,IAAI,CAAC,EAC1C,CAAC,kBAAkB,EAAEL,iBAAiB,CAACM,MAAM,CAAC,EAC9C,CAAC,WAAW,EAAEN,iBAAiB,CAACO,MAAM,CAAC,EACvC,CAAC,0BAA0B,EAAEP,iBAAiB,CAACQ,cAAc,CAAC,EAC9D,CAAC,mBAAmB,EAAER,iBAAiB,CAACS,UAAU,CAAC,EACnD,CAAC,aAAa,EAAET,iBAAiB,CAACU,QAAQ,CAAC,EAC3C,CAAC,QAAQ,EAAEV,iBAAiB,CAACW,YAAY,CAAC,EAC1C,CAAC,OAAO,EAAEX,iBAAiB,CAACY,QAAQ,CAAC,EACrC,CAAC,QAAQ,EAAEZ,iBAAiB,CAACa,IAAI,CAAC,EAClC,CAAC,aAAa,EAAEb,iBAAiB,CAACc,IAAI,CAAC,EACvC,CAAC,aAAa,EAAEd,iBAAiB,CAACe,UAAU,CAAC,EAC7C,CAAC,cAAc,EAAEf,iBAAiB,CAACgB,SAAS,CAAC,EAC7C,CAAC,iBAAiB,EAAEhB,iBAAiB,CAACiB,UAAU,CAAC,EACjD,CAAC,sBAAsB,EAAEjB,iBAAiB,CAACkB,KAAK,CAAC,EACjD,CAAC,SAAS,EAAElB,iBAAiB,CAACmB,EAAE,CAAC,EACjC,CAAC,oBAAoB,EAAEnB,iBAAiB,CAACoB,GAAG,CAAC,
|
|
1
|
+
{"version":3,"names":["IntegratedDevices","integratedDevicesMap","Map","BP2","F4","SPO2","PC60WF","AOJ20A","TAIDOC_GLUCOSE","GLUCOCHECK","FORATEMP","ANDESFITTEMP","COSINUSS","CMED","BC01","FORA_SCALE","RPM_SCALE","CLEVERTEMP","SP80B","S5","BGM","VEROVAL_DUO_CONTROL","VEROVAL_ECG"],"sourceRoot":"../../../../../src","sources":["modules/bt-management/constants/integrated-devices-map.ts"],"mappings":";;AAAA,SAASA,iBAAiB,QAAQ,gCAA6B;AAE/D,OAAO,MAAMC,oBAAoB,GAAG,IAAIC,GAAG,CAA4B,CACrE,CAAC,aAAa,EAAEF,iBAAiB,CAACG,GAAG,CAAC,EACtC,CAAC,MAAM,EAAEH,iBAAiB,CAACI,EAAE,CAAC,EAC9B,CAAC,gBAAgB,EAAEJ,iBAAiB,CAACK,IAAI,CAAC,EAC1C,CAAC,kBAAkB,EAAEL,iBAAiB,CAACM,MAAM,CAAC,EAC9C,CAAC,WAAW,EAAEN,iBAAiB,CAACO,MAAM,CAAC,EACvC,CAAC,0BAA0B,EAAEP,iBAAiB,CAACQ,cAAc,CAAC,EAC9D,CAAC,mBAAmB,EAAER,iBAAiB,CAACS,UAAU,CAAC,EACnD,CAAC,aAAa,EAAET,iBAAiB,CAACU,QAAQ,CAAC,EAC3C,CAAC,QAAQ,EAAEV,iBAAiB,CAACW,YAAY,CAAC,EAC1C,CAAC,OAAO,EAAEX,iBAAiB,CAACY,QAAQ,CAAC,EACrC,CAAC,QAAQ,EAAEZ,iBAAiB,CAACa,IAAI,CAAC,EAClC,CAAC,aAAa,EAAEb,iBAAiB,CAACc,IAAI,CAAC,EACvC,CAAC,aAAa,EAAEd,iBAAiB,CAACe,UAAU,CAAC,EAC7C,CAAC,cAAc,EAAEf,iBAAiB,CAACgB,SAAS,CAAC,EAC7C,CAAC,iBAAiB,EAAEhB,iBAAiB,CAACiB,UAAU,CAAC,EACjD,CAAC,sBAAsB,EAAEjB,iBAAiB,CAACkB,KAAK,CAAC,EACjD,CAAC,SAAS,EAAElB,iBAAiB,CAACmB,EAAE,CAAC,EACjC,CAAC,oBAAoB,EAAEnB,iBAAiB,CAACoB,GAAG,CAAC,EAC7C,CAAC,wBAAwB,EAAEpB,iBAAiB,CAACqB,mBAAmB,CAAC,EACjE,CAAC,gBAAgB,EAAErB,iBAAiB,CAACsB,WAAW,CAAC,CAClD,CAAC","ignoreList":[]}
|
|
@@ -12,9 +12,12 @@ export * from "./types/custom-device-spec.js";
|
|
|
12
12
|
export * from "./types/custom-field-encoding.js";
|
|
13
13
|
export * from "./types/custom-field-spec.js";
|
|
14
14
|
export * from "./types/custom-frame-spec.js";
|
|
15
|
+
export * from "./types/custom-lepu-spec.js";
|
|
15
16
|
export * from "./types/custom-measurement.js";
|
|
16
17
|
export * from "./types/custom-monitor-spec.js";
|
|
17
18
|
export * from "./types/custom-service-spec.js";
|
|
19
|
+
export * from "./types/command-sequencer.js";
|
|
20
|
+
export * from "./types/device-command.js";
|
|
18
21
|
export * from "./types/device-key.js";
|
|
19
22
|
export * from "./types/device-key-of.js";
|
|
20
23
|
export * from "./types/device-data.js";
|
|
@@ -32,6 +35,23 @@ export * from "./services/devices/bt-managed-device.js";
|
|
|
32
35
|
export * from "./services/devices/custom/custom.device.js";
|
|
33
36
|
export * from "./services/bt-manager.js";
|
|
34
37
|
export * from "./services/custom/define-custom-device.js";
|
|
38
|
+
export * from "./services/devices/standard-gatt/standard-gatt.devices.js";
|
|
39
|
+
export * from "./services/devices/veroval/veroval.bp-monitors.js";
|
|
40
|
+
export * from "./services/devices/veroval/veroval.duo-control-device.js";
|
|
41
|
+
export * from "./services/devices/veroval/veroval.ecg-device.js";
|
|
42
|
+
export * from "./services/devices/veroval/veroval.ecg-samples.js";
|
|
43
|
+
export * from "./services/devices/lepu/lepu.transports.js";
|
|
44
|
+
export * from "./services/devices/aoj/aoj.thermometers.js";
|
|
45
|
+
export * from "./services/devices/viatom/viatom.bp-monitors.js";
|
|
46
|
+
export * from "./services/devices/viatom/viatom.oximeters.js";
|
|
47
|
+
export * from "./services/devices/viatom/viatom.ecg-recorders.js";
|
|
48
|
+
export * from "./services/devices/viatom/viatom.lepod.js";
|
|
49
|
+
export * from "./services/devices/lepu/lepu.device-names.js";
|
|
50
|
+
export * from "./services/devices/lepu/lepu.name-match.js";
|
|
51
|
+
export * from "./services/devices/lepu/lepu.commands.js";
|
|
52
|
+
export * from "./services/devices/lepu/lepu.device-info.js";
|
|
53
|
+
export * from "./services/devices/lepu/lepu.file-transfer.js";
|
|
54
|
+
export * from "./services/devices/lepu/lepu.response-type.js";
|
|
35
55
|
export * from "./constants/measurement-field-catalog.js";
|
|
36
56
|
export * from "./components/bt-provider.js";
|
|
37
57
|
export * from "./components/default-permission-fallback.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sourceRoot":"../../../../src","sources":["modules/bt-management/index.ts"],"mappings":";;AAAA,cAAc,gCAA6B;AAC3C,cAAc,4BAAyB;AACvC,cAAc,kCAA+B;AAC7C,cAAc,8BAA2B;AACzC,cAAc,6BAA0B;AACxC,cAAc,6BAA0B;AACxC,cAAc,qCAAkC;AAChD,cAAc,6BAA0B;AACxC,cAAc,+BAA4B;AAC1C,cAAc,kCAA+B;AAC7C,cAAc,8BAA2B;AACzC,cAAc,8BAA2B;AACzC,cAAc,+BAA4B;AAC1C,cAAc,gCAA6B;AAC3C,cAAc,gCAA6B;AAC3C,cAAc,uBAAoB;AAClC,cAAc,0BAAuB;AACrC,cAAc,wBAAqB;AACnC,cAAc,0BAAuB;AACrC,cAAc,+BAA4B;AAC1C,cAAc,6BAA0B;AACxC,cAAc,yBAAsB;AACpC,cAAc,0BAAuB;AACrC,cAAc,6BAA0B;AACxC,cAAc,sCAAmC;AACjD,cAAc,4BAAyB;AACvC,cAAc,2BAAwB;AACtC,cAAc,0CAAuC;AAErD,cAAc,yCAAsC;AACpD,cAAc,4CAAyC;AACvD,cAAc,0BAAuB;AACrC,cAAc,2CAAwC;
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../../src","sources":["modules/bt-management/index.ts"],"mappings":";;AAAA,cAAc,gCAA6B;AAC3C,cAAc,4BAAyB;AACvC,cAAc,kCAA+B;AAC7C,cAAc,8BAA2B;AACzC,cAAc,6BAA0B;AACxC,cAAc,6BAA0B;AACxC,cAAc,qCAAkC;AAChD,cAAc,6BAA0B;AACxC,cAAc,+BAA4B;AAC1C,cAAc,kCAA+B;AAC7C,cAAc,8BAA2B;AACzC,cAAc,8BAA2B;AACzC,cAAc,6BAA0B;AACxC,cAAc,+BAA4B;AAC1C,cAAc,gCAA6B;AAC3C,cAAc,gCAA6B;AAC3C,cAAc,8BAA2B;AACzC,cAAc,2BAAwB;AACtC,cAAc,uBAAoB;AAClC,cAAc,0BAAuB;AACrC,cAAc,wBAAqB;AACnC,cAAc,0BAAuB;AACrC,cAAc,+BAA4B;AAC1C,cAAc,6BAA0B;AACxC,cAAc,yBAAsB;AACpC,cAAc,0BAAuB;AACrC,cAAc,6BAA0B;AACxC,cAAc,sCAAmC;AACjD,cAAc,4BAAyB;AACvC,cAAc,2BAAwB;AACtC,cAAc,0CAAuC;AAErD,cAAc,yCAAsC;AACpD,cAAc,4CAAyC;AACvD,cAAc,0BAAuB;AACrC,cAAc,2CAAwC;AACtD,cAAc,2DAAwD;AACtE,cAAc,mDAAgD;AAC9D,cAAc,0DAAuD;AACrE,cAAc,kDAA+C;AAC7D,cAAc,mDAAgD;AAC9D,cAAc,4CAAyC;AACvD,cAAc,4CAAyC;AACvD,cAAc,iDAA8C;AAC5D,cAAc,+CAA4C;AAC1D,cAAc,mDAAgD;AAC9D,cAAc,2CAAwC;AACtD,cAAc,8CAA2C;AACzD,cAAc,4CAAyC;AACvD,cAAc,0CAAuC;AACrD,cAAc,6CAA0C;AACxD,cAAc,+CAA4C;AAC1D,cAAc,+CAA4C;AAE1D,cAAc,0CAAuC;AAErD,cAAc,6BAA0B;AACxC,cAAc,6CAA0C;AACxD,cAAc,oCAAiC","ignoreList":[]}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { measurementFieldCatalog } from "../../constants/measurement-field-catalog.js";
|
|
4
|
+
import { createCustomFieldParser } from "../../utils/create-custom-field-parser.js";
|
|
5
|
+
import { compileCustomField } from "./compile-custom-field.js";
|
|
6
|
+
import { customDeviceError } from "./custom-device-error.js";
|
|
7
|
+
const registerField = (id, path, compiled, measurementTypeKey, fields) => {
|
|
8
|
+
const key = `${measurementTypeKey}:${compiled.name}`;
|
|
9
|
+
const existing = fields.get(key);
|
|
10
|
+
if (existing && (existing.min !== compiled.min || existing.max !== compiled.max)) {
|
|
11
|
+
throw customDeviceError(id, path, `declares ${compiled.name} with different bounds (${compiled.min}-${compiled.max}) than an earlier case (${existing.min}-${existing.max}); a property must mean the same thing in every frame`);
|
|
12
|
+
}
|
|
13
|
+
fields.set(key, compiled);
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* A reading must carry every property that makes it that measurement. A blood pressure
|
|
18
|
+
* without a diastolic is not a partial blood pressure, it is a clinical record of something
|
|
19
|
+
* the device never reported, so the declaration is refused rather than the reading dropped.
|
|
20
|
+
*/
|
|
21
|
+
const assertRequiredFields = (id, path, declared, measurementTypeKey) => {
|
|
22
|
+
const catalog = measurementFieldCatalog[measurementTypeKey] ?? {};
|
|
23
|
+
const declaredNames = new Set(declared.map(field => field?.name));
|
|
24
|
+
const missing = Object.entries(catalog).filter(([name, field]) => field.required && !declaredNames.has(name)).map(([name]) => name);
|
|
25
|
+
if (missing.length > 0) {
|
|
26
|
+
throw customDeviceError(id, `${path}.fields`, `does not declare ${missing.join(", ")}, which ${measurementTypeKey} needs to be a complete reading`);
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
const compileFields = (id, path, declared, measurementTypeKey, minLengthBytes, fields, names) => declared.map((field, index) => {
|
|
30
|
+
if (names.has(field.name)) {
|
|
31
|
+
throw customDeviceError(id, `${path}.fields[${index}].name`, `"${field.name}" is declared twice in this frame; a property name must be unique across every reading the frame carries, because the decoded frame is one flat object`);
|
|
32
|
+
}
|
|
33
|
+
names.add(field.name);
|
|
34
|
+
const compiled = compileCustomField(id, `${path}.fields[${index}]`, field, measurementTypeKey, minLengthBytes);
|
|
35
|
+
registerField(id, path, compiled, measurementTypeKey, fields);
|
|
36
|
+
return {
|
|
37
|
+
name: compiled.name,
|
|
38
|
+
parseType: "custom",
|
|
39
|
+
byteIndexes: compiled.byteIndexes,
|
|
40
|
+
customParserDefinition: createCustomFieldParser(compiled)
|
|
41
|
+
};
|
|
42
|
+
});
|
|
43
|
+
export { assertRequiredFields, compileFields };
|
|
44
|
+
//# sourceMappingURL=compile-case-fields.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["measurementFieldCatalog","createCustomFieldParser","compileCustomField","customDeviceError","registerField","id","path","compiled","measurementTypeKey","fields","key","name","existing","get","min","max","set","assertRequiredFields","declared","catalog","declaredNames","Set","map","field","missing","Object","entries","filter","required","has","length","join","compileFields","minLengthBytes","names","index","add","parseType","byteIndexes","customParserDefinition"],"sourceRoot":"../../../../../../src","sources":["modules/bt-management/services/custom/compile-case-fields.ts"],"mappings":";;AAEA,SAASA,uBAAuB,QAAQ,8CAA2C;AAInF,SAASC,uBAAuB,QAAQ,2CAAwC;AAEhF,SAASC,kBAAkB,QAAQ,2BAAwB;AAC3D,SAASC,iBAAiB,QAAQ,0BAAuB;AAEzD,MAAMC,aAAa,GAAGA,CACpBC,EAAU,EACVC,IAAY,EACZC,QAA6B,EAC7BC,k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CACrBE,EAAE,EACF,GAAGC,IAAI,SAAS,EAChB,oBAAoBkB,OAAO,CAACO,IAAI,CAAC,IAAI,CAAC,WAAWvB,kBAAkB,iCACrE,CAAC;EACH;AACF,CAAC;AAED,MAAMwB,aAAa,GAAGA,CACpB3B,EAAU,EACVC,IAAY,EACZY,QAA2B,EAC3BV,kBAAsC,EACtCyB,cAAsB,EACtBxB,MAAwC,EACxCyB,KAAkB,KAElBhB,QAAQ,CAACI,GAAG,CAAC,CAACC,KAAK,EAAEY,KAAK,KAAK;EAC7B,IAAID,KAAK,CAACL,GAAG,CAACN,KAAK,CAACZ,IAAI,CAAC,EAAE;IACzB,MAAMR,iBAAiB,CACrBE,EAAE,EACF,GAAGC,IAAI,WAAW6B,KAAK,QAAQ,EAC/B,IAAIZ,KAAK,CAACZ,IAAI,wJAChB,CAAC;EACH;EAEAuB,KAAK,CAACE,GAAG,CAACb,KAAK,CAACZ,IAAI,CAAC;EAErB,MAAMJ,QAAQ,GAAGL,kBAAkB,CACjCG,EAAE,EACF,GAAGC,IAAI,WAAW6B,KAAK,GAAG,EAC1BZ,KAAK,EACLf,kBAAkB,EAClByB,cACF,CAAC;EAED7B,aAAa,CAACC,EAAE,EAAEC,IAAI,EAAEC,QAAQ,EAAEC,kBAAkB,EAAEC,MAAM,CAAC;EAE7D,OAAO;IACLE,IAAI,EAAEJ,QAAQ,CAACI,IAAI;IACnB0B,SAAS,EAAE,QAAQ;IACnBC,WAAW,EAAE/B,QAAQ,CAAC+B,WAAW;IACjCC,sBAAsB,EAAEtC,uBAAuB,CAACM,QAAQ;EAC1D,CAAC;AACH,CAAC,CAAC;AAEJ,SAASU,oBAAoB,EAAEe,aAAa","ignoreList":[]}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { customDeviceError } from "./custom-device-error.js";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* How long a frame of this shape is, which may be longer than the shortest the
|
|
7
|
+
* characteristic emits but never shorter: the selector chose this shape, so its own fields
|
|
8
|
+
* are the ones that have to fit.
|
|
9
|
+
*/
|
|
10
|
+
const assertCaseLength = (id, path, caseSpec, frameMinLengthBytes) => {
|
|
11
|
+
const declared = caseSpec.minLengthBytes;
|
|
12
|
+
if (declared === undefined) {
|
|
13
|
+
return frameMinLengthBytes;
|
|
14
|
+
}
|
|
15
|
+
if (!Number.isInteger(declared) || declared < frameMinLengthBytes) {
|
|
16
|
+
throw customDeviceError(id, `${path}.minLengthBytes`, `is ${String(declared)}; it must be a whole number of bytes no smaller than frame.minLengthBytes (${frameMinLengthBytes})`);
|
|
17
|
+
}
|
|
18
|
+
return declared;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* A frame that is a run of records, and how wide one is.
|
|
23
|
+
*
|
|
24
|
+
* The characteristic has to guarantee at least one whole record, otherwise a declaration
|
|
25
|
+
* whose fields all fit could still never decode anything.
|
|
26
|
+
*/
|
|
27
|
+
const assertRepeatedRecords = (id, path, caseSpec, frameMinLengthBytes) => {
|
|
28
|
+
const declared = caseSpec.repeatedRecords;
|
|
29
|
+
if (!declared) {
|
|
30
|
+
return undefined;
|
|
31
|
+
}
|
|
32
|
+
const from = declared.from ?? 0;
|
|
33
|
+
if (!Number.isInteger(declared.recordBytes) || declared.recordBytes < 1) {
|
|
34
|
+
throw customDeviceError(id, `${path}.repeatedRecords.recordBytes`, `is ${String(declared.recordBytes)}; a record is a whole number of bytes, at least one`);
|
|
35
|
+
}
|
|
36
|
+
if (!Number.isInteger(from) || from < 0) {
|
|
37
|
+
throw customDeviceError(id, `${path}.repeatedRecords.from`, `is ${String(declared.from)}; it must be a byte offset of zero or more`);
|
|
38
|
+
}
|
|
39
|
+
if (from + declared.recordBytes > frameMinLengthBytes) {
|
|
40
|
+
throw customDeviceError(id, `${path}.repeatedRecords`, `needs ${from + declared.recordBytes} bytes for one record, which frame.minLengthBytes (${frameMinLengthBytes}) does not guarantee`);
|
|
41
|
+
}
|
|
42
|
+
return {
|
|
43
|
+
recordBytes: declared.recordBytes,
|
|
44
|
+
from
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
export { assertCaseLength, assertRepeatedRecords };
|
|
48
|
+
//# sourceMappingURL=compile-case-shape.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["customDeviceError","assertCaseLength","id","path","caseSpec","frameMinLengthBytes","declared","minLengthBytes","undefined","Number","isInteger","String","assertRepeatedRecords","repeatedRecords","from","recordBytes"],"sourceRoot":"../../../../../../src","sources":["modules/bt-management/services/custom/compile-case-shape.ts"],"mappings":";;AAEA,SAASA,iBAAiB,QAAQ,0BAAuB;;AAEzD;AACA;AACA;AACA;AACA;AACA,MAAMC,gBAAgB,GAAGA,CACvBC,EAAU,EACVC,IAAY,EACZC,QAAwB,EACxBC,mBAA2B,KAChB;EACX,MAAMC,QAAQ,GAAGF,QAAQ,CAACG,cAAc;EAExC,IAAID,QAAQ,KAAKE,SAAS,EAAE;IAC1B,OAAOH,mBAAmB;EAC5B;EAEA,IAAI,CAACI,MAAM,CAACC,SAAS,CAACJ,QAAQ,CAAC,IAAIA,QAAQ,GAAGD,mBAAmB,EAAE;IACjE,MAAML,iBAAiB,CACrBE,EAAE,EACF,GAAGC,IAAI,iBAAiB,EACxB,MAAMQ,MAAM,CAACL,QAAQ,CAAC,8EAA8ED,mBAAmB,GACzH,CAAC;EACH;EAEA,OAAOC,QAAQ;AACjB,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA,MAAMM,qBAAqB,GAAGA,CAC5BV,EAAU,EACVC,IAAY,EACZC,QAAwB,EACxBC,mBAA2B,KAC2B;EACtD,MAAMC,QAAQ,GAAGF,QAAQ,CAACS,eAAe;EAEzC,IAAI,CAACP,QAAQ,EAAE;IACb,OAAOE,SAAS;EAClB;EAEA,MAAMM,IAAI,GAAGR,QAAQ,CAACQ,IAAI,IAAI,CAAC;EAE/B,IAAI,CAACL,MAAM,CAACC,SAAS,CAACJ,QAAQ,CAACS,WAAW,CAAC,IAAIT,QAAQ,CAACS,WAAW,GAAG,CAAC,EAAE;IACvE,MAAMf,iBAAiB,CACrBE,EAAE,EACF,GAAGC,IAAI,8BAA8B,EACrC,MAAMQ,MAAM,CAACL,QAAQ,CAACS,WAAW,CAAC,qDACpC,CAAC;EACH;EAEA,IAAI,CAACN,MAAM,CAACC,SAAS,CAACI,IAAI,CAAC,IAAIA,IAAI,GAAG,CAAC,EAAE;IACvC,MAAMd,iBAAiB,CACrBE,EAAE,EACF,GAAGC,IAAI,uBAAuB,EAC9B,MAAMQ,MAAM,CAACL,QAAQ,CAACQ,IAAI,CAAC,4CAC7B,CAAC;EACH;EAEA,IAAIA,IAAI,GAAGR,QAAQ,CAACS,WAAW,GAAGV,mBAAmB,EAAE;IACrD,MAAML,iBAAiB,CACrBE,EAAE,EACF,GAAGC,IAAI,kBAAkB,EACzB,SAASW,IAAI,GAAGR,QAAQ,CAACS,WAAW,sDAAsDV,mBAAmB,sBAC/G,CAAC;EACH;EAEA,OAAO;IAAEU,WAAW,EAAET,QAAQ,CAACS,WAAW;IAAED;EAAK,CAAC;AACpD,CAAC;AAED,SAASb,gBAAgB,EAAEW,qBAAqB","ignoreList":[]}
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
import { measurementFieldCatalog } from "../../constants/measurement-field-catalog.js";
|
|
4
4
|
import { CaseType } from "../../types/case-type.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import { assertRequiredFields, compileFields } from "./compile-case-fields.js";
|
|
6
|
+
import { assertCaseLength, assertRepeatedRecords } from "./compile-case-shape.js";
|
|
7
7
|
import { customDeviceError } from "./custom-device-error.js";
|
|
8
8
|
|
|
9
9
|
/**
|
|
@@ -33,48 +33,34 @@ const assertMeasurementTypeKey = (id, path, caseSpec) => {
|
|
|
33
33
|
}
|
|
34
34
|
return key;
|
|
35
35
|
};
|
|
36
|
-
const registerField = (id, path, compiled, measurementTypeKey, fields) => {
|
|
37
|
-
const key = `${measurementTypeKey}:${compiled.name}`;
|
|
38
|
-
const existing = fields.get(key);
|
|
39
|
-
if (existing && (existing.min !== compiled.min || existing.max !== compiled.max)) {
|
|
40
|
-
throw customDeviceError(id, path, `declares ${compiled.name} with different bounds (${compiled.min}-${compiled.max}) than an earlier case (${existing.min}-${existing.max}); a property must mean the same thing in every frame`);
|
|
41
|
-
}
|
|
42
|
-
fields.set(key, compiled);
|
|
43
|
-
};
|
|
44
36
|
|
|
45
37
|
/**
|
|
46
|
-
*
|
|
47
|
-
*
|
|
48
|
-
*
|
|
38
|
+
* Every reading the frame carries, the declared one first.
|
|
39
|
+
*
|
|
40
|
+
* A frame reporting one measurement and a frame reporting six are the same shape here, so
|
|
41
|
+
* nothing downstream needs to know which it was reading.
|
|
49
42
|
*/
|
|
50
|
-
const
|
|
51
|
-
const
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
if (missing.length > 0) {
|
|
55
|
-
throw customDeviceError(id, `${path}.fields`, `does not declare ${missing.join(", ")}, which ${measurementTypeKey} needs to be a complete reading`);
|
|
43
|
+
const declaredMeasurements = (id, path, caseSpec, measurementTypeKey) => {
|
|
44
|
+
const additional = caseSpec.additionalMeasurements ?? [];
|
|
45
|
+
if (!Array.isArray(additional)) {
|
|
46
|
+
throw customDeviceError(id, `${path}.additionalMeasurements`, "must be an array of further readings this frame carries");
|
|
56
47
|
}
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
throw customDeviceError(id, `${path}.fields[${index}].name`, `"${field.name}" is declared twice in this case`);
|
|
48
|
+
return [{
|
|
49
|
+
path,
|
|
50
|
+
measurement: {
|
|
51
|
+
measurementTypeKey,
|
|
52
|
+
fields: caseSpec.fields ?? []
|
|
63
53
|
}
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
name: compiled.name,
|
|
69
|
-
parseType: "custom",
|
|
70
|
-
byteIndexes: compiled.byteIndexes,
|
|
71
|
-
customParserDefinition: createCustomFieldParser(compiled)
|
|
72
|
-
};
|
|
73
|
-
});
|
|
54
|
+
}, ...additional.map((measurement, index) => ({
|
|
55
|
+
path: `${path}.additionalMeasurements[${index}]`,
|
|
56
|
+
measurement
|
|
57
|
+
}))];
|
|
74
58
|
};
|
|
75
59
|
|
|
76
60
|
/** Validates one declared frame shape and turns it into a parsing case. */
|
|
77
61
|
export const compileCustomCase = (id, path, caseSpec, minLengthBytes, fields) => {
|
|
62
|
+
const caseMinLengthBytes = assertCaseLength(id, path, caseSpec, minLengthBytes);
|
|
63
|
+
const repeatedRecords = assertRepeatedRecords(id, path, caseSpec, minLengthBytes);
|
|
78
64
|
const caseType = CASE_TYPES[caseSpec.kind];
|
|
79
65
|
if (!caseType) {
|
|
80
66
|
throw customDeviceError(id, `${path}.kind`, `is "${String(caseSpec.kind)}"; expected ${Object.keys(CASE_TYPES).join(", ")}`);
|
|
@@ -82,7 +68,7 @@ export const compileCustomCase = (id, path, caseSpec, minLengthBytes, fields) =>
|
|
|
82
68
|
const measurementTypeKey = assertMeasurementTypeKey(id, path, caseSpec);
|
|
83
69
|
const declared = caseSpec.fields ?? [];
|
|
84
70
|
if (caseSpec.kind !== "result") {
|
|
85
|
-
if (declared.length > 0) {
|
|
71
|
+
if (declared.length > 0 || caseSpec.additionalMeasurements) {
|
|
86
72
|
throw customDeviceError(id, path, 'declares fields, but fields may be declared on only a "result" case');
|
|
87
73
|
}
|
|
88
74
|
return {
|
|
@@ -97,16 +83,42 @@ export const compileCustomCase = (id, path, caseSpec, minLengthBytes, fields) =>
|
|
|
97
83
|
throw customDeviceError(id, path, 'is a "result" case and must declare at least one field');
|
|
98
84
|
}
|
|
99
85
|
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
const parseDefinitions =
|
|
103
|
-
|
|
86
|
+
/** Shared, so a property declared under two readings in one frame is refused. */
|
|
87
|
+
const names = new Set();
|
|
88
|
+
const parseDefinitions = [];
|
|
89
|
+
const measurements = [];
|
|
90
|
+
declaredMeasurements(id, path, caseSpec, measurementTypeKey).forEach(({
|
|
91
|
+
path: measurementPath,
|
|
92
|
+
measurement
|
|
93
|
+
}) => {
|
|
94
|
+
const key = assertMeasurementTypeKey(id, measurementPath, {
|
|
95
|
+
...measurement,
|
|
96
|
+
kind: "result",
|
|
97
|
+
selector: caseSpec.selector
|
|
98
|
+
});
|
|
99
|
+
if (!key || (measurement.fields ?? []).length === 0) {
|
|
100
|
+
throw customDeviceError(id, measurementPath, "is a reading and must declare at least one field");
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
// Every field is checked first, so a misspelt property is reported as the typo it is
|
|
104
|
+
// rather than as the required property it failed to satisfy.
|
|
105
|
+
parseDefinitions.push(...compileFields(id, measurementPath, measurement.fields, key, repeatedRecords?.recordBytes ?? caseMinLengthBytes, fields, names));
|
|
106
|
+
assertRequiredFields(id, measurementPath, measurement.fields, key);
|
|
107
|
+
measurements.push({
|
|
108
|
+
measurementTypeKey: key,
|
|
109
|
+
fieldNames: measurement.fields.map(field => field.name)
|
|
110
|
+
});
|
|
111
|
+
});
|
|
104
112
|
return {
|
|
105
113
|
measurementTypeKey,
|
|
106
114
|
caseType,
|
|
107
115
|
caseValue: String(caseSpec.selector ?? "").toLowerCase(),
|
|
108
116
|
parseDefinitions,
|
|
109
|
-
description: caseSpec.description
|
|
117
|
+
description: caseSpec.description,
|
|
118
|
+
measurements,
|
|
119
|
+
...(repeatedRecords ? {
|
|
120
|
+
repeatedRecords
|
|
121
|
+
} : {})
|
|
110
122
|
};
|
|
111
123
|
};
|
|
112
124
|
//# sourceMappingURL=compile-custom-case.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["measurementFieldCatalog","CaseType","
|
|
1
|
+
{"version":3,"names":["measurementFieldCatalog","CaseType","assertRequiredFields","compileFields","assertCaseLength","assertRepeatedRecords","customDeviceError","CASE_TYPES","result","DEPENDENT","stream","STREAM","idle","OTHER","assertMeasurementTypeKey","id","path","caseSpec","key","measurementTypeKey","undefined","kind","Object","keys","join","declaredMeasurements","additional","additionalMeasurements","Array","isArray","measurement","fields","map","index","compileCustomCase","minLengthBytes","caseMinLengthBytes","repeatedRecords","caseType","String","declared","length","caseValue","selector","toLowerCase","parseDefinitions","description","names","Set","measurements","forEach","measurementPath","push","recordBytes","fieldNames","field","name"],"sourceRoot":"../../../../../../src","sources":["modules/bt-management/services/custom/compile-custom-case.ts"],"mappings":";;AAEA,SAASA,uBAAuB,QAAQ,8CAA2C;AACnF,SAASC,QAAQ,QAAQ,0BAAuB;AAQhD,SACEC,oBAAoB,EACpBC,aAAa,QACR,0BAAuB;AAC9B,SACEC,gBAAgB,EAChBC,qBAAqB,QAChB,yBAAsB;AAC7B,SAASC,iBAAiB,QAAQ,0BAAuB;;AAEzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,UAAoD,GAAG;EAC3DC,MAAM,EAAEP,QAAQ,CAACQ,SAAS;EAC1BC,MAAM,EAAET,QAAQ,CAACU,MAAM;EACvBC,IAAI,EAAEX,QAAQ,CAACY;AACjB,CAAC;AAED,MAAMC,wBAAwB,GAAGA,CAC/BC,EAAU,EACVC,IAAY,EACZC,QAAwB,KACW;EACnC,MAAMC,GAAG,GAAGD,QAAQ,CAACE,kBAAkB;EAEvC,IAAID,GAAG,KAAKE,SAAS,EAAE;IACrB,IAAIH,QAAQ,CAACI,IAAI,KAAK,QAAQ,EAAE;MAC9B,MAAMf,iBAAiB,CACrBS,EAAE,EACF,GAAGC,IAAI,qBAAqB,EAC5B,gCACF,CAAC;IACH;IAEA,OAAOI,SAAS;EAClB;EAEA,IAAI,CAACpB,uBAAuB,CAACkB,GAAG,CAAC,EAAE;IACjC,MAAMZ,iBAAiB,CACrBS,EAAE,EACF,GAAGC,IAAI,qBAAqB,EAC5B,IAAIE,GAAG,6HAA6HI,MAAM,CAACC,IAAI,CAC7IvB,uBACF,CAAC,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AC0B;IACrB,CAAC,CAAC;IAEF,IAAI,CAACzB,GAAG,IAAI,CAACY,WAAW,CAACC,MAAM,IAAI,EAAE,EAAEU,MAAM,KAAK,CAAC,EAAE;MACnD,MAAMnC,iBAAiB,CACrBS,EAAE,EACFoC,eAAe,EACf,kDACF,CAAC;IACH;;IAEA;IACA;IACAN,gBAAgB,CAACO,IAAI,CACnB,GAAGjD,aAAa,CACdY,EAAE,EACFoC,eAAe,EACfrB,WAAW,CAACC,MAAM,EAClBb,GAAG,EACHmB,eAAe,EAAEgB,WAAW,IAAIjB,kBAAkB,EAClDL,MAAM,EACNgB,KACF,CACF,CAAC;IAED7C,oBAAoB,CAACa,EAAE,EAAEoC,eAAe,EAAErB,WAAW,CAACC,MAAM,EAAEb,GAAG,CAAC;IAElE+B,YAAY,CAACG,IAAI,CAAC;MAChBjC,kBAAkB,EAAED,GAAG;MACvBoC,UAAU,EAAExB,WAAW,CAACC,MAAM,CAACC,GAAG,CAAEuB,KAAK,IAAKA,KAAK,CAACC,IAAI;IAC1D,CAAC,CAAC;EACJ,CACF,CAAC;EAED,OAAO;IACLrC,kBAAkB;IAClBmB,QAAQ;IACRI,SAAS,EAAEH,MAAM,CAACtB,QAAQ,CAAC0B,QAAQ,IAAI,EAAE,CAAC,CAACC,WAAW,CAAC,CAAC;IACxDC,gBAAgB;IAChBC,WAAW,EAAE7B,QAAQ,CAAC6B,WAAW;IACjCG,YAAY;IACZ,IAAIZ,eAAe,GAAG;MAAEA;IAAgB,CAAC,GAAG,CAAC,CAAC;EAChD,CAAC;AACH,CAAC","ignoreList":[]}
|
|
@@ -16,6 +16,9 @@ const assertByteIndexes = (id, path, field, minLengthBytes) => {
|
|
|
16
16
|
throw customDeviceError(id, `${path}.byteIndexes`, "reads the same byte twice");
|
|
17
17
|
}
|
|
18
18
|
const encoding = field.encoding ?? "uint";
|
|
19
|
+
if (encoding === "ascii" && field.byteOrder === "little") {
|
|
20
|
+
throw customDeviceError(id, `${path}.byteOrder`, 'is "little" on an "ascii" field; decimal digits read left to right, so reversing them would turn 120 into 21');
|
|
21
|
+
}
|
|
19
22
|
const required = WIDTHS[encoding];
|
|
20
23
|
if (required !== undefined && indexes.length !== required) {
|
|
21
24
|
throw customDeviceError(id, `${path}.encoding`, `"${encoding}" needs exactly ${required} bytes, but ${indexes.length} byte index(es) are declared`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["measurementFieldCatalog","customDeviceError","MAX_INTEGER_BYTES","WIDTHS","sfloat","float","assertByteIndexes","id","path","field","minLengthBytes","indexes","byteIndexes","Array","isArray","length","some","i","Number","isInteger","Set","size","encoding","required","undefined","outOfFrame","filter","assertArithmetic","scale","isFinite","offset","decimals","compileCustomField","measurementTypeKey","catalog","known","name","Object","keys","join","unit","min","max","
|
|
1
|
+
{"version":3,"names":["measurementFieldCatalog","customDeviceError","MAX_INTEGER_BYTES","WIDTHS","sfloat","float","assertByteIndexes","id","path","field","minLengthBytes","indexes","byteIndexes","Array","isArray","length","some","i","Number","isInteger","Set","size","encoding","byteOrder","required","undefined","outOfFrame","filter","assertArithmetic","scale","isFinite","offset","decimals","compileCustomField","measurementTypeKey","catalog","known","name","Object","keys","join","unit","min","max","reverse"],"sourceRoot":"../../../../../../src","sources":["modules/bt-management/services/custom/compile-custom-field.ts"],"mappings":";;AAEA,SAASA,uBAAuB,QAAQ,8CAA2C;AAInF,SAASC,iBAAiB,QAAQ,0BAAuB;AAEzD,MAAMC,iBAAiB,GAAG,CAAC;AAE3B,MAAMC,MAAgE,GAAG;EACvEC,MAAM,EAAE,CAAC;EACTC,KAAK,EAAE;AACT,CAAC;AAED,MAAMC,iBAAiB,GAAGA,CACxBC,EAAU,EACVC,IAAY,EACZC,KAAsB,EACtBC,cAAsB,KACb;EACT,MAAMC,OAAO,GAAGF,KAAK,CAACG,WAAW;EAEjC,IACE,CAACC,KAAK,CAACC,OAAO,CAACH,OAAO,CAAC,IACvBA,OAAO,CAACI,MAAM,KAAK,CAAC,IACpBJ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,GAAG,IAAIP,KAAK,CAACK,IAAI,GACtI,CAAC;EACH;EAEA,MAAM9B,OAAO,GAAG,CAAC,GAAGF,KAAK,CAACG,WAAW,CAAC;EAEtC,OAAO;IACLyB,IAAI,EAAE5B,KAAK,CAAC4B,IAAI;IAChBzB,WAAW,EAAEH,KAAK,CAACc,SAAS,KAAK,QAAQ,GAAGZ,OAAO,CAACiC,OAAO,CAAC,CAAC,GAAGjC,OAAO;IACvEW,QAAQ,EAAEb,KAAK,CAACa,QAAQ,IAAI,MAAM;IAClCO,KAAK,EAAEpB,KAAK,CAACoB,KAAK,IAAI,CAAC;IACvBE,MAAM,EAAEtB,KAAK,CAACsB,MAAM,IAAI,CAAC;IACzBC,QAAQ,EAAEvB,KAAK,CAACuB,QAAQ;IACxBS,IAAI,EAAEL,KAAK,CAACK,IAAI;IAChBC,GAAG;IACHC;EACF,CAAC;AACH,CAAC","ignoreList":[]}
|
|
@@ -1,8 +1,47 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
import { isChecksumAlgorithm } from "../../utils/calculate-checksum.js";
|
|
3
4
|
import { customDeviceError } from "./custom-device-error.js";
|
|
4
5
|
const HEX_BYTE = /^[0-9a-f]{2}$/;
|
|
5
6
|
|
|
7
|
+
/**
|
|
8
|
+
* Checks a checksum declaration against the frame it belongs to.
|
|
9
|
+
*
|
|
10
|
+
* Every byte it reads must be inside minLengthBytes, for the same reason field offsets are:
|
|
11
|
+
* a checksum verified against bytes the frame does not guarantee are present would pass on
|
|
12
|
+
* a truncated buffer and reject a whole one.
|
|
13
|
+
*/
|
|
14
|
+
const compileChecksum = (id, path, minLengthBytes, checksum) => {
|
|
15
|
+
if (!isChecksumAlgorithm(checksum.algorithm)) {
|
|
16
|
+
throw customDeviceError(id, `${path}.algorithm`, 'must be one of "crc8", "xor" or "sum"');
|
|
17
|
+
}
|
|
18
|
+
if (!Number.isInteger(checksum.index) || checksum.index < 0) {
|
|
19
|
+
throw customDeviceError(id, `${path}.index`, "must be a byte offset of at least 0");
|
|
20
|
+
}
|
|
21
|
+
if (checksum.index >= minLengthBytes) {
|
|
22
|
+
throw customDeviceError(id, `${path}.index`, `reads byte ${checksum.index}, which frame.minLengthBytes (${minLengthBytes}) does not guarantee is present`);
|
|
23
|
+
}
|
|
24
|
+
const from = checksum.from ?? 0;
|
|
25
|
+
if (!Number.isInteger(from) || from < 0) {
|
|
26
|
+
throw customDeviceError(id, `${path}.from`, "must be a byte offset of at least 0");
|
|
27
|
+
}
|
|
28
|
+
const byteCount = checksum.byteCount ?? checksum.index - from;
|
|
29
|
+
if (!Number.isInteger(byteCount) || byteCount < 1) {
|
|
30
|
+
throw customDeviceError(id, `${path}.byteCount`, "must cover at least one byte");
|
|
31
|
+
}
|
|
32
|
+
if (from + byteCount > minLengthBytes) {
|
|
33
|
+
throw customDeviceError(id, `${path}.byteCount`, `covers bytes ${from}-${from + byteCount - 1}, which frame.minLengthBytes (${minLengthBytes}) does not guarantee are present`);
|
|
34
|
+
}
|
|
35
|
+
if (checksum.index >= from && checksum.index < from + byteCount) {
|
|
36
|
+
throw customDeviceError(id, `${path}.index`, `is inside the bytes it covers (${from}-${from + byteCount - 1}), so it could never match`);
|
|
37
|
+
}
|
|
38
|
+
return Object.freeze({
|
|
39
|
+
...checksum,
|
|
40
|
+
from,
|
|
41
|
+
byteCount
|
|
42
|
+
});
|
|
43
|
+
};
|
|
44
|
+
|
|
6
45
|
/**
|
|
7
46
|
* Checks that a frame declaration can actually recognise a complete package, and returns a
|
|
8
47
|
* frozen, lower-cased copy of it.
|
|
@@ -29,11 +68,15 @@ export const compileCustomFrame = (id, path, frame) => {
|
|
|
29
68
|
if (header.length > minLengthBytes) {
|
|
30
69
|
throw customDeviceError(id, `${path}.header`, `is ${header.length} bytes, which does not fit inside minLengthBytes (${minLengthBytes})`);
|
|
31
70
|
}
|
|
71
|
+
const checksum = frame.checksum ? compileChecksum(id, `${path}.checksum`, minLengthBytes, frame.checksum) : undefined;
|
|
32
72
|
const length = frame.length;
|
|
33
73
|
if (!length) {
|
|
34
74
|
return Object.freeze({
|
|
35
75
|
header: Object.freeze(header),
|
|
36
|
-
minLengthBytes
|
|
76
|
+
minLengthBytes,
|
|
77
|
+
...(checksum ? {
|
|
78
|
+
checksum
|
|
79
|
+
} : {})
|
|
37
80
|
});
|
|
38
81
|
}
|
|
39
82
|
if (!Number.isInteger(length.index) || length.index < 0) {
|
|
@@ -53,7 +96,10 @@ export const compileCustomFrame = (id, path, frame) => {
|
|
|
53
96
|
minLengthBytes,
|
|
54
97
|
length: Object.freeze({
|
|
55
98
|
...length
|
|
56
|
-
})
|
|
99
|
+
}),
|
|
100
|
+
...(checksum ? {
|
|
101
|
+
checksum
|
|
102
|
+
} : {})
|
|
57
103
|
});
|
|
58
104
|
};
|
|
59
105
|
//# sourceMappingURL=compile-custom-frame.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["customDeviceError","HEX_BYTE","
|
|
1
|
+
{"version":3,"names":["isChecksumAlgorithm","customDeviceError","HEX_BYTE","compileChecksum","id","path","minLengthBytes","checksum","algorithm","Number","isInteger","index","from","byteCount","Object","freeze","compileCustomFrame","frame","declaredHeader","header","Array","isArray","map","byte","String","toLowerCase","some","test","length","undefined","widthBytes","overheadBytes"],"sourceRoot":"../../../../../../src","sources":["modules/bt-management/services/custom/compile-custom-frame.ts"],"mappings":";;AAEA,SAASA,mBAAmB,QAAQ,mCAAgC;AAEpE,SAASC,iBAAiB,QAAQ,0BAAuB;AAEzD,MAAMC,QAAQ,GAAG,eAAe;;AAEhC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,eAAe,GAAGA,CACtBC,EAAU,EACVC,IAAY,EACZC,cAAsB,EACtBC,QAA4B,KACL;EACvB,IAAI,CAACP,mBAAmB,CAACO,QAAQ,CAACC,SAAS,CAAC,EAAE;IAC5C,MAAMP,iBAAiB,CACrBG,EAAE,EACF,GAAGC,IAAI,YAAY,EACnB,uCACF,CAAC;EACH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