summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorNathan Hjelm <hjelmn@google.com>2021-07-21 11:47:25 -0600
committerNathan Hjelm <hjelmn@google.com>2021-07-21 12:41:26 -0600
commit42f9c3b43f49f22a3b10ed452f500f6f50c093df (patch)
treef0fb47d7693b44cbe6c7a6ec8f27492df5b412fd /examples
parent6cae9c6dbd74c0840848f343dd605c5ddcef1ad1 (diff)
downloadlibusb-42f9c3b43f49f22a3b10ed452f500f6f50c093df.tar.gz
xusb: add check for interface kernel driver
This commit adds a call to libusb_kernel_driver_active and prints out the result. This provides a way to quickly check the result when testing. Signed-off-by: Nathan Hjelm <hjelmn@google.com>
Diffstat (limited to 'examples')
-rw-r--r--examples/xusb.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/examples/xusb.c b/examples/xusb.c
index bf328fe..61ce4dd 100644
--- a/examples/xusb.c
+++ b/examples/xusb.c
@@ -914,6 +914,8 @@ static int test_device(uint16_t vid, uint16_t pid)
libusb_set_auto_detach_kernel_driver(handle, 1);
for (iface = 0; iface < nb_ifaces; iface++)
{
+ int ret = libusb_kernel_driver_active(handle, iface);
+ printf("\nKernel driver attached for interface %d: %d\n", iface, ret);
printf("\nClaiming interface %d...\n", iface);
r = libusb_claim_interface(handle, iface);
if (r != LIBUSB_SUCCESS) {