@ovok/native 0.4.6 → 0.4.7
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-management/index.js +176 -0
- package/lib/commonjs/modules/bt-management/index.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/custom/compile-case-fields.js +49 -0
- package/lib/commonjs/modules/bt-management/services/custom/compile-case-fields.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/custom/compile-custom-case.js +47 -41
- package/lib/commonjs/modules/bt-management/services/custom/compile-custom-case.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/custom/compile-custom-frame.js +48 -2
- package/lib/commonjs/modules/bt-management/services/custom/compile-custom-frame.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/custom/compile-custom-lepu.js +98 -0
- package/lib/commonjs/modules/bt-management/services/custom/compile-custom-lepu.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/custom/define-custom-device.js +24 -1
- package/lib/commonjs/modules/bt-management/services/custom/define-custom-device.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/device-creator.js +15 -8
- package/lib/commonjs/modules/bt-management/services/device-creator.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/devices/aoj/aoj.thermometers.js +85 -0
- package/lib/commonjs/modules/bt-management/services/devices/aoj/aoj.thermometers.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/devices/bp2/bp2.frame-reader.js +8 -74
- package/lib/commonjs/modules/bt-management/services/devices/bp2/bp2.frame-reader.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/devices/bt-command-writer.js +141 -0
- package/lib/commonjs/modules/bt-management/services/devices/bt-command-writer.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/devices/bt-connection-handler.js +9 -49
- package/lib/commonjs/modules/bt-management/services/devices/bt-connection-handler.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/devices/bt-data-processor.js +17 -6
- package/lib/commonjs/modules/bt-management/services/devices/bt-data-processor.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/devices/bt-managed-device.js +21 -14
- package/lib/commonjs/modules/bt-management/services/devices/bt-managed-device.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/devices/custom/custom-lepu-sequencer.js +36 -0
- package/lib/commonjs/modules/bt-management/services/devices/custom/custom-lepu-sequencer.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/devices/custom/custom.device.js +81 -14
- package/lib/commonjs/modules/bt-management/services/devices/custom/custom.device.js.map +1 -1
- package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.command-builder.js +48 -0
- package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.command-builder.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.commands.js +37 -0
- package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.commands.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.device-info.js +83 -0
- package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.device-info.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.device-names.js +26 -0
- package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.device-names.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.file-names.js +36 -0
- package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.file-names.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.file-transfer.js +155 -0
- package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.file-transfer.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.frame-reader.js +98 -0
- package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.frame-reader.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.frame.js +29 -0
- package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.frame.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.identity-gate.js +103 -0
- package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.identity-gate.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.name-match.js +32 -0
- package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.name-match.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.response-type.js +64 -0
- package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.response-type.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.transports.js +143 -0
- package/lib/commonjs/modules/bt-management/services/devices/lepu/lepu.transports.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/devices/polling-command-sequencer.js +38 -0
- package/lib/commonjs/modules/bt-management/services/devices/polling-command-sequencer.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/devices/standard-gatt/standard-gatt.devices.js +156 -0
- package/lib/commonjs/modules/bt-management/services/devices/standard-gatt/standard-gatt.devices.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/devices/viatom/viatom.bp-monitors.js +124 -0
- package/lib/commonjs/modules/bt-management/services/devices/viatom/viatom.bp-monitors.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/devices/viatom/viatom.ecg-recorders.js +113 -0
- package/lib/commonjs/modules/bt-management/services/devices/viatom/viatom.ecg-recorders.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/devices/viatom/viatom.lepod.js +117 -0
- package/lib/commonjs/modules/bt-management/services/devices/viatom/viatom.lepod.js.map +1 -0
- package/lib/commonjs/modules/bt-management/services/devices/viatom/viatom.oximeters.js +82 -0
- package/lib/commonjs/modules/bt-management/services/devices/viatom/viatom.oximeters.js.map +1 -0
- package/lib/commonjs/modules/bt-management/types/command-sequencer.js +6 -0
- package/lib/commonjs/modules/bt-management/types/command-sequencer.js.map +1 -0
- package/lib/commonjs/modules/bt-management/types/custom-checksum-algorithm.js +2 -0
- package/lib/commonjs/modules/bt-management/types/custom-checksum-algorithm.js.map +1 -0
- package/lib/commonjs/modules/bt-management/types/custom-checksum-spec.js +6 -0
- package/lib/commonjs/modules/bt-management/types/custom-checksum-spec.js.map +1 -0
- package/lib/commonjs/modules/bt-management/types/custom-lepu-spec.js +2 -0
- package/lib/commonjs/modules/bt-management/types/custom-lepu-spec.js.map +1 -0
- package/lib/commonjs/modules/bt-management/types/custom-measurement-spec.js +6 -0
- package/lib/commonjs/modules/bt-management/types/custom-measurement-spec.js.map +1 -0
- package/lib/commonjs/modules/bt-management/types/device-command.js +2 -0
- package/lib/commonjs/modules/bt-management/types/device-command.js.map +1 -0
- package/lib/commonjs/modules/bt-management/types/measurement-group.js +6 -0
- package/lib/commonjs/modules/bt-management/types/measurement-group.js.map +1 -0
- package/lib/commonjs/modules/bt-management/utils/calculate-checksum.js +49 -0
- package/lib/commonjs/modules/bt-management/utils/calculate-checksum.js.map +1 -0
- package/lib/commonjs/modules/bt-management/utils/create-frame-validator.js +9 -0
- package/lib/commonjs/modules/bt-management/utils/create-frame-validator.js.map +1 -1
- package/lib/commonjs/modules/bt-management/utils/hex-to-bytes.js +19 -0
- package/lib/commonjs/modules/bt-management/utils/hex-to-bytes.js.map +1 -0
- package/lib/commonjs/modules/bt-management/utils/le-32-to-bytes.js +13 -0
- package/lib/commonjs/modules/bt-management/utils/le-32-to-bytes.js.map +1 -0
- package/lib/commonjs/modules/bt-management/utils/summarise-measurement-for-log.js +22 -0
- package/lib/commonjs/modules/bt-management/utils/summarise-measurement-for-log.js.map +1 -0
- package/lib/commonjs/modules/bt-management/utils/supported-measurement-type-keys.js +18 -0
- package/lib/commonjs/modules/bt-management/utils/supported-measurement-type-keys.js.map +1 -0
- package/lib/module/modules/bt-management/index.js +16 -0
- package/lib/module/modules/bt-management/index.js.map +1 -1
- package/lib/module/modules/bt-management/services/custom/compile-case-fields.js +44 -0
- package/lib/module/modules/bt-management/services/custom/compile-case-fields.js.map +1 -0
- package/lib/module/modules/bt-management/services/custom/compile-custom-case.js +47 -41
- package/lib/module/modules/bt-management/services/custom/compile-custom-case.js.map +1 -1
- package/lib/module/modules/bt-management/services/custom/compile-custom-frame.js +48 -2
- package/lib/module/modules/bt-management/services/custom/compile-custom-frame.js.map +1 -1
- package/lib/module/modules/bt-management/services/custom/compile-custom-lepu.js +93 -0
- package/lib/module/modules/bt-management/services/custom/compile-custom-lepu.js.map +1 -0
- package/lib/module/modules/bt-management/services/custom/define-custom-device.js +24 -1
- package/lib/module/modules/bt-management/services/custom/define-custom-device.js.map +1 -1
- package/lib/module/modules/bt-management/services/device-creator.js +16 -8
- package/lib/module/modules/bt-management/services/device-creator.js.map +1 -1
- package/lib/module/modules/bt-management/services/devices/aoj/aoj.thermometers.js +81 -0
- package/lib/module/modules/bt-management/services/devices/aoj/aoj.thermometers.js.map +1 -0
- package/lib/module/modules/bt-management/services/devices/bp2/bp2.frame-reader.js +8 -73
- package/lib/module/modules/bt-management/services/devices/bp2/bp2.frame-reader.js.map +1 -1
- package/lib/module/modules/bt-management/services/devices/bt-command-writer.js +136 -0
- package/lib/module/modules/bt-management/services/devices/bt-command-writer.js.map +1 -0
- package/lib/module/modules/bt-management/services/devices/bt-connection-handler.js +9 -49
- package/lib/module/modules/bt-management/services/devices/bt-connection-handler.js.map +1 -1
- package/lib/module/modules/bt-management/services/devices/bt-data-processor.js +17 -6
- package/lib/module/modules/bt-management/services/devices/bt-data-processor.js.map +1 -1
- package/lib/module/modules/bt-management/services/devices/bt-managed-device.js +21 -14
- package/lib/module/modules/bt-management/services/devices/bt-managed-device.js.map +1 -1
- package/lib/module/modules/bt-management/services/devices/custom/custom-lepu-sequencer.js +32 -0
- package/lib/module/modules/bt-management/services/devices/custom/custom-lepu-sequencer.js.map +1 -0
- package/lib/module/modules/bt-management/services/devices/custom/custom.device.js +81 -14
- package/lib/module/modules/bt-management/services/devices/custom/custom.device.js.map +1 -1
- package/lib/module/modules/bt-management/services/devices/lepu/lepu.command-builder.js +43 -0
- package/lib/module/modules/bt-management/services/devices/lepu/lepu.command-builder.js.map +1 -0
- package/lib/module/modules/bt-management/services/devices/lepu/lepu.commands.js +33 -0
- package/lib/module/modules/bt-management/services/devices/lepu/lepu.commands.js.map +1 -0
- package/lib/module/modules/bt-management/services/devices/lepu/lepu.device-info.js +79 -0
- package/lib/module/modules/bt-management/services/devices/lepu/lepu.device-info.js.map +1 -0
- package/lib/module/modules/bt-management/services/devices/lepu/lepu.device-names.js +22 -0
- package/lib/module/modules/bt-management/services/devices/lepu/lepu.device-names.js.map +1 -0
- package/lib/module/modules/bt-management/services/devices/lepu/lepu.file-names.js +32 -0
- package/lib/module/modules/bt-management/services/devices/lepu/lepu.file-names.js.map +1 -0
- package/lib/module/modules/bt-management/services/devices/lepu/lepu.file-transfer.js +150 -0
- package/lib/module/modules/bt-management/services/devices/lepu/lepu.file-transfer.js.map +1 -0
- package/lib/module/modules/bt-management/services/devices/lepu/lepu.frame-reader.js +93 -0
- package/lib/module/modules/bt-management/services/devices/lepu/lepu.frame-reader.js.map +1 -0
- package/lib/module/modules/bt-management/services/devices/lepu/lepu.frame.js +24 -0
- package/lib/module/modules/bt-management/services/devices/lepu/lepu.frame.js.map +1 -0
- package/lib/module/modules/bt-management/services/devices/lepu/lepu.identity-gate.js +98 -0
- package/lib/module/modules/bt-management/services/devices/lepu/lepu.identity-gate.js.map +1 -0
- package/lib/module/modules/bt-management/services/devices/lepu/lepu.name-match.js +27 -0
- package/lib/module/modules/bt-management/services/devices/lepu/lepu.name-match.js.map +1 -0
- package/lib/module/modules/bt-management/services/devices/lepu/lepu.response-type.js +59 -0
- package/lib/module/modules/bt-management/services/devices/lepu/lepu.response-type.js.map +1 -0
- package/lib/module/modules/bt-management/services/devices/lepu/lepu.transports.js +140 -0
- package/lib/module/modules/bt-management/services/devices/lepu/lepu.transports.js.map +1 -0
- package/lib/module/modules/bt-management/services/devices/polling-command-sequencer.js +34 -0
- package/lib/module/modules/bt-management/services/devices/polling-command-sequencer.js.map +1 -0
- package/lib/module/modules/bt-management/services/devices/standard-gatt/standard-gatt.devices.js +149 -0
- package/lib/module/modules/bt-management/services/devices/standard-gatt/standard-gatt.devices.js.map +1 -0
- package/lib/module/modules/bt-management/services/devices/viatom/viatom.bp-monitors.js +118 -0
- package/lib/module/modules/bt-management/services/devices/viatom/viatom.bp-monitors.js.map +1 -0
- package/lib/module/modules/bt-management/services/devices/viatom/viatom.ecg-recorders.js +108 -0
- package/lib/module/modules/bt-management/services/devices/viatom/viatom.ecg-recorders.js.map +1 -0
- package/lib/module/modules/bt-management/services/devices/viatom/viatom.lepod.js +114 -0
- package/lib/module/modules/bt-management/services/devices/viatom/viatom.lepod.js.map +1 -0
- package/lib/module/modules/bt-management/services/devices/viatom/viatom.oximeters.js +79 -0
- package/lib/module/modules/bt-management/services/devices/viatom/viatom.oximeters.js.map +1 -0
- package/lib/module/modules/bt-management/types/command-sequencer.js +4 -0
- package/lib/module/modules/bt-management/types/command-sequencer.js.map +1 -0
- package/lib/module/modules/bt-management/types/custom-checksum-algorithm.js +2 -0
- package/lib/module/modules/bt-management/types/custom-checksum-algorithm.js.map +1 -0
- package/lib/module/modules/bt-management/types/custom-checksum-spec.js +4 -0
- package/lib/module/modules/bt-management/types/custom-checksum-spec.js.map +1 -0
- package/lib/module/modules/bt-management/types/custom-device-definition.js.map +1 -1
- package/lib/module/modules/bt-management/types/custom-lepu-spec.js +2 -0
- package/lib/module/modules/bt-management/types/custom-lepu-spec.js.map +1 -0
- package/lib/module/modules/bt-management/types/custom-measurement-spec.js +4 -0
- package/lib/module/modules/bt-management/types/custom-measurement-spec.js.map +1 -0
- package/lib/module/modules/bt-management/types/device-command.js +2 -0
- package/lib/module/modules/bt-management/types/device-command.js.map +1 -0
- package/lib/module/modules/bt-management/types/measurement-group.js +4 -0
- package/lib/module/modules/bt-management/types/measurement-group.js.map +1 -0
- package/lib/module/modules/bt-management/utils/calculate-checksum.js +44 -0
- package/lib/module/modules/bt-management/utils/calculate-checksum.js.map +1 -0
- package/lib/module/modules/bt-management/utils/create-frame-validator.js +9 -0
- package/lib/module/modules/bt-management/utils/create-frame-validator.js.map +1 -1
- package/lib/module/modules/bt-management/utils/hex-to-bytes.js +14 -0
- package/lib/module/modules/bt-management/utils/hex-to-bytes.js.map +1 -0
- package/lib/module/modules/bt-management/utils/le-32-to-bytes.js +8 -0
- package/lib/module/modules/bt-management/utils/le-32-to-bytes.js.map +1 -0
- package/lib/module/modules/bt-management/utils/summarise-measurement-for-log.js +17 -0
- package/lib/module/modules/bt-management/utils/summarise-measurement-for-log.js.map +1 -0
- package/lib/module/modules/bt-management/utils/supported-measurement-type-keys.js +13 -0
- package/lib/module/modules/bt-management/utils/supported-measurement-type-keys.js.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/index.d.ts +16 -0
- package/lib/typescript/commonjs/src/modules/bt-management/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/custom/compile-case-fields.d.ts +13 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/custom/compile-case-fields.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/custom/compile-custom-case.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/custom/compile-custom-frame.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/custom/compile-custom-lepu.d.ts +11 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/custom/compile-custom-lepu.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/custom/define-custom-device.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/device-creator.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/aoj/aoj.thermometers.d.ts +24 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/aoj/aoj.thermometers.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bp2/bp2.frame-reader.d.ts +5 -8
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bp2/bp2.frame-reader.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bt-command-writer.d.ts +67 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bt-command-writer.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bt-connection-handler.d.ts +6 -4
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bt-connection-handler.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bt-data-processor.d.ts +20 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bt-data-processor.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bt-managed-device.d.ts +12 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/bt-managed-device.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/custom/custom-lepu-sequencer.d.ts +21 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/custom/custom-lepu-sequencer.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/custom/custom.device.d.ts +33 -0
- 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/lepu/lepu.command-builder.d.ts +24 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.command-builder.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.commands.d.ts +32 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.commands.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.device-info.d.ts +27 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.device-info.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.device-names.d.ts +20 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.device-names.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.file-names.d.ts +14 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.file-names.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.file-transfer.d.ts +75 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.file-transfer.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.frame-reader.d.ts +28 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.frame-reader.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.frame.d.ts +12 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.frame.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.identity-gate.d.ts +81 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.identity-gate.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.name-match.d.ts +17 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.name-match.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.response-type.d.ts +33 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.response-type.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.transports.d.ts +85 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/lepu/lepu.transports.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/polling-command-sequencer.d.ts +27 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/polling-command-sequencer.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.devices.d.ts +44 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.devices.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/viatom/viatom.bp-monitors.d.ts +44 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/viatom/viatom.bp-monitors.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/viatom/viatom.ecg-recorders.d.ts +32 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/viatom/viatom.ecg-recorders.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/viatom/viatom.lepod.d.ts +25 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/viatom/viatom.lepod.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/viatom/viatom.oximeters.d.ts +39 -0
- package/lib/typescript/commonjs/src/modules/bt-management/services/devices/viatom/viatom.oximeters.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/types/command-sequencer.d.ts +26 -0
- package/lib/typescript/commonjs/src/modules/bt-management/types/command-sequencer.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/types/custom-case-spec.d.ts +13 -0
- package/lib/typescript/commonjs/src/modules/bt-management/types/custom-case-spec.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/types/custom-checksum-algorithm.d.ts +10 -0
- package/lib/typescript/commonjs/src/modules/bt-management/types/custom-checksum-algorithm.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/types/custom-checksum-spec.d.ts +23 -0
- package/lib/typescript/commonjs/src/modules/bt-management/types/custom-checksum-spec.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/types/custom-device-definition.d.ts +5 -0
- package/lib/typescript/commonjs/src/modules/bt-management/types/custom-device-definition.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/types/custom-device-spec.d.ts +12 -0
- package/lib/typescript/commonjs/src/modules/bt-management/types/custom-device-spec.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/types/custom-frame-spec.d.ts +8 -0
- package/lib/typescript/commonjs/src/modules/bt-management/types/custom-frame-spec.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/types/custom-lepu-spec.d.ts +44 -0
- package/lib/typescript/commonjs/src/modules/bt-management/types/custom-lepu-spec.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/types/custom-measurement-spec.d.ts +9 -0
- package/lib/typescript/commonjs/src/modules/bt-management/types/custom-measurement-spec.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/types/device-command.d.ts +18 -0
- package/lib/typescript/commonjs/src/modules/bt-management/types/device-command.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/types/measurement-group.d.ts +14 -0
- package/lib/typescript/commonjs/src/modules/bt-management/types/measurement-group.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/types/parsing-case.d.ts +9 -0
- package/lib/typescript/commonjs/src/modules/bt-management/types/parsing-case.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/utils/calculate-checksum.d.ts +13 -0
- package/lib/typescript/commonjs/src/modules/bt-management/utils/calculate-checksum.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/utils/create-frame-validator.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/modules/bt-management/utils/hex-to-bytes.d.ts +10 -0
- package/lib/typescript/commonjs/src/modules/bt-management/utils/hex-to-bytes.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/utils/le-32-to-bytes.d.ts +3 -0
- package/lib/typescript/commonjs/src/modules/bt-management/utils/le-32-to-bytes.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/utils/summarise-measurement-for-log.d.ts +9 -0
- package/lib/typescript/commonjs/src/modules/bt-management/utils/summarise-measurement-for-log.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/modules/bt-management/utils/supported-measurement-type-keys.d.ts +10 -0
- package/lib/typescript/commonjs/src/modules/bt-management/utils/supported-measurement-type-keys.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/index.d.ts +16 -0
- package/lib/typescript/module/src/modules/bt-management/index.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/custom/compile-case-fields.d.ts +13 -0
- package/lib/typescript/module/src/modules/bt-management/services/custom/compile-case-fields.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/custom/compile-custom-case.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/custom/compile-custom-frame.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/custom/compile-custom-lepu.d.ts +11 -0
- package/lib/typescript/module/src/modules/bt-management/services/custom/compile-custom-lepu.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/custom/define-custom-device.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/device-creator.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/devices/aoj/aoj.thermometers.d.ts +24 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/aoj/aoj.thermometers.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/bp2/bp2.frame-reader.d.ts +5 -8
- package/lib/typescript/module/src/modules/bt-management/services/devices/bp2/bp2.frame-reader.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/devices/bt-command-writer.d.ts +67 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/bt-command-writer.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/bt-connection-handler.d.ts +6 -4
- package/lib/typescript/module/src/modules/bt-management/services/devices/bt-connection-handler.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/devices/bt-data-processor.d.ts +20 -1
- package/lib/typescript/module/src/modules/bt-management/services/devices/bt-data-processor.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/devices/bt-managed-device.d.ts +12 -1
- package/lib/typescript/module/src/modules/bt-management/services/devices/bt-managed-device.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/services/devices/custom/custom-lepu-sequencer.d.ts +21 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/custom/custom-lepu-sequencer.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/custom/custom.device.d.ts +33 -0
- 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/lepu/lepu.command-builder.d.ts +24 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.command-builder.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.commands.d.ts +32 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.commands.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.device-info.d.ts +27 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.device-info.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.device-names.d.ts +20 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.device-names.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.file-names.d.ts +14 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.file-names.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.file-transfer.d.ts +75 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.file-transfer.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.frame-reader.d.ts +28 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.frame-reader.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.frame.d.ts +12 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.frame.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.identity-gate.d.ts +81 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.identity-gate.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.name-match.d.ts +17 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.name-match.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.response-type.d.ts +33 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.response-type.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.transports.d.ts +85 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/lepu/lepu.transports.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/polling-command-sequencer.d.ts +27 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/polling-command-sequencer.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.devices.d.ts +44 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/standard-gatt/standard-gatt.devices.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/viatom/viatom.bp-monitors.d.ts +44 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/viatom/viatom.bp-monitors.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/viatom/viatom.ecg-recorders.d.ts +32 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/viatom/viatom.ecg-recorders.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/viatom/viatom.lepod.d.ts +25 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/viatom/viatom.lepod.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/viatom/viatom.oximeters.d.ts +39 -0
- package/lib/typescript/module/src/modules/bt-management/services/devices/viatom/viatom.oximeters.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/types/command-sequencer.d.ts +26 -0
- package/lib/typescript/module/src/modules/bt-management/types/command-sequencer.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/types/custom-case-spec.d.ts +13 -0
- package/lib/typescript/module/src/modules/bt-management/types/custom-case-spec.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/types/custom-checksum-algorithm.d.ts +10 -0
- package/lib/typescript/module/src/modules/bt-management/types/custom-checksum-algorithm.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/types/custom-checksum-spec.d.ts +23 -0
- package/lib/typescript/module/src/modules/bt-management/types/custom-checksum-spec.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/types/custom-device-definition.d.ts +5 -0
- package/lib/typescript/module/src/modules/bt-management/types/custom-device-definition.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/types/custom-device-spec.d.ts +12 -0
- package/lib/typescript/module/src/modules/bt-management/types/custom-device-spec.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/types/custom-frame-spec.d.ts +8 -0
- package/lib/typescript/module/src/modules/bt-management/types/custom-frame-spec.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/types/custom-lepu-spec.d.ts +44 -0
- package/lib/typescript/module/src/modules/bt-management/types/custom-lepu-spec.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/types/custom-measurement-spec.d.ts +9 -0
- package/lib/typescript/module/src/modules/bt-management/types/custom-measurement-spec.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/types/device-command.d.ts +18 -0
- package/lib/typescript/module/src/modules/bt-management/types/device-command.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/types/measurement-group.d.ts +14 -0
- package/lib/typescript/module/src/modules/bt-management/types/measurement-group.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/types/parsing-case.d.ts +9 -0
- package/lib/typescript/module/src/modules/bt-management/types/parsing-case.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/utils/calculate-checksum.d.ts +13 -0
- package/lib/typescript/module/src/modules/bt-management/utils/calculate-checksum.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/utils/create-frame-validator.d.ts.map +1 -1
- package/lib/typescript/module/src/modules/bt-management/utils/hex-to-bytes.d.ts +10 -0
- package/lib/typescript/module/src/modules/bt-management/utils/hex-to-bytes.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/utils/le-32-to-bytes.d.ts +3 -0
- package/lib/typescript/module/src/modules/bt-management/utils/le-32-to-bytes.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/utils/summarise-measurement-for-log.d.ts +9 -0
- package/lib/typescript/module/src/modules/bt-management/utils/summarise-measurement-for-log.d.ts.map +1 -0
- package/lib/typescript/module/src/modules/bt-management/utils/supported-measurement-type-keys.d.ts +10 -0
- package/lib/typescript/module/src/modules/bt-management/utils/supported-measurement-type-keys.d.ts.map +1 -0
- package/package.json +1 -1
package/lib/module/modules/bt-management/services/devices/standard-gatt/standard-gatt.devices.js
ADDED
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { MeasurementTypeKey } from "@ovok/core";
|
|
4
|
+
import { defineCustomDevice } from "../../custom/define-custom-device.js";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Declarations for the Bluetooth SIG vital-signs profiles.
|
|
8
|
+
*
|
|
9
|
+
* These are the profiles a compliant patient device implements, and their layouts come from
|
|
10
|
+
* the public specification rather than from reading a vendor's app, so they can be written
|
|
11
|
+
* down exactly instead of inferred.
|
|
12
|
+
*
|
|
13
|
+
* The advertised name stays the caller's, because the SDK matches a scan result by name and
|
|
14
|
+
* every vendor names its hardware differently. A product declares the profile and supplies
|
|
15
|
+
* the name its own hardware advertises.
|
|
16
|
+
*
|
|
17
|
+
* Values are little-endian, as the specification requires. Only the layouts using each
|
|
18
|
+
* catalog's canonical unit are declared: a device reporting kPa, Fahrenheit or pounds needs
|
|
19
|
+
* a conversion a declaration cannot express, and leaving those flag values undeclared means
|
|
20
|
+
* such a device yields no reading rather than one that is quietly wrong.
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
/** Milliseconds a spot-check device may take to produce its reading. */
|
|
24
|
+
const SPOT_CHECK_TIMEOUT_MS = 60_000;
|
|
25
|
+
const sigUuid = assigned => `0000${assigned}-0000-1000-8000-00805f9b34fb`;
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* The flags byte selects the case, because it decides which optional fields are present and
|
|
29
|
+
* therefore where the later ones sit. Every declared case reads the same offsets, so only
|
|
30
|
+
* fields that keep their position across all of them may be declared.
|
|
31
|
+
*/
|
|
32
|
+
const declareProfile = (params, profile) => defineCustomDevice({
|
|
33
|
+
id: params.id,
|
|
34
|
+
nameMatch: params.nameMatch,
|
|
35
|
+
stuckDataTimeoutMs: params.stuckDataTimeoutMs ?? SPOT_CHECK_TIMEOUT_MS,
|
|
36
|
+
services: [{
|
|
37
|
+
uuid: sigUuid(profile.service),
|
|
38
|
+
monitor: [{
|
|
39
|
+
uuid: sigUuid(profile.characteristic),
|
|
40
|
+
frame: {
|
|
41
|
+
minLengthBytes: profile.minLengthBytes
|
|
42
|
+
},
|
|
43
|
+
caseSelectorBytes: [0],
|
|
44
|
+
cases: profile.selectors.map(selector => ({
|
|
45
|
+
selector,
|
|
46
|
+
kind: "result",
|
|
47
|
+
measurementTypeKey: profile.measurementTypeKey,
|
|
48
|
+
fields: [...profile.fields]
|
|
49
|
+
}))
|
|
50
|
+
}]
|
|
51
|
+
}]
|
|
52
|
+
});
|
|
53
|
+
const littleEndian = (name, byteIndexes, unit, encoding) => ({
|
|
54
|
+
name,
|
|
55
|
+
byteIndexes,
|
|
56
|
+
byteOrder: "little",
|
|
57
|
+
encoding,
|
|
58
|
+
unit
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Blood Pressure Service 0x1810, Blood Pressure Measurement 0x2A35.
|
|
63
|
+
*
|
|
64
|
+
* The pulse rate is deliberately not read. Its offset moves with the timestamp flag, and
|
|
65
|
+
* every byte a declaration reads must fit inside one `minLengthBytes` for the whole
|
|
66
|
+
* characteristic - reading it would raise the minimum to sixteen bytes and reject the
|
|
67
|
+
* shorter frames outright. The pressures sit at bytes 1-4 whatever the flags say, so they
|
|
68
|
+
* are always safe. A device whose pulse matters needs a device class.
|
|
69
|
+
*/
|
|
70
|
+
const standardBloodPressureDevice = params => declareProfile(params, {
|
|
71
|
+
service: "1810",
|
|
72
|
+
characteristic: "2a35",
|
|
73
|
+
minLengthBytes: 7,
|
|
74
|
+
measurementTypeKey: MeasurementTypeKey.bloodPressure,
|
|
75
|
+
/** mmHg, with and without the timestamp and pulse the pressures sit in front of. */
|
|
76
|
+
selectors: ["00", "02", "04", "06"],
|
|
77
|
+
fields: [littleEndian("systolic", [1, 2], "mmHg", "sfloat"), littleEndian("diastolic", [3, 4], "mmHg", "sfloat")]
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
/** Health Thermometer Service 0x1809, Temperature Measurement 0x2A1C. */
|
|
81
|
+
const standardThermometerDevice = params => declareProfile(params, {
|
|
82
|
+
service: "1809",
|
|
83
|
+
characteristic: "2a1c",
|
|
84
|
+
minLengthBytes: 5,
|
|
85
|
+
measurementTypeKey: MeasurementTypeKey.temperature,
|
|
86
|
+
/** Celsius, with and without the timestamp that follows the reading. */
|
|
87
|
+
selectors: ["00", "02"],
|
|
88
|
+
fields: [littleEndian("bodyTemp", [1, 2, 3, 4], "Cel", "float")]
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
/** The SI weight resolution the specification fixes at five grams per count. */
|
|
92
|
+
const WEIGHT_KG_PER_COUNT = 0.005;
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Weight Scale Service 0x181D, Weight Measurement 0x2A9D.
|
|
96
|
+
*
|
|
97
|
+
* The reading is a scaled integer rather than a float, so the resolution is applied here.
|
|
98
|
+
*/
|
|
99
|
+
const standardWeightScaleDevice = params => declareProfile(params, {
|
|
100
|
+
service: "181d",
|
|
101
|
+
characteristic: "2a9d",
|
|
102
|
+
minLengthBytes: 3,
|
|
103
|
+
measurementTypeKey: MeasurementTypeKey.bodyWeight,
|
|
104
|
+
/** Kilograms, with and without the timestamp that follows the reading. */
|
|
105
|
+
selectors: ["00", "02"],
|
|
106
|
+
fields: [{
|
|
107
|
+
...littleEndian("bodyWeight", [1, 2], "kg", "uint"),
|
|
108
|
+
scale: WEIGHT_KG_PER_COUNT,
|
|
109
|
+
decimals: 3
|
|
110
|
+
}]
|
|
111
|
+
});
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* Pulse Oximeter Service 0x1822, PLX Spot-Check Measurement 0x2A5E.
|
|
115
|
+
*
|
|
116
|
+
* Saturation and pulse rate are both required by the catalog, which matches the
|
|
117
|
+
* specification: a spot-check measurement always carries both.
|
|
118
|
+
*/
|
|
119
|
+
const standardPulseOximeterDevice = params => declareProfile(params, {
|
|
120
|
+
service: "1822",
|
|
121
|
+
characteristic: "2a5e",
|
|
122
|
+
minLengthBytes: 5,
|
|
123
|
+
measurementTypeKey: MeasurementTypeKey.bloodOxygenPulseRate,
|
|
124
|
+
selectors: ["00"],
|
|
125
|
+
fields: [littleEndian("bloodOxygen", [1, 2], "%", "sfloat"), littleEndian("pulseRate", [3, 4], "bpm", "sfloat")]
|
|
126
|
+
});
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* Heart Rate Service 0x180D, Heart Rate Measurement 0x2A37.
|
|
130
|
+
*
|
|
131
|
+
* Only the eight-bit layout is declared. The sixteen-bit variant needs byte 2, which would
|
|
132
|
+
* raise `minLengthBytes` to three and reject every eight-bit frame - the common case - so it
|
|
133
|
+
* is left out rather than made to displace it.
|
|
134
|
+
*/
|
|
135
|
+
const standardHeartRateDevice = params => declareProfile(params, {
|
|
136
|
+
service: "180d",
|
|
137
|
+
characteristic: "2a37",
|
|
138
|
+
minLengthBytes: 2,
|
|
139
|
+
measurementTypeKey: MeasurementTypeKey.heartRate,
|
|
140
|
+
selectors: ["00"],
|
|
141
|
+
fields: [{
|
|
142
|
+
name: "heartRate",
|
|
143
|
+
byteIndexes: [1],
|
|
144
|
+
encoding: "uint",
|
|
145
|
+
unit: "bpm"
|
|
146
|
+
}]
|
|
147
|
+
});
|
|
148
|
+
export { standardBloodPressureDevice, standardHeartRateDevice, standardPulseOximeterDevice, standardThermometerDevice, standardWeightScaleDevice };
|
|
149
|
+
//# sourceMappingURL=standard-gatt.devices.js.map
|
package/lib/module/modules/bt-management/services/devices/standard-gatt/standard-gatt.devices.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["MeasurementTypeKey","defineCustomDevice","SPOT_CHECK_TIMEOUT_MS","sigUuid","assigned","declareProfile","params","profile","id","nameMatch","stuckDataTimeoutMs","services","uuid","service","monitor","characteristic","frame","minLengthBytes","caseSelectorBytes","cases","selectors","map","selector","kind","measurementTypeKey","fields","littleEndian","name","byteIndexes","unit","encoding","byteOrder","standardBloodPressureDevice","bloodPressure","standardThermometerDevice","temperature","WEIGHT_KG_PER_COUNT","standardWeightScaleDevice","bodyWeight","scale","decimals","standardPulseOximeterDevice","bloodOxygenPulseRate","standardHeartRateDevice","heartRate"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/standard-gatt/standard-gatt.devices.ts"],"mappings":";;AAAA,SAASA,kBAAkB,QAAQ,YAAY;AAI/C,SAASC,kBAAkB,QAAQ,sCAAmC;;AAEtE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,MAAMC,qBAAqB,GAAG,MAAM;AA6BpC,MAAMC,OAAO,GAAIC,QAAgB,IAC/B,OAAOA,QAAQ,8BA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2B,GAC/BnC,MAA4B,IAE5BD,cAAc,CAACC,MAAM,EAAE;EACrBO,OAAO,EAAE,MAAM;EACfE,cAAc,EAAE,MAAM;EACtBE,cAAc,EAAE,CAAC;EACjBO,kBAAkB,EAAExB,kBAAkB,CAAC0C,oBAAoB;EAC3DtB,SAAS,EAAE,CAAC,IAAI,CAAC;EACjBK,MAAM,EAAE,CACNC,YAAY,CAAC,aAAa,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,QAAQ,CAAC,EAClDA,YAAY,CAAC,WAAW,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,QAAQ,CAAC;AAEtD,CAAC,CAAC;;AAEJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMiB,uBAAuB,GAC3BrC,MAA4B,IAE5BD,cAAc,CAACC,MAAM,EAAE;EACrBO,OAAO,EAAE,MAAM;EACfE,cAAc,EAAE,MAAM;EACtBE,cAAc,EAAE,CAAC;EACjBO,kBAAkB,EAAExB,kBAAkB,CAAC4C,SAAS;EAChDxB,SAAS,EAAE,CAAC,IAAI,CAAC;EACjBK,MAAM,EAAE,CACN;IAAEE,IAAI,EAAE,WAAW;IAAEC,WAAW,EAAE,CAAC,CAAC,CAAC;IAAEE,QAAQ,EAAE,MAAM;IAAED,IAAI,EAAE;EAAM,CAAC;AAE1E,CAAC,CAAC;AAEJ,SACEG,2BAA2B,EAC3BW,uBAAuB,EACvBF,2BAA2B,EAC3BP,yBAAyB,EACzBG,yBAAyB","ignoreList":[]}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { MeasurementTypeKey } from "@ovok/core";
|
|
4
|
+
import { lepuNameMatch } from "../lepu/lepu.name-match.js";
|
|
5
|
+
import { lepuDevice } from "../lepu/lepu.transports.js";
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* The Viatom blood-pressure monitors that report a reading over the realtime channel.
|
|
9
|
+
*
|
|
10
|
+
* The vendor documents BP2, BP2A and BP2T as one product group on one set of characteristics
|
|
11
|
+
* with one API, and the SDK's own BP2 device class has run against that protocol on real
|
|
12
|
+
* hardware. The byte offsets below are that class's, unchanged.
|
|
13
|
+
*
|
|
14
|
+
* BP2W and the BP3 range decode the same struct rather than merely sharing a transport:
|
|
15
|
+
* their interfaces build `Bp2BleRtData`, which holds the device state in its first nine
|
|
16
|
+
* bytes and the result immediately after, and all of them answer the same `RT_DATA` opcode.
|
|
17
|
+
* That is still one step short of BP2A and BP2T, which the vendor groups with BP2 outright.
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
/** Realtime data. Inert on this series: it reads state, it does not start a measurement. */
|
|
21
|
+
const RT_DATA = 0x08;
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* The command byte and the device's state byte together pick the case.
|
|
25
|
+
*
|
|
26
|
+
* The state is the first byte of the realtime payload and is what says whether the numbers
|
|
27
|
+
* that follow are a finished reading or a cuff still inflating.
|
|
28
|
+
*/
|
|
29
|
+
const CASE_SELECTOR_BYTES = [1, 7];
|
|
30
|
+
|
|
31
|
+
/** Header, realtime state, and the result struct through its pulse-rate field. */
|
|
32
|
+
const MIN_LENGTH_BYTES = 28;
|
|
33
|
+
const READING = [{
|
|
34
|
+
name: "systolic",
|
|
35
|
+
byteIndexes: [20, 21],
|
|
36
|
+
byteOrder: "little",
|
|
37
|
+
encoding: "uint",
|
|
38
|
+
unit: "mmHg"
|
|
39
|
+
}, {
|
|
40
|
+
name: "diastolic",
|
|
41
|
+
byteIndexes: [22, 23],
|
|
42
|
+
byteOrder: "little",
|
|
43
|
+
encoding: "uint",
|
|
44
|
+
unit: "mmHg"
|
|
45
|
+
}, {
|
|
46
|
+
name: "heartRate",
|
|
47
|
+
byteIndexes: [26, 27],
|
|
48
|
+
byteOrder: "little",
|
|
49
|
+
encoding: "uint",
|
|
50
|
+
unit: "bpm"
|
|
51
|
+
}];
|
|
52
|
+
const result = (selector, description) => ({
|
|
53
|
+
selector,
|
|
54
|
+
kind: "result",
|
|
55
|
+
measurementTypeKey: MeasurementTypeKey.bloodPressure,
|
|
56
|
+
fields: [...READING],
|
|
57
|
+
description
|
|
58
|
+
});
|
|
59
|
+
const measuring = (selector, description) => ({
|
|
60
|
+
selector,
|
|
61
|
+
kind: "stream",
|
|
62
|
+
description
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* The states the series reports, and what each means for a reading.
|
|
67
|
+
*
|
|
68
|
+
* A finished measurement keeps reporting itself for as long as the device sits on the
|
|
69
|
+
* result screen, so the same numbers arrive on every poll. The state transition is what
|
|
70
|
+
* separates one measurement from the next, which is why the states in between are declared
|
|
71
|
+
* rather than ignored.
|
|
72
|
+
*/
|
|
73
|
+
const BP2_CASES = [measuring("0804", "Cuff inflating or deflating"), result("0805", "Measurement finished"), measuring("080f", "Averaging run: a measurement is in progress"), measuring("0810", "Averaging run: waiting between measurements"), result("0811", "Averaging run finished, carrying the same payload")];
|
|
74
|
+
/**
|
|
75
|
+
* Declares one monitor of the BP2 series.
|
|
76
|
+
*
|
|
77
|
+
* `advertisedName` is the name the vendor's SDK matches - `BP2A`, `BP2T` - and the matcher
|
|
78
|
+
* derived from it excludes every longer name in the family, so a declaration for `BP2`
|
|
79
|
+
* cannot pick up a `BP2W`.
|
|
80
|
+
*/
|
|
81
|
+
const viatomBpMonitor = (advertisedName, params) => lepuDevice({
|
|
82
|
+
id: params.id,
|
|
83
|
+
nameMatch: params.nameMatch ?? lepuNameMatch(advertisedName),
|
|
84
|
+
pollCommand: RT_DATA,
|
|
85
|
+
minLengthBytes: MIN_LENGTH_BYTES,
|
|
86
|
+
caseSelectorBytes: CASE_SELECTOR_BYTES,
|
|
87
|
+
cases: BP2_CASES.map(each => ({
|
|
88
|
+
...each
|
|
89
|
+
})),
|
|
90
|
+
...(params.expectedDeviceTypes ? {
|
|
91
|
+
expectedDeviceTypes: params.expectedDeviceTypes
|
|
92
|
+
} : {})
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
/** BP2A, the arm-cuff monitor of the series. */
|
|
96
|
+
const bp2aMonitor = params => viatomBpMonitor("BP2A", params);
|
|
97
|
+
|
|
98
|
+
/** BP2T, documented by the vendor alongside BP2 and BP2A as the same protocol. */
|
|
99
|
+
const bp2tMonitor = params => viatomBpMonitor("BP2T", params);
|
|
100
|
+
|
|
101
|
+
/** BP2W. Documented in its own section, but decoding the same realtime struct. */
|
|
102
|
+
const bp2wMonitor = params => viatomBpMonitor("BP2W", params);
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* The names the BP3 range advertises.
|
|
106
|
+
*
|
|
107
|
+
* Fifteen products differing in cuff and casing rather than in protocol, so declaring the
|
|
108
|
+
* range is one line per name:
|
|
109
|
+
*
|
|
110
|
+
* ```typescript
|
|
111
|
+
* const bp3Devices = BP3_MODEL_NAMES.map((name) =>
|
|
112
|
+
* viatomBpMonitor(name, { id: `viatom-${name.toLowerCase()}` }),
|
|
113
|
+
* );
|
|
114
|
+
* ```
|
|
115
|
+
*/
|
|
116
|
+
const BP3_MODEL_NAMES = ["BP3", "BP3-B", "BP3-C1", "BP3-C2", "BP3A", "BP3B", "BP3C", "BP3D", "BP3E", "BP3F", "BP3G", "BP3H", "BP3K", "BP3L", "BP3Z"];
|
|
117
|
+
export { bp2aMonitor, bp2tMonitor, bp2wMonitor, BP3_MODEL_NAMES, viatomBpMonitor };
|
|
118
|
+
//# sourceMappingURL=viatom.bp-monitors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["MeasurementTypeKey","lepuNameMatch","lepuDevice","RT_DATA","CASE_SELECTOR_BYTES","MIN_LENGTH_BYTES","READING","name","byteIndexes","byteOrder","encoding","unit","result","selector","description","kind","measurementTypeKey","bloodPressure","fields","measuring","BP2_CASES","viatomBpMonitor","advertisedName","params","id","nameMatch","pollCommand","minLengthBytes","caseSelectorBytes","cases","map","each","expectedDeviceTypes","bp2aMonitor","bp2tMonitor","bp2wMonitor","BP3_MODEL_NAMES"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/viatom/viatom.bp-monitors.ts"],"mappings":";;AAAA,SAASA,kBAAkB,QAAQ,YAAY;AAK/C,SAASC,aAAa,QAAQ,4BAAyB;AACvD,SAASC,UAAU,QAAQ,4BAAyB;;AAEpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,MAAMC,OAAO,GAAG,IAAI;;AAEpB;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,mBAAmB,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC;;AAElC;AACA,MAAMC,gBAAgB,GAAG,EAAE;AAE3B,MAAMC,OAA0B,GAAG,CACjC;EACEC,IAAI,EAAE,UAAU;EAChBC,WAAW,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC;EACrBC,SAAS,EAAE,QAAQ;EACnBC,QAAQ,EAAE,MAAM;EAChBC,IAAI,EAAE;AACR,CAAC,EACD;EACEJ,IAAI,EAAE,WAAW;EACjBC,WAAW,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC;EACrBC,SAAS,EAAE,QAAQ;EACnBC,QAAQ,EAAE,MAAM;EAChBC,IAAI,EAAE;AACR,CAAC,EACD;EACEJ,IAAI,EAAE,WAAW;EACjBC,WAAW,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC;EACrBC,SAAS,EAAE,QAAQ;EACnBC,QAAQ,EAAE,MAAM;EAChBC,IAAI,EAAE;AACR,CAAC,CACF;AAED,MAAMC,MAAM,GAAGA,CAACC,QAAgB,EAAEC,WAAmB,MAAsB;EACzED,QAAQ;EACRE,IAAI,EAAE,QAAQ;EACdC,kBAAkB,EAAEhB,kBAAkB,CAACiB,aAAa;EACpDC,MAAM,EAAE,CAAC,GAAGZ,OAAO,CAAC;EACpBQ;AACF,CAAC,CAAC;AAEF,MAAMK,SAAS,GAAGA,CAACN,QAAgB,EAAEC,W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,MAAMa,eAAkC,GAAG,CACzC,KAAK,EACL,OAAO,EACP,QAAQ,EACR,QAAQ,EACR,MAAM,EACN,MAAM,EACN,MAAM,EACN,MAAM,EACN,MAAM,EACN,MAAM,EACN,MAAM,EACN,MAAM,EACN,MAAM,EACN,MAAM,EACN,MAAM,CACP;AAED,SACEH,WAAW,EACXC,WAAW,EACXC,WAAW,EACXC,eAAe,EACff,eAAe","ignoreList":[]}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { MeasurementTypeKey } from "@ovok/core";
|
|
4
|
+
import { lepuNameMatch } from "../lepu/lepu.name-match.js";
|
|
5
|
+
import { lepuDevice } from "../lepu/lepu.transports.js";
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* The Viatom ECG recorders - ER1, ER2 and ER3.
|
|
9
|
+
*
|
|
10
|
+
* **What a declaration gets from these is the heart rate, not the waveform.** The ECG itself
|
|
11
|
+
* arrives as a stream of samples assembled across many notifications and belongs to a device
|
|
12
|
+
* class; the recorders also report a heart rate in the same realtime frame, at a fixed
|
|
13
|
+
* offset, and that is a reading a declaration can carry on its own.
|
|
14
|
+
*
|
|
15
|
+
* Their stored recordings are a separate matter and are reachable: these devices use the
|
|
16
|
+
* family's generic file opcodes, so `LepuFileTransfer` downloads their records unchanged.
|
|
17
|
+
* Turning a downloaded recording into a measurement still needs a device class.
|
|
18
|
+
*
|
|
19
|
+
* ## A note on the opcodes
|
|
20
|
+
*
|
|
21
|
+
* This range numbers its commands low, in the space where the family's meanings diverge
|
|
22
|
+
* most, so the poll is chosen deliberately rather than taken from whatever the vendor's SDK
|
|
23
|
+
* calls first:
|
|
24
|
+
*
|
|
25
|
+
* - `RT_PARAM` is `0x02` here and **`CALIBRATION_SLOPE` on a BP2**, a factory command that
|
|
26
|
+
* silently biases every subsequent blood-pressure reading. It is never sent, even though
|
|
27
|
+
* it would be the cheaper poll - it returns the parameters without the waveform.
|
|
28
|
+
* - `START_ECG` is `0x08` on a Lepod and `RT_DATA` on a BP2. It is never sent either.
|
|
29
|
+
*
|
|
30
|
+
* `RT_DATA` is a read on every one of them, which is why it is the poll here. The advertised
|
|
31
|
+
* name is what keeps these opcodes pointed at the right hardware, so a matcher for one of
|
|
32
|
+
* these devices should be narrowed, never widened.
|
|
33
|
+
*/
|
|
34
|
+
|
|
35
|
+
/** Reads the realtime parameters and waveform. A read on every device in this range. */
|
|
36
|
+
const RT_DATA = 0x03;
|
|
37
|
+
|
|
38
|
+
/** The ER3 answers its realtime data on a different opcode from the rest of the range. */
|
|
39
|
+
const ER3_RT_DATA = 0x06;
|
|
40
|
+
const HEART_RATE_UNIT = "bpm";
|
|
41
|
+
/** ER1, ER2 and ER3 share one parameter block: the heart rate opens it. */
|
|
42
|
+
const ER_HEART_RATE_BYTES = [7, 8];
|
|
43
|
+
/**
|
|
44
|
+
* Declares one recorder, reporting the heart rate from its realtime frame.
|
|
45
|
+
*
|
|
46
|
+
* A recorder that is not against the skin reports a rate outside what a heart can beat at,
|
|
47
|
+
* so it is discarded rather than reported. The device marks that condition in bits of a
|
|
48
|
+
* status byte, which a declaration cannot select on, so a recorder left connected and unworn
|
|
49
|
+
* reports a decoding failure on each poll. Reading those bits quietly needs a device class.
|
|
50
|
+
*/
|
|
51
|
+
const declareRecorder = (advertisedName, profile, params) => lepuDevice({
|
|
52
|
+
id: params.id,
|
|
53
|
+
nameMatch: params.nameMatch ?? lepuNameMatch(advertisedName),
|
|
54
|
+
transport: profile.transport,
|
|
55
|
+
pollCommand: profile.pollCommand,
|
|
56
|
+
minLengthBytes: profile.heartRateBytes[1] + 1,
|
|
57
|
+
caseSelectorBytes: [1],
|
|
58
|
+
cases: [{
|
|
59
|
+
selector: profile.pollCommand.toString(16).padStart(2, "0"),
|
|
60
|
+
kind: "result",
|
|
61
|
+
measurementTypeKey: MeasurementTypeKey.heartRate,
|
|
62
|
+
description: "Realtime parameters and waveform",
|
|
63
|
+
fields: [{
|
|
64
|
+
name: "heartRate",
|
|
65
|
+
byteIndexes: [...profile.heartRateBytes],
|
|
66
|
+
byteOrder: "little",
|
|
67
|
+
encoding: "uint",
|
|
68
|
+
unit: HEART_RATE_UNIT
|
|
69
|
+
}]
|
|
70
|
+
}],
|
|
71
|
+
...(params.expectedDeviceTypes ? {
|
|
72
|
+
expectedDeviceTypes: params.expectedDeviceTypes
|
|
73
|
+
} : {})
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
/** The ER1, and the handheld recorders sold under other names on the same protocol. */
|
|
77
|
+
const er1Recorder = (advertisedName, params) => declareRecorder(advertisedName, {
|
|
78
|
+
pollCommand: RT_DATA,
|
|
79
|
+
heartRateBytes: ER_HEART_RATE_BYTES,
|
|
80
|
+
transport: "standard"
|
|
81
|
+
}, params);
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* The ER2, which reads the same block but over a link that grants nothing beyond the
|
|
85
|
+
* minimum. Asking it for the MTU the rest of the family grants is what the vendor's own SDK
|
|
86
|
+
* declines to do, and a command longer than the link carries is truncated rather than
|
|
87
|
+
* refused.
|
|
88
|
+
*/
|
|
89
|
+
const er2Recorder = (advertisedName, params) => declareRecorder(advertisedName, {
|
|
90
|
+
pollCommand: RT_DATA,
|
|
91
|
+
heartRateBytes: ER_HEART_RATE_BYTES,
|
|
92
|
+
transport: "standardSmallMtu"
|
|
93
|
+
}, params);
|
|
94
|
+
|
|
95
|
+
/** The ER3, which reads the same parameter block from a different opcode. */
|
|
96
|
+
const er3Recorder = (advertisedName, params) => declareRecorder(advertisedName, {
|
|
97
|
+
pollCommand: ER3_RT_DATA,
|
|
98
|
+
heartRateBytes: ER_HEART_RATE_BYTES,
|
|
99
|
+
transport: "standard"
|
|
100
|
+
}, params);
|
|
101
|
+
|
|
102
|
+
/** The names the ER1 recorders advertise. */
|
|
103
|
+
const ER1_MODEL_NAMES = ["ER1", "ER1-H", "ER1-L", "ER1-S", "ER1-SP", "ER1-W", "ER1S", "HHM1"];
|
|
104
|
+
|
|
105
|
+
/** The names the ER2 recorders advertise, all of them on the small-MTU link. */
|
|
106
|
+
const ER2_MODEL_NAMES = ["ER2", "ER2-S", "HHM2", "HHM3", "LP ER2"];
|
|
107
|
+
export { er1Recorder, ER1_MODEL_NAMES, er2Recorder, ER2_MODEL_NAMES, er3Recorder };
|
|
108
|
+
//# sourceMappingURL=viatom.ecg-recorders.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["MeasurementTypeKey","lepuNameMatch","lepuDevice","RT_DATA","ER3_RT_DATA","HEART_RATE_UNIT","ER_HEART_RATE_BYTES","declareRecorder","advertisedName","profile","params","id","nameMatch","transport","pollCommand","minLengthBytes","heartRateBytes","caseSelectorBytes","cases","selector","toString","padStart","kind","measurementTypeKey","heartRate","description","fields","name","byteIndexes","byteOrder","encoding","unit","expectedDeviceTypes","er1Recorder","er2Recorder","er3Recorder","ER1_MODEL_NAMES","ER2_MODEL_NAMES"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/viatom/viatom.ecg-recorders.ts"],"mappings":";;AAAA,SAASA,kBAAkB,QAAQ,YAAY;AAG/C,SAASC,aAAa,QAAQ,4BAAyB;AACvD,SAASC,UAAU,QAA2B,4BAAyB;;AAEvE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,MAAMC,OAAO,GAAG,IAAI;;AAEpB;AACA,MAAMC,WAAW,GAAG,IAAI;AAExB,MAAMC,eAAe,GAAG,KAAK;AAY7B;AACA,MAAMC,mBAAqC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC;AAoBpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,eAAe,GAAGA,CACtBC,cAAsB,EACtBC,OAAmB,EACnBC,MAAuB,KAEvBR,UAAU,CAAC;EACTS,EAAE,EAAED,MAAM,CAACC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CAAC,EACDH,MACF,CAAC;;AAEH;AACA,MAAMyB,WAAW,GAAGA,CAClB3B,cAAsB,EACtBE,MAAuB,KAEvBH,eAAe,CACbC,cAAc,EACd;EACEM,WAAW,EAAEV,WAAW;EACxBY,cAAc,EAAEV,mBAAmB;EACnCO,SAAS,EAAE;AACb,CAAC,EACDH,MACF,CAAC;;AAEH;AACA,MAAM0B,eAAkC,GAAG,CACzC,KAAK,EACL,OAAO,EACP,OAAO,EACP,OAAO,EACP,QAAQ,EACR,OAAO,EACP,MAAM,EACN,MAAM,CACP;;AAED;AACA,MAAMC,eAAkC,GAAG,CAAC,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,CAAC;AAErF,SACEJ,WAAW,EACXG,eAAe,EACfF,WAAW,EACXG,eAAe,EACfF,WAAW","ignoreList":[]}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { MeasurementTypeKey } from "@ovok/core";
|
|
4
|
+
import { lepuNameMatch } from "../lepu/lepu.name-match.js";
|
|
5
|
+
import { lepuDevice } from "../lepu/lepu.transports.js";
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* The Lepod, a multi-parameter patient monitor.
|
|
9
|
+
*
|
|
10
|
+
* One realtime frame carries a heart rate, an oxygen saturation with its pulse rate, a
|
|
11
|
+
* respiration rate and a body temperature. They are four measurements taken by four
|
|
12
|
+
* instruments that happen to share a frame, so they are declared and reported separately: a
|
|
13
|
+
* temperature probe that is not attached is no reason to withhold the heart rate beside it.
|
|
14
|
+
*
|
|
15
|
+
* The ECG waveform in the same frame is not declared. It is a sample stream assembled across
|
|
16
|
+
* notifications and needs a device class; the recordings the device stores are reachable
|
|
17
|
+
* through the family's generic file opcodes.
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Reads the realtime frame. A read - unlike `START_ECG`, which is `0x08` here and `RT_DATA`
|
|
22
|
+
* on a BP2, and `RT_PARAM`, which is `0x02` here and `CALIBRATION_SLOPE` on a BP2.
|
|
23
|
+
*/
|
|
24
|
+
const RT_DATA = 0x03;
|
|
25
|
+
|
|
26
|
+
/** Header plus the parameter block through the temperature, which ends it. */
|
|
27
|
+
const MIN_LENGTH_BYTES = 46;
|
|
28
|
+
|
|
29
|
+
/** Frame offsets: the vendor's parameter block starts at the seven-byte header. */
|
|
30
|
+
const HEART_RATE = [31, 32];
|
|
31
|
+
const RESPIRATION_RATE = 34;
|
|
32
|
+
const BLOOD_OXYGEN = 36;
|
|
33
|
+
const PULSE_RATE = [37, 38];
|
|
34
|
+
const PERFUSION_INDEX = 39;
|
|
35
|
+
const TEMPERATURE = [44, 45];
|
|
36
|
+
|
|
37
|
+
/** The device counts perfusion in tenths of a percent and temperature in hundredths. */
|
|
38
|
+
const PERFUSION_SCALE = 0.1;
|
|
39
|
+
const TEMPERATURE_SCALE = 0.01;
|
|
40
|
+
const littleEndian = (name, byteIndexes, unit) => ({
|
|
41
|
+
name,
|
|
42
|
+
byteIndexes,
|
|
43
|
+
byteOrder: "little",
|
|
44
|
+
encoding: "uint",
|
|
45
|
+
unit
|
|
46
|
+
});
|
|
47
|
+
const LEPOD_MEASUREMENTS = [{
|
|
48
|
+
measurementTypeKey: MeasurementTypeKey.bloodOxygenPulseRate,
|
|
49
|
+
fields: [{
|
|
50
|
+
name: "bloodOxygen",
|
|
51
|
+
byteIndexes: [BLOOD_OXYGEN],
|
|
52
|
+
encoding: "uint",
|
|
53
|
+
unit: "%"
|
|
54
|
+
}, littleEndian("pulseRate", PULSE_RATE, "bpm"), {
|
|
55
|
+
name: "perfusionIndex",
|
|
56
|
+
byteIndexes: [PERFUSION_INDEX],
|
|
57
|
+
encoding: "uint",
|
|
58
|
+
unit: "%",
|
|
59
|
+
scale: PERFUSION_SCALE,
|
|
60
|
+
decimals: 1
|
|
61
|
+
}]
|
|
62
|
+
}, {
|
|
63
|
+
measurementTypeKey: MeasurementTypeKey.respiratoryRate,
|
|
64
|
+
fields: [{
|
|
65
|
+
name: "respiratoryRate",
|
|
66
|
+
byteIndexes: [RESPIRATION_RATE],
|
|
67
|
+
encoding: "uint",
|
|
68
|
+
unit: "/min"
|
|
69
|
+
}]
|
|
70
|
+
}, {
|
|
71
|
+
measurementTypeKey: MeasurementTypeKey.temperature,
|
|
72
|
+
fields: [{
|
|
73
|
+
name: "bodyTemp",
|
|
74
|
+
byteIndexes: TEMPERATURE,
|
|
75
|
+
byteOrder: "little",
|
|
76
|
+
encoding: "uint",
|
|
77
|
+
unit: "Cel",
|
|
78
|
+
scale: TEMPERATURE_SCALE,
|
|
79
|
+
decimals: 2
|
|
80
|
+
}]
|
|
81
|
+
}];
|
|
82
|
+
/**
|
|
83
|
+
* Declares a Lepod, reporting every reading its realtime frame carries.
|
|
84
|
+
*
|
|
85
|
+
* An instrument that is not attached reports a value outside the physiological range for
|
|
86
|
+
* what it measures, so that reading is discarded and reported while the others in the same
|
|
87
|
+
* frame are still delivered. The device also marks those conditions in bits of a lead-off
|
|
88
|
+
* byte, which a declaration cannot select on - reading them quietly needs a device class.
|
|
89
|
+
*/
|
|
90
|
+
const lepodMonitor = (advertisedName, params) => lepuDevice({
|
|
91
|
+
id: params.id,
|
|
92
|
+
nameMatch: params.nameMatch ?? lepuNameMatch(advertisedName),
|
|
93
|
+
pollCommand: RT_DATA,
|
|
94
|
+
minLengthBytes: MIN_LENGTH_BYTES,
|
|
95
|
+
caseSelectorBytes: [1],
|
|
96
|
+
cases: [{
|
|
97
|
+
selector: "03",
|
|
98
|
+
kind: "result",
|
|
99
|
+
measurementTypeKey: MeasurementTypeKey.heartRate,
|
|
100
|
+
description: "Realtime parameters, waveform and lead state",
|
|
101
|
+
fields: [littleEndian("heartRate", HEART_RATE, "bpm")],
|
|
102
|
+
additionalMeasurements: LEPOD_MEASUREMENTS.map(each => ({
|
|
103
|
+
...each
|
|
104
|
+
}))
|
|
105
|
+
}],
|
|
106
|
+
...(params.expectedDeviceTypes ? {
|
|
107
|
+
expectedDeviceTypes: params.expectedDeviceTypes
|
|
108
|
+
} : {})
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
/** The names the Lepod range advertises. */
|
|
112
|
+
const LEPOD_MODEL_NAMES = ["Lepod", "LepodPro"];
|
|
113
|
+
export { LEPOD_MODEL_NAMES, lepodMonitor };
|
|
114
|
+
//# sourceMappingURL=viatom.lepod.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["MeasurementTypeKey","lepuNameMatch","lepuDevice","RT_DATA","MIN_LENGTH_BYTES","HEART_RATE","RESPIRATION_RATE","BLOOD_OXYGEN","PULSE_RATE","PERFUSION_INDEX","TEMPERATURE","PERFUSION_SCALE","TEMPERATURE_SCALE","littleEndian","name","byteIndexes","unit","byteOrder","encoding","LEPOD_MEASUREMENTS","measurementTypeKey","bloodOxygenPulseRate","fields","scale","decimals","respiratoryRate","temperature","lepodMonitor","advertisedName","params","id","nameMatch","pollCommand","minLengthBytes","caseSelectorBytes","cases","selector","kind","heartRate","description","additionalMeasurements","map","each","expectedDeviceTypes","LEPOD_MODEL_NAMES"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/viatom/viatom.lepod.ts"],"mappings":";;AAAA,SAASA,kBAAkB,QAAQ,YAAY;AAK/C,SAASC,aAAa,QAAQ,4BAAyB;AACvD,SAASC,UAAU,QAAQ,4BAAyB;;AAEpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,MAAMC,OAAO,GAAG,IAAI;;AAEpB;AACA,MAAMC,gBAAgB,GAAG,EAAE;;AAE3B;AACA,MAAMC,UAAU,GAAG,CAAC,EAAE,EAAE,EAAE,CAAC;AAC3B,MAAMC,gBAAgB,GAAG,EAAE;AAC3B,MAAMC,YAAY,GAAG,EAAE;AACvB,MAAMC,UAAU,GAAG,CAAC,EAAE,EAAE,EAAE,CAAC;AAC3B,MAAMC,eAAe,GA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Y,QAAQ,EAAE;EACZ,CAAC;AAEL,CAAC,CACF;AAiBD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMG,YAAY,GAAGA,CACnBC,cAAsB,EACtBC,MAAmB,KAEnB3B,UAAU,CAAC;EACT4B,EAAE,EAAED,MAAM,CAACC,EAAE;EACbC,SAAS,EAAEF,MAAM,CAACE,SAAS,IAAI9B,aAAa,CAAC2B,cAAc,CAAC;EAC5DI,WAAW,EAAE7B,OAAO;EACpB8B,cAAc,EAAE7B,gBAAgB;EAChC8B,iBAAiB,EAAE,CAAC,CAAC,CAAC;EACtBC,KAAK,EAAE,CACL;IACEC,QAAQ,EAAE,IAAI;IACdC,IAAI,EAAE,QAAQ;IACdjB,kBAAkB,EAAEpB,kBAAkB,CAACsC,SAAS;IAChDC,WAAW,EAAE,8CAA8C;IAC3DjB,MAAM,EAAE,CAACT,YAAY,CAAC,WAAW,EAAER,UAAU,EAAE,KAAK,CAAC,CAAC;IACtDmC,sBAAsB,EAAErB,kBAAkB,CAACsB,GAAG,CAAEC,IAAI,KAAM;MACxD,GAAGA;IACL,CAAC,CAAC;EACJ,CAAC,CACF;EACD,IAAIb,MAAM,CAACc,mBAAmB,GAC1B;IAAEA,mBAAmB,EAAEd,MAAM,CAACc;EAAoB,CAAC,GACnD,CAAC,CAAC;AACR,CAAC,CAAC;;AAEJ;AACA,MAAMC,iBAAoC,GAAG,CAAC,OAAO,EAAE,UAAU,CAAC;AAElE,SAASA,iBAAiB,EAAEjB,YAAY","ignoreList":[]}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { MeasurementTypeKey } from "@ovok/core";
|
|
4
|
+
import { lepuNameMatch } from "../lepu/lepu.name-match.js";
|
|
5
|
+
import { lepuDevice } from "../lepu/lepu.transports.js";
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* The Viatom pulse oximeters - the O2Ring, Oxyfit, KidsO2 and BabyO2 ranges.
|
|
9
|
+
*
|
|
10
|
+
* They share the family's framing and characteristics but not its opcodes: this range
|
|
11
|
+
* numbers its own commands, so realtime parameters are `0x17` here rather than the `0x08`
|
|
12
|
+
* the blood-pressure monitors answer, and its stored files are read with `0x03`-`0x05`
|
|
13
|
+
* rather than the generic `0xF1`-`0xF4`. A file transfer written for the rest of the family
|
|
14
|
+
* does not apply to these.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
/** Realtime parameters. A read: it reports what the sensor sees and starts nothing. */
|
|
18
|
+
const RT_PARAM = 0x17;
|
|
19
|
+
|
|
20
|
+
/** Only the command byte, because what makes a reading valid here is a bit, not a byte. */
|
|
21
|
+
const CASE_SELECTOR_BYTES = [1];
|
|
22
|
+
|
|
23
|
+
/** Header plus the realtime parameters through the pulse rate. */
|
|
24
|
+
const MIN_LENGTH_BYTES = 10;
|
|
25
|
+
const PAYLOAD = 7;
|
|
26
|
+
const SPOT_CHECK_TIMEOUT_MS = 60_000;
|
|
27
|
+
/**
|
|
28
|
+
* Declares one oximeter of the range.
|
|
29
|
+
*
|
|
30
|
+
* **A finger that is not in the sensor yields no reading, reported as an error.** The device
|
|
31
|
+
* answers every poll whether or not it is measuring, and marks an unusable reading in two
|
|
32
|
+
* bits of a status byte - which a declaration cannot read, because a case is selected by
|
|
33
|
+
* whole bytes. What it can do is refuse the number: an oxygen saturation measured off the
|
|
34
|
+
* finger falls outside the physiological range, so it is discarded rather than reported.
|
|
35
|
+
* The reading is therefore never wrong, but a device left connected with nobody wearing it
|
|
36
|
+
* reports a decoding failure on each poll. Reading those bits quietly needs a device class.
|
|
37
|
+
*/
|
|
38
|
+
const viatomOximeter = (advertisedName, params) => lepuDevice({
|
|
39
|
+
id: params.id,
|
|
40
|
+
nameMatch: params.nameMatch ?? lepuNameMatch(advertisedName),
|
|
41
|
+
stuckDataTimeoutMs: SPOT_CHECK_TIMEOUT_MS,
|
|
42
|
+
pollCommand: RT_PARAM,
|
|
43
|
+
minLengthBytes: MIN_LENGTH_BYTES,
|
|
44
|
+
caseSelectorBytes: CASE_SELECTOR_BYTES,
|
|
45
|
+
cases: [{
|
|
46
|
+
selector: "17",
|
|
47
|
+
kind: "result",
|
|
48
|
+
measurementTypeKey: MeasurementTypeKey.bloodOxygenPulseRate,
|
|
49
|
+
description: "Realtime parameters",
|
|
50
|
+
fields: [{
|
|
51
|
+
name: "bloodOxygen",
|
|
52
|
+
byteIndexes: [PAYLOAD],
|
|
53
|
+
encoding: "uint",
|
|
54
|
+
unit: "%"
|
|
55
|
+
}, {
|
|
56
|
+
name: "pulseRate",
|
|
57
|
+
byteIndexes: [PAYLOAD + 1, PAYLOAD + 2],
|
|
58
|
+
byteOrder: "little",
|
|
59
|
+
encoding: "uint",
|
|
60
|
+
unit: "bpm"
|
|
61
|
+
}]
|
|
62
|
+
}],
|
|
63
|
+
...(params.expectedDeviceTypes ? {
|
|
64
|
+
expectedDeviceTypes: params.expectedDeviceTypes
|
|
65
|
+
} : {})
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* The names the oximeter range advertises.
|
|
70
|
+
*
|
|
71
|
+
* ```typescript
|
|
72
|
+
* const oximeters = VIATOM_OXIMETER_NAMES.map((name) =>
|
|
73
|
+
* viatomOximeter(name, { id: `viatom-${name.toLowerCase()}` }),
|
|
74
|
+
* );
|
|
75
|
+
* ```
|
|
76
|
+
*/
|
|
77
|
+
const VIATOM_OXIMETER_NAMES = ["BBSM S1", "BBSM S2", "CMRing", "KidsO2-WPS", "O2 Intg", "O2M-WPS", "O2R WAVE", "O2RMed S", "O2Ring", "O2Ring S", "O2Ring SC", "O2Ring SF", "O2Ring SP", "O2Ring-RE", "O2RingF", "Oxyfit", "Oxyfit-WPS", "OxyU", "OxyU SE", "SI PO2"];
|
|
78
|
+
export { VIATOM_OXIMETER_NAMES, viatomOximeter };
|
|
79
|
+
//# sourceMappingURL=viatom.oximeters.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["MeasurementTypeKey","lepuNameMatch","lepuDevice","RT_PARAM","CASE_SELECTOR_BYTES","MIN_LENGTH_BYTES","PAYLOAD","SPOT_CHECK_TIMEOUT_MS","viatomOximeter","advertisedName","params","id","nameMatch","stuckDataTimeoutMs","pollCommand","minLengthBytes","caseSelectorBytes","cases","selector","kind","measurementTypeKey","bloodOxygenPulseRate","description","fields","name","byteIndexes","encoding","unit","byteOrder","expectedDeviceTypes","VIATOM_OXIMETER_NAMES"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/viatom/viatom.oximeters.ts"],"mappings":";;AAAA,SAASA,kBAAkB,QAAQ,YAAY;AAG/C,SAASC,aAAa,QAAQ,4BAAyB;AACvD,SAASC,UAAU,QAAQ,4BAAyB;;AAEpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,MAAMC,QAAQ,GAAG,IAAI;;AAErB;AACA,MAAMC,mBAAmB,GAAG,CAAC,CAAC,CAAC;;AAE/B;AACA,MAAMC,gBAAgB,GAAG,EAAE;AAE3B,MAAMC,OAAO,GAAG,CAAC;AAEjB,MAAMC,qBAAqB,GAAG,MAAM;AAoBpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,cAAc,GAAGA,CACrBC,cAAsB,EACtBC,MAA4B,KAE5BR,UAAU,CAAC;EACTS,EAAE,EAAED,MAAM,CAACC,EAAE;EACbC,SAAS,EAAEF,MAAM,CAACE,SAAS,IAAIX,aAAa,CAACQ,cAAc,CAAC;EAC5DI,kBAAkB,EAAEN,qBAAqB;EACzCO,WAAW,EAAEX,QAAQ;EACrBY,cAAc,EAAEV,gBAAgB;EAChCW,iBAAiB,EAAEZ,mBAAmB;EACtCa,KAAK,EAAE,CACL;IACEC,QAAQ,EAAE,IAAI;IACdC,IAAI,EAAE,QAAQ;IACdC,kBAAkB,EAAEpB,kBAAkB,CAACqB,oBAAoB;IAC3DC,WAAW,EAAE,qBAAqB;IAClCC,MAAM,EAAE,CACN;MACEC,IAAI,EAAE,aAAa;MACnBC,WAAW,EAAE,CAACnB,OAAO,CAAC;MACtBoB,QAAQ,EAAE,MAAM;MAChBC,IAAI,EAAE;IACR,CAAC,EACD;MACEH,IAAI,EAAE,WAAW;MACjBC,WAAW,EAAE,CAACnB,OAAO,GAAG,CAAC,EAAEA,OAAO,GAAG,CAAC,CAAC;MACvCsB,SAAS,EAAE,QAAQ;MACnBF,QAAQ,EAAE,MAAM;MAChBC,IAAI,EAAE;IACR,CAAC;EAEL,CAAC,CACF;EACD,IAAIjB,MAAM,CAACmB,mBAAmB,GAC1B;IAAEA,mBAAmB,EAAEnB,MAAM,CAACmB;EAAoB,CAAC,GACnD,CAAC,CAAC;AACR,CAAC,CAAC;;AAEJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,qBAAwC,GAAG,CAC/C,SAAS,EACT,SAAS,EACT,QAAQ,EACR,YAAY,EACZ,SAAS,EACT,SAAS,EACT,UAAU,EACV,UAAU,EACV,QAAQ,EACR,UAAU,EACV,WAAW,EACX,WAAW,EACX,WAAW,EACX,WAAW,EACX,SAAS,EACT,QAAQ,EACR,YAAY,EACZ,MAAM,EACN,SAAS,EACT,QAAQ,CACT;AAED,SAASA,qBAAqB,EAAEtB,cAAc","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../../../src","sources":["modules/bt-management/types/command-sequencer.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../../../src","sources":["modules/bt-management/types/custom-checksum-algorithm.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../../../src","sources":["modules/bt-management/types/custom-checksum-spec.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["CUSTOM_DEVICE_BRAND"],"sourceRoot":"../../../../../src","sources":["modules/bt-management/types/custom-device-definition.ts"],"mappings":";;AAAA,SAASA,mBAAmB,QAAQ,qCAAkC;;
|
|
1
|
+
{"version":3,"names":["CUSTOM_DEVICE_BRAND"],"sourceRoot":"../../../../../src","sources":["modules/bt-management/types/custom-device-definition.ts"],"mappings":";;AAAA,SAASA,mBAAmB,QAAQ,qCAAkC;;AAStE;AACA;AACA","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../../../src","sources":["modules/bt-management/types/custom-lepu-spec.ts"],"mappings":"","ignoreList":[]}
|