Find a list of devices instead of a single one

Several devices may match the requested serial, but above all, this
paves the way to list all devices (when no serial is provided).

PR #2974 <https://github.com/Genymobile/scrcpy/pull/2974>
This commit is contained in:
Romain Vimont
2022-01-26 22:08:55 +01:00
parent d8b37fe189
commit 1c17f57c10
3 changed files with 41 additions and 20 deletions

View File

@@ -23,15 +23,18 @@ struct sc_usb_device {
void
sc_usb_device_destroy(struct sc_usb_device *usb_device);
void
sc_usb_device_destroy_all(struct sc_usb_device *usb_devices, size_t count);
bool
sc_usb_init(struct sc_usb *usb);
void
sc_usb_destroy(struct sc_usb *usb);
bool
sc_usb_find_device(struct sc_usb *usb, const char *serial,
struct sc_usb_device *out);
ssize_t
sc_usb_find_devices(struct sc_usb *usb, const char *serial,
struct sc_usb_device *devices, size_t len);
bool
sc_usb_connect(struct sc_usb *usb, libusb_device *device);