diff options
| author | Amaury Pouly <amaury.pouly@gmail.com> | 2014-05-25 16:06:31 +0200 |
|---|---|---|
| committer | Amaury Pouly <amaury.pouly@gmail.com> | 2014-09-07 17:45:10 +0200 |
| commit | 12ce7fc2cce5531723ea7d141df80142891989d7 (patch) | |
| tree | dc4e3320f8ed0932265b3c917448a83f7dcecafe /utils/hwstub/tools/hwstub_shell.cpp | |
| parent | 1dc1a9310e8a078a633dd90def13103f80e01ce7 (diff) | |
| download | rockbox-12ce7fc2cce5531723ea7d141df80142891989d7.zip rockbox-12ce7fc2cce5531723ea7d141df80142891989d7.tar.gz rockbox-12ce7fc2cce5531723ea7d141df80142891989d7.tar.bz2 rockbox-12ce7fc2cce5531723ea7d141df80142891989d7.tar.xz | |
hwstub: remove protocol to make it use its own interface
This way, hwstub can be implemented along with other usb features/interfaces.
Change-Id: I7148cab845049cc0a8b8e740fa0d52d3a385eaed
Diffstat (limited to 'utils/hwstub/tools/hwstub_shell.cpp')
| -rw-r--r-- | utils/hwstub/tools/hwstub_shell.cpp | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/utils/hwstub/tools/hwstub_shell.cpp b/utils/hwstub/tools/hwstub_shell.cpp index d0fcdfa..a10a1da 100644 --- a/utils/hwstub/tools/hwstub_shell.cpp +++ b/utils/hwstub/tools/hwstub_shell.cpp @@ -754,15 +754,22 @@ int main(int argc, char **argv) // look for device if(!g_quiet) - printf("Looking for device %#04x:%#04x...\n", HWSTUB_USB_VID, HWSTUB_USB_PID); - - libusb_device_handle *handle = libusb_open_device_with_vid_pid(ctx, - HWSTUB_USB_VID, HWSTUB_USB_PID); - if(handle == NULL) + printf("Looking for hwstub device ...\n"); + // open first device + libusb_device **list; + ssize_t cnt = hwstub_get_device_list(ctx, &list); + if(cnt <= 0) { printf("No device found\n"); return 1; } + libusb_device_handle *handle; + if(libusb_open(list[0], &handle) != 0) + { + printf("Cannot open device\n"); + return 1; + } + libusb_free_device_list(list, 1); // admin stuff libusb_device *mydev = libusb_get_device(handle); |