Wrap libusb_device
Introduce a structure to wrap a libusb_device and expose its descriptor data read during discovery. PR #2974 <https://github.com/Genymobile/scrcpy/pull/2974>
This commit is contained in:
@@ -11,14 +11,27 @@ struct sc_usb {
|
||||
libusb_device_handle *handle;
|
||||
};
|
||||
|
||||
struct sc_usb_device {
|
||||
libusb_device *device;
|
||||
char *serial;
|
||||
char *manufacturer;
|
||||
char *product;
|
||||
uint16_t vid;
|
||||
uint16_t pid;
|
||||
};
|
||||
|
||||
void
|
||||
sc_usb_device_destroy(struct sc_usb_device *usb_device);
|
||||
|
||||
bool
|
||||
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_find_device(struct sc_usb *usb, const char *serial,
|
||||
struct sc_usb_device *out);
|
||||
|
||||
bool
|
||||
sc_usb_connect(struct sc_usb *usb, libusb_device *device);
|
||||
|
||||
Reference in New Issue
Block a user