From 1363b3af3227367c7c5699ac28ea3386c1907914 Mon Sep 17 00:00:00 2001 From: Pete Batard Date: Thu, 20 Jan 2011 12:46:02 +0000 Subject: added topology information retrieval to xusb --- configure.ac | 2 +- examples/xusb.c | 4 ++++ libusb/libusb_version.h | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 26f2389..0083d1b 100644 --- a/configure.ac +++ b/configure.ac @@ -1,7 +1,7 @@ m4_define(LIBUSB_MAJOR, [1]) m4_define(LIBUSB_MINOR, [0]) m4_define(LIBUSB_MICRO, [8]) -m4_define(LIBUSB_NANO, [10326]) +m4_define(LIBUSB_NANO, [10327]) AC_INIT([libusb], LIBUSB_MAJOR.LIBUSB_MINOR.LIBUSB_MICRO, [libusb-devel@lists.sourceforge.net], [libusb], [http://www.libusb.org/]) 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)); diff --git a/libusb/libusb_version.h b/libusb/libusb_version.h index 4c047bd..1dc070d 100644 --- a/libusb/libusb_version.h +++ b/libusb/libusb_version.h @@ -24,6 +24,6 @@ #define LIBUSB_VERSION_MAJOR 1 #define LIBUSB_VERSION_MINOR 0 #define LIBUSB_VERSION_MICRO 8 -#define LIBUSB_VERSION_NANO 10326 +#define LIBUSB_VERSION_NANO 10327 #endif -- cgit v1.2.1