diff options
author | Pete Batard <pbatard@gmail.com> | 2010-01-14 01:12:45 +0000 |
---|---|---|
committer | Pete Batard <pbatard@gmail.com> | 2010-01-14 01:12:45 +0000 |
commit | 0768325f83e261b8a6e5a0bbe2f8673eb7542655 (patch) | |
tree | eb74efbdb8a45f3d648a812e9863d897b775f06e /examples | |
parent | 107c5d988dce1c2843d81dac7b0d7b1c4f5f551a (diff) | |
download | libusb-0768325f83e261b8a6e5a0bbe2f8673eb7542655.tar.gz |
svn r13: add winusb to the mix: query first interface and pipes on device open
Diffstat (limited to 'examples')
-rw-r--r-- | examples/xusb.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/examples/xusb.c b/examples/xusb.c index 51140e4..43e1ca7 100644 --- a/examples/xusb.c +++ b/examples/xusb.c @@ -1,6 +1,9 @@ /* - * libusb example program to list devices on the bus - * Copyright (C) 2007 Daniel Drake <dsd@gentoo.org> + * xusb: winusb specific test program + * based on lsusb, copyright (C) 2007 Daniel Drake <dsd@gentoo.org> + * + * Currently, this test program will try to access an XBox USB + * Gamepad through WinUSB. To access your device, change VID/PID. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -42,8 +45,10 @@ static void print_devs(libusb_device **devs) // DEBUG: Access an XBox gamepad through WinUSB if ((desc.idVendor == 0x045e) && (desc.idProduct == 0x0289)) { - printf("got Xbox gamepad\n"); + printf("Opening Xbox gamepad:\n"); r = libusb_open(dev, &handle); + if (r != LIBUSB_SUCCESS) + printf("libusb error: %d\n", r); } } } |