summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTormod Volden <debian.tormod@gmail.com>2021-10-31 09:12:07 +0100
committerTormod Volden <debian.tormod@gmail.com>2021-10-31 09:12:48 +0100
commit6992d9bd4f627ae451e8a0371526a38434e074fe (patch)
treebd744234f631d50ed3e8a8bf54691e4784cd1c7b
parentedd1a4bfe4b037e67b65e4538fd880123fb004f7 (diff)
downloadlibusb-6992d9bd4f627ae451e8a0371526a38434e074fe.tar.gz
xusb: Print configuration descriptor length
Also inform about reading OS string descriptor. Signed-off-by: Tormod Volden <debian.tormod@gmail.com>
-rw-r--r--examples/xusb.c7
-rw-r--r--libusb/version_nano.h2
2 files changed, 7 insertions, 2 deletions
diff --git a/examples/xusb.c b/examples/xusb.c
index 61ce4dd..cf7c7a8 100644
--- a/examples/xusb.c
+++ b/examples/xusb.c
@@ -863,6 +863,7 @@ static int test_device(uint16_t vid, uint16_t pid)
printf("\nReading first configuration descriptor:\n");
CALL_CHECK_CLOSE(libusb_get_config_descriptor(dev, 0, &conf_desc), handle);
+ printf(" descriptor length: %d\n", conf_desc->bLength);
nb_ifaces = conf_desc->bNumInterfaces;
printf(" nb interfaces: %d\n", nb_ifaces);
if (nb_ifaces > 0)
@@ -932,12 +933,16 @@ static int test_device(uint16_t vid, uint16_t pid)
printf(" String (0x%02X): \"%s\"\n", string_index[i], string);
}
}
- // Read the OS String Descriptor
+
+ printf("\nReading OS string descriptor:");
r = libusb_get_string_descriptor(handle, MS_OS_DESC_STRING_INDEX, 0, (unsigned char*)string, MS_OS_DESC_STRING_LENGTH);
if (r == MS_OS_DESC_STRING_LENGTH && memcmp(ms_os_desc_string, string, sizeof(ms_os_desc_string)) == 0) {
// If this is a Microsoft OS String Descriptor,
// attempt to read the WinUSB extended Feature Descriptors
+ printf("\n");
read_ms_winsub_feature_descriptors(handle, string[MS_OS_DESC_VENDOR_CODE_OFFSET], first_iface);
+ } else {
+ printf(" no descriptor\n");
}
switch(test_mode) {
diff --git a/libusb/version_nano.h b/libusb/version_nano.h
index b82862d..f526fcf 100644
--- a/libusb/version_nano.h
+++ b/libusb/version_nano.h
@@ -1 +1 @@
-#define LIBUSB_NANO 11663
+#define LIBUSB_NANO 11665