From 12baf0ada30cffbc253e264ff8354c2703491ef0 Mon Sep 17 00:00:00 2001 From: Jakob Bornecrantz Date: Fri, 3 Dec 2021 21:04:47 +0000 Subject: [PATCH] st/prober: Warn when we can't get USB descriptors --- src/xrt/state_trackers/prober/p_prober.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/xrt/state_trackers/prober/p_prober.c b/src/xrt/state_trackers/prober/p_prober.c index 863daebdd..e77ed7491 100644 --- a/src/xrt/state_trackers/prober/p_prober.c +++ b/src/xrt/state_trackers/prober/p_prober.c @@ -1104,6 +1104,7 @@ p_get_string_descriptor(struct xrt_prober *xp, XRT_MAYBE_UNUSED struct prober *p = (struct prober *)xp; struct prober_device *pdev = (struct prober_device *)xpdev; int ret = 0; + #ifdef XRT_HAVE_LIBUSB if (pdev->base.bus == XRT_BUS_TYPE_USB && pdev->usb.dev != NULL) { ret = p_libusb_get_string_descriptor(p, pdev, which_string, buffer, max_length); @@ -1111,7 +1112,13 @@ p_get_string_descriptor(struct xrt_prober *xp, return ret; } } +#else + if (pdev->base.bus == XRT_BUS_TYPE_USB) { + P_WARN(p, "Can not get usb descriptors (libusb-dev not installed)!"); + return ret; + } #endif + if (pdev && pdev->base.bus == XRT_BUS_TYPE_BLUETOOTH) { switch (which_string) { case XRT_PROBER_STRING_SERIAL_NUMBER: {