Expose function to find a USB device

The device was automatically found by sc_usb_connect(). Instead, expose
a function to find a device from a serial, and let the caller connect to
the device found (if any).

This will allow to list all devices first, then select one device to
connect to.

PR #2974 <https://github.com/Genymobile/scrcpy/pull/2974>
This commit is contained in:
Romain Vimont
2022-01-25 21:11:32 +01:00
parent 1ab3692f3d
commit 0ee9e2ff51
3 changed files with 19 additions and 14 deletions

View File

@@ -17,8 +17,11 @@ sc_usb_init(struct sc_usb *usb);
void
sc_usb_destroy(struct sc_usb *usb);
libusb_device *
sc_usb_find_device(struct sc_usb *usb, const char *serial);
bool
sc_usb_connect(struct sc_usb *usb, const char *serial);
sc_usb_connect(struct sc_usb *usb, libusb_device *device);
void
sc_usb_disconnect(struct sc_usb *usb);