From 3ec93d3c4eefbe763bddb23205fc823a6eccc72c Mon Sep 17 00:00:00 2001 From: "Stephen H. Westin" Date: Wed, 9 Mar 2005 15:58:29 +0000 Subject: [PATCH] Added some interpretation of initial camera response. git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@7634 67ed7778-7388-44ab-90cf-0a291f65f57c --- camlibs/canon/urb-interpret | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/camlibs/canon/urb-interpret b/camlibs/canon/urb-interpret index 82d1232cb..53ee3ba5d 100755 --- a/camlibs/canon/urb-interpret +++ b/camlibs/canon/urb-interpret @@ -222,6 +222,13 @@ foreach $file (@ARGV) { } elsif ($urbdata{$current_urb}{pipe} eq "2" && hex($byte_offset) == 0x00 ) { # An interrupt read; let's save the data for later decoding $urbdata{$current_urb}{intdata} = $hex; + } elsif ($urbdata{$current_urb}{op} eq "READ" && hex($byte_offset) == 0x40 ) { + my @h = split(" ", $hex); + if ( defined($h[0x4]) && defined($h[0x5]) + && defined($h[0x6]) && defined($h[0x7]) ) { + $urbdata{$current_urb}{usbid} = "(0x$h[0x7]$h[0x6],0x$h[0x5]$h[0x4])"; + $urbdata{$current_urb}{magic} = "$h[0x3]$h[0x2]$h[0x1]$h[0x0]"; + } } if ( $current_lines < 65 ) { @@ -402,7 +409,9 @@ foreach $file (@ARGV) { } elsif ($length == 0x40) { print("\n\n\n\n*** URB $current_urb possible CANON RESPONSE ***\n"); } elsif ($length == 0x01) { - print("\n\n\n\n*** URB $current_urb PROBABLY CAMERA INIT ***\n\n"); + print("\n\n\n\n*** URB $current_urb probably CAMERA INIT ***\n\n"); + } elsif ($length == 0x58 && defined ($urbdata{$current_urb}{usbid}) ) { + print("\n\n\n\n*** URB $current_urb probably camera initial response, USB ID=$urbdata{$current_urb}{usbid}, magic=$urbdata{$current_urb}{magic} ***\n\n"); } else { print("\n"); }