@ovok/native 0.4.7 → 0.4.9
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 +44 -0
- package/lib/commonjs/modules/bt-management/index.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/bt-manager.js +15 -13
- package/lib/commonjs/modules/bt-management/services/bt-manager.js.map +1 -1
- 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 +8 -2
- 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/device-creator.js +12 -2
- package/lib/commonjs/modules/bt-management/services/device-creator.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/devices/bc01/bc01-command-sequencer.js +184 -0
- package/lib/commonjs/modules/bt-management/services/devices/bc01/bc01-command-sequencer.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/devices/bc01/bc01-frame-parser.js +114 -0
- package/lib/commonjs/modules/bt-management/services/devices/bc01/bc01-frame-parser.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/devices/bc01/bc01.device.js +113 -51
- package/lib/commonjs/modules/bt-management/services/devices/bc01/bc01.device.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/devices/bc01/bc01.main-services.js +41 -77
- package/lib/commonjs/modules/bt-management/services/devices/bc01/bc01.main-services.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/devices/bt-command-writer.js +15 -1
- package/lib/commonjs/modules/bt-management/services/devices/bt-command-writer.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/devices/custom/custom-lepu-sequencer.js +20 -1
- package/lib/commonjs/modules/bt-management/services/devices/custom/custom-lepu-sequencer.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/devices/custom/custom.device.js +30 -44
- 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/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 +27 -53
- package/lib/commonjs/modules/bt-management/services/devices/standard-gatt/standard-gatt.devices.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/devices/standard-gatt/standard-gatt.profile.js +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/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/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/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/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 +4 -0
- package/lib/module/modules/bt-management/index.js.map +1 -1
- package/lib/module/modules/bt-management/services/bt-manager.js +15 -13
- package/lib/module/modules/bt-management/services/bt-manager.js.map +1 -1
- 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 +8 -2
- 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/device-creator.js +12 -2
- package/lib/module/modules/bt-management/services/device-creator.js.map +1 -1
- package/lib/module/modules/bt-management/services/devices/bc01/bc01-command-sequencer.js +180 -0
- package/lib/module/modules/bt-management/services/devices/bc01/bc01-command-sequencer.js.map +1 -0
- package/lib/module/modules/bt-management/services/devices/bc01/bc01-frame-parser.js +110 -0
- package/lib/module/modules/bt-management/services/devices/bc01/bc01-frame-parser.js.map +1 -0
- package/lib/module/modules/bt-management/services/devices/bc01/bc01.device.js +113 -51
- package/lib/module/modules/bt-management/services/devices/bc01/bc01.device.js.map +1 -1
- package/lib/module/modules/bt-management/services/devices/bc01/bc01.main-services.js +41 -77
- package/lib/module/modules/bt-management/services/devices/bc01/bc01.main-services.js.map +1 -1
- package/lib/module/modules/bt-management/services/devices/bt-command-writer.js +15 -1
- package/lib/module/modules/bt-management/services/devices/bt-command-writer.js.map +1 -1
- package/lib/module/modules/bt-management/services/devices/custom/custom-lepu-sequencer.js +20 -1
- package/lib/module/modules/bt-management/services/devices/custom/custom-lepu-sequencer.js.map +1 -1
- package/lib/module/modules/bt-management/services/devices/custom/custom.device.js +31 -45
- 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/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 +19 -45
- package/lib/module/modules/bt-management/services/devices/standard-gatt/standard-gatt.devices.js.map +1 -1
- package/lib/module/modules/bt-management/services/devices/standard-gatt/standard-gatt.profile.js +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/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/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/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/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 +4 -0
- package/lib/typescript/commonjs/src/modules/bt-management/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/bt-manager.d.ts +0 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/bt-manager.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/custom/compile-case-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/device-creator.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bc01/bc01-command-sequencer.d.ts +53 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bc01/bc01-command-sequencer.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bc01/bc01-frame-parser.d.ts +53 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bc01/bc01-frame-parser.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bc01/bc01.device.d.ts +33 -13
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bc01/bc01.device.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bc01/bc01.main-services.d.ts +11 -17
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bc01/bc01.main-services.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bt-command-writer.d.ts +7 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bt-command-writer.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/custom/custom-lepu-sequencer.d.ts +11 -2
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/custom/custom-lepu-sequencer.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/custom/custom.device.d.ts +10 -13
- 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/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 +22 -13
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.devices.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.profile.d.ts +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/types/custom-case-spec.d.ts +30 -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-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/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 +9 -0
- package/lib/typescript/commonjs/src/modules/bt-management/types/device-command.d.ts.map +1 -1
- 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/parsing-case.d.ts +8 -0
- package/lib/typescript/commonjs/src/modules/bt-management/types/parsing-case.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/utils/create-custom-field-parser.d.ts.map +1 -1
- package/lib/typescript/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/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 +4 -0
- package/lib/typescript/module/src/modules/bt-management/index.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/bt-manager.d.ts +0 -1
- package/lib/typescript/module/src/modules/bt-management/services/bt-manager.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/custom/compile-case-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/device-creator.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/devices/bc01/bc01-command-sequencer.d.ts +53 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/bc01/bc01-command-sequencer.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/bc01/bc01-frame-parser.d.ts +53 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/bc01/bc01-frame-parser.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/bc01/bc01.device.d.ts +33 -13
- package/lib/typescript/module/src/modules/bt-management/services/devices/bc01/bc01.device.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/devices/bc01/bc01.main-services.d.ts +11 -17
- package/lib/typescript/module/src/modules/bt-management/services/devices/bc01/bc01.main-services.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/devices/bt-command-writer.d.ts +7 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/bt-command-writer.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/devices/custom/custom-lepu-sequencer.d.ts +11 -2
- package/lib/typescript/module/src/modules/bt-management/services/devices/custom/custom-lepu-sequencer.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/devices/custom/custom.device.d.ts +10 -13
- 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/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 +22 -13
- package/lib/typescript/module/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.devices.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.profile.d.ts +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/types/custom-case-spec.d.ts +30 -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-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/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 +9 -0
- package/lib/typescript/module/src/modules/bt-management/types/device-command.d.ts.map +1 -1
- 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/parsing-case.d.ts +8 -0
- package/lib/typescript/module/src/modules/bt-management/types/parsing-case.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/utils/create-custom-field-parser.d.ts.map +1 -1
- package/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/package.json +1 -1
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.decodeVerovalEcgSamples = exports.VEROVAL_ECG_SAMPLE_RATE_HZ = exports.DEFAULT_CALIBRATION = void 0;
|
|
7
|
+
var _hexToByte = require("../../../utils/hex-to-byte.js");
|
|
8
|
+
const SAMPLE_BYTES = 2;
|
|
9
|
+
const BYTE_BITS = 8;
|
|
10
|
+
const SIGN_BIT = 0x8000;
|
|
11
|
+
const SIGNED_16_RANGE = 0x10000;
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* How fast the device samples.
|
|
15
|
+
*
|
|
16
|
+
* Not taken on trust: the vendor's own plotting step works out to two two-hundred-and-fifty
|
|
17
|
+
* sixths of a second, and its transfer is thirty-four segments of sixteen packets of sixteen
|
|
18
|
+
* bytes - which is 256 bytes, 128 samples, one second per segment. Both say 128 Hz.
|
|
19
|
+
*/
|
|
20
|
+
const VEROVAL_ECG_SAMPLE_RATE_HZ = exports.VEROVAL_ECG_SAMPLE_RATE_HZ = 128;
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* The calibration the recording is read with.
|
|
24
|
+
*
|
|
25
|
+
* This is the EDF convention - a linear map from counts onto a physical range - and the
|
|
26
|
+
* device states its own in the header it sends before the curve. These are the values the
|
|
27
|
+
* vendor's app falls back to, and are what the SDK uses until a header supplies otherwise:
|
|
28
|
+
* the full signed sixteen-bit range spans plus or minus 27.68 mV.
|
|
29
|
+
*/
|
|
30
|
+
const DEFAULT_CALIBRATION = exports.DEFAULT_CALIBRATION = {
|
|
31
|
+
physicalMinimumMicrovolts: -27_680,
|
|
32
|
+
physicalMaximumMicrovolts: 27_680,
|
|
33
|
+
digitalMinimum: -32_768,
|
|
34
|
+
digitalMaximum: 32_767
|
|
35
|
+
};
|
|
36
|
+
const MICROVOLTS_PER_MILLIVOLT = 1000;
|
|
37
|
+
/** Samples are two bytes, most significant first, and signed. */
|
|
38
|
+
const signedSampleAt = (bytes, index) => {
|
|
39
|
+
const raw = (0, _hexToByte.hexToByte)(bytes[index] ?? "0") << BYTE_BITS | (0, _hexToByte.hexToByte)(bytes[index + 1] ?? "0");
|
|
40
|
+
return raw & SIGN_BIT ? raw - SIGNED_16_RANGE : raw;
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Turns the bytes of a recording into millivolts.
|
|
45
|
+
*
|
|
46
|
+
* A trailing odd byte is ignored: half a sample is not a sample. The conversion is the
|
|
47
|
+
* device's own, applied as it states it rather than reduced to a single factor, so a header
|
|
48
|
+
* that reports a different range still decodes correctly.
|
|
49
|
+
*/
|
|
50
|
+
const decodeVerovalEcgSamples = (bytes, calibration = DEFAULT_CALIBRATION) => {
|
|
51
|
+
const physicalRange = calibration.physicalMaximumMicrovolts - calibration.physicalMinimumMicrovolts;
|
|
52
|
+
const digitalRange = calibration.digitalMaximum - calibration.digitalMinimum;
|
|
53
|
+
const samples = [];
|
|
54
|
+
if (digitalRange === 0) {
|
|
55
|
+
return samples;
|
|
56
|
+
}
|
|
57
|
+
for (let index = 0; index + 1 < bytes.length; index += SAMPLE_BYTES) {
|
|
58
|
+
const counts = signedSampleAt(bytes, index) - calibration.digitalMinimum;
|
|
59
|
+
samples.push((counts * physicalRange / digitalRange + calibration.physicalMinimumMicrovolts) / MICROVOLTS_PER_MILLIVOLT);
|
|
60
|
+
}
|
|
61
|
+
return samples;
|
|
62
|
+
};
|
|
63
|
+
exports.decodeVerovalEcgSamples = decodeVerovalEcgSamples;
|
|
64
|
+
//# sourceMappingURL=veroval.ecg-samples.js.map
|
package/lib/commonjs/modules/bt-management/services/devices/veroval/veroval.ecg-samples.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_hexToByte","require","SAMPLE_BYTES","BYTE_BITS","SIGN_BIT","SIGNED_16_RANGE","VEROVAL_ECG_SAMPLE_RATE_HZ","exports","DEFAULT_CALIBRATION","physicalMinimumMicrovolts","physicalMaximumMicrovolts","digitalMinimum","digitalMaximum","MICROVOLTS_PER_MILLIVOLT","signedSampleAt","bytes","index","raw","hexToByte","decodeVerovalEcgSamples","calibration","physicalRange","digitalRange","samples","length","counts","push"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/veroval/veroval.ecg-samples.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IAAIP,KAAK,GAAG,CAAC,EAAEA,KAAK,GAAG,CAAC,GAAGD,KAAK,CAACS,MAAM,EAAER,KAAK,IAAId,YAAY,EAAE;IACnE,MAAMuB,MAAM,GAAGX,cAAc,CAACC,KAAK,EAAEC,KAAK,CAAC,GAAGI,WAAW,CAACT,cAAc;IAExEY,OAAO,CAACG,IAAI,CACV,CAAED,MAAM,GAAGJ,aAAa,GAAIC,YAAY,GACtCF,WAAW,CAACX,yBAAyB,IACrCI,wBACJ,CAAC;EACH;EAEA,OAAOU,OAAO;AAChB,CAAC;AAAChB,OAAA,CAAAY,uBAAA,GAAAA,uBAAA","ignoreList":[]}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.VerovalEcgTransfer = void 0;
|
|
7
|
+
/** Every request is a fixed twenty-byte packet, zero filled but for its group and command. */
|
|
8
|
+
const PACKET_BYTES = 20;
|
|
9
|
+
const GROUP_INDEX = 1;
|
|
10
|
+
const COMMAND_INDEX = 2;
|
|
11
|
+
const PARAMETER_INDEX = 3;
|
|
12
|
+
const DOWNLOAD_GROUP = 4;
|
|
13
|
+
const DOWNLOAD_MODE = 1;
|
|
14
|
+
const DOWNLOAD_HEADER = 2;
|
|
15
|
+
const DOWNLOAD_RAW = 3;
|
|
16
|
+
|
|
17
|
+
/** The transfer's shape, from the vendor's own device table. */
|
|
18
|
+
const PAYLOAD_FROM = 4;
|
|
19
|
+
const PAYLOAD_BYTES = 16;
|
|
20
|
+
const HEADER_PACKETS = 5;
|
|
21
|
+
const PACKETS_PER_SEGMENT = 16;
|
|
22
|
+
const SEGMENTS = 34;
|
|
23
|
+
const BYTE_MASK = 0xff;
|
|
24
|
+
const BYTE_BITS = 8;
|
|
25
|
+
const toHex = byte => (byte & BYTE_MASK).toString(16).padStart(2, "0");
|
|
26
|
+
const packet = (write, command, parameters = []) => {
|
|
27
|
+
const bytes = new Array(PACKET_BYTES).fill(0);
|
|
28
|
+
bytes[GROUP_INDEX] = DOWNLOAD_GROUP;
|
|
29
|
+
bytes[COMMAND_INDEX] = command;
|
|
30
|
+
parameters.forEach((value, index) => {
|
|
31
|
+
bytes[PARAMETER_INDEX + index] = value;
|
|
32
|
+
});
|
|
33
|
+
return {
|
|
34
|
+
...write,
|
|
35
|
+
frame: bytes.map(toHex)
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
const segmentParameters = segment => [segment & BYTE_MASK, segment >> BYTE_BITS & BYTE_MASK, segment >> BYTE_BITS * 2 & BYTE_MASK];
|
|
39
|
+
/**
|
|
40
|
+
* Downloads a recording from the Veroval ECG.
|
|
41
|
+
*
|
|
42
|
+
* The exchange is a fixed walk rather than a conversation: ask for the download mode, then
|
|
43
|
+
* the header, then each second of the recording in turn. The device answers each request
|
|
44
|
+
* with a known number of twenty-byte packets, sixteen payload bytes each, so the transfer is
|
|
45
|
+
* paced by counting them - which is how the vendor's own app paces it, and is the only thing
|
|
46
|
+
* that distinguishes one phase's packets from another's.
|
|
47
|
+
*
|
|
48
|
+
* A recording is thirty-four seconds at 128 Hz. Nothing is reported until all of it has
|
|
49
|
+
* arrived: a partial ECG that looked whole would be worse than none, and the count is what
|
|
50
|
+
* says it is whole.
|
|
51
|
+
*/
|
|
52
|
+
class VerovalEcgTransfer {
|
|
53
|
+
phase = "mode";
|
|
54
|
+
packets = 0;
|
|
55
|
+
segment = 0;
|
|
56
|
+
recording = [];
|
|
57
|
+
constructor(params) {
|
|
58
|
+
this.params = params;
|
|
59
|
+
}
|
|
60
|
+
initialCommands = () => [packet(this.params.write, DOWNLOAD_MODE)];
|
|
61
|
+
nextCommand = frame => {
|
|
62
|
+
if (this.phase === "done") {
|
|
63
|
+
return undefined;
|
|
64
|
+
}
|
|
65
|
+
if (this.phase === "mode") {
|
|
66
|
+
this.phase = "header";
|
|
67
|
+
this.packets = 0;
|
|
68
|
+
return [packet(this.params.write, DOWNLOAD_HEADER)];
|
|
69
|
+
}
|
|
70
|
+
this.packets += 1;
|
|
71
|
+
if (this.phase === "header") {
|
|
72
|
+
return this.packets < HEADER_PACKETS ? undefined : this.requestSegment(0);
|
|
73
|
+
}
|
|
74
|
+
this.recording.push(...frame.slice(PAYLOAD_FROM, PAYLOAD_FROM + PAYLOAD_BYTES));
|
|
75
|
+
return this.packets < PACKETS_PER_SEGMENT ? undefined : this.finishSegment();
|
|
76
|
+
};
|
|
77
|
+
finishSegment = () => {
|
|
78
|
+
this.segment += 1;
|
|
79
|
+
if (this.segment < SEGMENTS) {
|
|
80
|
+
return this.requestSegment(this.segment);
|
|
81
|
+
}
|
|
82
|
+
this.phase = "done";
|
|
83
|
+
this.params.onRecording(this.recording);
|
|
84
|
+
return undefined;
|
|
85
|
+
};
|
|
86
|
+
requestSegment = segment => {
|
|
87
|
+
this.phase = "raw";
|
|
88
|
+
this.packets = 0;
|
|
89
|
+
this.segment = segment;
|
|
90
|
+
return [packet(this.params.write, DOWNLOAD_RAW, segmentParameters(segment))];
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
exports.VerovalEcgTransfer = VerovalEcgTransfer;
|
|
94
|
+
//# sourceMappingURL=veroval.ecg-transfer.js.map
|
package/lib/commonjs/modules/bt-management/services/devices/veroval/veroval.ecg-transfer.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["PACKET_BYTES","GROUP_INDEX","COMMAND_INDEX","PARAMETER_INDEX","DOWNLOAD_GROUP","DOWNLOAD_MODE","DOWNLOAD_HEADER","DOWNLOAD_RAW","PAYLOAD_FROM","PAYLOAD_BYTES","HEADER_PACKETS","PACKETS_PER_SEGMENT","SEGMENTS","BYTE_MASK","BYTE_BITS","toHex","byte","toString","padStart","packet","write","command","parameters","bytes","Array","fill","forEach","value","index","frame","map","segmentParameters","segment","VerovalEcgTransfer","phase","packets","recording","constructor","params","initialCommands","nextCommand","undefined","requestSegment","push","slice","finishSegment","onRecording","exports"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/veroval/veroval.ecg-transfer.ts"],"mappings":";;;;;;AAGA;AACA,MAAMA,YAAY,GAAG,EAAE;AACvB,MAAMC,WAAW,GAAG,CAAC;AACrB,MAAMC,aAAa,GAAG,CAAC;AACvB,MAAMC,eAAe,GAAG,CAAC;AAEzB,MAAMC,cAAc,GAAG,CAAC;AACxB,MAAMC,aAAa,GAAG,CAAC;AACvB,MAAMC,eAAe,GAAG,CAAC;AACzB,MAAMC,YAAY,GAAG,CAAC;;AAEtB;AACA,MAAMC,YAAY,GAAG,CAAC;AACtB,MAAMC,aAAa,GAAG,EAAE;AACxB,MAAMC,cAAc,GAAG,CAAC;AACxB,MAAMC,mBAAmB,GAAG,EAAE;AAC9B,MAAMC,QAAQ,GAAG,EAAE;AAEnB,MAAMC,SAAS,GAAG,IAAI;AACtB,MAAMC,SAAS,GAAG,CAAC;AAEnB,MAAMC,KAAK,GAAIC,IAAY,IACzB,CAACA,IAAI,GAAGH,SAAS,EAAEI,QAAQ,CAAC,EAAE,CAAC,CAACC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC;AAElD,MAAMC,MAAM,GAAGA,CACbC,KAAmC,EACnCC,OAAe,EACfC,UAA6B,GAAG,EAAE,KAChB;EAClB,MAAMC,KAAK,GAAG,IAAIC,KAAK,CAASxB,YAAY,CAAC,CAACyB,IAAI,CAAC,CAAC,CAAC;EAErDF,KAAK,CAACtB,WAAW,CAAC,GAAGG,cAAc;EACnCmB,KAAK,CAACrB,aAAa,CAAC,GAAGmB,OAAO;EAC9BC,UAAU,CAACI,OAAO,CAAC,CAACC,KAAK,EAAEC,KAAK,KAAK;IACnCL,KAAK,CAACpB,eAAe,GAAGyB,KAAK,CAAC,GAAGD,KAAK;EACxC,CAAC,CAAC;EAEF,OAAO;IAAE,GAAGP,KAAK;IAAES,KAAK,EAAEN,KAAK,CAACO,GAAG,CAACf,KAAK;EAAE,CAAC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AC0B,OAAO,GAAGxB,mBAAmB,GACrC8B,SAAS,GACT,IAAI,CAACI,aAAa,CAAC,CAAC;EAC1B,CAAC;EAEOA,aAAa,GAAGA,CAAA,KAA4C;IAClE,IAAI,CAACb,OAAO,IAAI,CAAC;IAEjB,IAAI,IAAI,CAACA,OAAO,GAAGpB,QAAQ,EAAE;MAC3B,OAAO,IAAI,CAAC8B,cAAc,CAAC,IAAI,CAACV,OAAO,CAAC;IAC1C;IAEA,IAAI,CAACE,KAAK,GAAG,MAAM;IACnB,IAAI,CAACI,MAAM,CAACQ,WAAW,CAAC,IAAI,CAACV,SAAS,CAAC;IAEvC,OAAOK,SAAS;EAClB,CAAC;EAEOC,cAAc,GAAIV,OAAe,IAA+B;IACtE,IAAI,CAACE,KAAK,GAAG,KAAK;IAClB,IAAI,CAACC,OAAO,GAAG,CAAC;IAChB,IAAI,CAACH,OAAO,GAAGA,OAAO;IAEtB,OAAO,CACLb,MAAM,CAAC,IAAI,CAACmB,MAAM,CAAClB,KAAK,EAAEb,YAAY,EAAEwB,iBAAiB,CAACC,OAAO,CAAC,CAAC,CACpE;EACH,CAAC;AACH;AAACe,OAAA,CAAAd,kBAAA,GAAAA,kBAAA","ignoreList":[]}
|
|
@@ -24,6 +24,8 @@ let IntegratedDevices = exports.IntegratedDevices = /*#__PURE__*/function (Integ
|
|
|
24
24
|
IntegratedDevices["S5"] = "Le S5";
|
|
25
25
|
IntegratedDevices["ALIVE_COR"] = "alivecor";
|
|
26
26
|
IntegratedDevices["BGM"] = "BGM";
|
|
27
|
+
IntegratedDevices["VEROVAL_DUO_CONTROL"] = "Veroval duo control";
|
|
28
|
+
IntegratedDevices["VEROVAL_ECG"] = "Veroval ECG";
|
|
27
29
|
return IntegratedDevices;
|
|
28
30
|
}({});
|
|
29
31
|
//# sourceMappingURL=integrated-devices.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["IntegratedDevices","exports"],"sourceRoot":"../../../../../src","sources":["modules/bt-management/types/integrated-devices.ts"],"mappings":";;;;;;IAAYA,iBAAiB,GAAAC,OAAA,CAAAD,iBAAA,0BAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAA,OAAjBA,iBAAiB;AAAA","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["IntegratedDevices","exports"],"sourceRoot":"../../../../../src","sources":["modules/bt-management/types/integrated-devices.ts"],"mappings":";;;;;;IAAYA,iBAAiB,GAAAC,OAAA,CAAAD,iBAAA,0BAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAA,OAAjBA,iBAAiB;AAAA","ignoreList":[]}
|
|
@@ -6,7 +6,28 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.createCustomFieldParser = void 0;
|
|
7
7
|
var _decodeMedicalFloat = require("./decode-medical-float.js");
|
|
8
8
|
const HEX_ONLY = /^[0-9a-f]+$/;
|
|
9
|
+
const ASCII_ZERO = 0x30;
|
|
10
|
+
const ASCII_NINE = 0x39;
|
|
11
|
+
const HEX_BYTE = /../g;
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Reads bytes that are decimal digits written as characters, not a number.
|
|
15
|
+
*
|
|
16
|
+
* A byte outside "0"-"9" makes the whole field undefined rather than being skipped: these
|
|
17
|
+
* records are fixed width and a non-digit means the field was not what the declaration
|
|
18
|
+
* says it is, so decoding the rest of it would report a number built from part of a value.
|
|
19
|
+
*/
|
|
20
|
+
const fromAsciiDigits = hex => {
|
|
21
|
+
const codes = (hex.match(HEX_BYTE) ?? []).map(byte => parseInt(byte, 16));
|
|
22
|
+
if (codes.length === 0 || codes.some(code => code < ASCII_ZERO || code > ASCII_NINE)) {
|
|
23
|
+
return undefined;
|
|
24
|
+
}
|
|
25
|
+
return Number(codes.map(code => code - ASCII_ZERO).join(""));
|
|
26
|
+
};
|
|
9
27
|
const toRaw = (hex, field) => {
|
|
28
|
+
if (field.encoding === "ascii") {
|
|
29
|
+
return fromAsciiDigits(hex);
|
|
30
|
+
}
|
|
10
31
|
const raw = parseInt(hex, 16);
|
|
11
32
|
const bits = hex.length * 4;
|
|
12
33
|
if (field.encoding === "int") {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_decodeMedicalFloat","require","HEX_ONLY","
|
|
1
|
+
{"version":3,"names":["_decodeMedicalFloat","require","HEX_ONLY","ASCII_ZERO","ASCII_NINE","HEX_BYTE","fromAsciiDigits","hex","codes","match","map","byte","parseInt","length","some","code","undefined","Number","join","toRaw","field","encoding","raw","bits","sign","decodeMedicalFloat","createCustomFieldParser","assembledHex","toLowerCase","byteIndexes","test","isFinite","value","scale","offset","decimals","factor","Math","round","exports"],"sourceRoot":"../../../../../src","sources":["modules/bt-management/utils/create-custom-field-parser.ts"],"mappings":";;;;;;AAEA,IAAAA,mBAAA,GAAAC,OAAA;AAEA,MAAMC,QAAQ,GAAG,aAAa;AAE9B,MAAMC,UAAU,GAAG,IAAI;AACvB,MAAMC,UAAU,GAAG,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KAAK,OAAO,EAAE;IAC9B,OAAO,IAAAI,sCAAkB,EAACH,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC;EACvC;EAEA,OAAOA,GAAG;AACZ,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMI,uBAAuB,GACjCN,KAA0B,IAC1BO,YAAoB,IAAyB;EAC5C,MAAMpB,GAAG,GAAG,CAACoB,YAAY,IAAI,EAAE,EAAEC,WAAW,CAAC,CAAC;EAE9C,IACErB,GAAG,CAACM,MAAM,KAAKO,KAAK,CAACS,WAAW,CAAChB,MAAM,GAAG,CAAC,IAC3C,CAACX,QAAQ,CAAC4B,IAAI,CAACvB,GAAG,CAAC,EACnB;IACA,OAAOS,SAAS;EAClB;EAEA,MAAMM,GAAG,GAAGH,KAAK,CAACZ,GAAG,EAAEa,KAAK,CAAC;EAE7B,IAAIE,GAAG,KAAKN,SAAS,IAAI,CAACC,MAAM,CAACc,QAAQ,CAACT,GAAG,CAAC,EAAE;IAC9C,OAAON,SAAS;EAClB;EAEA,MAAMgB,KAAK,GAAGV,GAAG,GAAGF,KAAK,CAACa,KAAK,GAAGb,KAAK,CAACc,MAAM;EAE9C,IAAI,CAACjB,MAAM,CAACc,QAAQ,CAACC,KAAK,CAAC,EAAE;IAC3B,OAAOhB,SAAS;EAClB;EAEA,IAAII,KAAK,CAACe,QAAQ,KAAKnB,SAAS,EAAE;IAChC,OAAOgB,KAAK;EACd;EAEA,MAAMI,MAAM,GAAG,EAAE,IAAIhB,KAAK,CAACe,QAAQ;EAEnC,OAAOE,IAAI,CAACC,KAAK,CAACN,KAAK,GAAGI,MAAM,CAAC,GAAGA,MAAM;AAC5C,CAAC;AAACG,OAAA,CAAAb,uBAAA,GAAAA,uBAAA","ignoreList":[]}
|
|
@@ -4,10 +4,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.parseMeasurement = void 0;
|
|
7
|
-
|
|
7
|
+
/**
|
|
8
|
+
* @param byteOffset added to every declared index, for a frame that repeats one record.
|
|
9
|
+
*/
|
|
10
|
+
const parseMeasurement = (measurementInHex, parsingCase, byteOffset = 0) => {
|
|
8
11
|
const parserDefinitions = parsingCase.parseDefinitions;
|
|
9
12
|
const result = parserDefinitions.reduce((acc, parserDefinition) => {
|
|
10
|
-
const parsingValue = getFullValueForMeasurementProperty(measurementInHex, parserDefinition);
|
|
13
|
+
const parsingValue = getFullValueForMeasurementProperty(measurementInHex, parserDefinition, byteOffset);
|
|
11
14
|
if (parserDefinition.customParserDefinition) {
|
|
12
15
|
acc[parserDefinition.name] = parserDefinition.customParserDefinition(parsingValue);
|
|
13
16
|
} else {
|
|
@@ -23,15 +26,15 @@ const parseMeasurement = (measurementInHex, parsingCase) => {
|
|
|
23
26
|
return measurement;
|
|
24
27
|
};
|
|
25
28
|
|
|
26
|
-
/** Example: We received message ["1A","02", "00", "50"]. Value for weight is on indexes 2,3. Which means we need to combine 2nd and 3rd indexes to get result
|
|
27
|
-
* This method will combine them and return string "0050".
|
|
28
|
-
* Indexes should be written in ParseDeinition
|
|
29
|
+
/** Example: We received message ["1A","02", "00", "50"]. Value for weight is on indexes 2,3. Which means we need to combine 2nd and 3rd indexes to get result
|
|
30
|
+
* This method will combine them and return string "0050".
|
|
31
|
+
* Indexes should be written in ParseDeinition
|
|
29
32
|
*/
|
|
30
33
|
exports.parseMeasurement = parseMeasurement;
|
|
31
|
-
const getFullValueForMeasurementProperty = (messageInHex, parseDefinition) => {
|
|
34
|
+
const getFullValueForMeasurementProperty = (messageInHex, parseDefinition, byteOffset) => {
|
|
32
35
|
let valuesInString = "";
|
|
33
36
|
for (let i = 0; i < parseDefinition.byteIndexes.length; i++) {
|
|
34
|
-
valuesInString += messageInHex[parseDefinition.byteIndexes[i]
|
|
37
|
+
valuesInString += messageInHex[(parseDefinition.byteIndexes[i] ?? 0) + byteOffset];
|
|
35
38
|
}
|
|
36
39
|
return valuesInString;
|
|
37
40
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["parseMeasurement","measurementInHex","parsingCase","parserDefinitions","parseDefinitions","result","reduce","acc","parserDefinition","parsingValue","getFullValueForMeasurementProperty","customParserDefinition","name","parseInt","measurement","measurementTypeKey","caseType","exports","messageInHex","parseDefinition","valuesInString","i","byteIndexes","length"],"sourceRoot":"../../../../../src","sources":["modules/bt-management/utils/parse-measurement.ts"],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"names":["parseMeasurement","measurementInHex","parsingCase","byteOffset","parserDefinitions","parseDefinitions","result","reduce","acc","parserDefinition","parsingValue","getFullValueForMeasurementProperty","customParserDefinition","name","parseInt","measurement","measurementTypeKey","caseType","exports","messageInHex","parseDefinition","valuesInString","i","byteIndexes","length"],"sourceRoot":"../../../../../src","sources":["modules/bt-management/utils/parse-measurement.ts"],"mappings":";;;;;;AAMA;AACA;AACA;AACO,MAAMA,gBAAgB,GAAGA,CAC9BC,gBAA0B,EAC1BC,WAAwB,EACxBC,UAAU,GAAG,CAAC,KAC2B;EACzC,MAAMC,iBAAiB,GAAGF,WAAW,CAACG,gBAAgB;EAEtD,MAAMC,MAAM,GAAGF,iBAAiB,CAACG,MAAM,CACrC,CAACC,GAAG,EAAEC,gBAAgB,KAAK;IACzB,MAAMC,YAAY,GAAGC,kCAAkC,CACrDV,gBAAgB,EAChBQ,gBAAgB,EAChBN,UACF,CAAC;IAED,IAAIM,gBAAgB,CAACG,sBAAsB,EAAE;MAC3CJ,GAAG,CAACC,gBAAgB,CAACI,IAAI,CAAC,GACxBJ,gBAAgB,CAACG,sBAAsB,CAACF,YAAY,CAAC;IACzD,CAAC,MAAM;MACLF,GAAG,CAACC,gBAAgB,CAACI,IAAI,CAAC,GAAGC,QAAQ,CAACJ,YAAY,EAAE,EAAE,CAAC;IACzD;IAEA,OAAOF,GAAG;EACZ,CAAC;EACD;EACA,CAAC,CACH,CAAC;EAED,MAAMO,WAAW,GAAGT,MAA8C;EAElES,WAAW,CAACC,kBAAkB,GAAGd,WAAW,CAACc,kBAAmB;EAChED,WAAW,CAACE,QAAQ,GAAGf,WAAW,CAACe,QAAQ;EAE3C,OAAOF,WAAW;AACpB,CAAC;;AAED;AACA;AACA;AACA;AAHAG,OAAA,CAAAlB,gBAAA,GAAAA,gBAAA;AAIA,MAAMW,kCAAkC,GAAGA,CACzCQ,YAAsB,EACtBC,eAAiC,EACjCjB,UAAkB,KACP;EACX,IAAIkB,cAAc,GAAG,EAAE;EAEvB,KAAK,IAAIC,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGF,eAAe,CAACG,WAAW,CAACC,MAAM,EAAEF,CAAC,EAAE,EAAE;IAC3DD,cAAc,IACZF,YAAY,CAAC,CAACC,eAAe,CAACG,WAAW,CAACD,CAAC,CAAC,IAAI,CAAC,IAAInB,UAAU,CAAC;EACpE;EAEA,OAAOkB,cAAc;AACvB,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.rejectCustomReading = exports.discardedReadingError = void 0;
|
|
7
|
+
/** The reading that was thrown away, and why, so a decoding fault can be diagnosed. */
|
|
8
|
+
const discardedReadingError = (deviceId, reason, parsedData) => new Error(`Custom device "${deviceId}": ${reason}. The reading was discarded (decoded ${JSON.stringify(parsedData)}).`);
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Why a decoded property is not a reading, or nothing when it is.
|
|
12
|
+
*
|
|
13
|
+
* The checks are the last thing between a misread frame and a clinical record, so each one
|
|
14
|
+
* says what was wrong rather than returning a bare false: a property the measurement does
|
|
15
|
+
* not have is a declaration mistake, a value that is not a finite number is a frame shorter
|
|
16
|
+
* than the declaration expects, and a value outside the envelope is a decoding fault
|
|
17
|
+
* wearing the shape of a reading.
|
|
18
|
+
*/
|
|
19
|
+
exports.discardedReadingError = discardedReadingError;
|
|
20
|
+
const rejectCustomReading = (fields, measurementTypeKey, name, value) => {
|
|
21
|
+
const field = fields.get(`${measurementTypeKey}:${name}`);
|
|
22
|
+
if (!field) {
|
|
23
|
+
return `decoded "${name}", which is not declared for ${measurementTypeKey}`;
|
|
24
|
+
}
|
|
25
|
+
if (typeof value !== "number" || !Number.isFinite(value)) {
|
|
26
|
+
return `could not decode ${name}; the frame was shorter than the declaration expects`;
|
|
27
|
+
}
|
|
28
|
+
if (value < field.min || value > field.max) {
|
|
29
|
+
return `decoded ${name} = ${value} ${field.unit}, outside the accepted range ${field.min}-${field.max} ${field.unit}`;
|
|
30
|
+
}
|
|
31
|
+
return undefined;
|
|
32
|
+
};
|
|
33
|
+
exports.rejectCustomReading = rejectCustomReading;
|
|
34
|
+
//# sourceMappingURL=reject-custom-reading.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["discardedReadingError","deviceId","reason","parsedData","Error","JSON","stringify","exports","rejectCustomReading","fields","measurementTypeKey","name","value","field","get","Number","isFinite","min","max","unit","undefined"],"sourceRoot":"../../../../../src","sources":["modules/bt-management/utils/reject-custom-reading.ts"],"mappings":";;;;;;AAEA;AACA,MAAMA,qBAAqB,GAAGA,CAC5BC,QAAgB,EAChBC,MAAc,EACdC,UAAmB,KAEnB,IAAIC,KAAK,CACP,kBAAkBH,QAAQ,MAAMC,MAAM,wCAAwCG,IAAI,CAACC,SAAS,CAACH,UAAU,CAAC,IAC1G,CAAC;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AARAI,OAAA,CAAAP,qBAAA,GAAAA,qBAAA;AASA,MAAMQ,mBAAmB,GAAGA,CAC1BC,MAAgD,EAChDC,kBAA0B,EAC1BC,IAAY,EACZC,KAAc,KACS;EACvB,MAAMC,KAAK,GAAGJ,MAAM,CAACK,GAAG,CAAC,GAAGJ,kBAAkB,IAAIC,IAAI,EAAE,CAAC;EAEzD,IAAI,CAACE,KAAK,EAAE;IACV,OAAO,YAAYF,IAAI,gCAAgCD,kBAAkB,EAAE;EAC7E;EAEA,IAAI,OAAOE,KAAK,KAAK,QAAQ,IAAI,CAACG,MAAM,CAACC,QAAQ,CAACJ,KAAK,CAAC,EAAE;IACxD,OAAO,oBAAoBD,IAAI,sDAAsD;EACvF;EAEA,IAAIC,KAAK,GAAGC,KAAK,CAACI,GAAG,IAAIL,KAAK,GAAGC,KAAK,CAACK,GAAG,EAAE;IAC1C,OAAO,WAAWP,IAAI,MAAMC,KAAK,IAAIC,KAAK,CAACM,IAAI,gCAAgCN,KAAK,CAACI,GAAG,IAAIJ,KAAK,CAACK,GAAG,IAAIL,KAAK,CAACM,IAAI,EAAE;EACvH;EAEA,OAAOC,SAAS;AAClB,CAAC;AAACb,OAAA,CAAAC,mBAAA,GAAAA,mBAAA","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,QAA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BaseUrl","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":[]}
|
|
@@ -36,6 +36,10 @@ export * from "./services/devices/custom/custom.device.js";
|
|
|
36
36
|
export * from "./services/bt-manager.js";
|
|
37
37
|
export * from "./services/custom/define-custom-device.js";
|
|
38
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";
|
|
39
43
|
export * from "./services/devices/lepu/lepu.transports.js";
|
|
40
44
|
export * from "./services/devices/aoj/aoj.thermometers.js";
|
|
41
45
|
export * from "./services/devices/viatom/viatom.bp-monitors.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,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,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":[]}
|
|
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":[]}
|
|
@@ -10,7 +10,6 @@ export class BTManager {
|
|
|
10
10
|
static MAX_DEVICES = 15; // Safety limit to prevent unbounded growth
|
|
11
11
|
devices = new Map();
|
|
12
12
|
eventSubscriptions = [];
|
|
13
|
-
lastScanTimestamp = 0;
|
|
14
13
|
constructor(bleManager, acceptedDevices) {
|
|
15
14
|
this.bleManager = bleManager;
|
|
16
15
|
this.acceptedDevices = acceptedDevices;
|
|
@@ -25,7 +24,6 @@ export class BTManager {
|
|
|
25
24
|
this.stateChangeListener.remove();
|
|
26
25
|
this.stateChangeListener = undefined;
|
|
27
26
|
}
|
|
28
|
-
this.lastScanTimestamp = 0;
|
|
29
27
|
|
|
30
28
|
// Then clear all callbacks
|
|
31
29
|
this.onErrorCallback = undefined;
|
|
@@ -39,12 +37,6 @@ export class BTManager {
|
|
|
39
37
|
this.deviceCreator.destroy();
|
|
40
38
|
};
|
|
41
39
|
startScan = () => {
|
|
42
|
-
if (Date.now() - this.lastScanTimestamp < 60_000) {
|
|
43
|
-
sentryLogger("warning", "BT_MANAGER: startScan called too frequently, skipping (within 1 min window)");
|
|
44
|
-
return;
|
|
45
|
-
}
|
|
46
|
-
this.lastScanTimestamp = Date.now();
|
|
47
|
-
|
|
48
40
|
// Remove previous state change listener to prevent accumulation
|
|
49
41
|
if (this.stateChangeListener) {
|
|
50
42
|
this.stateChangeListener.remove();
|
|
@@ -67,12 +59,14 @@ export class BTManager {
|
|
|
67
59
|
}
|
|
68
60
|
sentryLogger("warning", "BT_MANAGER: State is not PoweredOn, sending intent to enable Bluetooth");
|
|
69
61
|
|
|
70
|
-
// Only send intent on Android
|
|
62
|
+
// Only send intent on Android — iOS has no programmatic way to power on
|
|
63
|
+
// Bluetooth, and `bleManager.enable()` there returns an unsupported-op
|
|
64
|
+
// promise that would surface as an unhandled rejection.
|
|
71
65
|
if (Platform.OS === "android") {
|
|
72
66
|
Linking.sendIntent("android.bluetooth.adapter.action.REQUEST_ENABLE");
|
|
73
|
-
|
|
74
|
-
this.bleManager.enable();
|
|
67
|
+
return;
|
|
75
68
|
}
|
|
69
|
+
sentryLogger("warning", "BT_MANAGER: Bluetooth is off; on iOS the user must enable it from Settings");
|
|
76
70
|
}, true);
|
|
77
71
|
|
|
78
72
|
// Track subscription for proper cleanup
|
|
@@ -131,13 +125,21 @@ export class BTManager {
|
|
|
131
125
|
});
|
|
132
126
|
return;
|
|
133
127
|
}
|
|
134
|
-
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* On iOS the advertised name arrives as `localName` while `name` stays null until the
|
|
131
|
+
* device is connected. Dropping every ad without a `name` therefore hides real BC401
|
|
132
|
+
* and other Contec hardware from the scan list. Fall back to `localName` so the same
|
|
133
|
+
* matcher runs against the string the peripheral actually advertised.
|
|
134
|
+
*/
|
|
135
|
+
const advertisedName = device?.name?.trim() || device?.localName?.trim() || "";
|
|
136
|
+
if (!device || !advertisedName) {
|
|
135
137
|
return;
|
|
136
138
|
}
|
|
137
139
|
if (this.devices.has(device.id)) {
|
|
138
140
|
return;
|
|
139
141
|
}
|
|
140
|
-
const deviceName = this.deviceCreator.getDeviceName(
|
|
142
|
+
const deviceName = this.deviceCreator.getDeviceName(advertisedName);
|
|
141
143
|
if (!deviceName) {
|
|
142
144
|
return;
|
|
143
145
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Linking","Platform","ScanMode","State","slog","sentryLogger","DeviceCreator","BTManager","MAX_DEVICES","devices","Map","eventSubscriptions","
|
|
1
|
+
{"version":3,"names":["Linking","Platform","ScanMode","State","slog","sentryLogger","DeviceCreator","BTManager","MAX_DEVICES","devices","Map","eventSubscriptions","constructor","bleManager","acceptedDevices","deviceCreator","destroy","stopScan","stateChangeListener","remove","undefined","onErrorCallback","onDeviceFoundCallback","onResultCallback","onDeviceStatusChangedCallback","forEach","device","clear","startScan","onStateChange","state","PoweredOn","index","indexOf","splice","startDeviceScan","scanMode","Balanced","onScanResult","OS","sendIntent","push","stopDeviceScan","sub","onDeviceFound","callback","onError","onDeviceStatusChanged","onResult","error","Error","message","advertisedName","name","trim","localName","has","id","deviceName","getDeviceName","size","deviceId","currentSize","deviceClass","createDevice","bind","onDeviceDisconnected","removeDeviceFromFoundedDevices","set","get","delete"],"sourceRoot":"../../../../../src","sources":["modules/bt-management/services/bt-manager.ts"],"mappings":";;AAAA;AACA,SAASA,OAAO,EAAEC,QAAQ,QAAQ,cAAc;AAChD,SAIEC,QAAQ,EACRC,KAAK,QAEA,sBAAsB;AAE7B,SAASC,IAAI,QAAQ,wBAAe;AACpC,SAASC,YAAY,QAAQ,sCAAmC;AAOhE,SAASC,aAAa,QAAQ,qBAAkB;AAGhD,OAAO,MAAMC,SAAS,CAAsC;EAC1D,OAAwBC,WAAW,GAAG,EAAE,CAAC,CAAC;EAClCC,OAAO,GAAG,IAAIC,GAAG,CAA0C,CAAC;EAG5DC,kBAAkB,GAAmB,EAAE;EAI/CC,WAAWA,CACQC,UAAsB,EACtBC,eAAkB,EACnC;IAAA,KAFiBD,UAAsB,GAAtBA,UAAsB;IAAA,KACtBC,eAAkB,GAAlBA,eAAkB;IAEnC,IAAI,CAACC,aAAa,GAAG,IAAIT,aAAa,CAAC,IAAI,CAACQ,eAAe,CAAC;EAC9D;EAEOE,OAAO,GAAGA,CAAA,KAAM;IACrBX,YAAY,CAAC,MAAM,EAAE,kCAAkC,CAAC;IAExD,IAAI,CAACY,QAAQ,C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AAC,CAAC;MACFjD,IAAI,CAAC6C,KAAK,EAAE,mCAAmC,EAAE;QAC/CA,KAAK;QACLY,QAAQ,EAAEnC,MAAM,EAAE+B,EAAE;QACpBC,UAAU,EAAEhC,MAAM,EAAE2B;MACtB,CAAC,CAAC;IACJ;EACF,CAAC;EAEOc,8BAA8B,GAAIN,QAAgB,IAAK;IAC7DxD,YAAY,CACV,MAAM,EACN,2EAA2E,EAC3E;MACEwD,QAAQ;MACRH,UAAU,EAAE,IAAI,CAACjD,OAAO,CAAC4D,GAAG,CAACR,QAAQ,CAAC,EAAEnC,MAAM,EAAE2B;IAClD,CACF,CAAC;IACD,IAAI,CAAC5C,OAAO,CAAC6D,MAAM,CAACT,QAAQ,CAAC;EAC/B,CAAC;AACH","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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AASW,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":[]}
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
import { measurementFieldCatalog } from "../../constants/measurement-field-catalog.js";
|
|
4
4
|
import { CaseType } from "../../types/case-type.js";
|
|
5
5
|
import { assertRequiredFields, compileFields } from "./compile-case-fields.js";
|
|
6
|
+
import { assertCaseLength, assertRepeatedRecords } from "./compile-case-shape.js";
|
|
6
7
|
import { customDeviceError } from "./custom-device-error.js";
|
|
7
8
|
|
|
8
9
|
/**
|
|
@@ -58,6 +59,8 @@ const declaredMeasurements = (id, path, caseSpec, measurementTypeKey) => {
|
|
|
58
59
|
|
|
59
60
|
/** Validates one declared frame shape and turns it into a parsing case. */
|
|
60
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);
|
|
61
64
|
const caseType = CASE_TYPES[caseSpec.kind];
|
|
62
65
|
if (!caseType) {
|
|
63
66
|
throw customDeviceError(id, `${path}.kind`, `is "${String(caseSpec.kind)}"; expected ${Object.keys(CASE_TYPES).join(", ")}`);
|
|
@@ -99,7 +102,7 @@ export const compileCustomCase = (id, path, caseSpec, minLengthBytes, fields) =>
|
|
|
99
102
|
|
|
100
103
|
// Every field is checked first, so a misspelt property is reported as the typo it is
|
|
101
104
|
// rather than as the required property it failed to satisfy.
|
|
102
|
-
parseDefinitions.push(...compileFields(id, measurementPath, measurement.fields, key,
|
|
105
|
+
parseDefinitions.push(...compileFields(id, measurementPath, measurement.fields, key, repeatedRecords?.recordBytes ?? caseMinLengthBytes, fields, names));
|
|
103
106
|
assertRequiredFields(id, measurementPath, measurement.fields, key);
|
|
104
107
|
measurements.push({
|
|
105
108
|
measurementTypeKey: key,
|
|
@@ -112,7 +115,10 @@ export const compileCustomCase = (id, path, caseSpec, minLengthBytes, fields) =>
|
|
|
112
115
|
caseValue: String(caseSpec.selector ?? "").toLowerCase(),
|
|
113
116
|
parseDefinitions,
|
|
114
117
|
description: caseSpec.description,
|
|
115
|
-
measurements
|
|
118
|
+
measurements,
|
|
119
|
+
...(repeatedRecords ? {
|
|
120
|
+
repeatedRecords
|
|
121
|
+
} : {})
|
|
116
122
|
};
|
|
117
123
|
};
|
|
118
124
|
//# sourceMappingURL=compile-custom-case.js.map
|