Skip to content

sanei_usb: Allow backends to specify when USB recording is cleared

Unfortunately recent changes (!380 (merged)) that allowed USB recordings composed of multiple conversations between sanei_usb_open()/close() broke record/replay support in certain cases when multiple devices are connected.

If the backend calls sanei_usb_open() to figure out the USB product and vendor IDs of connected device, the product and vendor IDs of the first device will be recorded in the file. Which device happens to be first is indeterminate. The selected device may be a different device than what the backend is asked to scan with.

It still may be useful to record all interactions with the scanner in such cases. Thus a separate API has been added for the backends to clear all recorded USB data just before the sanei_usb_open()/close() conversation that they're most interested in.

cc @ro-ben

Edited by Olaf Meeuwissen

Merge request reports