@ovok/native 0.4.5 → 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 +16 -50
- 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 +16 -50
- 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 +12 -1
|
@@ -0,0 +1,81 @@
|
|
|
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 AOJ Medical thermometers.
|
|
8
|
+
*
|
|
9
|
+
* Their frame is `aa | 01 | cmd | len | payload | xor`, where the checksum covers everything
|
|
10
|
+
* from the device-type byte up to itself. It is not the Lepu framing, despite both being
|
|
11
|
+
* reachable from the same vendor app: no complement byte, no sequence number, a one-byte
|
|
12
|
+
* length and an exclusive-or rather than a CRC.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
/** Every frame opens with these two: a fixed start byte and a fixed device type. */
|
|
16
|
+
const FRAME_HEADER = ["aa", "01"];
|
|
17
|
+
const COMMAND_BYTE = 2;
|
|
18
|
+
|
|
19
|
+
/** Header, a three-byte payload and the checksum. */
|
|
20
|
+
const FRAME_BYTES = 8;
|
|
21
|
+
const CHECKSUM_INDEX = 7;
|
|
22
|
+
|
|
23
|
+
/** The checksum starts after the start byte, which it does not cover. */
|
|
24
|
+
const CHECKSUM_FROM = 1;
|
|
25
|
+
const PAYLOAD = 4;
|
|
26
|
+
|
|
27
|
+
/** The device answers a realtime-temperature request with this. */
|
|
28
|
+
const TEMPERATURE_REPLY = "c1";
|
|
29
|
+
|
|
30
|
+
/** Hundredths of a degree, big-endian - the one field in this family that is not little. */
|
|
31
|
+
const TEMPERATURE_SCALE = 0.01;
|
|
32
|
+
const TEMPERATURE_DECIMALS = 2;
|
|
33
|
+
const SPOT_CHECK_TIMEOUT_MS = 60_000;
|
|
34
|
+
/**
|
|
35
|
+
* The AOJ-20A infrared thermometer.
|
|
36
|
+
*
|
|
37
|
+
* Declared without a write characteristic, because the device sends its reading rather than
|
|
38
|
+
* waiting to be asked: the vendor app has a request for it, calls it from nowhere, and still
|
|
39
|
+
* displays temperatures - so the reply arrives when someone takes a measurement. Not writing
|
|
40
|
+
* also means not polling, which for a spot-check device would otherwise re-report the same
|
|
41
|
+
* reading for as long as the link stayed up.
|
|
42
|
+
*
|
|
43
|
+
* Only the realtime reply is declared. The stored-history reply shares the header and would
|
|
44
|
+
* need its own case; nothing reads history yet, and a case that decoded it into the same
|
|
45
|
+
* measurement would post old readings as though they had just been taken.
|
|
46
|
+
*/
|
|
47
|
+
export const aoj20aThermometer = params => defineCustomDevice({
|
|
48
|
+
id: params.id,
|
|
49
|
+
nameMatch: params.nameMatch,
|
|
50
|
+
stuckDataTimeoutMs: params.stuckDataTimeoutMs ?? SPOT_CHECK_TIMEOUT_MS,
|
|
51
|
+
services: [{
|
|
52
|
+
uuid: "ffe0",
|
|
53
|
+
monitor: [{
|
|
54
|
+
uuid: "ffe1",
|
|
55
|
+
frame: {
|
|
56
|
+
header: FRAME_HEADER,
|
|
57
|
+
minLengthBytes: FRAME_BYTES,
|
|
58
|
+
checksum: {
|
|
59
|
+
algorithm: "xor",
|
|
60
|
+
index: CHECKSUM_INDEX,
|
|
61
|
+
from: CHECKSUM_FROM
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
caseSelectorBytes: [COMMAND_BYTE],
|
|
65
|
+
cases: [{
|
|
66
|
+
selector: TEMPERATURE_REPLY,
|
|
67
|
+
kind: "result",
|
|
68
|
+
measurementTypeKey: MeasurementTypeKey.temperature,
|
|
69
|
+
fields: [{
|
|
70
|
+
name: "bodyTemp",
|
|
71
|
+
byteIndexes: [PAYLOAD, PAYLOAD + 1],
|
|
72
|
+
byteOrder: "big",
|
|
73
|
+
unit: "Cel",
|
|
74
|
+
scale: TEMPERATURE_SCALE,
|
|
75
|
+
decimals: TEMPERATURE_DECIMALS
|
|
76
|
+
}]
|
|
77
|
+
}]
|
|
78
|
+
}]
|
|
79
|
+
}]
|
|
80
|
+
});
|
|
81
|
+
//# sourceMappingURL=aoj.thermometers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["MeasurementTypeKey","defineCustomDevice","FRAME_HEADER","COMMAND_BYTE","FRAME_BYTES","CHECKSUM_INDEX","CHECKSUM_FROM","PAYLOAD","TEMPERATURE_REPLY","TEMPERATURE_SCALE","TEMPERATURE_DECIMALS","SPOT_CHECK_TIMEOUT_MS","aoj20aThermometer","params","id","nameMatch","stuckDataTimeoutMs","services","uuid","monitor","frame","header","minLengthBytes","checksum","algorithm","index","from","caseSelectorBytes","cases","selector","kind","measurementTypeKey","temperature","fields","name","byteIndexes","byteOrder","unit","scale","decimals"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/aoj/aoj.thermometers.ts"],"mappings":";;AAAA,SAASA,kBAAkB,QAAQ,YAAY;AAG/C,SAASC,kBAAkB,QAAQ,sCAAmC;;AAEtE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;A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AK;UAChBC,IAAI,EAAE,KAAK;UACXC,KAAK,EAAE7B,iBAAiB;UACxB8B,QAAQ,EAAE7B;QACZ,CAAC;MAEL,CAAC;IAEL,CAAC;EAEL,CAAC;AAEL,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1,84 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
import { calculateCrc8 } from "../../../utils/calculate-crc-8.js";
|
|
5
|
-
import { hexToByte } from "../../../utils/hex-to-byte.js";
|
|
6
|
-
import { le16FromHex } from "../../../utils/le-16-from-hex.js";
|
|
7
|
-
const FRAME_START_BYTE = "a5";
|
|
8
|
-
const COMMAND_INDEX = 1;
|
|
9
|
-
const COMMAND_COMPLEMENT_INDEX = 2;
|
|
10
|
-
const PAYLOAD_LENGTH_INDEX = 5;
|
|
11
|
-
const HEADER_BYTES = 7;
|
|
12
|
-
const CHECKSUM_BYTES = 1;
|
|
13
|
-
const BYTE_MASK = 0xff;
|
|
3
|
+
import { LepuFrameReader } from "../lepu/lepu.frame-reader.js";
|
|
14
4
|
|
|
15
|
-
/**
|
|
16
|
-
const
|
|
17
|
-
const isFrameStart = (buffer, index) => {
|
|
18
|
-
if ((buffer[index] || "").toLowerCase() !== FRAME_START_BYTE) {
|
|
19
|
-
return false;
|
|
20
|
-
}
|
|
21
|
-
const command = hexToByte(buffer[index + COMMAND_INDEX] || "0");
|
|
22
|
-
const complement = hexToByte(buffer[index + COMMAND_COMPLEMENT_INDEX] || "0");
|
|
23
|
-
return command === (~complement & BYTE_MASK);
|
|
24
|
-
};
|
|
25
|
-
const findFrameStart = buffer => {
|
|
26
|
-
const lastCandidate = buffer.length - START_PATTERN_BYTES;
|
|
27
|
-
for (let index = 0; index <= lastCandidate; index++) {
|
|
28
|
-
if (isFrameStart(buffer, index)) {
|
|
29
|
-
return index;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
return -1;
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* Bytes that cannot begin a frame start, and are therefore safe to drop when no start
|
|
37
|
-
* was found. The trailing bytes are kept because a start pattern may still be arriving.
|
|
38
|
-
*/
|
|
39
|
-
const droppableLeadingBytes = buffer => Math.max(0, buffer.length - (START_PATTERN_BYTES - 1));
|
|
5
|
+
/** The start byte the BP2 and most of its family use. */
|
|
6
|
+
const BP2_START_BYTES = ["a5"];
|
|
40
7
|
|
|
41
8
|
/**
|
|
42
9
|
* Reads Lepu protocol frames as used by the BP2.
|
|
43
10
|
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
* the search for a start; the checksum is what actually decides a frame is trustworthy.
|
|
11
|
+
* The frame itself is shared across the family, so it lives in `LepuFrameReader`; the only
|
|
12
|
+
* thing that makes it a BP2 is which start byte it accepts.
|
|
47
13
|
*/
|
|
48
|
-
export class BP2FrameReader {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
if (start === -1) {
|
|
52
|
-
return {
|
|
53
|
-
status: FrameReadStatus.INCOMPLETE,
|
|
54
|
-
consumedBytes: droppableLeadingBytes(buffer)
|
|
55
|
-
};
|
|
56
|
-
}
|
|
57
|
-
const payloadLength = le16FromHex(buffer, start + PAYLOAD_LENGTH_INDEX);
|
|
58
|
-
const frameLength = HEADER_BYTES + payloadLength + CHECKSUM_BYTES;
|
|
59
|
-
if (start + frameLength > buffer.length) {
|
|
60
|
-
return {
|
|
61
|
-
status: FrameReadStatus.INCOMPLETE,
|
|
62
|
-
consumedBytes: start
|
|
63
|
-
};
|
|
64
|
-
}
|
|
65
|
-
const frame = buffer.slice(start, start + frameLength);
|
|
66
|
-
if (!this.hasValidChecksum(frame)) {
|
|
67
|
-
return {
|
|
68
|
-
status: FrameReadStatus.CORRUPT,
|
|
69
|
-
consumedBytes: start + START_PATTERN_BYTES
|
|
70
|
-
};
|
|
71
|
-
}
|
|
72
|
-
return {
|
|
73
|
-
status: FrameReadStatus.COMPLETE,
|
|
74
|
-
consumedBytes: start + frameLength,
|
|
75
|
-
frame
|
|
76
|
-
};
|
|
77
|
-
}
|
|
78
|
-
hasValidChecksum(frame) {
|
|
79
|
-
const checksummedBytes = frame.length - CHECKSUM_BYTES;
|
|
80
|
-
const declared = hexToByte(frame[checksummedBytes] || "0");
|
|
81
|
-
return declared === calculateCrc8(frame, checksummedBytes);
|
|
14
|
+
export class BP2FrameReader extends LepuFrameReader {
|
|
15
|
+
constructor() {
|
|
16
|
+
super(BP2_START_BYTES);
|
|
82
17
|
}
|
|
83
18
|
}
|
|
84
19
|
//# sourceMappingURL=bp2.frame-reader.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["LepuFrameReader","BP2_START_BYTES","BP2FrameReader","constructor"],"sourceRoot":"../../../../../../../src","sources":["modules/bt-management/services/devices/bp2/bp2.frame-reader.ts"],"mappings":";;AAAA,SAASA,eAAe,QAAQ,8BAA2B;;AAE3D;AACA,MAAMC,eAAe,GAAG,CAAC,IAAI,CAAC;;AAE9B;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,cAAc,SAASF,eAAe,CAAC;EAC3CG,WAAWA,CAAA,EAAG;IACnB,KAAK,CAACF,eAAe,CAAC;EACxB;AACF","ignoreList":[]}
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { slog } from "../../../helpers/utils/s-log.js";
|
|
4
|
+
import { sentryLogger } from "../../../helpers/utils/sentry-logger.js";
|
|
5
|
+
import { hexToBase64 } from "../../utils/hex-to-base-64.js";
|
|
6
|
+
const MAX_WRITE_ATTEMPTS = 3;
|
|
7
|
+
|
|
8
|
+
/** The MTU every BLE link starts at, before either side asks for more. */
|
|
9
|
+
const DEFAULT_ATT_MTU = 23;
|
|
10
|
+
|
|
11
|
+
/** An ATT write spends three bytes on its own header. */
|
|
12
|
+
const ATT_WRITE_HEADER_BYTES = 3;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* The write channel to a connected device.
|
|
16
|
+
*
|
|
17
|
+
* These protocols allow one command outstanding at a time, and the reply to it is what
|
|
18
|
+
* decides the next one, so writes are serialised rather than merely guarded against
|
|
19
|
+
* re-entry. Refusing a command while another is in flight stalls a self-clocking exchange
|
|
20
|
+
* permanently: the refused command is the one that would have provoked the next reply, and
|
|
21
|
+
* nothing retries it.
|
|
22
|
+
*/
|
|
23
|
+
export class BTCommandWriter {
|
|
24
|
+
pendingWrites = Promise.resolve();
|
|
25
|
+
mtu = DEFAULT_ATT_MTU;
|
|
26
|
+
constructor(device, onError) {
|
|
27
|
+
this.device = device;
|
|
28
|
+
this.onError = onError;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Records what the link actually negotiated.
|
|
33
|
+
*
|
|
34
|
+
* The floor stands until something says otherwise, because a link that has not
|
|
35
|
+
* negotiated is at the minimum, and over-estimating truncates while under-estimating
|
|
36
|
+
* only costs a second packet.
|
|
37
|
+
*/
|
|
38
|
+
useNegotiatedMtu = mtu => {
|
|
39
|
+
if (typeof mtu === "number" && Number.isInteger(mtu) && mtu > this.mtu) {
|
|
40
|
+
this.mtu = mtu;
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
/** Drops anything still queued, for a link that is going away. */
|
|
45
|
+
reset = () => {
|
|
46
|
+
this.pendingWrites = Promise.resolve();
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Queues commands behind whatever is already being written.
|
|
51
|
+
*
|
|
52
|
+
* The returned promise settles when the last of them has been written and never rejects.
|
|
53
|
+
* A write that fails is retried and reported where it happens; the catch here is a
|
|
54
|
+
* backstop, so that anything that gets past that still cannot poison the queue and
|
|
55
|
+
* silence every command after it.
|
|
56
|
+
*/
|
|
57
|
+
send = commands => {
|
|
58
|
+
this.pendingWrites = this.pendingWrites.then(() => this.writeInOrder(commands)).catch(error => {
|
|
59
|
+
this.onError?.(error);
|
|
60
|
+
});
|
|
61
|
+
return this.pendingWrites;
|
|
62
|
+
};
|
|
63
|
+
writeInOrder = async commands => {
|
|
64
|
+
for (const command of commands) {
|
|
65
|
+
await this.writeCommand(command);
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Writes one command, split to fit the link.
|
|
71
|
+
*
|
|
72
|
+
* A write longer than the negotiated MTU is truncated by the stack rather than refused,
|
|
73
|
+
* so an oversized command arrives as a shorter one whose header still looks valid. The
|
|
74
|
+
* Er2 negotiates the 23-byte minimum where the rest of the family grants 247, which is
|
|
75
|
+
* enough to cut a 28-byte file-read request in half.
|
|
76
|
+
*
|
|
77
|
+
* A chunk that cannot be written abandons the rest of the command. The device reassembles
|
|
78
|
+
* by arrival, so continuing past a gap would hand it a frame that is not the one asked
|
|
79
|
+
* for - worse than sending nothing, because it would be answered.
|
|
80
|
+
*/
|
|
81
|
+
writeCommand = async command => {
|
|
82
|
+
for (const chunk of this.chunksOf(command.frame)) {
|
|
83
|
+
const written = await this.writeChunk(command, chunk);
|
|
84
|
+
if (!written) {
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Splits a frame into writes the link will carry whole.
|
|
92
|
+
*
|
|
93
|
+
* A frame that already fits yields one chunk, so the common command - a poll of a handful
|
|
94
|
+
* of bytes - is written exactly as it was before there was any splitting at all.
|
|
95
|
+
*/
|
|
96
|
+
chunksOf = frame => {
|
|
97
|
+
const size = Math.max(1, this.mtu - ATT_WRITE_HEADER_BYTES);
|
|
98
|
+
const chunks = [];
|
|
99
|
+
for (let start = 0; start < frame.length; start += size) {
|
|
100
|
+
chunks.push(frame.slice(start, start + size));
|
|
101
|
+
}
|
|
102
|
+
return chunks;
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Writes one chunk, retrying a failed write.
|
|
107
|
+
*
|
|
108
|
+
* The attempt count is local rather than an instance field, so a write that exhausted its
|
|
109
|
+
* retries cannot leave the next one with none left - which is what a shared counter did
|
|
110
|
+
* on any path that failed to reset it.
|
|
111
|
+
*/
|
|
112
|
+
writeChunk = async (command, chunk) => {
|
|
113
|
+
for (let attempt = 1; attempt <= MAX_WRITE_ATTEMPTS; attempt++) {
|
|
114
|
+
try {
|
|
115
|
+
const isConnected = await this.device.isConnected();
|
|
116
|
+
if (!isConnected) {
|
|
117
|
+
return false;
|
|
118
|
+
}
|
|
119
|
+
await this.device.writeCharacteristicWithResponseForService(command.serviceUuid, command.characteristicUuid, hexToBase64(chunk.join("")));
|
|
120
|
+
return true;
|
|
121
|
+
} catch (error) {
|
|
122
|
+
sentryLogger("error", "DEVICE: Error sending command", {
|
|
123
|
+
error: error instanceof Error ? error.message : error,
|
|
124
|
+
deviceName: this.device.name
|
|
125
|
+
});
|
|
126
|
+
if (attempt === MAX_WRITE_ATTEMPTS) {
|
|
127
|
+
slog(error, "BT_CONNECTION_HANDLER: Error sending command", {
|
|
128
|
+
deviceName: this.device.name
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
return false;
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
//# sourceMappingURL=bt-command-writer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["slog","sentryLogger","hexToBase64","MAX_WRITE_ATTEMPTS","DEFAULT_ATT_MTU","ATT_WRITE_HEADER_BYTES","BTCommandWriter","pendingWrites","Promise","resolve","mtu","constructor","device","onError","useNegotiatedMtu","Number","isInteger","reset","send","commands","then","writeInOrder","catch","error","command","writeCommand","chunk","chunksOf","frame","written","writeChunk","size","Math","max","chunks","start","length","push","slice","attempt","isConnected","writeCharacteristicWithResponseForService","serviceUuid","characteristicUuid","join","Error","message","deviceName","name"],"sourceRoot":"../../../../../../src","sources":["modules/bt-management/services/devices/bt-command-writer.ts"],"mappings":";;AAEA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AC5B,MAAM,CAAC6B,yCAAyC,CACzDjB,OAAO,CAACkB,WAAW,EACnBlB,OAAO,CAACmB,kBAAkB,EAC1BzC,WAAW,CAACwB,KAAK,CAACkB,IAAI,CAAC,EAAE,CAAC,CAC5B,CAAC;QAED,OAAO,IAAI;MACb,CAAC,CAAC,OAAOrB,KAAK,EAAE;QACdtB,YAAY,CAAC,OAAO,EAAE,+BAA+B,EAAE;UACrDsB,KAAK,EAAEA,KAAK,YAAYsB,KAAK,GAAGtB,KAAK,CAACuB,OAAO,GAAGvB,KAAK;UACrDwB,UAAU,EAAE,IAAI,CAACnC,MAAM,CAACoC;QAC1B,CAAC,CAAC;QAEF,IAAIT,OAAO,KAAKpC,kBAAkB,EAAE;UAClCH,IAAI,CAACuB,KAAK,EAAE,8CAA8C,EAAE;YAC1DwB,UAAU,EAAE,IAAI,CAACnC,MAAM,CAACoC;UAC1B,CAAC,CAAC;QACJ;MACF;IACF;IAEA,OAAO,KAAK;EACd,CAAC;AACH","ignoreList":[]}
|
|
@@ -1,19 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import { slog } from "../../../helpers/index.js";
|
|
4
3
|
import { sentryLogger } from "../../../helpers/utils/sentry-logger.js";
|
|
5
4
|
import { DeviceStatus } from "../../types/device-status.js";
|
|
6
5
|
import { base64ToHex } from "../../utils/base-64-to-hex.js";
|
|
7
|
-
import {
|
|
6
|
+
import { BTCommandWriter } from "./bt-command-writer.js";
|
|
8
7
|
export class BTConnectionHandler {
|
|
9
8
|
characteristicSubscriptions = [];
|
|
10
|
-
isSendingCommand = false;
|
|
11
|
-
retryCount = 0;
|
|
12
9
|
constructor(device, mainServices, callbacks, preferredMtu) {
|
|
13
10
|
this.device = device;
|
|
14
11
|
this.mainServices = mainServices;
|
|
15
12
|
this.callbacks = callbacks;
|
|
16
13
|
this.preferredMtu = preferredMtu;
|
|
14
|
+
this.writer = new BTCommandWriter(device, callbacks.onError);
|
|
17
15
|
}
|
|
18
16
|
connect = async () => {
|
|
19
17
|
try {
|
|
@@ -35,23 +33,12 @@ export class BTConnectionHandler {
|
|
|
35
33
|
destroy = () => {
|
|
36
34
|
this.characteristicSubscriptions.forEach(sub => sub?.remove());
|
|
37
35
|
this.characteristicSubscriptions = [];
|
|
38
|
-
this.
|
|
39
|
-
this.retryCount = 0;
|
|
36
|
+
this.writer.reset();
|
|
40
37
|
this.onDisconnectSubscription?.remove();
|
|
41
38
|
};
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
}
|
|
46
|
-
this.isSendingCommand = true;
|
|
47
|
-
for (const mainService of this.mainServices) {
|
|
48
|
-
if (mainService.writeUuid) {
|
|
49
|
-
await this.sendCommand(mainService);
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
this.isSendingCommand = false;
|
|
53
|
-
this.retryCount = 0;
|
|
54
|
-
};
|
|
39
|
+
|
|
40
|
+
/** Sends commands to the device, in order, one at a time. */
|
|
41
|
+
sendCommands = commands => this.writer.send(commands);
|
|
55
42
|
|
|
56
43
|
/**
|
|
57
44
|
* Asks for a larger MTU so a frame arrives in fewer notifications.
|
|
@@ -64,7 +51,8 @@ export class BTConnectionHandler {
|
|
|
64
51
|
return;
|
|
65
52
|
}
|
|
66
53
|
try {
|
|
67
|
-
await this.device.requestMTU(this.preferredMtu);
|
|
54
|
+
const negotiated = await this.device.requestMTU(this.preferredMtu);
|
|
55
|
+
this.writer.useNegotiatedMtu(negotiated?.mtu ?? this.device.mtu);
|
|
68
56
|
} catch (error) {
|
|
69
57
|
sentryLogger("info", "DEVICE: MTU request was not granted", {
|
|
70
58
|
deviceId: this.device.id,
|
|
@@ -118,8 +106,14 @@ export class BTConnectionHandler {
|
|
|
118
106
|
});
|
|
119
107
|
if (error) {
|
|
120
108
|
this.callbacks.onError?.(error);
|
|
121
|
-
return;
|
|
122
109
|
}
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* The teardown runs whether or not the disconnect carried an error. A link that drops
|
|
113
|
+
* on its own reports one, and returning early there left the device reported as
|
|
114
|
+
* connected with its subscriptions still attached, so it was never rediscovered and
|
|
115
|
+
* only a device restart recovered it.
|
|
116
|
+
*/
|
|
123
117
|
this.callbacks.onStatusChanged?.(DeviceStatus.DISCONNECTED);
|
|
124
118
|
this.destroy();
|
|
125
119
|
};
|
|
@@ -142,7 +136,7 @@ export class BTConnectionHandler {
|
|
|
142
136
|
this.characteristicSubscriptions.push(subscription);
|
|
143
137
|
}
|
|
144
138
|
}
|
|
145
|
-
await this.
|
|
139
|
+
await this.sendCommands(this.callbacks.initialCommands?.() ?? []);
|
|
146
140
|
} catch (error) {
|
|
147
141
|
sentryLogger("error", "DEVICE: Error subscribing to all characteristics", {
|
|
148
142
|
error: error instanceof Error ? error.message : error,
|
|
@@ -151,33 +145,5 @@ export class BTConnectionHandler {
|
|
|
151
145
|
this.callbacks.onError?.(error);
|
|
152
146
|
}
|
|
153
147
|
};
|
|
154
|
-
sendCommand = async mainService => {
|
|
155
|
-
if (!mainService.writeUuid) {
|
|
156
|
-
return;
|
|
157
|
-
}
|
|
158
|
-
while (this.retryCount < 3) {
|
|
159
|
-
try {
|
|
160
|
-
const isConnected = await this.device.isConnected();
|
|
161
|
-
if (!isConnected) {
|
|
162
|
-
return;
|
|
163
|
-
}
|
|
164
|
-
const command = hexToBase64(mainService.writeUuid.mainCommandUuid);
|
|
165
|
-
await this.device.writeCharacteristicWithResponseForService(mainService.uuid, mainService.writeUuid.uuid, command);
|
|
166
|
-
this.retryCount = 0;
|
|
167
|
-
break;
|
|
168
|
-
} catch (error) {
|
|
169
|
-
this.retryCount++;
|
|
170
|
-
sentryLogger("error", "DEVICE: Error sending command", {
|
|
171
|
-
error: error instanceof Error ? error.message : error,
|
|
172
|
-
deviceName: this.device.name
|
|
173
|
-
});
|
|
174
|
-
if (this.retryCount === 3) {
|
|
175
|
-
slog(error, "BT_CONNECTION_HANDLER: Error sending command", {
|
|
176
|
-
deviceName: this.device.name
|
|
177
|
-
});
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
};
|
|
182
148
|
}
|
|
183
149
|
//# sourceMappingURL=bt-connection-handler.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["sentryLogger","DeviceStatus","base64ToHex","BTCommandWriter","BTConnectionHandler","characteristicSubscriptions","constructor","device","mainServices","callbacks","preferredMtu","writer","onError","connect","connectWithRetries","requestPreferredMtu","onStatusChanged","CONNECTED","discoverAllServicesAndCharacteristics","onDisconnectSubscription","onDisconnected","onDeviceDisconnected","subscribeToAllCharacteristics","error","Error","message","deviceName","name","DISCONNECTED","destroy","forEach","sub","remove","reset","sendCommands","commands","send","negotiated","requestMTU","useNegotiatedMtu","mtu","deviceId","id","requestedMtu","String","maxRetries","retryDelay","maxDelay","connected","retryCount","isConnected","errorCode","willRetry","Promise","resolve","setTimeout","Math","min","pow","mainService","monitorUuid","monitorUuids","subscription","monitorCharacteristicForService","uuid","result","value","hexValue","onDataReceived","push","initialCommands"],"sourceRoot":"../../../../../../src","sources":["modules/bt-management/services/devices/bt-connection-handler.ts"],"mappings":";;AAEA,SAASA,YAAY,QAAQ,yCAAsC;AAEnE,SAASC,YAAY,QAAQ,8BAA2B;AAExD,SAASC,WAAW,QAAQ,+BAA4B;AAExD,SAASC,eAAe,QAAQ,wBAAqB;AAWrD,OAAO,MAAMC,mBAAmB,CAAC;EAEvBC,2BAA2B,GAAmB,EAAE;EAGxDC,WAAWA,CACQC,MAAc,EACdC,YAA2C,EAC3CC,SAAqC,EACrCC,YAAqB,EACtC;IAAA,KAJiBH,MAAc,GAAdA,MAAc;IAAA,KACdC,YAA2C,GAA3CA,YAA2C;IAAA,KAC3CC,SAAqC,GAArCA,SAAqC;IAAA,KACrCC,YAAqB,GAArBA,YAAqB;IAEtC,IAAI,CAACC,MAAM,GAAG,IAAIR,eAAe,CAACI,MAAM,EAAEE,SAAS,CAACG,OAAO,C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M,CAACoB;MAC1B,CACF,CAAC;MACD,IAAI,CAAClB,SAAS,CAACG,OAAO,GAAGW,KAAyB,CAAC;IACrD;EACF,CAAC;AAEH","ignoreList":[]}
|
|
@@ -57,14 +57,13 @@ export class BTDataProcessor {
|
|
|
57
57
|
* A frame that fails its integrity check is reported and skipped rather than parsed.
|
|
58
58
|
*/
|
|
59
59
|
readFramesFromBuffer = (reader, uuid, buffer) => {
|
|
60
|
-
let hasReadFrame = false;
|
|
61
60
|
while (buffer.length > 0) {
|
|
62
61
|
const result = reader.readFrame(buffer);
|
|
63
62
|
const hasProgressed = result.consumedBytes > 0;
|
|
64
63
|
buffer.splice(0, result.consumedBytes);
|
|
65
64
|
if (result.status === FrameReadStatus.COMPLETE) {
|
|
66
|
-
hasReadFrame = true;
|
|
67
65
|
this.handleFrame(uuid, result.frame);
|
|
66
|
+
this.answerFrame(result.frame);
|
|
68
67
|
continue;
|
|
69
68
|
}
|
|
70
69
|
if (result.status === FrameReadStatus.CORRUPT) {
|
|
@@ -74,9 +73,6 @@ export class BTDataProcessor {
|
|
|
74
73
|
break;
|
|
75
74
|
}
|
|
76
75
|
}
|
|
77
|
-
if (hasReadFrame) {
|
|
78
|
-
this.callbacks.onSendCommandToDevice?.();
|
|
79
|
-
}
|
|
80
76
|
};
|
|
81
77
|
|
|
82
78
|
/**
|
|
@@ -88,7 +84,22 @@ export class BTDataProcessor {
|
|
|
88
84
|
}
|
|
89
85
|
this.handleFrame(uuid, buffer);
|
|
90
86
|
this.buffers.set(this.currentUuid, []);
|
|
91
|
-
this.
|
|
87
|
+
this.answerFrame(buffer);
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Answers one complete frame with whatever the device's sequencer decides.
|
|
92
|
+
*
|
|
93
|
+
* Every frame is offered, including one that matched no parsing case. An identity reply
|
|
94
|
+
* and a file-transfer chunk carry no measurement, and a sequencer that never saw them
|
|
95
|
+
* could not take the step that follows - the exchange would stop dead on the first frame
|
|
96
|
+
* that was protocol rather than data.
|
|
97
|
+
*/
|
|
98
|
+
answerFrame = frame => {
|
|
99
|
+
const commands = this.callbacks.nextCommand?.(frame);
|
|
100
|
+
if (commands && commands.length > 0) {
|
|
101
|
+
this.callbacks.sendCommands?.(commands);
|
|
102
|
+
}
|
|
92
103
|
};
|
|
93
104
|
handleFrame = (uuid, frame) => {
|
|
94
105
|
const data = this.frameParser.parse(uuid, frame);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["sentryLogger","CaseType","FrameReadStatus","FrameParser","MeasurementStateMachine","BTDataProcessor","buffers","Map","constructor","device","mainServices","stuckDataTimeoutDuration","callbacks","frameReader","frameParser","measurementState","onStatusChanged","onStreamStart","onResult","currentUuid","destroy","clear","reset","clearTimeout","stuckDataTimeout","undefined","processData","uuid","hexValue","String","toLowerCase","buffer","get","push","set","startStuckTimeout","readFramesFromBuffer","readWholeBuffer","reader","
|
|
1
|
+
{"version":3,"names":["sentryLogger","CaseType","FrameReadStatus","FrameParser","MeasurementStateMachine","BTDataProcessor","buffers","Map","constructor","device","mainServices","stuckDataTimeoutDuration","callbacks","frameReader","frameParser","measurementState","onStatusChanged","onStreamStart","onResult","currentUuid","destroy","clear","reset","clearTimeout","stuckDataTimeout","undefined","processData","uuid","hexValue","String","toLowerCase","buffer","get","push","set","startStuckTimeout","readFramesFromBuffer","readWholeBuffer","reader","length","result","readFrame","hasProgressed","consumedBytes","splice","status","COMPLETE","handleFrame","frame","answerFrame","CORRUPT","reportCorruptFrame","INCOMPLETE","validatePackage","commands","nextCommand","sendCommands","data","parse","join","dependentData","parsingCase","caseType","DEPENDENT","handleDependentResult","advance","onError","Error","cause","message","setTimeout","cancelConnection"],"sourceRoot":"../../../../../../src","sources":["modules/bt-management/services/devices/bt-data-processor.ts"],"mappings":";;AAGA,SAASA,YAAY,QAAQ,yCAAsC;AACnE,SAASC,QAAQ,QAAQ,0BAAuB;AAIhD,SAASC,eAAe,QAAQ,kCAA+B;AAK/D,SA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