diff options
author | Pete Batard <pbatard@gmail.com> | 2011-01-20 12:46:02 +0000 |
---|---|---|
committer | Pete Batard <pbatard@gmail.com> | 2011-01-20 12:56:45 +0000 |
commit | 1363b3af3227367c7c5699ac28ea3386c1907914 (patch) | |
tree | 20642993920033048ac0342ce83a41a992f65b8b /examples | |
parent | 453b8bd631084b561a7a1e99e54e9f8a96a7940c (diff) | |
download | libusb-1363b3af3227367c7c5699ac28ea3386c1907914.tar.gz |
added topology information retrieval to xusbpbr327
Diffstat (limited to 'examples')
-rw-r--r-- | examples/xusb.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/examples/xusb.c b/examples/xusb.c index 58bb6da..f701b2c 100644 --- a/examples/xusb.c +++ b/examples/xusb.c @@ -606,6 +606,7 @@ int test_device(uint16_t vid, uint16_t pid) { libusb_device_handle *handle; libusb_device *dev; + struct libusb_device_topology topology; struct libusb_config_descriptor *conf_desc; const struct libusb_endpoint_descriptor *endpoint; int i, j, k, r; @@ -629,6 +630,9 @@ int test_device(uint16_t vid, uint16_t pid) } dev = libusb_get_device(handle); + if (libusb_get_device_topology(dev, &topology) == LIBUSB_SUCCESS) { + printf("bus: %d, port: %d, depth: %d\n", topology.bus, topology.port, topology.depth); + } printf("\nReading device descriptor:\n"); CALL_CHECK(libusb_get_device_descriptor(dev, &dev_desc)); |