@ovok/native 1.10.10 → 1.10.12
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 +20 -1
- package/lib/commonjs/modules/bt-device/constants/device-instruction-pdfs.js.map +1 -1
- package/lib/commonjs/modules/bt-device/constants/supported-device-catalog-and-medical-variants.js +47 -0
- package/lib/commonjs/modules/bt-device/constants/supported-device-catalog-and-medical-variants.js.map +1 -0
- package/lib/commonjs/modules/bt-device/constants/supported-device-catalog-cofoe-variants.js +119 -0
- package/lib/commonjs/modules/bt-device/constants/supported-device-catalog-cofoe-variants.js.map +1 -0
- package/lib/commonjs/modules/bt-device/constants/supported-device-catalog-standard-variants.js +6 -0
- package/lib/commonjs/modules/bt-device/constants/supported-device-catalog-standard-variants.js.map +1 -1
- package/lib/commonjs/modules/bt-device/constants/supported-device-catalog-taidoc-variants.js +173 -0
- package/lib/commonjs/modules/bt-device/constants/supported-device-catalog-taidoc-variants.js.map +1 -0
- package/lib/commonjs/modules/bt-device/constants/supported-device-catalog-transtek-a6-variants.js +107 -0
- package/lib/commonjs/modules/bt-device/constants/supported-device-catalog-transtek-a6-variants.js.map +1 -0
- package/lib/commonjs/modules/bt-device/constants/supported-device-catalog-variants.js +10 -0
- package/lib/commonjs/modules/bt-device/constants/supported-device-catalog-variants.js.map +1 -1
- package/lib/commonjs/modules/bt-device/constants/supported-device-catalog-yonker-variants.js +113 -0
- package/lib/commonjs/modules/bt-device/constants/supported-device-catalog-yonker-variants.js.map +1 -0
- package/lib/commonjs/modules/bt-device/constants/supported-devices.js +5 -37
- package/lib/commonjs/modules/bt-device/constants/supported-devices.js.map +1 -1
- package/lib/commonjs/modules/bt-management/constants/and-medical-device-variants.js +39 -0
- package/lib/commonjs/modules/bt-management/constants/and-medical-device-variants.js.map +1 -0
- package/lib/commonjs/modules/bt-management/constants/built-in-measurement-types.js +86 -0
- package/lib/commonjs/modules/bt-management/constants/built-in-measurement-types.js.map +1 -0
- package/lib/commonjs/modules/bt-management/constants/cofoe-device-variants.js +101 -0
- package/lib/commonjs/modules/bt-management/constants/cofoe-device-variants.js.map +1 -0
- package/lib/commonjs/modules/bt-management/constants/device-variants.js +6 -1
- package/lib/commonjs/modules/bt-management/constants/device-variants.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/constants/standard-device-variants.js +5 -0
- package/lib/commonjs/modules/bt-management/constants/standard-device-variants.js.map +1 -1
- package/lib/commonjs/modules/bt-management/constants/taidoc-device-variants.js +144 -0
- package/lib/commonjs/modules/bt-management/constants/taidoc-device-variants.js.map +1 -0
- package/lib/commonjs/modules/bt-management/constants/transtek-a6-device-variants.js +89 -0
- package/lib/commonjs/modules/bt-management/constants/transtek-a6-device-variants.js.map +1 -0
- package/lib/commonjs/modules/bt-management/constants/yonker-device-variants.js +93 -0
- package/lib/commonjs/modules/bt-management/constants/yonker-device-variants.js.map +1 -0
- package/lib/commonjs/modules/bt-management/core/resolve-device-key.js +6 -0
- package/lib/commonjs/modules/bt-management/core/resolve-device-key.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/background-sync/background-service-uuids.js +18 -0
- package/lib/commonjs/modules/bt-management/services/background-sync/background-service-uuids.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/device-classes.js +27 -1
- package/lib/commonjs/modules/bt-management/services/device-classes.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/device-creator.js +5 -3
- package/lib/commonjs/modules/bt-management/services/device-creator.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/devices/and-medical/and-medical.device.js +61 -0
- package/lib/commonjs/modules/bt-management/services/devices/and-medical/and-medical.device.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/devices/and-medical/and-medical.protocol.js +113 -0
- package/lib/commonjs/modules/bt-management/services/devices/and-medical/and-medical.protocol.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/devices/and-medical/and-medical.sequencer.js +77 -0
- package/lib/commonjs/modules/bt-management/services/devices/and-medical/and-medical.sequencer.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/devices/aoj/aoj-70b.device.js +1 -1
- package/lib/commonjs/modules/bt-management/services/devices/aoj/aoj-70b.device.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/devices/blood-glucose/blood-glucose.device.js +7 -25
- package/lib/commonjs/modules/bt-management/services/devices/blood-glucose/blood-glucose.device.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/devices/bt-data-processor.js +3 -2
- 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 +7 -2
- package/lib/commonjs/modules/bt-management/services/devices/bt-managed-device.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/devices/cofoe/cofoe-bp.sequencer.js +86 -0
- package/lib/commonjs/modules/bt-management/services/devices/cofoe/cofoe-bp.sequencer.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/devices/cofoe/cofoe-glucose.sequencer.js +155 -0
- package/lib/commonjs/modules/bt-management/services/devices/cofoe/cofoe-glucose.sequencer.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/devices/cofoe/cofoe-thermometer.sequencer.js +33 -0
- package/lib/commonjs/modules/bt-management/services/devices/cofoe/cofoe-thermometer.sequencer.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/devices/cofoe/cofoe.device.js +87 -0
- package/lib/commonjs/modules/bt-management/services/devices/cofoe/cofoe.device.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/devices/cofoe/cofoe.protocol.js +185 -0
- package/lib/commonjs/modules/bt-management/services/devices/cofoe/cofoe.protocol.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/devices/cofoe/cofoe.records.js +86 -0
- package/lib/commonjs/modules/bt-management/services/devices/cofoe/cofoe.records.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/devices/jumper/jumper.device.js +1 -1
- package/lib/commonjs/modules/bt-management/services/devices/jumper/jumper.device.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/devices/live-oximeter.sequencer.js +10 -6
- package/lib/commonjs/modules/bt-management/services/devices/live-oximeter.sequencer.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/devices/taidoc/taidoc.device.js +50 -0
- package/lib/commonjs/modules/bt-management/services/devices/taidoc/taidoc.device.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/devices/taidoc/taidoc.protocol.js +127 -0
- package/lib/commonjs/modules/bt-management/services/devices/taidoc/taidoc.protocol.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/devices/taidoc/taidoc.records.js +181 -0
- package/lib/commonjs/modules/bt-management/services/devices/taidoc/taidoc.records.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/devices/taidoc/taidoc.sequencer.js +139 -0
- package/lib/commonjs/modules/bt-management/services/devices/taidoc/taidoc.sequencer.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/devices/transtek/a6-scale.device.js +50 -0
- package/lib/commonjs/modules/bt-management/services/devices/transtek/a6-scale.device.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/devices/transtek/a6-scale.measurements.js +78 -0
- package/lib/commonjs/modules/bt-management/services/devices/transtek/a6-scale.measurements.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/devices/transtek/a6-scale.protocol.js +134 -0
- package/lib/commonjs/modules/bt-management/services/devices/transtek/a6-scale.protocol.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/devices/transtek/a6-scale.sequencer.js +102 -0
- package/lib/commonjs/modules/bt-management/services/devices/transtek/a6-scale.sequencer.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/devices/transtek/mambo-a5.device.js +51 -0
- package/lib/commonjs/modules/bt-management/services/devices/transtek/mambo-a5.device.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/devices/transtek/mambo-a5.measurements.js +48 -0
- package/lib/commonjs/modules/bt-management/services/devices/transtek/mambo-a5.measurements.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/devices/transtek/mambo-a5.protocol.js +181 -0
- package/lib/commonjs/modules/bt-management/services/devices/transtek/mambo-a5.protocol.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/devices/transtek/mambo-a5.sequencer.js +73 -0
- package/lib/commonjs/modules/bt-management/services/devices/transtek/mambo-a5.sequencer.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/devices/yonker/yonker.device.js +90 -0
- package/lib/commonjs/modules/bt-management/services/devices/yonker/yonker.device.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/devices/yonker/yonker.protocol.js +202 -0
- package/lib/commonjs/modules/bt-management/services/devices/yonker/yonker.protocol.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/devices/yonker/yonker.sequencer.js +137 -0
- package/lib/commonjs/modules/bt-management/services/devices/yonker/yonker.sequencer.js.map +1 -0
- package/lib/commonjs/modules/bt-management/types/clock-sync.js +2 -0
- package/lib/commonjs/modules/bt-management/types/clock-sync.js.map +1 -1
- package/lib/commonjs/modules/bt-management/types/integrated-devices.js +19 -0
- package/lib/commonjs/modules/bt-management/types/integrated-devices.js.map +1 -1
- package/lib/module/modules/bt-device/constants/device-instruction-pdfs.js +20 -1
- package/lib/module/modules/bt-device/constants/device-instruction-pdfs.js.map +1 -1
- package/lib/module/modules/bt-device/constants/supported-device-catalog-and-medical-variants.js +45 -0
- package/lib/module/modules/bt-device/constants/supported-device-catalog-and-medical-variants.js.map +1 -0
- package/lib/module/modules/bt-device/constants/supported-device-catalog-cofoe-variants.js +117 -0
- package/lib/module/modules/bt-device/constants/supported-device-catalog-cofoe-variants.js.map +1 -0
- package/lib/module/modules/bt-device/constants/supported-device-catalog-standard-variants.js +6 -0
- package/lib/module/modules/bt-device/constants/supported-device-catalog-standard-variants.js.map +1 -1
- package/lib/module/modules/bt-device/constants/supported-device-catalog-taidoc-variants.js +171 -0
- package/lib/module/modules/bt-device/constants/supported-device-catalog-taidoc-variants.js.map +1 -0
- package/lib/module/modules/bt-device/constants/supported-device-catalog-transtek-a6-variants.js +105 -0
- package/lib/module/modules/bt-device/constants/supported-device-catalog-transtek-a6-variants.js.map +1 -0
- package/lib/module/modules/bt-device/constants/supported-device-catalog-variants.js +10 -0
- package/lib/module/modules/bt-device/constants/supported-device-catalog-variants.js.map +1 -1
- package/lib/module/modules/bt-device/constants/supported-device-catalog-yonker-variants.js +111 -0
- package/lib/module/modules/bt-device/constants/supported-device-catalog-yonker-variants.js.map +1 -0
- package/lib/module/modules/bt-device/constants/supported-devices.js +5 -37
- package/lib/module/modules/bt-device/constants/supported-devices.js.map +1 -1
- package/lib/module/modules/bt-management/constants/and-medical-device-variants.js +37 -0
- package/lib/module/modules/bt-management/constants/and-medical-device-variants.js.map +1 -0
- package/lib/module/modules/bt-management/constants/built-in-measurement-types.js +84 -0
- package/lib/module/modules/bt-management/constants/built-in-measurement-types.js.map +1 -0
- package/lib/module/modules/bt-management/constants/cofoe-device-variants.js +99 -0
- package/lib/module/modules/bt-management/constants/cofoe-device-variants.js.map +1 -0
- package/lib/module/modules/bt-management/constants/device-variants.js +6 -1
- package/lib/module/modules/bt-management/constants/device-variants.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/constants/standard-device-variants.js +5 -0
- package/lib/module/modules/bt-management/constants/standard-device-variants.js.map +1 -1
- package/lib/module/modules/bt-management/constants/taidoc-device-variants.js +142 -0
- package/lib/module/modules/bt-management/constants/taidoc-device-variants.js.map +1 -0
- package/lib/module/modules/bt-management/constants/transtek-a6-device-variants.js +87 -0
- package/lib/module/modules/bt-management/constants/transtek-a6-device-variants.js.map +1 -0
- package/lib/module/modules/bt-management/constants/yonker-device-variants.js +91 -0
- package/lib/module/modules/bt-management/constants/yonker-device-variants.js.map +1 -0
- package/lib/module/modules/bt-management/core/resolve-device-key.js +6 -0
- package/lib/module/modules/bt-management/core/resolve-device-key.js.map +1 -1
- package/lib/module/modules/bt-management/services/background-sync/background-service-uuids.js +18 -0
- package/lib/module/modules/bt-management/services/background-sync/background-service-uuids.js.map +1 -1
- package/lib/module/modules/bt-management/services/device-classes.js +27 -1
- package/lib/module/modules/bt-management/services/device-classes.js.map +1 -1
- package/lib/module/modules/bt-management/services/device-creator.js +5 -3
- package/lib/module/modules/bt-management/services/device-creator.js.map +1 -1
- package/lib/module/modules/bt-management/services/devices/and-medical/and-medical.device.js +57 -0
- package/lib/module/modules/bt-management/services/devices/and-medical/and-medical.device.js.map +1 -0
- package/lib/module/modules/bt-management/services/devices/and-medical/and-medical.protocol.js +106 -0
- package/lib/module/modules/bt-management/services/devices/and-medical/and-medical.protocol.js.map +1 -0
- package/lib/module/modules/bt-management/services/devices/and-medical/and-medical.sequencer.js +74 -0
- package/lib/module/modules/bt-management/services/devices/and-medical/and-medical.sequencer.js.map +1 -0
- package/lib/module/modules/bt-management/services/devices/aoj/aoj-70b.device.js +2 -2
- package/lib/module/modules/bt-management/services/devices/aoj/aoj-70b.device.js.map +1 -1
- package/lib/module/modules/bt-management/services/devices/blood-glucose/blood-glucose.device.js +6 -24
- package/lib/module/modules/bt-management/services/devices/blood-glucose/blood-glucose.device.js.map +1 -1
- package/lib/module/modules/bt-management/services/devices/bt-data-processor.js +3 -2
- 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 +7 -2
- package/lib/module/modules/bt-management/services/devices/bt-managed-device.js.map +1 -1
- package/lib/module/modules/bt-management/services/devices/cofoe/cofoe-bp.sequencer.js +82 -0
- package/lib/module/modules/bt-management/services/devices/cofoe/cofoe-bp.sequencer.js.map +1 -0
- package/lib/module/modules/bt-management/services/devices/cofoe/cofoe-glucose.sequencer.js +148 -0
- package/lib/module/modules/bt-management/services/devices/cofoe/cofoe-glucose.sequencer.js.map +1 -0
- package/lib/module/modules/bt-management/services/devices/cofoe/cofoe-thermometer.sequencer.js +30 -0
- package/lib/module/modules/bt-management/services/devices/cofoe/cofoe-thermometer.sequencer.js.map +1 -0
- package/lib/module/modules/bt-management/services/devices/cofoe/cofoe.device.js +83 -0
- package/lib/module/modules/bt-management/services/devices/cofoe/cofoe.device.js.map +1 -0
- package/lib/module/modules/bt-management/services/devices/cofoe/cofoe.protocol.js +173 -0
- package/lib/module/modules/bt-management/services/devices/cofoe/cofoe.protocol.js.map +1 -0
- package/lib/module/modules/bt-management/services/devices/cofoe/cofoe.records.js +78 -0
- package/lib/module/modules/bt-management/services/devices/cofoe/cofoe.records.js.map +1 -0
- package/lib/module/modules/bt-management/services/devices/jumper/jumper.device.js +2 -2
- package/lib/module/modules/bt-management/services/devices/jumper/jumper.device.js.map +1 -1
- package/lib/module/modules/bt-management/services/devices/live-oximeter.sequencer.js +10 -6
- package/lib/module/modules/bt-management/services/devices/live-oximeter.sequencer.js.map +1 -1
- package/lib/module/modules/bt-management/services/devices/taidoc/taidoc.device.js +46 -0
- package/lib/module/modules/bt-management/services/devices/taidoc/taidoc.device.js.map +1 -0
- package/lib/module/modules/bt-management/services/devices/taidoc/taidoc.protocol.js +114 -0
- package/lib/module/modules/bt-management/services/devices/taidoc/taidoc.protocol.js.map +1 -0
- package/lib/module/modules/bt-management/services/devices/taidoc/taidoc.records.js +168 -0
- package/lib/module/modules/bt-management/services/devices/taidoc/taidoc.records.js.map +1 -0
- package/lib/module/modules/bt-management/services/devices/taidoc/taidoc.sequencer.js +136 -0
- package/lib/module/modules/bt-management/services/devices/taidoc/taidoc.sequencer.js.map +1 -0
- package/lib/module/modules/bt-management/services/devices/transtek/a6-scale.device.js +45 -0
- package/lib/module/modules/bt-management/services/devices/transtek/a6-scale.device.js.map +1 -0
- package/lib/module/modules/bt-management/services/devices/transtek/a6-scale.measurements.js +73 -0
- package/lib/module/modules/bt-management/services/devices/transtek/a6-scale.measurements.js.map +1 -0
- package/lib/module/modules/bt-management/services/devices/transtek/a6-scale.protocol.js +121 -0
- package/lib/module/modules/bt-management/services/devices/transtek/a6-scale.protocol.js.map +1 -0
- package/lib/module/modules/bt-management/services/devices/transtek/a6-scale.sequencer.js +97 -0
- package/lib/module/modules/bt-management/services/devices/transtek/a6-scale.sequencer.js.map +1 -0
- package/lib/module/modules/bt-management/services/devices/transtek/mambo-a5.device.js +46 -0
- package/lib/module/modules/bt-management/services/devices/transtek/mambo-a5.device.js.map +1 -0
- package/lib/module/modules/bt-management/services/devices/transtek/mambo-a5.measurements.js +43 -0
- package/lib/module/modules/bt-management/services/devices/transtek/mambo-a5.measurements.js.map +1 -0
- package/lib/module/modules/bt-management/services/devices/transtek/mambo-a5.protocol.js +174 -0
- package/lib/module/modules/bt-management/services/devices/transtek/mambo-a5.protocol.js.map +1 -0
- package/lib/module/modules/bt-management/services/devices/transtek/mambo-a5.sequencer.js +68 -0
- package/lib/module/modules/bt-management/services/devices/transtek/mambo-a5.sequencer.js.map +1 -0
- package/lib/module/modules/bt-management/services/devices/yonker/yonker.device.js +86 -0
- package/lib/module/modules/bt-management/services/devices/yonker/yonker.device.js.map +1 -0
- package/lib/module/modules/bt-management/services/devices/yonker/yonker.protocol.js +186 -0
- package/lib/module/modules/bt-management/services/devices/yonker/yonker.protocol.js.map +1 -0
- package/lib/module/modules/bt-management/services/devices/yonker/yonker.sequencer.js +133 -0
- package/lib/module/modules/bt-management/services/devices/yonker/yonker.sequencer.js.map +1 -0
- package/lib/module/modules/bt-management/types/clock-sync.js +2 -0
- package/lib/module/modules/bt-management/types/clock-sync.js.map +1 -1
- package/lib/module/modules/bt-management/types/device-measurement-map.js.map +1 -1
- package/lib/module/modules/bt-management/types/integrated-devices.js +19 -0
- package/lib/module/modules/bt-management/types/integrated-devices.js.map +1 -1
- package/lib/typescript/commonjs/src/modules/auth/hooks/use-sign-in.d.ts +1 -1
- package/lib/typescript/commonjs/src/modules/bt-device/constants/device-instruction-pdfs.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-device/constants/supported-device-catalog-and-medical-variants.d.ts +5 -0
- package/lib/typescript/commonjs/src/modules/bt-device/constants/supported-device-catalog-and-medical-variants.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-device/constants/supported-device-catalog-cofoe-variants.d.ts +5 -0
- package/lib/typescript/commonjs/src/modules/bt-device/constants/supported-device-catalog-cofoe-variants.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-device/constants/supported-device-catalog-standard-variants.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-device/constants/supported-device-catalog-taidoc-variants.d.ts +5 -0
- package/lib/typescript/commonjs/src/modules/bt-device/constants/supported-device-catalog-taidoc-variants.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-device/constants/supported-device-catalog-transtek-a6-variants.d.ts +5 -0
- package/lib/typescript/commonjs/src/modules/bt-device/constants/supported-device-catalog-transtek-a6-variants.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-device/constants/supported-device-catalog-variants.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-device/constants/supported-device-catalog-yonker-variants.d.ts +5 -0
- package/lib/typescript/commonjs/src/modules/bt-device/constants/supported-device-catalog-yonker-variants.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-device/constants/supported-devices.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/constants/and-medical-device-variants.d.ts +5 -0
- package/lib/typescript/commonjs/src/modules/bt-management/constants/and-medical-device-variants.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/constants/built-in-measurement-types.d.ts +9 -0
- package/lib/typescript/commonjs/src/modules/bt-management/constants/built-in-measurement-types.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/constants/cofoe-device-variants.d.ts +5 -0
- package/lib/typescript/commonjs/src/modules/bt-management/constants/cofoe-device-variants.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/constants/device-variants.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/constants/standard-device-variants.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/constants/taidoc-device-variants.d.ts +5 -0
- package/lib/typescript/commonjs/src/modules/bt-management/constants/taidoc-device-variants.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/constants/transtek-a6-device-variants.d.ts +5 -0
- package/lib/typescript/commonjs/src/modules/bt-management/constants/transtek-a6-device-variants.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/constants/yonker-device-variants.d.ts +5 -0
- package/lib/typescript/commonjs/src/modules/bt-management/constants/yonker-device-variants.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/core/resolve-device-key.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/background-sync/background-service-uuids.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/device-classes.d.ts +26 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/device-classes.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/and-medical/and-medical.device.d.ts +18 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/and-medical/and-medical.device.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/and-medical/and-medical.protocol.d.ts +30 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/and-medical/and-medical.protocol.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/and-medical/and-medical.sequencer.d.ts +26 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/and-medical/and-medical.sequencer.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/blood-glucose/blood-glucose.device.d.ts.map +1 -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 +4 -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/cofoe/cofoe-bp.sequencer.d.ts +32 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/cofoe/cofoe-bp.sequencer.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/cofoe/cofoe-glucose.sequencer.d.ts +46 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/cofoe/cofoe-glucose.sequencer.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/cofoe/cofoe-thermometer.sequencer.d.ts +15 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/cofoe/cofoe-thermometer.sequencer.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/cofoe/cofoe.device.d.ts +18 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/cofoe/cofoe.device.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/cofoe/cofoe.protocol.d.ts +75 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/cofoe/cofoe.protocol.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/cofoe/cofoe.records.d.ts +22 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/cofoe/cofoe.records.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/jumper/jumper.device.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/live-oximeter.sequencer.d.ts +6 -2
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/live-oximeter.sequencer.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/taidoc/taidoc.device.d.ts +16 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/taidoc/taidoc.device.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/taidoc/taidoc.protocol.d.ts +50 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/taidoc/taidoc.protocol.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/taidoc/taidoc.records.d.ts +40 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/taidoc/taidoc.records.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/taidoc/taidoc.sequencer.d.ts +38 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/taidoc/taidoc.sequencer.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/transtek/a6-scale.device.d.ts +16 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/transtek/a6-scale.device.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/transtek/a6-scale.measurements.d.ts +5 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/transtek/a6-scale.measurements.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/transtek/a6-scale.protocol.d.ts +22 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/transtek/a6-scale.protocol.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/transtek/a6-scale.sequencer.d.ts +28 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/transtek/a6-scale.sequencer.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/transtek/mambo-a5.device.d.ts +16 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/transtek/mambo-a5.device.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/transtek/mambo-a5.measurements.d.ts +6 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/transtek/mambo-a5.measurements.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/transtek/mambo-a5.protocol.d.ts +18 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/transtek/mambo-a5.protocol.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/transtek/mambo-a5.sequencer.d.ts +21 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/transtek/mambo-a5.sequencer.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/yonker/yonker.device.d.ts +21 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/yonker/yonker.device.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/yonker/yonker.protocol.d.ts +62 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/yonker/yonker.protocol.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/yonker/yonker.sequencer.d.ts +46 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/yonker/yonker.sequencer.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/types/clock-sync.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/types/device-data.d.ts +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/types/device-data.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/types/device-measurement-map.d.ts +20 -1
- 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/frame-reader.d.ts +2 -1
- package/lib/typescript/commonjs/src/modules/bt-management/types/frame-reader.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/types/integrated-devices.d.ts +20 -1
- package/lib/typescript/commonjs/src/modules/bt-management/types/integrated-devices.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/data-sync/utils/get-samples-from-health.d.ts +2 -2
- package/lib/typescript/module/src/modules/auth/hooks/use-sign-in.d.ts +1 -1
- package/lib/typescript/module/src/modules/bt-device/constants/device-instruction-pdfs.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-device/constants/supported-device-catalog-and-medical-variants.d.ts +5 -0
- package/lib/typescript/module/src/modules/bt-device/constants/supported-device-catalog-and-medical-variants.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-device/constants/supported-device-catalog-cofoe-variants.d.ts +5 -0
- package/lib/typescript/module/src/modules/bt-device/constants/supported-device-catalog-cofoe-variants.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-device/constants/supported-device-catalog-standard-variants.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-device/constants/supported-device-catalog-taidoc-variants.d.ts +5 -0
- package/lib/typescript/module/src/modules/bt-device/constants/supported-device-catalog-taidoc-variants.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-device/constants/supported-device-catalog-transtek-a6-variants.d.ts +5 -0
- package/lib/typescript/module/src/modules/bt-device/constants/supported-device-catalog-transtek-a6-variants.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-device/constants/supported-device-catalog-variants.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-device/constants/supported-device-catalog-yonker-variants.d.ts +5 -0
- package/lib/typescript/module/src/modules/bt-device/constants/supported-device-catalog-yonker-variants.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-device/constants/supported-devices.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/constants/and-medical-device-variants.d.ts +5 -0
- package/lib/typescript/module/src/modules/bt-management/constants/and-medical-device-variants.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/constants/built-in-measurement-types.d.ts +9 -0
- package/lib/typescript/module/src/modules/bt-management/constants/built-in-measurement-types.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/constants/cofoe-device-variants.d.ts +5 -0
- package/lib/typescript/module/src/modules/bt-management/constants/cofoe-device-variants.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/constants/device-variants.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/constants/standard-device-variants.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/constants/taidoc-device-variants.d.ts +5 -0
- package/lib/typescript/module/src/modules/bt-management/constants/taidoc-device-variants.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/constants/transtek-a6-device-variants.d.ts +5 -0
- package/lib/typescript/module/src/modules/bt-management/constants/transtek-a6-device-variants.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/constants/yonker-device-variants.d.ts +5 -0
- package/lib/typescript/module/src/modules/bt-management/constants/yonker-device-variants.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/core/resolve-device-key.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/background-sync/background-service-uuids.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/device-classes.d.ts +26 -0
- package/lib/typescript/module/src/modules/bt-management/services/device-classes.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/and-medical/and-medical.device.d.ts +18 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/and-medical/and-medical.device.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/and-medical/and-medical.protocol.d.ts +30 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/and-medical/and-medical.protocol.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/and-medical/and-medical.sequencer.d.ts +26 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/and-medical/and-medical.sequencer.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/blood-glucose/blood-glucose.device.d.ts.map +1 -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 +4 -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/cofoe/cofoe-bp.sequencer.d.ts +32 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/cofoe/cofoe-bp.sequencer.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/cofoe/cofoe-glucose.sequencer.d.ts +46 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/cofoe/cofoe-glucose.sequencer.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/cofoe/cofoe-thermometer.sequencer.d.ts +15 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/cofoe/cofoe-thermometer.sequencer.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/cofoe/cofoe.device.d.ts +18 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/cofoe/cofoe.device.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/cofoe/cofoe.protocol.d.ts +75 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/cofoe/cofoe.protocol.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/cofoe/cofoe.records.d.ts +22 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/cofoe/cofoe.records.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/jumper/jumper.device.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/devices/live-oximeter.sequencer.d.ts +6 -2
- package/lib/typescript/module/src/modules/bt-management/services/devices/live-oximeter.sequencer.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/devices/taidoc/taidoc.device.d.ts +16 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/taidoc/taidoc.device.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/taidoc/taidoc.protocol.d.ts +50 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/taidoc/taidoc.protocol.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/taidoc/taidoc.records.d.ts +40 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/taidoc/taidoc.records.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/taidoc/taidoc.sequencer.d.ts +38 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/taidoc/taidoc.sequencer.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/transtek/a6-scale.device.d.ts +16 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/transtek/a6-scale.device.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/transtek/a6-scale.measurements.d.ts +5 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/transtek/a6-scale.measurements.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/transtek/a6-scale.protocol.d.ts +22 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/transtek/a6-scale.protocol.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/transtek/a6-scale.sequencer.d.ts +28 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/transtek/a6-scale.sequencer.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/transtek/mambo-a5.device.d.ts +16 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/transtek/mambo-a5.device.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/transtek/mambo-a5.measurements.d.ts +6 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/transtek/mambo-a5.measurements.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/transtek/mambo-a5.protocol.d.ts +18 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/transtek/mambo-a5.protocol.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/transtek/mambo-a5.sequencer.d.ts +21 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/transtek/mambo-a5.sequencer.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/yonker/yonker.device.d.ts +21 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/yonker/yonker.device.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/yonker/yonker.protocol.d.ts +62 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/yonker/yonker.protocol.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/yonker/yonker.sequencer.d.ts +46 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/yonker/yonker.sequencer.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/types/clock-sync.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/types/device-data.d.ts +1 -0
- package/lib/typescript/module/src/modules/bt-management/types/device-data.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/types/device-measurement-map.d.ts +20 -1
- 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/frame-reader.d.ts +2 -1
- package/lib/typescript/module/src/modules/bt-management/types/frame-reader.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/types/integrated-devices.d.ts +20 -1
- package/lib/typescript/module/src/modules/bt-management/types/integrated-devices.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/data-sync/utils/get-samples-from-health.d.ts +2 -2
- package/package.json +1 -1
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/* eslint-disable import/group-exports */
|
|
4
|
+
import { MeasurementTypeKey } from "@ovok/core";
|
|
5
|
+
import { CaseType } from "../../../types/case-type.js";
|
|
6
|
+
import { cgh25Frame, cgh25SetTime, COFOE_GATT, kfb06Frame, kfb06SetTime, unframe } from "./cofoe.protocol.js";
|
|
7
|
+
import { readCgh25Glucose, readKfb06Glucose } from "./cofoe.records.js";
|
|
8
|
+
const command = frame => ({
|
|
9
|
+
serviceUuid: COFOE_GATT.glucometer.service,
|
|
10
|
+
characteristicUuid: COFOE_GATT.glucometer.write,
|
|
11
|
+
frame
|
|
12
|
+
});
|
|
13
|
+
const report = (params, reading) => params.onResult({
|
|
14
|
+
caseType: CaseType.RESULT,
|
|
15
|
+
measurementTypeKey: MeasurementTypeKey.bloodGlucose,
|
|
16
|
+
...reading
|
|
17
|
+
});
|
|
18
|
+
const KFB06 = {
|
|
19
|
+
handshake: 0x01,
|
|
20
|
+
getInfo: 0x03,
|
|
21
|
+
setTime: 0x10,
|
|
22
|
+
getData: 0x07,
|
|
23
|
+
ack: 0x40,
|
|
24
|
+
ok: 0x00,
|
|
25
|
+
info: 0x13,
|
|
26
|
+
header: 0x15,
|
|
27
|
+
record: 0x11
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
/** MedM re-sends get-data every second until the data header arrives. */
|
|
31
|
+
const GET_DATA_RETRY_MS = 1_000;
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* KF-B06, CGH200 and Novocont Comfort: handshake, device info, set the clock, then get-data
|
|
35
|
+
* until the data header (`15`) arrives, and acknowledge each `11` record with the sequence
|
|
36
|
+
* byte it carried. There is no end-of-data command; the meter closes the link.
|
|
37
|
+
*/
|
|
38
|
+
export class CofoeKfb06Sequencer {
|
|
39
|
+
phase = "handshake";
|
|
40
|
+
sequence = 0;
|
|
41
|
+
constructor(params) {
|
|
42
|
+
this.params = params;
|
|
43
|
+
}
|
|
44
|
+
initialCommands = () => [this.send(KFB06.handshake)];
|
|
45
|
+
isHistoryTransfer = () => true;
|
|
46
|
+
isNormalDisconnect = () => this.phase === "records";
|
|
47
|
+
commandTimeoutMs = () => this.phase === "header" ? GET_DATA_RETRY_MS : undefined;
|
|
48
|
+
onCommandTimeout = () => this.phase === "header" ? {
|
|
49
|
+
commands: [this.send(KFB06.getData)]
|
|
50
|
+
} : {};
|
|
51
|
+
|
|
52
|
+
/** Keeps the get-data retry running across anything that is not the data header. */
|
|
53
|
+
commandProgress = frame => this.phase === "header" && unframe("kfb06", frame).command !== KFB06.header ? "partial" : "complete";
|
|
54
|
+
nextCommand = frame => {
|
|
55
|
+
const {
|
|
56
|
+
command: received,
|
|
57
|
+
sequence,
|
|
58
|
+
body
|
|
59
|
+
} = unframe("kfb06", frame);
|
|
60
|
+
if (this.phase === "handshake" && received === KFB06.ok) {
|
|
61
|
+
this.phase = "info";
|
|
62
|
+
return [this.send(KFB06.getInfo)];
|
|
63
|
+
}
|
|
64
|
+
if (this.phase === "info" && received === KFB06.info) {
|
|
65
|
+
this.phase = "time";
|
|
66
|
+
return [command(kfb06SetTime(this.sequence++, this.now()))];
|
|
67
|
+
}
|
|
68
|
+
if (this.phase === "time" && received === KFB06.ok) {
|
|
69
|
+
this.phase = "header";
|
|
70
|
+
return [this.send(KFB06.getData)];
|
|
71
|
+
}
|
|
72
|
+
if (this.phase === "header" && received === KFB06.header) {
|
|
73
|
+
this.phase = "records";
|
|
74
|
+
}
|
|
75
|
+
if ((this.phase === "header" || this.phase === "records") && received === KFB06.record) {
|
|
76
|
+
const reading = readKfb06Glucose(body);
|
|
77
|
+
if (reading) {
|
|
78
|
+
report(this.params, reading);
|
|
79
|
+
}
|
|
80
|
+
return [command(kfb06Frame(KFB06.ack, sequence))];
|
|
81
|
+
}
|
|
82
|
+
return undefined;
|
|
83
|
+
};
|
|
84
|
+
send = code => command(kfb06Frame(code, this.sequence++));
|
|
85
|
+
now = () => this.params.now?.() ?? new Date();
|
|
86
|
+
}
|
|
87
|
+
const CGH25 = {
|
|
88
|
+
live: 0x00,
|
|
89
|
+
timeRequest: 0x01,
|
|
90
|
+
record: 0x02,
|
|
91
|
+
count: 0x04,
|
|
92
|
+
ready: 0x06,
|
|
93
|
+
getRecord: 0x02,
|
|
94
|
+
getCount: 0x04
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* CGH25 and CGH30. The meter drives: it asks for the time (`01`), says it is ready (`06`), is
|
|
99
|
+
* asked for its record count, and the records are then pulled newest first, from index `count`
|
|
100
|
+
* down to 1. MedM can also wipe the meter's memory afterwards; that is never done here.
|
|
101
|
+
*/
|
|
102
|
+
export class CofoeCgh25Sequencer {
|
|
103
|
+
remaining = 0;
|
|
104
|
+
finished = false;
|
|
105
|
+
constructor(params) {
|
|
106
|
+
this.params = params;
|
|
107
|
+
}
|
|
108
|
+
initialCommands = () => [];
|
|
109
|
+
isHistoryTransfer = () => true;
|
|
110
|
+
isNormalDisconnect = () => this.finished;
|
|
111
|
+
nextCommand = frame => {
|
|
112
|
+
const {
|
|
113
|
+
command: received,
|
|
114
|
+
body
|
|
115
|
+
} = unframe("cgh25", frame);
|
|
116
|
+
switch (received) {
|
|
117
|
+
case CGH25.timeRequest:
|
|
118
|
+
return [command(cgh25SetTime(this.now()))];
|
|
119
|
+
case CGH25.ready:
|
|
120
|
+
return [command(cgh25Frame(CGH25.getCount))];
|
|
121
|
+
case CGH25.count:
|
|
122
|
+
this.remaining = (body[0] ?? 0) << 8 | (body[1] ?? 0);
|
|
123
|
+
return this.requestNext();
|
|
124
|
+
case CGH25.live:
|
|
125
|
+
case CGH25.record:
|
|
126
|
+
{
|
|
127
|
+
const reading = readCgh25Glucose(body);
|
|
128
|
+
if (reading) {
|
|
129
|
+
report(this.params, reading);
|
|
130
|
+
}
|
|
131
|
+
return received === CGH25.record ? this.requestNext() : undefined;
|
|
132
|
+
}
|
|
133
|
+
default:
|
|
134
|
+
return undefined;
|
|
135
|
+
}
|
|
136
|
+
};
|
|
137
|
+
requestNext = () => {
|
|
138
|
+
const index = this.remaining;
|
|
139
|
+
if (index < 1) {
|
|
140
|
+
this.finished = true;
|
|
141
|
+
return undefined;
|
|
142
|
+
}
|
|
143
|
+
this.remaining = index - 1;
|
|
144
|
+
return [command(cgh25Frame(CGH25.getRecord, [index >> 8, index & 0xff, 0, 0, 0, 0, 0, 0, 0]))];
|
|
145
|
+
};
|
|
146
|
+
now = () => this.params.now?.() ?? new Date();
|
|
147
|
+
}
|
|
148
|
+
//# sourceMappingURL=cofoe-glucose.sequencer.js.map
|
package/lib/module/modules/bt-management/services/devices/cofoe/cofoe-glucose.sequencer.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["MeasurementTypeKey","CaseType","cgh25Frame","cgh25SetTime","COFOE_GATT","kfb06Frame","kfb06SetTime","unframe","readCgh25Glucose","readKfb06Glucose","command","frame","serviceUuid","glucometer","service","characteristicUuid","write","report","params","reading","onResult","caseType","RESULT","measurementTypeKey","bloodGlucose","KFB06","handshake","getInfo","setTime","getData","ack","ok","info","header","record","GET_DATA_RETRY_MS","CofoeKfb06Sequencer","phase","sequence","constructor","initialCommands","send","isHistoryTransfer","isNormalDisconnect","commandTimeoutMs","undefined","onCommandTimeout","commands","commandProgress","nextCommand","received","body","now","code","Date","CGH25","live","timeRequest","count","ready","getRecord","getCount","CofoeCgh25Sequencer","remaining","finished","requestNext","index"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/cofoe/cofoe-glucose.sequencer.ts"],"mappings":";;AAAA;AACA,SAASA,kBAAkB,QAAQ,YAAY;AAE/C,SAASC,QAAQ,QAAQ,6BAA0B;AAInD,SACEC,UAAU,EACVC,YAAY,EACZC,UAAU,EACVC,UAAU,EACVC,YAAY,EACZC,OAAO,QACF,qBAAkB;AACzB,SAAuBC,gBAAgB,EAAEC,gBAAgB,QAAQ,oBAAiB;AAOlF,MAAMC,OAAO,GAAIC,KAAwB,KAAqB;EAC5DC,WAAW,EAAER,UAAU,CAACS,UAAU,CAACC,OAAO;EAC1CC,kBAAkB,EAAEX,UAAU,CAACS,UAAU,CAACG,KAAK;EAC/CL;AACF,CAAC,CAAC;AAEF,MAAMM,MAAM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,GAAGA,CAAA,KAAY,IAAI,CAAClC,MAAM,CAACkC,GAAG,GAAG,CAAC,IAAI,IAAIE,IAAI,CAAC,CAAC;AAC7D","ignoreList":[]}
|
package/lib/module/modules/bt-management/services/devices/cofoe/cofoe-thermometer.sequencer.js
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { MeasurementTypeKey } from "@ovok/core";
|
|
4
|
+
import { CaseType } from "../../../types/case-type.js";
|
|
5
|
+
import { readThermometerText } from "./cofoe.records.js";
|
|
6
|
+
|
|
7
|
+
/** KF-HW-081A: one ASCII reading per notification, timed by the phone; the app never writes. */
|
|
8
|
+
class CofoeThermometerSequencer {
|
|
9
|
+
recorded = false;
|
|
10
|
+
constructor(params) {
|
|
11
|
+
this.params = params;
|
|
12
|
+
}
|
|
13
|
+
initialCommands = () => [];
|
|
14
|
+
isNormalDisconnect = () => this.recorded;
|
|
15
|
+
nextCommand = frame => {
|
|
16
|
+
const bodyTemp = readThermometerText(frame);
|
|
17
|
+
if (bodyTemp !== undefined) {
|
|
18
|
+
this.recorded = true;
|
|
19
|
+
this.params.onResult({
|
|
20
|
+
caseType: CaseType.RESULT,
|
|
21
|
+
measurementTypeKey: MeasurementTypeKey.temperature,
|
|
22
|
+
bodyTemp,
|
|
23
|
+
recordedAt: new Date()
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
return undefined;
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
export { CofoeThermometerSequencer };
|
|
30
|
+
//# sourceMappingURL=cofoe-thermometer.sequencer.js.map
|
package/lib/module/modules/bt-management/services/devices/cofoe/cofoe-thermometer.sequencer.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["MeasurementTypeKey","CaseType","readThermometerText","CofoeThermometerSequencer","recorded","constructor","params","initialCommands","isNormalDisconnect","nextCommand","frame","bodyTemp","undefined","onResult","caseType","RESULT","measurementTypeKey","temperature","recordedAt","Date"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/cofoe/cofoe-thermometer.sequencer.ts"],"mappings":";;AAAA,SAASA,kBAAkB,QAAQ,YAAY;AAE/C,SAASC,QAAQ,QAAQ,6BAA0B;AAInD,SAASC,mBAAmB,QAAQ,oBAAiB;;AAErD;AACA,MAAMC,yBAAyB,CAA6B;EAClDC,QAAQ,GAAG,KAAK;EAEjBC,WAAWA,CAAkBC,MAA+D,EAAE;IAAA,KAAjEA,MAA+D,GAA/DA,MAA+D;EAAG;EAE/FC,eAAe,GAAGA,CAAA,KAAgC,EAAE;EAEpDC,kBAAkB,GAAGA,CAAA,KAAe,IAAI,CAACJ,QAAQ;EAEjDK,WAAW,GAAIC,KAAwB,IAAgB;IAC5D,MAAMC,QAAQ,GAAGT,mBAAmB,CAACQ,KAAK,CAAC;IAE3C,IAAIC,QAAQ,KAAKC,SAAS,EAAE;MAC1B,IAAI,CAACR,QAAQ,GAAG,IAAI;MACpB,IAAI,CAACE,MAAM,CAACO,QAAQ,CAAC;QACnBC,QAAQ,EAAEb,QAAQ,CAACc,MAAM;QACzBC,kBAAkB,EAAEhB,kBAAkB,CAACiB,WAAW;QAClDN,QAAQ;QACRO,UAAU,EAAE,IAAIC,IAAI,CAAC;MACvB,CAAC,CAAC;IACJ;IAEA,OAAOP,SAAS;EAClB,CAAC;AACH;AAEA,SAAST,yBAAyB","ignoreList":[]}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { IntegratedDevices } from "../../../types/integrated-devices.js";
|
|
4
|
+
import { BTManagedDevice } from "../bt-managed-device.js";
|
|
5
|
+
import { CofoeBpSequencer } from "./cofoe-bp.sequencer.js";
|
|
6
|
+
import { CofoeCgh25Sequencer, CofoeKfb06Sequencer } from "./cofoe-glucose.sequencer.js";
|
|
7
|
+
import { CofoeThermometerSequencer } from "./cofoe-thermometer.sequencer.js";
|
|
8
|
+
import { COFOE_GATT, CofoeFrameReader } from "./cofoe.protocol.js";
|
|
9
|
+
const passThrough = {
|
|
10
|
+
caseValuePosition: [],
|
|
11
|
+
cases: []
|
|
12
|
+
};
|
|
13
|
+
const service = ({
|
|
14
|
+
service: uuid,
|
|
15
|
+
notify
|
|
16
|
+
}, optional = false) => ({
|
|
17
|
+
uuid,
|
|
18
|
+
optional,
|
|
19
|
+
monitorUuids: [{
|
|
20
|
+
uuid: notify,
|
|
21
|
+
parsingModel: passThrough
|
|
22
|
+
}]
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
/** The 0x18F0 generation is declared under both UUID layouts MedM's build could mean. */
|
|
26
|
+
const historyServices = [service(COFOE_GATT.history, true), service(COFOE_GATT.historyReversed, true)];
|
|
27
|
+
const SERVICES = {
|
|
28
|
+
[IntegratedDevices.COFOE_BPM]: [service(COFOE_GATT.bloodPressure)],
|
|
29
|
+
[IntegratedDevices.COFOE_BPM_HISTORY]: historyServices,
|
|
30
|
+
[IntegratedDevices.COFOE_GLUCOMETER]: [service(COFOE_GATT.glucometer)],
|
|
31
|
+
[IntegratedDevices.COFOE_GLUCOMETER_CGH25]: [service(COFOE_GATT.glucometer)],
|
|
32
|
+
[IntegratedDevices.COFOE_THERMOMETER]: historyServices
|
|
33
|
+
};
|
|
34
|
+
const FRAMING = {
|
|
35
|
+
[IntegratedDevices.COFOE_BPM]: "bloodPressure",
|
|
36
|
+
[IntegratedDevices.COFOE_BPM_HISTORY]: "bloodPressure",
|
|
37
|
+
[IntegratedDevices.COFOE_GLUCOMETER]: "kfb06",
|
|
38
|
+
[IntegratedDevices.COFOE_GLUCOMETER_CGH25]: "cgh25"
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
/** Cofoe KF-6x blood-pressure monitors, KF-B06 and CGH glucometers and the KF-HW-081A thermometer. */
|
|
42
|
+
class CofoeDeviceClass extends BTManagedDevice {
|
|
43
|
+
stuckDataTimeout = 90_000;
|
|
44
|
+
onStreamStart = undefined;
|
|
45
|
+
constructor(device, params) {
|
|
46
|
+
super(device, params);
|
|
47
|
+
this.mainServices = SERVICES[params.deviceName];
|
|
48
|
+
const framing = FRAMING[params.deviceName];
|
|
49
|
+
if (framing) {
|
|
50
|
+
this.frameReader = new CofoeFrameReader(framing);
|
|
51
|
+
}
|
|
52
|
+
const onResult = result => this.onResult?.(result);
|
|
53
|
+
this.createCommandSequencer = () => {
|
|
54
|
+
switch (params.deviceName) {
|
|
55
|
+
case IntegratedDevices.COFOE_GLUCOMETER:
|
|
56
|
+
return new CofoeKfb06Sequencer({
|
|
57
|
+
onResult
|
|
58
|
+
});
|
|
59
|
+
case IntegratedDevices.COFOE_GLUCOMETER_CGH25:
|
|
60
|
+
return new CofoeCgh25Sequencer({
|
|
61
|
+
onResult
|
|
62
|
+
});
|
|
63
|
+
case IntegratedDevices.COFOE_THERMOMETER:
|
|
64
|
+
return new CofoeThermometerSequencer({
|
|
65
|
+
onResult
|
|
66
|
+
});
|
|
67
|
+
default:
|
|
68
|
+
return new CofoeBpSequencer({
|
|
69
|
+
history: params.deviceName === IntegratedDevices.COFOE_BPM_HISTORY,
|
|
70
|
+
onResult
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/** The thermometer has no frame reader: one notification is one message. */
|
|
77
|
+
validatePackage = () => true;
|
|
78
|
+
handleSuccessResult() {
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
export { CofoeDeviceClass as CofoeDevice };
|
|
83
|
+
//# sourceMappingURL=cofoe.device.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["IntegratedDevices","BTManagedDevice","CofoeBpSequencer","CofoeCgh25Sequencer","CofoeKfb06Sequencer","CofoeThermometerSequencer","COFOE_GATT","CofoeFrameReader","passThrough","caseValuePosition","cases","service","uuid","notify","optional","monitorUuids","parsingModel","historyServices","history","historyReversed","SERVICES","COFOE_BPM","bloodPressure","COFOE_BPM_HISTORY","COFOE_GLUCOMETER","glucometer","COFOE_GLUCOMETER_CGH25","COFOE_THERMOMETER","FRAMING","CofoeDeviceClass","stuckDataTimeout","onStreamStart","undefined","constructor","device","params","mainServices","deviceName","framing","frameReader","onResult","result","createCommandSequencer","validatePackage","handleSuccessResult","CofoeDevice"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/cofoe/cofoe.device.ts"],"mappings":";;AAIA,SAASA,iBAAiB,QAAQ,sCAAmC;AAGrE,SAASC,eAAe,QAAQ,yBAAsB;AAEtD,SAASC,gBAAgB,QAAQ,yBAAsB;AACvD,SAASC,mBAAmB,EAAEC,mBAAmB,QAAQ,8BAA2B;AACpF,SAASC,yBAAyB,QAAQ,kCAA+B;AACzE,SAASC,UAAU,EAAgBC,gBAAgB,QAAQ,qBAAkB;AAS7E,MAAMC,WAAW,GAAG;EAAEC,iBAAiB,EAAE,EAAE;EAAEC,KAAK,EAAE;AAAG,CAAC;AAExD,MAAMC,OAAO,GAAGA,CACd;EAAEA,OAAO,EAAEC,IAAI;EAAEC;AAA4C,CAAC,EAC9DC,QAAQ,GAAG,KAAK,MACF;EAAEF,IAAI;EAAEE,QAAQ;EAAEC,YAAY,EAAE,CAAC;IAAEH,IAAI,EAAEC,MAAM;IAAEG,YAAY,EAAER;EAAY,CAAC;AAAE,CAAC,CAAC;;AAEhG;AACA,MAAMS,eAAe,GAAG,CAACN,OAAO,CAACL,UAAU,CAACY,OAAO,EAAE,IAAI,CAAC,EAAEP,OAAO,CAACL,UAAU,CAACa,eAAe,EAAE,IAAI,CAAC,CAAC;AAEtG,MAAMC,QAAyC,GAAG;EAChD,CAACpB,iBAAiB,CAACqB,SAAS,GAAG,CAACV,OAAO,CAACL,UAAU,CAACgB,aAAa,CAAC,CAAC;EAClE,CAACtB,iBAAiB,CAACuB,iBAAiB,GAAGN,eAAe;EACtD,CAACjB,iBAAiB,CAACwB,gBAAgB,GAAG,CAACb,OAAO,CAACL,UAAU,CAACmB,U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O,IAAItB,yBAAyB,CAAC;YAAEmC;UAAS,CAAC,CAAC;QACpD;UACE,OAAO,IAAItC,gBAAgB,CAAC;YAC1BgB,OAAO,EAAEiB,MAAM,CAACE,UAAU,KAAKrC,iBAAiB,CAACuB,iBAAiB;YAClEiB;UACF,CAAC,CAAC;MACN;IACF,CAAC;EACH;;EAEA;EACUG,eAAe,GAAGA,CAAA,KAAe,IAAI;EAErCC,mBAAmBA,CAAA,EAAS;IACpC;EACF;AACF;AAEA,SAASf,gBAAgB,IAAIgB,WAAW","ignoreList":[]}
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/* eslint-disable import/group-exports */
|
|
4
|
+
|
|
5
|
+
import { FrameReadStatus } from "../../../types/frame-read-status.js";
|
|
6
|
+
import { calculateCrc8Maxim } from "../../../utils/calculate-crc-8-maxim.js";
|
|
7
|
+
import { hexToByte } from "../../../utils/hex-to-byte.js";
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Cofoe blood-pressure monitors, glucometers and thermometer, from MedM Health Diary 3.12.11's
|
|
11
|
+
* `CCofoe_*` classes. Three binary framings and one ASCII one:
|
|
12
|
+
*
|
|
13
|
+
* - `FF FF len cmd payload ck` (blood pressure): `len` is the whole frame, `ck` makes the byte
|
|
14
|
+
* sum from `len` on zero.
|
|
15
|
+
* - `5A A5 cmd seq len payload crc` (KF-B06 glucometers): CRC-8/MAXIM over `cmd … payload`.
|
|
16
|
+
* - `$PCL A cmd len payload sum` (CGH25 glucometers): the 8-bit sum of everything after `$`.
|
|
17
|
+
* - `<me>o=VVVVx=T\r\n` (KF-HW-081A thermometer), one notification each.
|
|
18
|
+
*
|
|
19
|
+
* MedM does not check the KF-66EP+ checksum and only drops a KF-B06 frame whose CRC happens to
|
|
20
|
+
* be zero; every frame here is verified and dropped when it does not add up.
|
|
21
|
+
*/
|
|
22
|
+
const sig16 = assigned => `0000${assigned}-0000-1000-8000-00805f9b34fb`;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* MedM builds the KF-66EP+ and thermometer UUIDs with their words reversed, which reads as
|
|
26
|
+
* `fb349b5f-8000-0080-0010-0000XXXX0000`. Which of the two the hardware exposes is unknown, so
|
|
27
|
+
* both are declared, optional, and the one discovery finds is used.
|
|
28
|
+
*/
|
|
29
|
+
const reversed = assigned => `fb349b5f-8000-0080-0010-0000${assigned.slice(2)}${assigned.slice(0, 2)}0000`;
|
|
30
|
+
const gatt = (service, notify, write, wrap) => ({
|
|
31
|
+
service: wrap(service),
|
|
32
|
+
notify: wrap(notify),
|
|
33
|
+
write: wrap(write)
|
|
34
|
+
});
|
|
35
|
+
export const COFOE_GATT = {
|
|
36
|
+
bloodPressure: gatt("f018", "f02a", "f12a", sig16),
|
|
37
|
+
history: gatt("18f0", "2af0", "2af1", sig16),
|
|
38
|
+
historyReversed: gatt("18f0", "2af0", "2af1", reversed),
|
|
39
|
+
glucometer: gatt("ae30", "ae02", "ae01", sig16)
|
|
40
|
+
};
|
|
41
|
+
const toHex = bytes => bytes.map(value => (value & 0xff).toString(16).padStart(2, "0"));
|
|
42
|
+
export const toBytes = frame => frame.map(byte => hexToByte(byte));
|
|
43
|
+
const sum = bytes => bytes.reduce((total, value) => total + value, 0) & 0xff;
|
|
44
|
+
|
|
45
|
+
/* ---------------------------------------------------------------- framing */
|
|
46
|
+
|
|
47
|
+
/** `FF FF len cmd payload ck`. */
|
|
48
|
+
export const bpFrame = (command, payload = []) => {
|
|
49
|
+
const covered = [payload.length + 5, command, ...payload];
|
|
50
|
+
return toHex([0xff, 0xff, ...covered, -sum(covered) & 0xff]);
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
/** `5A A5 cmd seq len payload crc`. */
|
|
54
|
+
export const kfb06Frame = (command, sequence, payload = []) => {
|
|
55
|
+
const covered = toHex([command, sequence, payload.length, ...payload]);
|
|
56
|
+
return [...toHex([0x5a, 0xa5]), ...covered, ...toHex([calculateCrc8Maxim(covered, covered.length)])];
|
|
57
|
+
};
|
|
58
|
+
const PCL = [0x24, 0x50, 0x43, 0x4c];
|
|
59
|
+
|
|
60
|
+
/** `$PCL A cmd len payload sum`. */
|
|
61
|
+
export const cgh25Frame = (command, payload = []) => {
|
|
62
|
+
const bytes = [...PCL, 0x41, command, payload.length, ...payload];
|
|
63
|
+
return toHex([...bytes, sum(bytes.slice(1))]);
|
|
64
|
+
};
|
|
65
|
+
const FRAMINGS = {
|
|
66
|
+
bloodPressure: {
|
|
67
|
+
magic: [0xff, 0xff],
|
|
68
|
+
header: 4,
|
|
69
|
+
length: frame => frame[2] ?? 0,
|
|
70
|
+
valid: frame => frame.length >= 5 && sum(frame.slice(2)) === 0
|
|
71
|
+
},
|
|
72
|
+
kfb06: {
|
|
73
|
+
magic: [0x5a, 0xa5],
|
|
74
|
+
header: 5,
|
|
75
|
+
length: frame => (frame[4] ?? 0) + 6,
|
|
76
|
+
valid: frame => calculateCrc8Maxim(toHex(frame.slice(2, -1)), frame.length - 3) === frame[frame.length - 1]
|
|
77
|
+
},
|
|
78
|
+
cgh25: {
|
|
79
|
+
magic: PCL,
|
|
80
|
+
header: 7,
|
|
81
|
+
length: frame => (frame[6] ?? 0) + 8,
|
|
82
|
+
valid: frame => sum(frame.slice(1, -1)) === frame[frame.length - 1]
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
/** Isolates verified frames of one framing whatever the notification boundaries. */
|
|
86
|
+
export class CofoeFrameReader {
|
|
87
|
+
constructor(framing) {
|
|
88
|
+
this.framing = FRAMINGS[framing];
|
|
89
|
+
}
|
|
90
|
+
readFrame(buffer) {
|
|
91
|
+
const {
|
|
92
|
+
magic,
|
|
93
|
+
header,
|
|
94
|
+
length,
|
|
95
|
+
valid
|
|
96
|
+
} = this.framing;
|
|
97
|
+
const values = toBytes(buffer);
|
|
98
|
+
const start = values.findIndex((_, index) => magic.every((byte, offset) => index + offset >= values.length || values[index + offset] === byte));
|
|
99
|
+
if (start === -1) {
|
|
100
|
+
return {
|
|
101
|
+
status: FrameReadStatus.INCOMPLETE,
|
|
102
|
+
consumedBytes: values.length
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
if (start + header > values.length) {
|
|
106
|
+
return {
|
|
107
|
+
status: FrameReadStatus.INCOMPLETE,
|
|
108
|
+
consumedBytes: start
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
const total = length(values.slice(start));
|
|
112
|
+
if (total < header + 1) {
|
|
113
|
+
return {
|
|
114
|
+
status: FrameReadStatus.CORRUPT,
|
|
115
|
+
consumedBytes: start + 1
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
if (start + total > values.length) {
|
|
119
|
+
return {
|
|
120
|
+
status: FrameReadStatus.INCOMPLETE,
|
|
121
|
+
consumedBytes: start
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
if (!valid(values.slice(start, start + total))) {
|
|
125
|
+
return {
|
|
126
|
+
status: FrameReadStatus.CORRUPT,
|
|
127
|
+
consumedBytes: start + 1
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
return {
|
|
131
|
+
status: FrameReadStatus.COMPLETE,
|
|
132
|
+
consumedBytes: start + total,
|
|
133
|
+
frame: buffer.slice(start, start + total)
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
/** The command and body of a verified frame. */
|
|
139
|
+
export const unframe = (framing, frame) => {
|
|
140
|
+
const bytes = toBytes(frame);
|
|
141
|
+
if (framing === "kfb06") {
|
|
142
|
+
return {
|
|
143
|
+
command: (bytes[2] ?? 0) & 0x3f,
|
|
144
|
+
sequence: bytes[3] ?? 0,
|
|
145
|
+
body: bytes.slice(5, -1)
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
const at = framing === "bloodPressure" ? 3 : 5;
|
|
149
|
+
return {
|
|
150
|
+
command: bytes[at] ?? 0,
|
|
151
|
+
sequence: 0,
|
|
152
|
+
body: bytes.slice(FRAMINGS[framing].header, -1)
|
|
153
|
+
};
|
|
154
|
+
};
|
|
155
|
+
|
|
156
|
+
/* ------------------------------------------------------------------ time */
|
|
157
|
+
|
|
158
|
+
const toBcd = value => Math.floor(value / 10) % 10 << 4 | value % 10;
|
|
159
|
+
const clock = now => [now.getFullYear() - 2000, now.getMonth() + 1, now.getDate(), now.getHours(), now.getMinutes(), now.getSeconds()];
|
|
160
|
+
|
|
161
|
+
/** `Cofoe_BPM` set-time, `08`: binary `YY MM DD hh mm ss`. */
|
|
162
|
+
export const bpSetTime = now => bpFrame(0x08, clock(now));
|
|
163
|
+
|
|
164
|
+
/** `Cofoe_KF66EP` set-time, `08`: BCD `YY MM DD hh mm ss`. */
|
|
165
|
+
export const historySetTime = now => bpFrame(0x08, clock(now).map(toBcd));
|
|
166
|
+
|
|
167
|
+
/** KF-B06 set-time, `10`: binary `YY MM DD hh mm ss`. */
|
|
168
|
+
export const kfb06SetTime = (sequence, now) => kfb06Frame(0x10, sequence, clock(now));
|
|
169
|
+
|
|
170
|
+
/** CGH25 set-time, `01`: `00 00 YY MM DD hh mm 00 00`. */
|
|
171
|
+
export const cgh25SetTime = now => cgh25Frame(0x01, [0, 0, ...clock(now).slice(0, 5), 0, 0]);
|
|
172
|
+
export const BP_ACK = bpFrame(0x05);
|
|
173
|
+
//# sourceMappingURL=cofoe.protocol.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["FrameReadStatus","calculateCrc8Maxim","hexToByte","sig16","assigned","reversed","slice","gatt","service","notify","write","wrap","COFOE_GATT","bloodPressure","history","historyReversed","glucometer","toHex","bytes","map","value","toString","padStart","toBytes","frame","byte","sum","reduce","total","bpFrame","command","payload","covered","length","kfb06Frame","sequence","PCL","cgh25Frame","FRAMINGS","magic","header","valid","kfb06","cgh25","CofoeFrameReader","constructor","framing","readFrame","buffer","values","start","findIndex","_","index","every","offset","status","INCOMPLETE","consumedBytes","CORRUPT","COMPLETE","unframe","body","at","toBcd","Math","floor","clock","now","getFullYear","getMonth","getDate","getHours","getMinutes","getSeconds","bpSetTime","historySetTime","kfb06SetTime","cgh25SetTime","BP_ACK"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/cofoe/cofoe.protocol.ts"],"mappings":";;AAAA;;AAGA,SAASA,eAAe,QAAQ,qCAAkC;AAElE,SAASC,kBAAkB,QAAQ,yCAAsC;AACzE,SAASC,SAAS,QAAQ,+BAA4B;;AAEtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,KAAK,GAAIC,QAAgB,IAAa,OAAOA,QAAQ,8BAA8B;;AAEzF;AACA;AACA;AACA;AACA;AACA,MAAMC,QAAQ,GAAID,QAAgB,IAChC,+BAA+BA,QAAQ,CAACE,KAAK,CAAC,CAAC,CAAC,GAAGF,QAAQ,CAACE,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,MAAM;AAE/E,MAAMC,IAAI,GAAGA,CAACC,OAAe,EAAEC,MAAc,EAAEC,KAAa,EAAEC,IAA4B,MAAM;EAC9FH,OAAO,EAAEG,IAAI,CAACH,OAAO,CAAC;EACtBC,MAAM,EAAEE,IAAI,CAACF,MAAM,CAAC;EACpBC,KAAK,EAAEC,IAAI,CAACD,KAAK;AACnB,CAAC,CAAC;AAEF,OAAO,MAAME,UAAU,GAAG;EACxBC,aAAa,EAAEN,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAEJ,KAAK,CAAC;EAClDW,OAAO,EAAEP,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAEJ,KAAK,CAAC;EAC5CY,eAAe,EAAER,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAEF,QAAQ,CAAC;EACvDW,UAAU,EAAET,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAEJ,KAAK;AAChD,CAAU;AAEV,MAAMc,KAAK,GAAIC,KAAwB,IACrCA,KAAK,CAACC,GAAG,CAA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AGlD,OAAO,CAAC,IAAI,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/* eslint-disable import/group-exports */
|
|
4
|
+
|
|
5
|
+
import { toBytes } from "./cofoe.protocol.js";
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Cofoe record decoders. Times are local wall-clock with no zone; a field out of range drops
|
|
9
|
+
* the record rather than letting `Date` roll it into a plausible wrong time.
|
|
10
|
+
*/
|
|
11
|
+
const fromBcd = value => value >> 4 > 9 || (value & 0x0f) > 9 ? undefined : (value >> 4) * 10 + (value & 0x0f);
|
|
12
|
+
|
|
13
|
+
/** `[year - 2000, month, day, hour, minute, second]` as phone-local time, or undefined if any field is out of range. */
|
|
14
|
+
const localTime = fields => {
|
|
15
|
+
if (fields.some(field => field === undefined)) {
|
|
16
|
+
return undefined;
|
|
17
|
+
}
|
|
18
|
+
const [year, month, day, hour, minute, second] = fields.map((field, index) => index === 0 ? field + 2000 : field);
|
|
19
|
+
const time = new Date(year, month - 1, day, hour, minute, second);
|
|
20
|
+
return time.getMonth() === month - 1 && time.getDate() === day && time.getHours() === hour && time.getMinutes() === minute && time.getSeconds() === second ? time : undefined;
|
|
21
|
+
};
|
|
22
|
+
/** Pulse, systolic - 20, diastolic - 20 (mmHg), irregular-pulse flag. */
|
|
23
|
+
const readPressures = bytes => {
|
|
24
|
+
if (bytes.length < 4) {
|
|
25
|
+
return undefined;
|
|
26
|
+
}
|
|
27
|
+
const [heartRate, systolic, diastolic, flag] = bytes;
|
|
28
|
+
return systolic > diastolic && heartRate > 0 ? {
|
|
29
|
+
systolic: systolic + 20,
|
|
30
|
+
diastolic: diastolic + 20,
|
|
31
|
+
heartRate,
|
|
32
|
+
irregularHeartbeat: flag !== 0
|
|
33
|
+
} : undefined;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
/** `Cofoe_BPM` result, `03`: four bytes, timed by the phone. */
|
|
37
|
+
export const readBpResult = body => body.length === 4 ? readPressures(body) : undefined;
|
|
38
|
+
|
|
39
|
+
/** `Cofoe_KF66EP` record, `02`/`03`: BCD `YY MM DD hh mm ss`, then the four result bytes. */
|
|
40
|
+
export const readBpRecord = body => {
|
|
41
|
+
const recordedAt = body.length === 10 ? localTime(body.slice(0, 6).map(fromBcd)) : undefined;
|
|
42
|
+
const pressures = readPressures(body.slice(6));
|
|
43
|
+
return recordedAt && pressures && {
|
|
44
|
+
...pressures,
|
|
45
|
+
recordedAt
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
/** One mmol/L of glucose (180.16 g/mol) is 18.016 mg/dL, as in the SIG glucose profile. */
|
|
50
|
+
const MG_PER_DL_PER_MMOL_PER_L = 18.016;
|
|
51
|
+
|
|
52
|
+
/** Tenths of a mmol/L, rounded to whole mg/dL. */
|
|
53
|
+
const mgPerDl = tenthsMmol => Math.round(tenthsMmol / 10 * MG_PER_DL_PER_MMOL_PER_L);
|
|
54
|
+
const glucose = (tenthsMmol, recordedAt) => recordedAt && tenthsMmol > 0 && tenthsMmol < 0xffff ? {
|
|
55
|
+
bloodGlucose: mgPerDl(tenthsMmol),
|
|
56
|
+
recordedAt
|
|
57
|
+
} : undefined;
|
|
58
|
+
const KFB06_GLUCOSE_TYPE = 9;
|
|
59
|
+
|
|
60
|
+
/** KF-B06 record, `11`: binary `YY MM DD hh mm ss`, type (`9` = glucose), u16 LE tenths of mmol/L. */
|
|
61
|
+
export const readKfb06Glucose = body => body.length === 9 && body[6] === KFB06_GLUCOSE_TYPE ? glucose((body[8] ?? 0) << 8 | (body[7] ?? 0), localTime(body.slice(0, 6))) : undefined;
|
|
62
|
+
|
|
63
|
+
/** CGH25 record, `00`/`02`: index (u16 BE), `YY MM DD hh mm`, u16 BE tenths of mmol/L. */
|
|
64
|
+
export const readCgh25Glucose = body => body.length === 9 ? glucose((body[7] ?? 0) << 8 | (body[8] ?? 0), localTime([...body.slice(2, 7), 0])) : undefined;
|
|
65
|
+
|
|
66
|
+
/** `<me>…o=VVVV…x=T…\r\n`: hundredths of a degree Celsius; type `3` is dropped, as MedM does. */
|
|
67
|
+
const THERMOMETER_TEXT = /^<me>(.*)\r\n$/s;
|
|
68
|
+
export const readThermometerText = frame => {
|
|
69
|
+
const text = THERMOMETER_TEXT.exec(String.fromCharCode(...toBytes(frame)))?.[1];
|
|
70
|
+
const type = text && /x=([0-9-])/.exec(text)?.[1];
|
|
71
|
+
const value = text && /o=([0-9-]{1,4})/.exec(text)?.[1];
|
|
72
|
+
if (!type || !value || type === "3" || !/^-?\d+$/.test(value)) {
|
|
73
|
+
return undefined;
|
|
74
|
+
}
|
|
75
|
+
const hundredths = Number.parseInt(value, 10);
|
|
76
|
+
return hundredths > 0 ? hundredths / 100 : undefined;
|
|
77
|
+
};
|
|
78
|
+
//# sourceMappingURL=cofoe.records.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["toBytes","fromBcd","value","undefined","localTime","fields","some","field","year","month","day","hour","minute","second","map","index","time","Date","getMonth","getDate","getHours","getMinutes","getSeconds","readPressures","bytes","length","heartRate","systolic","diastolic","flag","irregularHeartbeat","readBpResult","body","readBpRecord","recordedAt","slice","pressures","MG_PER_DL_PER_MMOL_PER_L","mgPerDl","tenthsMmol","Math","round","glucose","bloodGlucose","KFB06_GLUCOSE_TYPE","readKfb06Glucose","readCgh25Glucose","THERMOMETER_TEXT","readThermometerText","frame","text","exec","String","fromCharCode","type","test","hundredths","Number","parseInt"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/cofoe/cofoe.records.ts"],"mappings":";;AAAA;;AAEA,SAASA,OAAO,QAAQ,qBAAkB;;AAE1C;AACA;AACA;AACA;AACA,MAAMC,OAAO,GAAIC,KAAa,IAC3BA,KAAK,IAAI,CAAC,GAAI,CAAC,IAAI,CAACA,KAAK,GAAG,IAAI,IAAI,CAAC,GAAGC,SAAS,GAAG,CAACD,KAAK,IAAI,CAAC,IA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7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import { IntegratedDevices } from "../../../types/integrated-devices.js";
|
|
4
4
|
import { BTManagedDevice } from "../bt-managed-device.js";
|
|
5
|
-
import { JUMPER_VALUES, LiveOximeterSequencer } from "../live-oximeter.sequencer.js";
|
|
5
|
+
import { JUMPER_VALUES, LiveOximeterSequencer, readOximeterData } from "../live-oximeter.sequencer.js";
|
|
6
6
|
import { JUMPER_GATT, JUMPER_NOTIFY, JUMPER_SERVICE } from "./jumper.protocol.js";
|
|
7
7
|
import { JumperSequencer } from "./jumper.sequencer.js";
|
|
8
8
|
const passThrough = {
|
|
@@ -34,7 +34,7 @@ class JumperDeviceClass extends BTManagedDevice {
|
|
|
34
34
|
this.mainServices = SERVICES[params.deviceName];
|
|
35
35
|
const onResult = result => this.onResult?.(result);
|
|
36
36
|
this.createCommandSequencer = () => params.deviceName === IntegratedDevices.JUMPER_OXIMETER ? new LiveOximeterSequencer({
|
|
37
|
-
|
|
37
|
+
readValues: frame => readOximeterData(frame, JUMPER_VALUES),
|
|
38
38
|
onResult
|
|
39
39
|
}) : new JumperSequencer({
|
|
40
40
|
kind: params.deviceName === IntegratedDevices.JUMPER_BPM ? "blood-pressure" : "thermometer",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["IntegratedDevices","BTManagedDevice","JUMPER_VALUES","LiveOximeterSequencer","JUMPER_GATT","JUMPER_NOTIFY","JUMPER_SERVICE","JumperSequencer","passThrough","caseValuePosition","cases","service","uuid","notify","optional","monitorUuids","parsingModel","SERVICES","JUMPER_OXIMETER","oximeterAlternate","JUMPER_THERMOMETER","thermometerAlternate","JUMPER_BPM","bloodPressure","JumperDeviceClass","stuckDataTimeout","onStreamStart","undefined","constructor","device","params","mainServices","deviceName","onResult","result","createCommandSequencer","
|
|
1
|
+
{"version":3,"names":["IntegratedDevices","BTManagedDevice","JUMPER_VALUES","LiveOximeterSequencer","readOximeterData","JUMPER_GATT","JUMPER_NOTIFY","JUMPER_SERVICE","JumperSequencer","passThrough","caseValuePosition","cases","service","uuid","notify","optional","monitorUuids","parsingModel","SERVICES","JUMPER_OXIMETER","oximeterAlternate","JUMPER_THERMOMETER","thermometerAlternate","JUMPER_BPM","bloodPressure","JumperDeviceClass","stuckDataTimeout","onStreamStart","undefined","constructor","device","params","mainServices","deviceName","onResult","result","createCommandSequencer","readValues","frame","kind","validatePackage","handleSuccessResult","JumperDevice"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/jumper/jumper.device.ts"],"mappings":";;AAIA,SAASA,iBAAiB,QAAQ,sCAAmC;AAGrE,SAASC,eAAe,QAAQ,yBAAsB;AACtD,SAASC,aAAa,EAAEC,qBAAqB,EAAEC,gBAAgB,QAAQ,+BAA4B;AAEnG,SAASC,WAAW,EAAEC,aAAa,EAAEC,cAAc,QAAQ,sBAAmB;AAC9E,SAASC,eAAe,QAAQ,uBAAoB;AAOpD,MAAMC,WAAW,GAAG;EAAEC,iBAAiB,EAAE,EAAE;EAAEC,KAAK,EAAE;AAAG,CAAC;AAExD,MAAMC,OAAO,GAAGA,CAACC,IAAY,EAAEC,MAAc,EAAEC,QAAiB,MAAgB;EAC9EF,IAAI;EACJE,QAAQ;EACRC,YAAY,EAAE,CAAC;IAAEH,IAAI,EAAEC,MAAM;IAAEG,YAAY,EAAER;EAAY,CAAC;AAC5D,CAAC,CAAC;;AAEF;AACA,MAAMS,QAA0C,GAAG;EACjD,CAAClB,iBAAiB,CAACmB,eAAe,GAAG,CACnCP,OAAO,CAACL,cAAc,EAAED,aAAa,EAAE,IAAI,CAAC,EAC5CM,OAAO,CAACP,WAAW,CAACe,iBAAiB,CAACR,OAAO,EAAEP,WAAW,CAACe,iBAAiB,CAACN,MAAM,EAAE,IAAI,CAAC,CAC3F;EACD,CAACd,iBAAiB,CAACqB,kBAAkB,GAAG,CACtCT,OAAO,CAACL,cAAc,EAAED,aAAa,EAAE,IAAI,CAAC,EAC5CM,OAAO,CAACP,WAAW,CAACiB,oBAAoB,CAACV,OAAO,EAAEP,WAAW,CAACiB,oBAAoB,CAACR,MAAM,EAAE,IAAI,CAAC,CACjG;EACD,CAACd,iBAAiB,CAACuB,UAAU,GAAG,CAC9BX,OAAO,CAACP,WAAW,CAACmB,aAAa,CAACZ,OAAO,EAAEP,WAAW,CAACmB,aAAa,CAACV,MAAM,EAAE,KAAK,CAAC;AAEvF,CAAC;;AAED;AACA,MAAMW,iBAAiB,SAASxB,eAAe,CAAe;EAElDyB,gBAAgB,GAAG,OAAO;EAC1BC,aAAa,GAAGC,SAAS;EAE5BC,WAAWA,CAACC,MAAc,EAAEC,MAAwC,EAAE;IAC3E,KAAK,CAACD,MAAM,EAAEC,MAAM,CAAC;IACrB,IAAI,CAACC,YAAY,GAAGd,QAAQ,CAACa,MAAM,CAACE,UAAU,CAAC;IAE/C,MAAMC,QAAQ,GAAIC,MAA+B,IAC/C,IAAI,CAACD,QAAQ,GACXC,MACF,CAAC;IAEH,IAAI,CAACC,sBAAsB,GAAG,MAC5BL,MAAM,CAACE,UAAU,KAAKjC,iBAAiB,CAACmB,eAAe,GACnD,IAAIhB,qBAAqB,CAAC;MACxBkC,UAAU,EAAGC,KAAK,IAAKlC,gBAAgB,CAACkC,KAAK,EAAEpC,aAAa,CAAC;MAC7DgC;IACF,CAAC,CAAC,GACF,IAAI1B,eAAe,CAAC;MAClB+B,IAAI,EACFR,MAAM,CAACE,UAAU,KAAKjC,iBAAiB,CAACuB,UAAU,GAAG,gBAAgB,GAAG,aAAa;MACvFW;IACF,CAAC,CAAC;EACV;;EAEA;EACUM,eAAe,GAAGA,CAAA,KAAe,IAAI;EAErCC,mBAAmBA,CAAA,EAAS;IACpC;EACF;AACF;AAEA,SAAShB,iBAAiB,IAAIiB,YAAY","ignoreList":[]}
|
|
@@ -5,8 +5,9 @@ import { CaseType } from "../../types/case-type.js";
|
|
|
5
5
|
import { hexToByte } from "../../utils/hex-to-byte.js";
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
|
-
* Pulse oximeters that only notify live values - `PR SpO2 PI×10` after a header byte -
|
|
9
|
-
* stored records and no clock: the AOJ-70A/70B
|
|
8
|
+
* Pulse oximeters that only notify live values - `PR SpO2 PI×10` after a header byte (Yonker YK-81C:
|
|
9
|
+
* `SpO2 PR PI×10`, the AOJ header) - with no stored records and no clock: the AOJ-70A/70B, Jumper JPD-500D and
|
|
10
|
+
* Yonker YK-81C/YK-80B families.
|
|
10
11
|
*
|
|
11
12
|
* A spot reading is the last valid saturation and pulse once valid values stop for a few
|
|
12
13
|
* seconds - the finger came out or the device went to sleep - which is also how MedM forms one.
|
|
@@ -16,6 +17,8 @@ const SETTLE_MS = 3_000;
|
|
|
16
17
|
|
|
17
18
|
/** Picks the values frame out of whatever else the device sends (waveform, status). */
|
|
18
19
|
|
|
20
|
+
/** Which of pulse and SpO2 comes first after the header byte. */
|
|
21
|
+
|
|
19
22
|
/** AOJ-70: header exactly `81`, extra bytes ignored. */
|
|
20
23
|
const AOJ_VALUES = (header, length) => header === 0x81 && length >= 4;
|
|
21
24
|
|
|
@@ -23,12 +26,13 @@ const AOJ_VALUES = (header, length) => header === 0x81 && length >= 4;
|
|
|
23
26
|
const JUMPER_VALUES = (header, length) => (header & 0x0f) === 1 && length === 4;
|
|
24
27
|
|
|
25
28
|
/** Pulse rate counts at 1-254 bpm, SpO2 is invalid at 0 or 0x7F, PI 0 means none. */
|
|
26
|
-
const readOximeterData = (frame, isValuesFrame = AOJ_VALUES) => {
|
|
29
|
+
const readOximeterData = (frame, isValuesFrame = AOJ_VALUES, fieldOrder = "pulse-spo2") => {
|
|
27
30
|
if (!isValuesFrame(hexToByte(frame[0] ?? "00"), frame.length)) {
|
|
28
31
|
return undefined;
|
|
29
32
|
}
|
|
30
|
-
const
|
|
31
|
-
const
|
|
33
|
+
const first = hexToByte(frame[1] ?? "00");
|
|
34
|
+
const second = hexToByte(frame[2] ?? "00");
|
|
35
|
+
const [pulseRate, bloodOxygen] = fieldOrder === "pulse-spo2" ? [first, second] : [second, first];
|
|
32
36
|
const perfusionIndex = hexToByte(frame[3] ?? "00");
|
|
33
37
|
if (pulseRate < 1 || pulseRate > 254 || bloodOxygen === 0 || bloodOxygen === 0x7f) {
|
|
34
38
|
return undefined;
|
|
@@ -63,7 +67,7 @@ class LiveOximeterSequencer {
|
|
|
63
67
|
|
|
64
68
|
/** A valid value restarts the settle time; anything else leaves it running. */
|
|
65
69
|
commandProgress = frame => {
|
|
66
|
-
const values =
|
|
70
|
+
const values = this.params.readValues(frame);
|
|
67
71
|
if (!values) {
|
|
68
72
|
return "ignored";
|
|
69
73
|
}
|