From c45787bf5c47c1f16360ad5843fb6cc6c5118384 Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Tue, 24 Dec 2019 12:20:07 +0100 Subject: usb: Add osmo_libusb_find_matching_dev_{path,serial} Thise two helper functions allow the user application to find a unique match among the existing USB devices, using either a user- provided iSerial string, or a user-provided physical USB path. Change-Id: I8ff3fb3e1a77e10cb313473480ce5e7673749a93 --- include/osmocom/usb/libusb.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'include') diff --git a/include/osmocom/usb/libusb.h b/include/osmocom/usb/libusb.h index 382c86e1..2220e03d 100644 --- a/include/osmocom/usb/libusb.h +++ b/include/osmocom/usb/libusb.h @@ -62,6 +62,14 @@ char *osmo_libusb_dev_get_path_c(void *ctx, libusb_device *dev); libusb_device **osmo_libusb_find_matching_usb_devs(void *ctx, struct libusb_context *luctx, const struct dev_id *dev_ids); +libusb_device *osmo_libusb_find_matching_dev_path(struct libusb_context *luctx, + const struct dev_id *dev_ids, + const char *path); + +libusb_device *osmo_libusb_find_matching_dev_serial(struct libusb_context *luctx, + const struct dev_id *dev_ids, + const char *serial); + int osmo_libusb_dev_find_matching_interfaces(libusb_device *dev, int class, int sub_class, int protocol, struct usb_interface_match *out, unsigned int out_len); -- cgit v1.2.3