Permalink
Browse files

libusb-sniff: Fix usb_control_msg log

  • Loading branch information...
1 parent 7868ad0 commit a321f275eff87a98c82a7d2be6154be0c59a3bb6 @pali pali committed Sep 22, 2012
Showing with 13 additions and 1 deletion.
  1. +13 −1 src/libusb-sniff.c
View
@@ -122,9 +122,21 @@ int usb_control_msg(usb_dev_handle *dev, int requesttype, int request, int value
if ( ! real_usb_control_msg )
real_usb_control_msg = dlsym(RTLD_NEXT, "usb_control_msg");
+ if ( requesttype == 64 && ! getenv("USBSNIFF_SKIP_CONTROL") ) {
+
+ printf("\n==== usb_control_msg(requesttype=%d, request=%d, value=%d, index=%d, size=%d, timeout=%d) ====\n", requesttype, request, value, index, size, timeout);
+ dump_bytes(bytes, size);
+ printf("====\n");
+
+ if ( getenv("USBSNIFF_WAIT") ) {
+ printf("Press ENTER"); fflush(stdout); getchar();
+ }
+
+ }
+
ret = real_usb_control_msg(dev, requesttype, request, value, index, bytes, size, timeout);
- if ( ! getenv("USBSNIFF_SKIP_CONTROL") ) {
+ if ( requesttype != 64 && ! getenv("USBSNIFF_SKIP_CONTROL") ) {
printf("\n==== usb_control_msg(requesttype=%d, request=%d, value=%d, index=%d, size=%d, timeout=%d) ret = %d ====\n", requesttype, request, value, index, size, timeout, ret);
if ( ret > 0 ) {

0 comments on commit a321f27

Please sign in to comment.