@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,155 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.LepuFileTransfer = void 0;
|
|
7
|
+
var _le32FromHex = require("../../../utils/le-32-from-hex.js");
|
|
8
|
+
var _le32ToBytes = require("../../../utils/le-32-to-bytes.js");
|
|
9
|
+
var _lepuCommands = require("./lepu.commands.js");
|
|
10
|
+
var _lepuFileNames = require("./lepu.file-names.js");
|
|
11
|
+
var _lepuFrame = require("./lepu.frame.js");
|
|
12
|
+
var _lepuResponseType = require("./lepu.response-type.js");
|
|
13
|
+
const FILE_SIZE_OFFSET = 0;
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* A hex-byte array costs far more memory than the file it describes, so the cap sits well
|
|
17
|
+
* below what a device could offer. A stored ECG is tens of kilobytes; a length near this one
|
|
18
|
+
* is a length to refuse rather than try to hold on a low-memory tablet.
|
|
19
|
+
*/
|
|
20
|
+
const MAX_FILE_BYTES = 262_144;
|
|
21
|
+
const TRANSFER_COMMANDS = [_lepuCommands.LepuCommand.GET_FILE_LIST, _lepuCommands.LepuCommand.READ_FILE_START, _lepuCommands.LepuCommand.READ_FILE_DATA, _lepuCommands.LepuCommand.READ_FILE_END];
|
|
22
|
+
/**
|
|
23
|
+
* Downloads the records a Lepu device has stored.
|
|
24
|
+
*
|
|
25
|
+
* Every opcode this uses is generic and inert - list, open, read, close - so unlike a
|
|
26
|
+
* realtime poll it is safe on hardware whose model is not known. That is what makes it the
|
|
27
|
+
* one thing the whole family can be asked for without identifying it first.
|
|
28
|
+
*
|
|
29
|
+
* The exchange is self-clocking and has no windowing: each reply decides the next request,
|
|
30
|
+
* and the device chooses how much to send, so the offset advances by what actually arrived
|
|
31
|
+
* rather than by an assumed chunk size. There is no retry in the protocol either - a single
|
|
32
|
+
* dropped reply stalls the transfer with nothing to resume it - which is what the data
|
|
33
|
+
* processor's stuck-data timeout is the watchdog for.
|
|
34
|
+
*
|
|
35
|
+
* A short read is an error, not a truncated success: the device is asked to close the file
|
|
36
|
+
* and the reading is discarded, because half an ECG that looks like a whole one is worse
|
|
37
|
+
* than none.
|
|
38
|
+
*/
|
|
39
|
+
class LepuFileTransfer {
|
|
40
|
+
files = [];
|
|
41
|
+
fileIndex = 0;
|
|
42
|
+
name = "";
|
|
43
|
+
totalBytes = 0;
|
|
44
|
+
content = [];
|
|
45
|
+
isSessionOpen = false;
|
|
46
|
+
isDone = false;
|
|
47
|
+
constructor(params) {
|
|
48
|
+
this.params = params;
|
|
49
|
+
}
|
|
50
|
+
initialCommands = () => [this.commandFor(_lepuCommands.LepuCommand.GET_FILE_LIST)];
|
|
51
|
+
nextCommand = frame => {
|
|
52
|
+
const command = (0, _lepuFrame.lepuCommandOf)(frame);
|
|
53
|
+
if (this.isDone || !TRANSFER_COMMANDS.includes(command)) {
|
|
54
|
+
return undefined;
|
|
55
|
+
}
|
|
56
|
+
if (!(0, _lepuResponseType.isLepuSuccess)(frame)) {
|
|
57
|
+
return this.fail(`the device refused it: ${(0, _lepuResponseType.describeLepuResponseType)(frame)}`);
|
|
58
|
+
}
|
|
59
|
+
if (command === _lepuCommands.LepuCommand.GET_FILE_LIST) {
|
|
60
|
+
this.files = (0, _lepuFileNames.lepuNamesFrom)((0, _lepuFrame.lepuPayloadOf)(frame));
|
|
61
|
+
this.fileIndex = 0;
|
|
62
|
+
return this.openNextFile();
|
|
63
|
+
}
|
|
64
|
+
if (command === _lepuCommands.LepuCommand.READ_FILE_START) {
|
|
65
|
+
return this.openedFile((0, _lepuFrame.lepuPayloadOf)(frame));
|
|
66
|
+
}
|
|
67
|
+
if (command === _lepuCommands.LepuCommand.READ_FILE_DATA) {
|
|
68
|
+
return this.appendChunk((0, _lepuFrame.lepuPayloadOf)(frame));
|
|
69
|
+
}
|
|
70
|
+
return this.closedFile();
|
|
71
|
+
};
|
|
72
|
+
openNextFile = () => {
|
|
73
|
+
const name = this.files[this.fileIndex];
|
|
74
|
+
if (name === undefined) {
|
|
75
|
+
this.isDone = true;
|
|
76
|
+
return undefined;
|
|
77
|
+
}
|
|
78
|
+
this.name = name;
|
|
79
|
+
this.totalBytes = 0;
|
|
80
|
+
this.content = [];
|
|
81
|
+
return [this.commandFor(_lepuCommands.LepuCommand.READ_FILE_START, [...(0, _lepuFileNames.lepuNameBytes)(name), ...(0, _le32ToBytes.le32ToBytes)(0)])];
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
/** The reply to opening a file states its whole length, which bounds everything after. */
|
|
85
|
+
openedFile = payload => {
|
|
86
|
+
this.isSessionOpen = true;
|
|
87
|
+
this.totalBytes = (0, _le32FromHex.le32FromHex)([...payload], FILE_SIZE_OFFSET);
|
|
88
|
+
const limit = this.params.maxFileBytes ?? MAX_FILE_BYTES;
|
|
89
|
+
if (this.totalBytes > limit) {
|
|
90
|
+
return this.fail(`"${this.name}" is ${this.totalBytes} bytes, more than the ${limit} this transfer will hold`);
|
|
91
|
+
}
|
|
92
|
+
if (this.totalBytes === 0) {
|
|
93
|
+
return this.closeFile();
|
|
94
|
+
}
|
|
95
|
+
return [this.commandFor(_lepuCommands.LepuCommand.READ_FILE_DATA, (0, _le32ToBytes.le32ToBytes)(0))];
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* A reply with no bytes in it ends the transfer rather than asking again from the same
|
|
100
|
+
* offset, which is a request the device would answer the same way for as long as the link
|
|
101
|
+
* stayed up.
|
|
102
|
+
*/
|
|
103
|
+
appendChunk = payload => {
|
|
104
|
+
if (payload.length === 0) {
|
|
105
|
+
return this.fail(`"${this.name}" stopped sending at ${this.content.length} of ${this.totalBytes} bytes`);
|
|
106
|
+
}
|
|
107
|
+
this.content.push(...payload);
|
|
108
|
+
this.params.onProgress?.({
|
|
109
|
+
name: this.name,
|
|
110
|
+
receivedBytes: this.content.length,
|
|
111
|
+
totalBytes: this.totalBytes
|
|
112
|
+
});
|
|
113
|
+
if (this.content.length >= this.totalBytes) {
|
|
114
|
+
return this.closeFile();
|
|
115
|
+
}
|
|
116
|
+
return [this.commandFor(_lepuCommands.LepuCommand.READ_FILE_DATA, (0, _le32ToBytes.le32ToBytes)(this.content.length))];
|
|
117
|
+
};
|
|
118
|
+
closedFile = () => {
|
|
119
|
+
this.isSessionOpen = false;
|
|
120
|
+
if (this.totalBytes > 0 && this.content.length !== this.totalBytes) {
|
|
121
|
+
return this.fail(`"${this.name}" ended at ${this.content.length} of ${this.totalBytes} bytes`);
|
|
122
|
+
}
|
|
123
|
+
if (this.totalBytes > 0) {
|
|
124
|
+
this.params.onFile({
|
|
125
|
+
name: this.name,
|
|
126
|
+
content: this.content
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
this.fileIndex++;
|
|
130
|
+
return this.openNextFile();
|
|
131
|
+
};
|
|
132
|
+
closeFile = () => [this.commandFor(_lepuCommands.LepuCommand.READ_FILE_END)];
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* Stops, and releases the device's file handle if one is open.
|
|
136
|
+
*
|
|
137
|
+
* The device holds that handle from the moment a file is opened until it is closed, so
|
|
138
|
+
* walking away from a failed read can leave it open until the device times out or resets.
|
|
139
|
+
*/
|
|
140
|
+
fail = reason => {
|
|
141
|
+
this.params.onError(reason);
|
|
142
|
+
this.isDone = true;
|
|
143
|
+
if (!this.isSessionOpen) {
|
|
144
|
+
return undefined;
|
|
145
|
+
}
|
|
146
|
+
this.isSessionOpen = false;
|
|
147
|
+
return this.closeFile();
|
|
148
|
+
};
|
|
149
|
+
commandFor = (command, payload = []) => ({
|
|
150
|
+
...this.params.write,
|
|
151
|
+
frame: this.params.builder.build(command, payload)
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
exports.LepuFileTransfer = LepuFileTransfer;
|
|
155
|
+
//# sourceMappingURL=lepu.file-transfer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_le32FromHex","require","_le32ToBytes","_lepuCommands","_lepuFileNames","_lepuFrame","_lepuResponseType","FILE_SIZE_OFFSET","MAX_FILE_BYTES","TRANSFER_COMMANDS","LepuCommand","GET_FILE_LIST","READ_FILE_START","READ_FILE_DATA","READ_FILE_END","LepuFileTransfer","files","fileIndex","name","totalBytes","content","isSessionOpen","isDone","constructor","params","initialCommands","commandFor","nextCommand","frame","command","lepuCommandOf","includes","undefined","isLepuSuccess","fail","describeLepuResponseType","lepuNamesFrom","lepuPayloadOf","openNextFile","openedFile","appendChunk","closedFile","lepuNameBytes","le32ToBytes","payload","le32FromHex","limit","maxFileBytes","closeFile","length","push","onProgress","receivedBytes","onFile","reason","onError","write","builder","build","exports"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/lepu/lepu.file-transfer.ts"],"mappings":";;;;;;AAEA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAGA,IAAAE,aAAA,GAAAF,OAAA;AACA,IAAAG,cAAA,GAAAH,OAAA;AACA,IAAAI,UAAA,GAAAJ,OAAA;AACA,IAAAK,iBAAA,GAAAL,OAAA;AAEA,MAAMM,gBAAgB,GAAG,CAAC;;AAE1B;AACA;AACA;AACA;AACA;AACA,MAAMC,cAAc,GAAG,OAAO;AAE9B,MAAMC,iBAAoC,GAAG,CAC3CC,yBAAW,CAACC,aAAa,EACzBD,yBAAW,CAACE,eAAe,EAC3BF,yBAAW,CAACG,cAAc,EAC1BH,yBAAW,CAACI,aAAa,CAC1B;AA+BD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMC,gBAAgB,CAA6B;EAChDC,KAAK,GAAa,EAAE;EACpBC,SAAS,GAAG,CAAC;EACbC,IAAI,GAAG,EAAE;EACTC,UAAU,GAAG,CAAC;EACdC,OAAO,GAAa,EAAE;EACtBC,aAAa,GAAG,KAAK;EACrBC,MAAM,GAAG,KAAK;EAEfC,WAAWA,CAAkBC,MAA8B,EAAE;IAAA,KAAhCA,MAA8B,GAA9BA,MAA8B;EAAG;EAE9DC,eAAe,GAAGA,CAAA,KAAgC,CACvD,IAAI,CAACC,UAAU,CAAChB,yBAAW,CAACC,aAAa,CAAC,CAC3C;EAEMgB,WAAW,GAChBC,KAAwB,IACiB;IACzC,MAAMC,OAAO,GAAG,IAAAC,wBAA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EAAE;MACvB,OAAOW,SAAS;IAClB;IAEA,IAAI,CAACX,aAAa,GAAG,KAAK;IAE1B,OAAO,IAAI,CAAC2B,SAAS,CAAC,CAAC;EACzB,CAAC;EAEOtB,UAAU,GAAGA,CACnBG,OAAe,EACfe,OAA0B,GAAG,EAAE,MACZ;IACnB,GAAG,IAAI,CAACpB,MAAM,CAACgC,KAAK;IACpB5B,KAAK,EAAE,IAAI,CAACJ,MAAM,CAACiC,OAAO,CAACC,KAAK,CAAC7B,OAAO,EAAEe,OAAO;EACnD,CAAC,CAAC;AACJ;AAACe,OAAA,CAAA5C,gBAAA,GAAAA,gBAAA","ignoreList":[]}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.LepuFrameReader = void 0;
|
|
7
|
+
var _frameReadStatus = require("../../../types/frame-read-status.js");
|
|
8
|
+
var _calculateCrc = require("../../../utils/calculate-crc-8.js");
|
|
9
|
+
var _hexToByte = require("../../../utils/hex-to-byte.js");
|
|
10
|
+
var _le16FromHex = require("../../../utils/le-16-from-hex.js");
|
|
11
|
+
const COMMAND_INDEX = 1;
|
|
12
|
+
const COMMAND_COMPLEMENT_INDEX = 2;
|
|
13
|
+
const PAYLOAD_LENGTH_INDEX = 5;
|
|
14
|
+
const HEADER_BYTES = 7;
|
|
15
|
+
const CHECKSUM_BYTES = 1;
|
|
16
|
+
const BYTE_MASK = 0xff;
|
|
17
|
+
|
|
18
|
+
/** Start byte, command and its complement: the shortest run that can identify a start. */
|
|
19
|
+
const START_PATTERN_BYTES = 3;
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Reads the frame every Lepu device shares.
|
|
23
|
+
*
|
|
24
|
+
* Layout: `start | cmd | ~cmd | type | seq | lenLow lenHigh | payload | crc8`, where the
|
|
25
|
+
* checksum covers every byte before it. The complement of the command byte only narrows the
|
|
26
|
+
* search for a start; the checksum is what actually decides a frame is trustworthy.
|
|
27
|
+
*
|
|
28
|
+
* The start byte is the only part that varies across the family. Most devices use `a5`, a
|
|
29
|
+
* smaller group uses `55`, and a few accept either and settle on one at runtime - so it is a
|
|
30
|
+
* list rather than a single value. Everything else is identical on every device speaking this
|
|
31
|
+
* protocol, which is why it is worth having once rather than once per device.
|
|
32
|
+
*/
|
|
33
|
+
class LepuFrameReader {
|
|
34
|
+
constructor(startBytes) {
|
|
35
|
+
this.startBytes = startBytes;
|
|
36
|
+
}
|
|
37
|
+
readFrame(buffer) {
|
|
38
|
+
const start = this.findFrameStart(buffer);
|
|
39
|
+
if (start === -1) {
|
|
40
|
+
return {
|
|
41
|
+
status: _frameReadStatus.FrameReadStatus.INCOMPLETE,
|
|
42
|
+
consumedBytes: this.droppableLeadingBytes(buffer)
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
const payloadLength = (0, _le16FromHex.le16FromHex)(buffer, start + PAYLOAD_LENGTH_INDEX);
|
|
46
|
+
const frameLength = HEADER_BYTES + payloadLength + CHECKSUM_BYTES;
|
|
47
|
+
if (start + frameLength > buffer.length) {
|
|
48
|
+
return {
|
|
49
|
+
status: _frameReadStatus.FrameReadStatus.INCOMPLETE,
|
|
50
|
+
consumedBytes: start
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
const frame = buffer.slice(start, start + frameLength);
|
|
54
|
+
if (!this.hasValidChecksum(frame)) {
|
|
55
|
+
return {
|
|
56
|
+
status: _frameReadStatus.FrameReadStatus.CORRUPT,
|
|
57
|
+
consumedBytes: start + START_PATTERN_BYTES
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
return {
|
|
61
|
+
status: _frameReadStatus.FrameReadStatus.COMPLETE,
|
|
62
|
+
consumedBytes: start + frameLength,
|
|
63
|
+
frame
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
isFrameStart(buffer, index) {
|
|
67
|
+
if (!this.startBytes.includes((buffer[index] || "").toLowerCase())) {
|
|
68
|
+
return false;
|
|
69
|
+
}
|
|
70
|
+
const command = (0, _hexToByte.hexToByte)(buffer[index + COMMAND_INDEX] || "0");
|
|
71
|
+
const complement = (0, _hexToByte.hexToByte)(buffer[index + COMMAND_COMPLEMENT_INDEX] || "0");
|
|
72
|
+
return command === (~complement & BYTE_MASK);
|
|
73
|
+
}
|
|
74
|
+
findFrameStart(buffer) {
|
|
75
|
+
const lastCandidate = buffer.length - START_PATTERN_BYTES;
|
|
76
|
+
for (let index = 0; index <= lastCandidate; index++) {
|
|
77
|
+
if (this.isFrameStart(buffer, index)) {
|
|
78
|
+
return index;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
return -1;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Bytes that cannot begin a frame start, and are therefore safe to drop when no start was
|
|
86
|
+
* found. The trailing bytes are kept because a start pattern may still be arriving.
|
|
87
|
+
*/
|
|
88
|
+
droppableLeadingBytes(buffer) {
|
|
89
|
+
return Math.max(0, buffer.length - (START_PATTERN_BYTES - 1));
|
|
90
|
+
}
|
|
91
|
+
hasValidChecksum(frame) {
|
|
92
|
+
const checksummedBytes = frame.length - CHECKSUM_BYTES;
|
|
93
|
+
const declared = (0, _hexToByte.hexToByte)(frame[checksummedBytes] || "0");
|
|
94
|
+
return declared === (0, _calculateCrc.calculateCrc8)(frame, checksummedBytes);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
exports.LepuFrameReader = LepuFrameReader;
|
|
98
|
+
//# sourceMappingURL=lepu.frame-reader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_frameReadStatus","require","_calculateCrc","_hexToByte","_le16FromHex","COMMAND_INDEX","COMMAND_COMPLEMENT_INDEX","PAYLOAD_LENGTH_INDEX","HEADER_BYTES","CHECKSUM_BYTES","BYTE_MASK","START_PATTERN_BYTES","LepuFrameReader","constructor","startBytes","readFrame","buffer","start","findFrameStart","status","FrameReadStatus","INCOMPLETE","consumedBytes","droppableLeadingBytes","payloadLength","le16FromHex","frameLength","length","frame","slice","hasValidChecksum","CORRUPT","COMPLETE","isFrameStart","index","includes","toLowerCase","command","hexToByte","complement","lastCandidate","Math","max","checksummedBytes","declared","calculateCrc8","exports"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/lepu/lepu.frame-reader.ts"],"mappings":";;;;;;AACA,IAAAA,gBAAA,GAAAC,OAAA;AAEA,IAAAC,aAAA,GAAAD,OAAA;AACA,IAAAE,UAAA,GAAAF,OAAA;AACA,IAAAG,YAAA,GAAAH,OAAA;AAEA,MAAMI,aAAa,GAAG,CAAC;AACvB,MAAMC,wBAAwB,GAAG,CAAC;AAClC,MAAMC,oBAAoB,GAAG,CAAC;AAC9B,MAAMC,YAAY,GAAG,CAAC;AACtB,MAAMC,cAAc,GAAG,CAAC;AACxB,MAAMC,SAAS,GAAG,IAAI;;AAEtB;AACA,MAAMC,mBAAmB,GAAG,CAAC;;AAE7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMC,eAAe,CAAwB;EAC3CC,WAAWA,CAAkBC,UAA6B,EAAE;IAAA,KAA/BA,UAA6B,GAA7BA,UAA6B;EAAG;EAE7DC,SAASA,CAACC,MAAyB,EAAmB;IAC3D,MAAMC,KAAK,GAAG,IAAI,CAACC,cAAc,CAACF,MAAM,CAAC;IAEzC,IAAIC,KAAK,KAAK,CAAC,CAAC,EAAE;MAChB,OAAO;QACLE,MAAM,EAAEC,gCAAe,CAACC,UAAU;QAClCC,aAAa,EAAE,IAAI,CAACC,qBAAqB,CAACP,MAAM;MAClD,CAAC;IACH;IAEA,MAAMQ,aAAa,GAAG,IAAAC,wBAAW,EAACT,MAAM,EAAEC,KAAK,GAAGV,oBAAoB,CAAC;IACvE,MAAMmB,WAAW,GAAGlB,YAAY,GAAGgB,aAAa,GAAGf,cAAc;IAEjE,IAAIQ,KAAK,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M,EAAEkB,KAAK,CAAC,EAAE;QACpC,OAAOA,KAAK;MACd;IACF;IAEA,OAAO,CAAC,CAAC;EACX;;EAEA;AACF;AACA;AACA;EACUX,qBAAqBA,CAACP,MAAyB,EAAU;IAC/D,OAAOyB,IAAI,CAACC,GAAG,CAAC,CAAC,EAAE1B,MAAM,CAACW,MAAM,IAAIhB,mBAAmB,GAAG,CAAC,CAAC,CAAC;EAC/D;EAEQmB,gBAAgBA,CAACF,KAAe,EAAW;IACjD,MAAMe,gBAAgB,GAAGf,KAAK,CAACD,MAAM,GAAGlB,cAAc;IACtD,MAAMmC,QAAQ,GAAG,IAAAN,oBAAS,EAACV,KAAK,CAACe,gBAAgB,CAAC,IAAI,GAAG,CAAC;IAE1D,OAAOC,QAAQ,KAAK,IAAAC,2BAAa,EAACjB,KAAK,EAAEe,gBAAgB,CAAC;EAC5D;AACF;AAACG,OAAA,CAAAlC,eAAA,GAAAA,eAAA","ignoreList":[]}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.lepuPayloadOf = exports.lepuCommandOf = void 0;
|
|
7
|
+
var _hexToByte = require("../../../utils/hex-to-byte.js");
|
|
8
|
+
var _le16FromHex = require("../../../utils/le-16-from-hex.js");
|
|
9
|
+
const COMMAND_INDEX = 1;
|
|
10
|
+
const PAYLOAD_LENGTH_INDEX = 5;
|
|
11
|
+
const HEADER_BYTES = 7;
|
|
12
|
+
|
|
13
|
+
/** The opcode a frame answers, which is what correlates a reply to its request. */
|
|
14
|
+
const lepuCommandOf = frame => (0, _hexToByte.hexToByte)(frame[COMMAND_INDEX] ?? "0");
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* The bytes a frame carries, from its own declared length.
|
|
18
|
+
*
|
|
19
|
+
* Declared rather than derived from what arrived: the frame reader has already checked that
|
|
20
|
+
* the buffer holds the whole frame, so the length field is the payload's end, and trusting
|
|
21
|
+
* the array instead would fold the checksum byte into the data.
|
|
22
|
+
*/
|
|
23
|
+
exports.lepuCommandOf = lepuCommandOf;
|
|
24
|
+
const lepuPayloadOf = frame => {
|
|
25
|
+
const length = (0, _le16FromHex.le16FromHex)(frame, PAYLOAD_LENGTH_INDEX);
|
|
26
|
+
return frame.slice(HEADER_BYTES, HEADER_BYTES + length);
|
|
27
|
+
};
|
|
28
|
+
exports.lepuPayloadOf = lepuPayloadOf;
|
|
29
|
+
//# sourceMappingURL=lepu.frame.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_hexToByte","require","_le16FromHex","COMMAND_INDEX","PAYLOAD_LENGTH_INDEX","HEADER_BYTES","lepuCommandOf","frame","hexToByte","exports","lepuPayloadOf","length","le16FromHex","slice"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/lepu/lepu.frame.ts"],"mappings":";;;;;;AAAA,IAAAA,UAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAEA,MAAME,aAAa,GAAG,CAAC;AACvB,MAAMC,oBAAoB,GAAG,CAAC;AAC9B,MAAMC,YAAY,GAAG,CAAC;;AAEtB;AACA,MAAMC,aAAa,GAAIC,KAAwB,IAC7C,IAAAC,oBAAS,EAACD,KAAK,CAACJ,aAAa,CAAC,IAAI,GAAG,CAAC;;AAExC;AACA;AACA;AACA;AACA;AACA;AACA;AANAM,OAAA,CAAAH,aAAA,GAAAA,aAAA;AAOA,MAAMI,aAAa,GAAIH,KAAwB,IAAe;EAC5D,MAAMI,MAAM,GAAG,IAAAC,wBAAW,EAACL,KAAK,EAAEH,oBAAoB,CAAC;EAEvD,OAAOG,KAAK,CAACM,KAAK,CAACR,YAAY,EAAEA,YAAY,GAAGM,MAAM,CAAC;AACzD,CAAC;AAACF,OAAA,CAAAC,aAAA,GAAAA,aAAA","ignoreList":[]}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.LepuIdentityGate = void 0;
|
|
7
|
+
var _hexToByte = require("../../../utils/hex-to-byte.js");
|
|
8
|
+
var _lepuCommands = require("./lepu.commands.js");
|
|
9
|
+
var _lepuDeviceInfo = require("./lepu.device-info.js");
|
|
10
|
+
var _lepuResponseType = require("./lepu.response-type.js");
|
|
11
|
+
const COMMAND_INDEX = 1;
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Asks a Lepu device what it is before sending it anything that acts.
|
|
15
|
+
*
|
|
16
|
+
* The family shares one frame format, one checksum and one opcode space, but not one
|
|
17
|
+
* meaning: `0x08` polls realtime data on a BP2, starts a blood-pressure measurement on an
|
|
18
|
+
* AirBp and starts an ECG on a Lepod. A frame built for the wrong device is therefore
|
|
19
|
+
* perfectly well-formed - the CRC is computed the same way on every one of them - so
|
|
20
|
+
* nothing in the protocol catches a driver bound to the wrong hardware. What comes back is
|
|
21
|
+
* a cuff inflating on someone's arm because a name matched during a scan.
|
|
22
|
+
*
|
|
23
|
+
* `GET_INFO` is the one command that cannot cause that: it is generic, inert, and answered
|
|
24
|
+
* identically family-wide. So it goes first, and everything else waits on its reply.
|
|
25
|
+
*
|
|
26
|
+
* A declaration that names the models it was written for is refused permanently when the
|
|
27
|
+
* device answers with a different one. A declaration that names none is identified by the
|
|
28
|
+
* advertised name it already matched, which is the basis the vendor's own SDK binds every
|
|
29
|
+
* one of its products on; it is asked what it is anyway, and the answer reported, because
|
|
30
|
+
* that is the only place these model numbers exist - the vendor never reads the field back,
|
|
31
|
+
* so there is no table of them to copy.
|
|
32
|
+
*
|
|
33
|
+
* A reply that never arrives leaves the gate closed and nothing sent, which the data
|
|
34
|
+
* processor's stuck-data timeout reports and disconnects on. That is the watchdog for this
|
|
35
|
+
* too - the protocol has no retry of its own, so a dropped reply is recovered by
|
|
36
|
+
* reconnecting rather than by asking again.
|
|
37
|
+
*/
|
|
38
|
+
class LepuIdentityGate {
|
|
39
|
+
isIdentified = false;
|
|
40
|
+
isRefused = false;
|
|
41
|
+
constructor(params) {
|
|
42
|
+
this.params = params;
|
|
43
|
+
}
|
|
44
|
+
initialCommands = () => [this.commandFor(_lepuCommands.LepuCommand.GET_INFO)];
|
|
45
|
+
nextCommand = frame => {
|
|
46
|
+
if (this.isRefused) {
|
|
47
|
+
return undefined;
|
|
48
|
+
}
|
|
49
|
+
if (this.isIdentified) {
|
|
50
|
+
return this.poll();
|
|
51
|
+
}
|
|
52
|
+
return this.admit(frame);
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Decides on the reply to `GET_INFO`.
|
|
57
|
+
*
|
|
58
|
+
* A frame that is not that reply leaves the gate as it was rather than provoking another
|
|
59
|
+
* command, because the only command outstanding is the one still being waited on.
|
|
60
|
+
*
|
|
61
|
+
* A reply that is that command but carries an error type is refused rather than parsed.
|
|
62
|
+
* The payload of an error is the reason for it, so reading a model number out of it would
|
|
63
|
+
* identify the hardware from an error code.
|
|
64
|
+
*/
|
|
65
|
+
admit = frame => {
|
|
66
|
+
if ((0, _hexToByte.hexToByte)(frame[COMMAND_INDEX] ?? "0") !== _lepuCommands.LepuCommand.GET_INFO) {
|
|
67
|
+
return undefined;
|
|
68
|
+
}
|
|
69
|
+
if (!(0, _lepuResponseType.isLepuSuccess)(frame)) {
|
|
70
|
+
return this.refuse(`the device would not say what it is: ${(0, _lepuResponseType.describeLepuResponseType)(frame)}`);
|
|
71
|
+
}
|
|
72
|
+
const info = (0, _lepuDeviceInfo.parseLepuDeviceInfo)(frame);
|
|
73
|
+
if (!info) {
|
|
74
|
+
return this.refuse("the device answered with a frame too short to hold its own model number");
|
|
75
|
+
}
|
|
76
|
+
this.params.onIdentified?.(info);
|
|
77
|
+
if (this.params.pollCommand === undefined) {
|
|
78
|
+
return undefined;
|
|
79
|
+
}
|
|
80
|
+
const isNarrowed = this.params.expectedDeviceTypes.length > 0;
|
|
81
|
+
if (isNarrowed && !this.params.expectedDeviceTypes.includes(info.deviceType)) {
|
|
82
|
+
return this.refuse(`the hardware reported model ${info.deviceType} (branch "${info.branchCode}"), which this declaration was not written for`);
|
|
83
|
+
}
|
|
84
|
+
this.isIdentified = true;
|
|
85
|
+
return this.poll();
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
/** Closes the gate for good. There is no state a refused device can be talked back from. */
|
|
89
|
+
refuse = reason => {
|
|
90
|
+
this.isRefused = true;
|
|
91
|
+
this.params.onRefused(reason);
|
|
92
|
+
return undefined;
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
/** Nothing, for a declaration that asks what the device is and stops there. */
|
|
96
|
+
poll = () => this.params.pollCommand === undefined ? undefined : [this.commandFor(this.params.pollCommand)];
|
|
97
|
+
commandFor = command => ({
|
|
98
|
+
...this.params.write,
|
|
99
|
+
frame: this.params.builder.build(command)
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
exports.LepuIdentityGate = LepuIdentityGate;
|
|
103
|
+
//# sourceMappingURL=lepu.identity-gate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_hexToByte","require","_lepuCommands","_lepuDeviceInfo","_lepuResponseType","COMMAND_INDEX","LepuIdentityGate","isIdentified","isRefused","constructor","params","initialCommands","commandFor","LepuCommand","GET_INFO","nextCommand","frame","undefined","poll","admit","hexToByte","isLepuSuccess","refuse","describeLepuResponseType","info","parseLepuDeviceInfo","onIdentified","pollCommand","isNarrowed","expectedDeviceTypes","length","includes","deviceType","branchCode","reason","onRefused","command","write","builder","build","exports"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/lepu/lepu.identity-gate.ts"],"mappings":";;;;;;AAEA,IAAAA,UAAA,GAAAC,OAAA;AAGA,IAAAC,aAAA,GAAAD,OAAA;AACA,IAAAE,eAAA,GAAAF,OAAA;AACA,IAAAG,iBAAA,GAAAH,OA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,IAAI,IAAI,CAACd,MAAM,CAACiB,WAAW,KAAKV,SAAS,EAAE;MACzC,OAAOA,SAAS;IAClB;IAEA,MAAMW,UAAU,GAAG,IAAI,CAAClB,MAAM,CAACmB,mBAAmB,CAACC,MAAM,GAAG,CAAC;IAE7D,IAAIF,UAAU,IAAI,CAAC,IAAI,CAAClB,MAAM,CAACmB,mBAAmB,CAACE,QAAQ,CAACP,IAAI,CAACQ,UAAU,CAAC,EAAE;MAC5E,OAAO,IAAI,CAACV,MAAM,CAChB,+BAA+BE,IAAI,CAACQ,UAAU,aAAaR,IAAI,CAACS,UAAU,gDAC5E,CAAC;IACH;IAEA,IAAI,CAAC1B,YAAY,GAAG,IAAI;IAExB,OAAO,IAAI,CAACW,IAAI,CAAC,CAAC;EACpB,CAAC;;EAED;EACQI,MAAM,GAAIY,MAAc,IAAgB;IAC9C,IAAI,CAAC1B,SAAS,GAAG,IAAI;IACrB,IAAI,CAACE,MAAM,CAACyB,SAAS,CAACD,MAAM,CAAC;IAE7B,OAAOjB,SAAS;EAClB,CAAC;;EAED;EACQC,IAAI,GAAGA,CAAA,KACb,IAAI,CAACR,MAAM,CAACiB,WAAW,KAAKV,SAAS,GACjCA,SAAS,GACT,CAAC,IAAI,CAACL,UAAU,CAAC,IAAI,CAACF,MAAM,CAACiB,WAAW,CAAC,CAAC;EAExCf,UAAU,GAAIwB,OAAe,KAAqB;IACxD,GAAG,IAAI,CAAC1B,MAAM,CAAC2B,KAAK;IACpBrB,KAAK,EAAE,IAAI,CAACN,MAAM,CAAC4B,OAAO,CAACC,KAAK,CAACH,OAAO;EAC1C,CAAC,CAAC;AACJ;AAACI,OAAA,CAAAlC,gBAAA,GAAAA,gBAAA","ignoreList":[]}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.lepuNameMatch = void 0;
|
|
7
|
+
var _lepuDeviceNames = require("./lepu.device-names.js");
|
|
8
|
+
const REGEXP_SPECIAL = /[.*+?^${}()|[\]\\]/g;
|
|
9
|
+
const escapeRegExp = value => value.replace(REGEXP_SPECIAL, "\\$&");
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Builds a matcher for one advertised name that cannot also match a longer one.
|
|
13
|
+
*
|
|
14
|
+
* The vendor tests these names with a substring check in a hand-ordered cascade, so `BP2`
|
|
15
|
+
* only fails to match a BP2W because `BP2W` happens to be checked first. Order is a fragile
|
|
16
|
+
* place to keep a safety property: it lives in whoever wrote the list, is invisible at the
|
|
17
|
+
* point of use, and an insertion in the wrong place silently binds the wrong driver.
|
|
18
|
+
*
|
|
19
|
+
* Here the exclusions are derived instead. Every name in the vocabulary that extends this
|
|
20
|
+
* one becomes a negative lookahead, so the matcher is correct wherever it is used and in
|
|
21
|
+
* whatever order it is tried.
|
|
22
|
+
*
|
|
23
|
+
* The match is deliberately open at the end, because these devices advertise a serial after
|
|
24
|
+
* the model - `BP2 1234` - and the serial's shape varies across the family.
|
|
25
|
+
*/
|
|
26
|
+
const lepuNameMatch = (name, vocabulary = _lepuDeviceNames.LEPU_DEVICE_NAMES) => {
|
|
27
|
+
const extensions = vocabulary.filter(other => other !== name && other.startsWith(name)).map(other => escapeRegExp(other.slice(name.length)));
|
|
28
|
+
const exclusion = extensions.length > 0 ? `(?!${extensions.join("|")})` : "";
|
|
29
|
+
return new RegExp(`^${escapeRegExp(name)}${exclusion}`);
|
|
30
|
+
};
|
|
31
|
+
exports.lepuNameMatch = lepuNameMatch;
|
|
32
|
+
//# sourceMappingURL=lepu.name-match.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_lepuDeviceNames","require","REGEXP_SPECIAL","escapeRegExp","value","replace","lepuNameMatch","name","vocabulary","LEPU_DEVICE_NAMES","extensions","filter","other","startsWith","map","slice","length","exclusion","join","RegExp","exports"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/lepu/lepu.name-match.ts"],"mappings":";;;;;;AAAA,IAAAA,gBAAA,GAAAC,OAAA;AAEA,MAAMC,cAAc,GAAG,qBAAqB;AAE5C,MAAMC,YAAY,GAAIC,KAAa,IACjCA,KAAK,CAACC,OAAO,CAACH,cAAc,EAAE,MAAM,CAAC;;AAEvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMI,aAAa,GAAGA,CAC3BC,IAAY,EACZC,UAA6B,GAAGC,kCAAiB,KACtC;EACX,MAAMC,UAAU,GAAGF,UAAU,CAC1BG,MAAM,CAAEC,KAAK,IAAKA,KAAK,KAAKL,IAAI,IAAIK,KAAK,CAACC,UAAU,CAACN,IAAI,CAAC,CAAC,CAC3DO,GAAG,CAAEF,KAAK,IAAKT,YAAY,CAACS,KAAK,CAACG,KAAK,CAACR,IAAI,CAACS,MAAM,CAAC,CAAC,CAAC;EAEzD,MAAMC,SAAS,GACbP,UAAU,CAACM,MAAM,GAAG,CAAC,GAAG,MAAMN,UAAU,CAACQ,IAAI,CAAC,GAAG,CAAC,GAAG,GAAG,EAAE;EAE5D,OAAO,IAAIC,MAAM,CAAC,IAAIhB,YAAY,CAACI,IAAI,CAAC,GAAGU,SAAS,EAAE,CAAC;AACzD,CAAC;AAACG,OAAA,CAAAd,aAAA,GAAAA,aAAA","ignoreList":[]}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.lepuResponseType = exports.isLepuSuccess = exports.describeLepuResponseType = exports.LepuResponseType = void 0;
|
|
7
|
+
var _hexToByte = require("../../../utils/hex-to-byte.js");
|
|
8
|
+
/** Byte 3 of every frame: the direction on a request, the outcome on a reply. */
|
|
9
|
+
const RESPONSE_TYPE_INDEX = 3;
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* What a Lepu device says about the request it just answered.
|
|
13
|
+
*
|
|
14
|
+
* Only `SUCCESS` means the payload holds what was asked for. Every other value is an error
|
|
15
|
+
* whose payload is not the requested data, so a reply has to be checked before it is
|
|
16
|
+
* decoded - otherwise a refusal is read as a reading, out of whatever bytes happen to
|
|
17
|
+
* follow the header.
|
|
18
|
+
*/
|
|
19
|
+
const LepuResponseType = exports.LepuResponseType = {
|
|
20
|
+
/** A request, phone to device. Never seen on a reply. */
|
|
21
|
+
REQUEST: 0x00,
|
|
22
|
+
SUCCESS: 0x01,
|
|
23
|
+
/** The device rejected our checksum. */
|
|
24
|
+
CRC_ERROR: 0x02,
|
|
25
|
+
FILE_NOT_FOUND: 0xe0,
|
|
26
|
+
FILE_READ_FAILED: 0xe1,
|
|
27
|
+
FILE_WRITE_FAILED: 0xe2,
|
|
28
|
+
PARAMETER_ILLEGAL: 0xf1,
|
|
29
|
+
PERMISSION_DENIED: 0xf2,
|
|
30
|
+
DECRYPT_FAILED: 0xf3,
|
|
31
|
+
/** Mid-measurement or otherwise occupied. Worth backing off rather than giving up. */
|
|
32
|
+
DEVICE_BUSY: 0xfb,
|
|
33
|
+
COMMAND_FORMAT_ERROR: 0xfc,
|
|
34
|
+
/** The opcode is unknown to this firmware, which is how a feature is detected. */
|
|
35
|
+
COMMAND_NOT_SUPPORTED: 0xfd,
|
|
36
|
+
ERROR: 0xff
|
|
37
|
+
};
|
|
38
|
+
const RESPONSE_TYPE_NAMES = {
|
|
39
|
+
[LepuResponseType.CRC_ERROR]: "it rejected our checksum",
|
|
40
|
+
[LepuResponseType.FILE_NOT_FOUND]: "the file does not exist",
|
|
41
|
+
[LepuResponseType.FILE_READ_FAILED]: "the file could not be read",
|
|
42
|
+
[LepuResponseType.FILE_WRITE_FAILED]: "the file could not be written",
|
|
43
|
+
[LepuResponseType.PARAMETER_ILLEGAL]: "the parameter was rejected",
|
|
44
|
+
[LepuResponseType.PERMISSION_DENIED]: "permission was denied",
|
|
45
|
+
[LepuResponseType.DECRYPT_FAILED]: "it could not decrypt the request",
|
|
46
|
+
[LepuResponseType.DEVICE_BUSY]: "it is busy",
|
|
47
|
+
[LepuResponseType.COMMAND_FORMAT_ERROR]: "the command was malformed",
|
|
48
|
+
[LepuResponseType.COMMAND_NOT_SUPPORTED]: "the opcode is unknown to this firmware",
|
|
49
|
+
[LepuResponseType.ERROR]: "it reported a generic error"
|
|
50
|
+
};
|
|
51
|
+
const lepuResponseType = frame => (0, _hexToByte.hexToByte)(frame[RESPONSE_TYPE_INDEX] ?? "0");
|
|
52
|
+
exports.lepuResponseType = lepuResponseType;
|
|
53
|
+
const isLepuSuccess = frame => lepuResponseType(frame) === LepuResponseType.SUCCESS;
|
|
54
|
+
|
|
55
|
+
/** Why a device refused, in words, for an error a person will read. */
|
|
56
|
+
exports.isLepuSuccess = isLepuSuccess;
|
|
57
|
+
const describeLepuResponseType = frame => {
|
|
58
|
+
const type = lepuResponseType(frame);
|
|
59
|
+
const known = RESPONSE_TYPE_NAMES[type];
|
|
60
|
+
const code = `0x${type.toString(16).padStart(2, "0")}`;
|
|
61
|
+
return known ? `${known} (${code})` : `it answered with ${code}`;
|
|
62
|
+
};
|
|
63
|
+
exports.describeLepuResponseType = describeLepuResponseType;
|
|
64
|
+
//# sourceMappingURL=lepu.response-type.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_hexToByte","require","RESPONSE_TYPE_INDEX","LepuResponseType","exports","REQUEST","SUCCESS","CRC_ERROR","FILE_NOT_FOUND","FILE_READ_FAILED","FILE_WRITE_FAILED","PARAMETER_ILLEGAL","PERMISSION_DENIED","DECRYPT_FAILED","DEVICE_BUSY","COMMAND_FORMAT_ERROR","COMMAND_NOT_SUPPORTED","ERROR","RESPONSE_TYPE_NAMES","lepuResponseType","frame","hexToByte","isLepuSuccess","describeLepuResponseType","type","known","code","toString","padStart"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/lepu/lepu.response-type.ts"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