@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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sourceRoot":"../../../../src","sources":["modules/bt-management/index.ts"],"mappings":";;AAAA,cAAc,gCAA6B;AAC3C,cAAc,4BAAyB;AACvC,cAAc,kCAA+B;AAC7C,cAAc,8BAA2B;AACzC,cAAc,6BAA0B;AACxC,cAAc,6BAA0B;AACxC,cAAc,qCAAkC;AAChD,cAAc,6BAA0B;AACxC,cAAc,+BAA4B;AAC1C,cAAc,kCAA+B;AAC7C,cAAc,8BAA2B;AACzC,cAAc,8BAA2B;AACzC,cAAc,+BAA4B;AAC1C,cAAc,gCAA6B;AAC3C,cAAc,gCAA6B;AAC3C,cAAc,uBAAoB;AAClC,cAAc,0BAAuB;AACrC,cAAc,wBAAqB;AACnC,cAAc,0BAAuB;AACrC,cAAc,+BAA4B;AAC1C,cAAc,6BAA0B;AACxC,cAAc,yBAAsB;AACpC,cAAc,0BAAuB;AACrC,cAAc,6BAA0B;AACxC,cAAc,sCAAmC;AACjD,cAAc,4BAAyB;AACvC,cAAc,2BAAwB;AACtC,cAAc,0CAAuC;AAErD,cAAc,yCAAsC;AACpD,cAAc,4CAAyC;AACvD,cAAc,0BAAuB;AACrC,cAAc,2CAAwC;
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../../src","sources":["modules/bt-management/index.ts"],"mappings":";;AAAA,cAAc,gCAA6B;AAC3C,cAAc,4BAAyB;AACvC,cAAc,kCAA+B;AAC7C,cAAc,8BAA2B;AACzC,cAAc,6BAA0B;AACxC,cAAc,6BAA0B;AACxC,cAAc,qCAAkC;AAChD,cAAc,6BAA0B;AACxC,cAAc,+BAA4B;AAC1C,cAAc,kCAA+B;AAC7C,cAAc,8BAA2B;AACzC,cAAc,8BAA2B;AACzC,cAAc,6BAA0B;AACxC,cAAc,+BAA4B;AAC1C,cAAc,gCAA6B;AAC3C,cAAc,gCAA6B;AAC3C,cAAc,8BAA2B;AACzC,cAAc,2BAAwB;AACtC,cAAc,uBAAoB;AAClC,cAAc,0BAAuB;AACrC,cAAc,wBAAqB;AACnC,cAAc,0BAAuB;AACrC,cAAc,+BAA4B;AAC1C,cAAc,6BAA0B;AACxC,cAAc,yBAAsB;AACpC,cAAc,0BAAuB;AACrC,cAAc,6BAA0B;AACxC,cAAc,sCAAmC;AACjD,cAAc,4BAAyB;AACvC,cAAc,2BAAwB;AACtC,cAAc,0CAAuC;AAErD,cAAc,yCAAsC;AACpD,cAAc,4CAAyC;AACvD,cAAc,0BAAuB;AACrC,cAAc,2CAAwC;AACtD,cAAc,2DAAwD;AACtE,cAAc,4CAAyC;AACvD,cAAc,4CAAyC;AACvD,cAAc,iDAA8C;AAC5D,cAAc,+CAA4C;AAC1D,cAAc,mDAAgD;AAC9D,cAAc,2CAAwC;AACtD,cAAc,8CAA2C;AACzD,cAAc,4CAAyC;AACvD,cAAc,0CAAuC;AACrD,cAAc,6CAA0C;AACxD,cAAc,+CAA4C;AAC1D,cAAc,+CAA4C;AAE1D,cAAc,0CAAuC;AAErD,cAAc,6BAA0B;AACxC,cAAc,6CAA0C;AACxD,cAAc,oCAAiC","ignoreList":[]}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { measurementFieldCatalog } from "../../constants/measurement-field-catalog.js";
|
|
4
|
+
import { createCustomFieldParser } from "../../utils/create-custom-field-parser.js";
|
|
5
|
+
import { compileCustomField } from "./compile-custom-field.js";
|
|
6
|
+
import { customDeviceError } from "./custom-device-error.js";
|
|
7
|
+
const registerField = (id, path, compiled, measurementTypeKey, fields) => {
|
|
8
|
+
const key = `${measurementTypeKey}:${compiled.name}`;
|
|
9
|
+
const existing = fields.get(key);
|
|
10
|
+
if (existing && (existing.min !== compiled.min || existing.max !== compiled.max)) {
|
|
11
|
+
throw customDeviceError(id, path, `declares ${compiled.name} with different bounds (${compiled.min}-${compiled.max}) than an earlier case (${existing.min}-${existing.max}); a property must mean the same thing in every frame`);
|
|
12
|
+
}
|
|
13
|
+
fields.set(key, compiled);
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* A reading must carry every property that makes it that measurement. A blood pressure
|
|
18
|
+
* without a diastolic is not a partial blood pressure, it is a clinical record of something
|
|
19
|
+
* the device never reported, so the declaration is refused rather than the reading dropped.
|
|
20
|
+
*/
|
|
21
|
+
const assertRequiredFields = (id, path, declared, measurementTypeKey) => {
|
|
22
|
+
const catalog = measurementFieldCatalog[measurementTypeKey] ?? {};
|
|
23
|
+
const declaredNames = new Set(declared.map(field => field?.name));
|
|
24
|
+
const missing = Object.entries(catalog).filter(([name, field]) => field.required && !declaredNames.has(name)).map(([name]) => name);
|
|
25
|
+
if (missing.length > 0) {
|
|
26
|
+
throw customDeviceError(id, `${path}.fields`, `does not declare ${missing.join(", ")}, which ${measurementTypeKey} needs to be a complete reading`);
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
const compileFields = (id, path, declared, measurementTypeKey, minLengthBytes, fields, names) => declared.map((field, index) => {
|
|
30
|
+
if (names.has(field.name)) {
|
|
31
|
+
throw customDeviceError(id, `${path}.fields[${index}].name`, `"${field.name}" is declared twice in this frame; a property name must be unique across every reading the frame carries, because the decoded frame is one flat object`);
|
|
32
|
+
}
|
|
33
|
+
names.add(field.name);
|
|
34
|
+
const compiled = compileCustomField(id, `${path}.fields[${index}]`, field, measurementTypeKey, minLengthBytes);
|
|
35
|
+
registerField(id, path, compiled, measurementTypeKey, fields);
|
|
36
|
+
return {
|
|
37
|
+
name: compiled.name,
|
|
38
|
+
parseType: "custom",
|
|
39
|
+
byteIndexes: compiled.byteIndexes,
|
|
40
|
+
customParserDefinition: createCustomFieldParser(compiled)
|
|
41
|
+
};
|
|
42
|
+
});
|
|
43
|
+
export { assertRequiredFields, compileFields };
|
|
44
|
+
//# sourceMappingURL=compile-case-fields.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["measurementFieldCatalog","createCustomFieldParser","compileCustomField","customDeviceError","registerField","id","path","compiled","measurementTypeKey","fields","key","name","existing","get","min","max","set","assertRequiredFields","declared","catalog","declaredNames","Set","map","field","missing","Object","entries","filter","required","has","length","join","compileFields","minLengthBytes","names","index","add","parseType","byteIndexes","customParserDefinition"],"sourceRoot":"../../../../../../src","sources":["modules/bt-management/services/custom/compile-case-fields.ts"],"mappings":";;AAEA,SAASA,uBAAuB,QAAQ,8CAA2C;AAInF,SAASC,uBAAuB,QAAQ,2CAAwC;AAEhF,SAASC,kBAAkB,QAAQ,2BAAwB;AAC3D,SAASC,iBAAiB,QAAQ,0BAAuB;AAEzD,MAAMC,aAAa,GAAGA,CACpBC,EAAU,EACVC,IAAY,EACZC,QAA6B,EAC7BC,kBAAsC,EACtCC,MAAwC,KAC/B;EACT,MAAMC,GAAG,GAAG,GAAGF,kBAAkB,IAAID,QAAQ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AAI,CAAC,WAAWvB,kBAAkB,iCACrE,CAAC;EACH;AACF,CAAC;AAED,MAAMwB,aAAa,GAAGA,CACpB3B,EAAU,EACVC,IAAY,EACZY,QAA2B,EAC3BV,kBAAsC,EACtCyB,cAAsB,EACtBxB,MAAwC,EACxCyB,KAAkB,KAElBhB,QAAQ,CAACI,GAAG,CAAC,CAACC,KAAK,EAAEY,KAAK,KAAK;EAC7B,IAAID,KAAK,CAACL,GAAG,CAACN,KAAK,CAACZ,IAAI,CAAC,EAAE;IACzB,MAAMR,iBAAiB,CACrBE,EAAE,EACF,GAAGC,IAAI,WAAW6B,KAAK,QAAQ,EAC/B,IAAIZ,KAAK,CAACZ,IAAI,wJAChB,CAAC;EACH;EAEAuB,KAAK,CAACE,GAAG,CAACb,KAAK,CAACZ,IAAI,CAAC;EAErB,MAAMJ,QAAQ,GAAGL,kBAAkB,CACjCG,EAAE,EACF,GAAGC,IAAI,WAAW6B,KAAK,GAAG,EAC1BZ,KAAK,EACLf,kBAAkB,EAClByB,cACF,CAAC;EAED7B,aAAa,CAACC,EAAE,EAAEC,IAAI,EAAEC,QAAQ,EAAEC,kBAAkB,EAAEC,MAAM,CAAC;EAE7D,OAAO;IACLE,IAAI,EAAEJ,QAAQ,CAACI,IAAI;IACnB0B,SAAS,EAAE,QAAQ;IACnBC,WAAW,EAAE/B,QAAQ,CAAC+B,WAAW;IACjCC,sBAAsB,EAAEtC,uBAAuB,CAACM,QAAQ;EAC1D,CAAC;AACH,CAAC,CAAC;AAEJ,SAASU,oBAAoB,EAAEe,aAAa","ignoreList":[]}
|
|
@@ -2,8 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import { measurementFieldCatalog } from "../../constants/measurement-field-catalog.js";
|
|
4
4
|
import { CaseType } from "../../types/case-type.js";
|
|
5
|
-
import {
|
|
6
|
-
import { compileCustomField } from "./compile-custom-field.js";
|
|
5
|
+
import { assertRequiredFields, compileFields } from "./compile-case-fields.js";
|
|
7
6
|
import { customDeviceError } from "./custom-device-error.js";
|
|
8
7
|
|
|
9
8
|
/**
|
|
@@ -33,44 +32,28 @@ const assertMeasurementTypeKey = (id, path, caseSpec) => {
|
|
|
33
32
|
}
|
|
34
33
|
return key;
|
|
35
34
|
};
|
|
36
|
-
const registerField = (id, path, compiled, measurementTypeKey, fields) => {
|
|
37
|
-
const key = `${measurementTypeKey}:${compiled.name}`;
|
|
38
|
-
const existing = fields.get(key);
|
|
39
|
-
if (existing && (existing.min !== compiled.min || existing.max !== compiled.max)) {
|
|
40
|
-
throw customDeviceError(id, path, `declares ${compiled.name} with different bounds (${compiled.min}-${compiled.max}) than an earlier case (${existing.min}-${existing.max}); a property must mean the same thing in every frame`);
|
|
41
|
-
}
|
|
42
|
-
fields.set(key, compiled);
|
|
43
|
-
};
|
|
44
35
|
|
|
45
36
|
/**
|
|
46
|
-
*
|
|
47
|
-
*
|
|
48
|
-
*
|
|
37
|
+
* Every reading the frame carries, the declared one first.
|
|
38
|
+
*
|
|
39
|
+
* A frame reporting one measurement and a frame reporting six are the same shape here, so
|
|
40
|
+
* nothing downstream needs to know which it was reading.
|
|
49
41
|
*/
|
|
50
|
-
const
|
|
51
|
-
const
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
if (missing.length > 0) {
|
|
55
|
-
throw customDeviceError(id, `${path}.fields`, `does not declare ${missing.join(", ")}, which ${measurementTypeKey} needs to be a complete reading`);
|
|
42
|
+
const declaredMeasurements = (id, path, caseSpec, measurementTypeKey) => {
|
|
43
|
+
const additional = caseSpec.additionalMeasurements ?? [];
|
|
44
|
+
if (!Array.isArray(additional)) {
|
|
45
|
+
throw customDeviceError(id, `${path}.additionalMeasurements`, "must be an array of further readings this frame carries");
|
|
56
46
|
}
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
throw customDeviceError(id, `${path}.fields[${index}].name`, `"${field.name}" is declared twice in this case`);
|
|
47
|
+
return [{
|
|
48
|
+
path,
|
|
49
|
+
measurement: {
|
|
50
|
+
measurementTypeKey,
|
|
51
|
+
fields: caseSpec.fields ?? []
|
|
63
52
|
}
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
name: compiled.name,
|
|
69
|
-
parseType: "custom",
|
|
70
|
-
byteIndexes: compiled.byteIndexes,
|
|
71
|
-
customParserDefinition: createCustomFieldParser(compiled)
|
|
72
|
-
};
|
|
73
|
-
});
|
|
53
|
+
}, ...additional.map((measurement, index) => ({
|
|
54
|
+
path: `${path}.additionalMeasurements[${index}]`,
|
|
55
|
+
measurement
|
|
56
|
+
}))];
|
|
74
57
|
};
|
|
75
58
|
|
|
76
59
|
/** Validates one declared frame shape and turns it into a parsing case. */
|
|
@@ -82,7 +65,7 @@ export const compileCustomCase = (id, path, caseSpec, minLengthBytes, fields) =>
|
|
|
82
65
|
const measurementTypeKey = assertMeasurementTypeKey(id, path, caseSpec);
|
|
83
66
|
const declared = caseSpec.fields ?? [];
|
|
84
67
|
if (caseSpec.kind !== "result") {
|
|
85
|
-
if (declared.length > 0) {
|
|
68
|
+
if (declared.length > 0 || caseSpec.additionalMeasurements) {
|
|
86
69
|
throw customDeviceError(id, path, 'declares fields, but fields may be declared on only a "result" case');
|
|
87
70
|
}
|
|
88
71
|
return {
|
|
@@ -97,16 +80,39 @@ export const compileCustomCase = (id, path, caseSpec, minLengthBytes, fields) =>
|
|
|
97
80
|
throw customDeviceError(id, path, 'is a "result" case and must declare at least one field');
|
|
98
81
|
}
|
|
99
82
|
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
const parseDefinitions =
|
|
103
|
-
|
|
83
|
+
/** Shared, so a property declared under two readings in one frame is refused. */
|
|
84
|
+
const names = new Set();
|
|
85
|
+
const parseDefinitions = [];
|
|
86
|
+
const measurements = [];
|
|
87
|
+
declaredMeasurements(id, path, caseSpec, measurementTypeKey).forEach(({
|
|
88
|
+
path: measurementPath,
|
|
89
|
+
measurement
|
|
90
|
+
}) => {
|
|
91
|
+
const key = assertMeasurementTypeKey(id, measurementPath, {
|
|
92
|
+
...measurement,
|
|
93
|
+
kind: "result",
|
|
94
|
+
selector: caseSpec.selector
|
|
95
|
+
});
|
|
96
|
+
if (!key || (measurement.fields ?? []).length === 0) {
|
|
97
|
+
throw customDeviceError(id, measurementPath, "is a reading and must declare at least one field");
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
// Every field is checked first, so a misspelt property is reported as the typo it is
|
|
101
|
+
// rather than as the required property it failed to satisfy.
|
|
102
|
+
parseDefinitions.push(...compileFields(id, measurementPath, measurement.fields, key, minLengthBytes, fields, names));
|
|
103
|
+
assertRequiredFields(id, measurementPath, measurement.fields, key);
|
|
104
|
+
measurements.push({
|
|
105
|
+
measurementTypeKey: key,
|
|
106
|
+
fieldNames: measurement.fields.map(field => field.name)
|
|
107
|
+
});
|
|
108
|
+
});
|
|
104
109
|
return {
|
|
105
110
|
measurementTypeKey,
|
|
106
111
|
caseType,
|
|
107
112
|
caseValue: String(caseSpec.selector ?? "").toLowerCase(),
|
|
108
113
|
parseDefinitions,
|
|
109
|
-
description: caseSpec.description
|
|
114
|
+
description: caseSpec.description,
|
|
115
|
+
measurements
|
|
110
116
|
};
|
|
111
117
|
};
|
|
112
118
|
//# sourceMappingURL=compile-custom-case.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["measurementFieldCatalog","CaseType","
|
|
1
|
+
{"version":3,"names":["measurementFieldCatalog","CaseType","assertRequiredFields","compileFields","customDeviceError","CASE_TYPES","result","DEPENDENT","stream","STREAM","idle","OTHER","assertMeasurementTypeKey","id","path","caseSpec","key","measurementTypeKey","undefined","kind","Object","keys","join","declaredMeasurements","additional","additionalMeasurements","Array","isArray","measurement","fields","map","index","compileCustomCase","minLengthBytes","caseType","String","declared","length","caseValue","selector","toLowerCase","parseDefinitions","description","names","Set","measurements","forEach","measurementPath","push","fieldNames","field","name"],"sourceRoot":"../../../../../../src","sources":["modules/bt-management/services/custom/compile-custom-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MAAM,CAACC,GAAG,CAAEoB,KAAK,IAAKA,KAAK,CAACC,IAAI;IAC1D,CAAC,CAAC;EACJ,CACF,CAAC;EAED,OAAO;IACLlC,kBAAkB;IAClBiB,QAAQ;IACRI,SAAS,EAAEH,MAAM,CAACpB,QAAQ,CAACwB,QAAQ,IAAI,EAAE,CAAC,CAACC,WAAW,CAAC,CAAC;IACxDC,gBAAgB;IAChBC,WAAW,EAAE3B,QAAQ,CAAC2B,WAAW;IACjCG;EACF,CAAC;AACH,CAAC","ignoreList":[]}
|
|
@@ -1,8 +1,47 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
import { isChecksumAlgorithm } from "../../utils/calculate-checksum.js";
|
|
3
4
|
import { customDeviceError } from "./custom-device-error.js";
|
|
4
5
|
const HEX_BYTE = /^[0-9a-f]{2}$/;
|
|
5
6
|
|
|
7
|
+
/**
|
|
8
|
+
* Checks a checksum declaration against the frame it belongs to.
|
|
9
|
+
*
|
|
10
|
+
* Every byte it reads must be inside minLengthBytes, for the same reason field offsets are:
|
|
11
|
+
* a checksum verified against bytes the frame does not guarantee are present would pass on
|
|
12
|
+
* a truncated buffer and reject a whole one.
|
|
13
|
+
*/
|
|
14
|
+
const compileChecksum = (id, path, minLengthBytes, checksum) => {
|
|
15
|
+
if (!isChecksumAlgorithm(checksum.algorithm)) {
|
|
16
|
+
throw customDeviceError(id, `${path}.algorithm`, 'must be one of "crc8", "xor" or "sum"');
|
|
17
|
+
}
|
|
18
|
+
if (!Number.isInteger(checksum.index) || checksum.index < 0) {
|
|
19
|
+
throw customDeviceError(id, `${path}.index`, "must be a byte offset of at least 0");
|
|
20
|
+
}
|
|
21
|
+
if (checksum.index >= minLengthBytes) {
|
|
22
|
+
throw customDeviceError(id, `${path}.index`, `reads byte ${checksum.index}, which frame.minLengthBytes (${minLengthBytes}) does not guarantee is present`);
|
|
23
|
+
}
|
|
24
|
+
const from = checksum.from ?? 0;
|
|
25
|
+
if (!Number.isInteger(from) || from < 0) {
|
|
26
|
+
throw customDeviceError(id, `${path}.from`, "must be a byte offset of at least 0");
|
|
27
|
+
}
|
|
28
|
+
const byteCount = checksum.byteCount ?? checksum.index - from;
|
|
29
|
+
if (!Number.isInteger(byteCount) || byteCount < 1) {
|
|
30
|
+
throw customDeviceError(id, `${path}.byteCount`, "must cover at least one byte");
|
|
31
|
+
}
|
|
32
|
+
if (from + byteCount > minLengthBytes) {
|
|
33
|
+
throw customDeviceError(id, `${path}.byteCount`, `covers bytes ${from}-${from + byteCount - 1}, which frame.minLengthBytes (${minLengthBytes}) does not guarantee are present`);
|
|
34
|
+
}
|
|
35
|
+
if (checksum.index >= from && checksum.index < from + byteCount) {
|
|
36
|
+
throw customDeviceError(id, `${path}.index`, `is inside the bytes it covers (${from}-${from + byteCount - 1}), so it could never match`);
|
|
37
|
+
}
|
|
38
|
+
return Object.freeze({
|
|
39
|
+
...checksum,
|
|
40
|
+
from,
|
|
41
|
+
byteCount
|
|
42
|
+
});
|
|
43
|
+
};
|
|
44
|
+
|
|
6
45
|
/**
|
|
7
46
|
* Checks that a frame declaration can actually recognise a complete package, and returns a
|
|
8
47
|
* frozen, lower-cased copy of it.
|
|
@@ -29,11 +68,15 @@ export const compileCustomFrame = (id, path, frame) => {
|
|
|
29
68
|
if (header.length > minLengthBytes) {
|
|
30
69
|
throw customDeviceError(id, `${path}.header`, `is ${header.length} bytes, which does not fit inside minLengthBytes (${minLengthBytes})`);
|
|
31
70
|
}
|
|
71
|
+
const checksum = frame.checksum ? compileChecksum(id, `${path}.checksum`, minLengthBytes, frame.checksum) : undefined;
|
|
32
72
|
const length = frame.length;
|
|
33
73
|
if (!length) {
|
|
34
74
|
return Object.freeze({
|
|
35
75
|
header: Object.freeze(header),
|
|
36
|
-
minLengthBytes
|
|
76
|
+
minLengthBytes,
|
|
77
|
+
...(checksum ? {
|
|
78
|
+
checksum
|
|
79
|
+
} : {})
|
|
37
80
|
});
|
|
38
81
|
}
|
|
39
82
|
if (!Number.isInteger(length.index) || length.index < 0) {
|
|
@@ -53,7 +96,10 @@ export const compileCustomFrame = (id, path, frame) => {
|
|
|
53
96
|
minLengthBytes,
|
|
54
97
|
length: Object.freeze({
|
|
55
98
|
...length
|
|
56
|
-
})
|
|
99
|
+
}),
|
|
100
|
+
...(checksum ? {
|
|
101
|
+
checksum
|
|
102
|
+
} : {})
|
|
57
103
|
});
|
|
58
104
|
};
|
|
59
105
|
//# sourceMappingURL=compile-custom-frame.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["customDeviceError","HEX_BYTE","
|
|
1
|
+
{"version":3,"names":["isChecksumAlgorithm","customDeviceError","HEX_BYTE","compileChecksum","id","path","minLengthBytes","checksum","algorithm","Number","isInteger","index","from","byteCount","Object","freeze","compileCustomFrame","frame","declaredHeader","header","Array","isArray","map","byte","String","toLowerCase","some","test","length","undefined","widthBytes","overheadBytes"],"sourceRoot":"../../../../../../src","sources":["modules/bt-management/services/custom/compile-custom-frame.ts"],"mappings":";;AAEA,SAASA,mBAAmB,QAAQ,mCAAgC;AAEpE,SAASC,iBAAiB,QAAQ,0BAAuB;AAEzD,MAAMC,QAAQ,GAAG,eAAe;;AAEhC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,eAAe,GAAGA,CACtBC,EAAU,EACVC,IAAY,EACZC,cAAsB,EACtBC,QAA4B,KACL;EACvB,IAAI,CAACP,mBAAmB,CAACO,QAAQ,CAACC,SAAS,CAAC,EAAE;IAC5C,MAAMP,iBAAiB,CACrBG,EAAE,EACF,GAAGC,IAAI,YAAY,EACnB,uCACF,CAAC;EACH;EAEA,IAAI,CAACI,MAAM,CAACC,SAAS,CAACH,QAAQ,CAACI,KAAK,CAAC,IAAIJ,QAAQ,CAACI,KAAK,GAAG,CAAC,EAAE;IAC3D,MAAMV,iBAAiB,CACrBG,EAAE,EACF,GAAGC,IAAI,QAAQ,EACf,qCACF,CAAC;EACH;EAEA,IAAIE,QAAQ,CAACI,KAAK,IAAIL,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,GAAG;MAAEA;IAAS,CAAC,GAAG,CAAC,CAAC;EAClC,CAAC,CAAC;AACJ,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { customDeviceError } from "./custom-device-error.js";
|
|
4
|
+
import { normalizeBleUuid } from "./normalize-ble-uuid.js";
|
|
5
|
+
const HEX_BYTE = /^[0-9a-f]{2}$/;
|
|
6
|
+
const MAX_OPCODE = 0xff;
|
|
7
|
+
const MAX_DEVICE_TYPE = 0xffff;
|
|
8
|
+
const assertStartBytes = (id, startBytes) => {
|
|
9
|
+
if (!Array.isArray(startBytes) || startBytes.length === 0) {
|
|
10
|
+
throw customDeviceError(id, "lepu.startBytes", "must list at least one frame start byte, such as [\"a5\"]");
|
|
11
|
+
}
|
|
12
|
+
return startBytes.map((byte, index) => {
|
|
13
|
+
const normalized = String(byte).toLowerCase();
|
|
14
|
+
if (!HEX_BYTE.test(normalized)) {
|
|
15
|
+
throw customDeviceError(id, `lepu.startBytes[${index}]`, `is "${String(byte)}"; it must be exactly two hex digits`);
|
|
16
|
+
}
|
|
17
|
+
return normalized;
|
|
18
|
+
});
|
|
19
|
+
};
|
|
20
|
+
const assertDeviceTypes = (id, deviceTypes) => {
|
|
21
|
+
if (!Array.isArray(deviceTypes)) {
|
|
22
|
+
throw customDeviceError(id, "lepu.expectedDeviceTypes", "must be an array of the model numbers this declaration was written for");
|
|
23
|
+
}
|
|
24
|
+
return deviceTypes.map((deviceType, index) => {
|
|
25
|
+
if (!Number.isInteger(deviceType) || deviceType < 0 || deviceType > MAX_DEVICE_TYPE) {
|
|
26
|
+
throw customDeviceError(id, `lepu.expectedDeviceTypes[${index}]`, `is ${String(deviceType)}; a model number is a whole number between 0 and ${MAX_DEVICE_TYPE}`);
|
|
27
|
+
}
|
|
28
|
+
return deviceType;
|
|
29
|
+
});
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* The opcode to poll with, once the device has been identified.
|
|
34
|
+
*
|
|
35
|
+
* Identification is the advertised name unless `expectedDeviceTypes` narrows it further.
|
|
36
|
+
* The name is what the vendor's own SDK binds every one of its products on - a 732-line
|
|
37
|
+
* cascade of name checks resolving to 176 models - so requiring more than that to poll at
|
|
38
|
+
* all would hold this SDK to a bar the hardware's own maker does not meet, and would leave
|
|
39
|
+
* every device undeclarable.
|
|
40
|
+
*
|
|
41
|
+
* Naming the models is still the stronger declaration, and is worth doing once the numbers
|
|
42
|
+
* are known: the family's low opcodes act, and a frame built for the wrong product is still
|
|
43
|
+
* well formed, so a name that matched the wrong hardware would not be caught by anything
|
|
44
|
+
* else in the protocol.
|
|
45
|
+
*/
|
|
46
|
+
const assertPollCommand = (id, lepu) => {
|
|
47
|
+
const {
|
|
48
|
+
pollCommand
|
|
49
|
+
} = lepu;
|
|
50
|
+
if (pollCommand === undefined) {
|
|
51
|
+
return undefined;
|
|
52
|
+
}
|
|
53
|
+
if (!Number.isInteger(pollCommand) || pollCommand < 0 || pollCommand > MAX_OPCODE) {
|
|
54
|
+
throw customDeviceError(id, "lepu.pollCommand", `is ${String(pollCommand)}; an opcode is a whole number between 0 and ${MAX_OPCODE}`);
|
|
55
|
+
}
|
|
56
|
+
return pollCommand;
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Validates the Lepu declaration and normalises its UUIDs.
|
|
61
|
+
*
|
|
62
|
+
* The write service has to be one the declaration already monitors: a command written to a
|
|
63
|
+
* service the device never opened is accepted by nothing and answered by nothing, which
|
|
64
|
+
* looks exactly like hardware that is simply not responding.
|
|
65
|
+
*/
|
|
66
|
+
export const compileCustomLepu = (id, spec, serviceUuids) => {
|
|
67
|
+
const lepu = spec.lepu;
|
|
68
|
+
if (!lepu) {
|
|
69
|
+
return undefined;
|
|
70
|
+
}
|
|
71
|
+
if (spec.services.some(service => service.write)) {
|
|
72
|
+
throw customDeviceError(id, "services[].write", "cannot be declared alongside lepu, which builds its own commands and addresses them through lepu.write");
|
|
73
|
+
}
|
|
74
|
+
const startBytes = assertStartBytes(id, lepu.startBytes);
|
|
75
|
+
const expectedDeviceTypes = assertDeviceTypes(id, lepu.expectedDeviceTypes);
|
|
76
|
+
const pollCommand = assertPollCommand(id, lepu);
|
|
77
|
+
const serviceUuid = normalizeBleUuid(id, "lepu.write.serviceUuid", lepu.write?.serviceUuid);
|
|
78
|
+
if (!serviceUuids.includes(serviceUuid)) {
|
|
79
|
+
throw customDeviceError(id, "lepu.write.serviceUuid", `is "${serviceUuid}", which this device does not declare among its services`);
|
|
80
|
+
}
|
|
81
|
+
return {
|
|
82
|
+
startBytes,
|
|
83
|
+
expectedDeviceTypes,
|
|
84
|
+
...(pollCommand === undefined ? {} : {
|
|
85
|
+
pollCommand
|
|
86
|
+
}),
|
|
87
|
+
write: {
|
|
88
|
+
serviceUuid,
|
|
89
|
+
characteristicUuid: normalizeBleUuid(id, "lepu.write.characteristicUuid", lepu.write?.characteristicUuid)
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
};
|
|
93
|
+
//# sourceMappingURL=compile-custom-lepu.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["customDeviceError","normalizeBleUuid","HEX_BYTE","MAX_OPCODE","MAX_DEVICE_TYPE","assertStartBytes","id","startBytes","Array","isArray","length","map","byte","index","normalized","String","toLowerCase","test","assertDeviceTypes","deviceTypes","deviceType","Number","isInteger","assertPollCommand","lepu","pollCommand","undefined","compileCustomLepu","spec","serviceUuids","services","some","service","write","expectedDeviceTypes","serviceUuid","includes","characteristicUuid"],"sourceRoot":"../../../../../../src","sources":["modules/bt-management/services/custom/compile-custom-lepu.ts"],"mappings":";;AAGA,SAASA,iBAAiB,QAAQ,0BAAuB;AACzD,SAASC,gBAAgB,QAAQ,yBAAsB;AAEvD,MAAMC,QAAQ,GAAG,eAAe;AAChC,MAAMC,UAAU,GAAG,IAAI;AACvB,MAAMC,eAAe,GAAG,MAAM;AA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,MAAMnC,iBAAiB,CACrBM,EAAE,EACF,wBAAwB,EACxB,OAAO6B,WAAW,0DACpB,CAAC;EACH;EAEA,OAAO;IACL5B,UAAU;IACV2B,mBAAmB;IACnB,IAAIT,WAAW,KAAKC,SAAS,GAAG,CAAC,CAAC,GAAG;MAAED;IAAY,CAAC,CAAC;IACrDQ,KAAK,EAAE;MACLE,WAAW;MACXE,kBAAkB,EAAEpC,gBAAgB,CAClCK,EAAE,EACF,+BAA+B,EAC/BkB,IAAI,CAACS,KAAK,EAAEI,kBACd;IACF;EACF,CAAC;AACH,CAAC","ignoreList":[]}
|
|
@@ -2,11 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
import { CUSTOM_DEVICE_BRAND } from "../../constants/custom-device-brand.js";
|
|
4
4
|
import { IntegratedDevices } from "../../types/integrated-devices.js";
|
|
5
|
+
import { compileCustomLepu } from "./compile-custom-lepu.js";
|
|
5
6
|
import { compileCustomMonitor } from "./compile-custom-monitor.js";
|
|
6
7
|
import { customDeviceError } from "./custom-device-error.js";
|
|
7
8
|
import { normalizeBleUuid } from "./normalize-ble-uuid.js";
|
|
8
9
|
const MIN_STUCK_TIMEOUT_MS = 1_000;
|
|
9
10
|
|
|
11
|
+
/** The smallest MTU a BLE link has, and the largest an ATT packet may declare. */
|
|
12
|
+
const MIN_MTU = 23;
|
|
13
|
+
const MAX_MTU = 517;
|
|
14
|
+
|
|
10
15
|
// The SDK's own F4 scale waits this long, because it sleeps while still connected.
|
|
11
16
|
const MAX_STUCK_TIMEOUT_MS = 6_000_000;
|
|
12
17
|
const HEX_BYTES = /^([0-9a-f]{2})+$/;
|
|
@@ -42,6 +47,16 @@ const assertStuckTimeout = (id, spec) => {
|
|
|
42
47
|
}
|
|
43
48
|
return timeout;
|
|
44
49
|
};
|
|
50
|
+
const assertPreferredMtu = (id, spec) => {
|
|
51
|
+
const mtu = spec.preferredMtu;
|
|
52
|
+
if (mtu === undefined) {
|
|
53
|
+
return undefined;
|
|
54
|
+
}
|
|
55
|
+
if (!Number.isInteger(mtu) || mtu < MIN_MTU || mtu > MAX_MTU) {
|
|
56
|
+
throw customDeviceError(id, "preferredMtu", `is ${String(mtu)}; it must be a whole number between ${MIN_MTU} and ${MAX_MTU}`);
|
|
57
|
+
}
|
|
58
|
+
return mtu;
|
|
59
|
+
};
|
|
45
60
|
const compileWrite = (id, path, write) => {
|
|
46
61
|
if (!write) {
|
|
47
62
|
return undefined;
|
|
@@ -68,6 +83,7 @@ export const defineCustomDevice = spec => {
|
|
|
68
83
|
const id = assertIdentity(spec);
|
|
69
84
|
const nameMatch = compileNameMatch(id, spec);
|
|
70
85
|
const stuckDataTimeout = assertStuckTimeout(id, spec);
|
|
86
|
+
const preferredMtu = assertPreferredMtu(id, spec);
|
|
71
87
|
if (!Array.isArray(spec.services) || spec.services.length === 0) {
|
|
72
88
|
throw customDeviceError(id, "services", "must declare at least one service");
|
|
73
89
|
}
|
|
@@ -101,6 +117,7 @@ export const defineCustomDevice = spec => {
|
|
|
101
117
|
writeUuid: compileWrite(id, path, service.write)
|
|
102
118
|
};
|
|
103
119
|
});
|
|
120
|
+
const lepu = compileCustomLepu(id, spec, mainServices.map(service => service.uuid));
|
|
104
121
|
return {
|
|
105
122
|
[CUSTOM_DEVICE_BRAND]: true,
|
|
106
123
|
id: id,
|
|
@@ -109,7 +126,13 @@ export const defineCustomDevice = spec => {
|
|
|
109
126
|
mainServices,
|
|
110
127
|
stuckDataTimeout,
|
|
111
128
|
fields,
|
|
112
|
-
frames
|
|
129
|
+
frames,
|
|
130
|
+
...(preferredMtu === undefined ? {} : {
|
|
131
|
+
preferredMtu
|
|
132
|
+
}),
|
|
133
|
+
...(lepu === undefined ? {} : {
|
|
134
|
+
lepu
|
|
135
|
+
})
|
|
113
136
|
};
|
|
114
137
|
};
|
|
115
138
|
//# sourceMappingURL=define-custom-device.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["CUSTOM_DEVICE_BRAND","IntegratedDevices","compileCustomMonitor","customDeviceError","normalizeBleUuid","MIN_STUCK_TIMEOUT_MS","MAX_STUCK_TIMEOUT_MS","HEX_BYTES","assertIdentity","spec","id","trim","String","builtIn","Object","values","find","name","toLowerCase","compileNameMatch","nameMatch","RegExp","global","sticky","exact","replace","assertStuckTimeout","timeout","stuckDataTimeoutMs","Number","isInteger","
|
|
1
|
+
{"version":3,"names":["CUSTOM_DEVICE_BRAND","IntegratedDevices","compileCustomLepu","compileCustomMonitor","customDeviceError","normalizeBleUuid","MIN_STUCK_TIMEOUT_MS","MIN_MTU","MAX_MTU","MAX_STUCK_TIMEOUT_MS","HEX_BYTES","assertIdentity","spec","id","trim","String","builtIn","Object","values","find","name","toLowerCase","compileNameMatch","nameMatch","RegExp","global","sticky","exact","replace","assertStuckTimeout","timeout","stuckDataTimeoutMs","Number","isInteger","assertPreferredMtu","mtu","preferredMtu","undefined","compileWrite","path","write","commandHex","test","uuid","mainCommandUuid","defineCustomDevice","stuckDataTimeout","Array","isArray","services","length","fields","Map","frames","seenCharacteristics","Set","mainServices","map","service","serviceIndex","monitor","monitorUuids","monitorIndex","monitorPath","characteristic","frame","has","add","set","writeUuid","lepu"],"sourceRoot":"../../../../../../src","sources":["modules/bt-management/services/custom/define-custom-device.ts"],"mappings":";;AAAA,SAASA,mBAAmB,QAAQ,wCAAqC;AAMzE,SAASC,iBAAiB,QAAQ,mCAAgC;AAGlE,SAASC,iBAAiB,QAAQ,0BAAuB;AACzD,SAASC,oBAAoB,QAAQ,6BAA0B;AAC/D,SAASC,iBAAiB,QAAQ,0BAAuB;AACzD,SAASC,gBAAgB,QAAQ,yBAAsB;AAEvD,MAAMC,oBAAoB,GAAG,KAAK;;AAElC;AACA,MAAMC,OAAO,GAAG,EAAE;AAClB,MAAMC,OAAO,GAAG,GAAG;;AAEnB;AACA,MAAMC,oBAAoB,GAAG,SAAS;AACtC,MAAMC,SAAS,GAAG,kBAAkB;AAEpC,MAAMC,cAAc,GAAIC,IAAsB,IAAa;EACzD,MAA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Y;IACZV,gBAAgB;IAChBK,MAAM;IACNE,MAAM;IACN,IAAIjB,YAAY,KAAKC,SAAS,GAAG,CAAC,CAAC,GAAG;MAAED;IAAa,CAAC,CAAC;IACvD,IAAIkC,IAAI,KAAKjC,SAAS,GAAG,CAAC,CAAC,GAAG;MAAEiC;IAAK,CAAC;EACxC,CAAC;AACH,CAAC","ignoreList":[]}
|
|
@@ -8,6 +8,20 @@ import { BP2Device } from "./devices/bp2/bp2.device.js";
|
|
|
8
8
|
import { CustomDevice } from "./devices/custom/custom.device.js";
|
|
9
9
|
import { F4Device } from "./devices/f4/f4.device.js";
|
|
10
10
|
import { SPO2Device } from "./devices/spo/spo2.device.js";
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* The built-in names the SDK can actually build.
|
|
14
|
+
*
|
|
15
|
+
* `integratedDevicesMap` matches more names than this, on purpose: matching is what names a
|
|
16
|
+
* device in a scan result and a device list, which is useful for hardware the SDK cannot
|
|
17
|
+
* yet decode. Connecting to one of those is what fails, and it fails saying so.
|
|
18
|
+
*/
|
|
19
|
+
const DEVICE_CLASSES = {
|
|
20
|
+
[IntegratedDevices.BP2]: BP2Device,
|
|
21
|
+
[IntegratedDevices.F4]: F4Device,
|
|
22
|
+
[IntegratedDevices.PC60WF]: SPO2Device,
|
|
23
|
+
[IntegratedDevices.BC01]: BC01Device
|
|
24
|
+
};
|
|
11
25
|
const collectCustomDevices = acceptedDevices => {
|
|
12
26
|
const customDevices = new Map();
|
|
13
27
|
const matchers = new Set();
|
|
@@ -67,15 +81,9 @@ export class DeviceCreator {
|
|
|
67
81
|
// @ts-expect-error - the caller asked for this custom device by its own id
|
|
68
82
|
return new CustomDevice(params.device, params, custom);
|
|
69
83
|
}
|
|
70
|
-
const
|
|
71
|
-
[IntegratedDevices.BP2]: BP2Device,
|
|
72
|
-
[IntegratedDevices.F4]: F4Device,
|
|
73
|
-
[IntegratedDevices.PC60WF]: SPO2Device,
|
|
74
|
-
[IntegratedDevices.BC01]: BC01Device
|
|
75
|
-
};
|
|
76
|
-
const deviceClass = deviceMap[params.deviceName];
|
|
84
|
+
const deviceClass = DEVICE_CLASSES[params.deviceName];
|
|
77
85
|
if (!deviceClass) {
|
|
78
|
-
throw new Error(`
|
|
86
|
+
throw new Error(`"${params.deviceName}" is a name the SDK matches during a scan but has no decoder for, so "${params.device.name}" cannot be connected. The names it can decode are ${Object.keys(DEVICE_CLASSES).join(", ")}; anything else needs a declaration registered with defineCustomDevice and passed in acceptedDevices.`);
|
|
79
87
|
}
|
|
80
88
|
|
|
81
89
|
// @ts-expect-error - This is a workaround to allow the deviceClass to be instantiated with the correct type
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["integratedDevicesMap","IntegratedDevices","isCustomDeviceDefinition","BC01Device","BP2Device","CustomDevice","F4Device","SPO2Device","collectCustomDevices","acceptedDevices","customDevices","Map","matchers","Set","forEach","entry","index","Error","has","id","nameMatch","source","set","add","DeviceCreator","deviceNameCache","CACHE_MAX_SIZE","constructor","acceptedDeviceNames","getDeviceName","foundName","undefined","get","matched","matchDeviceName","cacheDeviceName","createDevice","params","String","deviceName","trim","device","name","custom","
|
|
1
|
+
{"version":3,"names":["integratedDevicesMap","IntegratedDevices","isCustomDeviceDefinition","BC01Device","BP2Device","CustomDevice","F4Device","SPO2Device","DEVICE_CLASSES","BP2","F4","PC60WF","BC01","collectCustomDevices","acceptedDevices","customDevices","Map","matchers","Set","forEach","entry","index","Error","has","id","nameMatch","source","set","add","DeviceCreator","deviceNameCache","CACHE_MAX_SIZE","constructor","acceptedDeviceNames","getDeviceName","foundName","undefined","get","matched","matchDeviceName","cacheDeviceName","createDevice","params","String","deviceName","trim","device","name","custom","deviceClass","Object","keys","join","destroy","clear","regex","deviceType","test","some","values","size","firstKey","next","value","delete"],"sourceRoot":"../../../../../src","sources":["modules/bt-management/services/device-creator.ts"],"mappings":";;AAAA,SAASA,oBAAoB,QAAQ,wCAAqC;AAM1E,SAASC,iBAAiB,QAAQ,g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