Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
examples/hotplugtest: Allow multiple devices attaching
If no device ID is specified, and for instance a hub is plugged, many devices will be attached (and later detached) at the same time. The old code counting only 2 events would then exit prematurely. By counting attach and detach events separately, we preserve the old behaviour in the single-device case, but also allow more complex sequences to be handled in a way that mostly appears intuitive. This is not fool-proof, and we can still end up leaving after a surprise detachment of a "pre-existing" device while we have one of the "new" devices open. In this case print a warning. References libusb#1455 Signed-off-by: Tormod Volden <[email protected]>
- Loading branch information