[sane-devel] Visioneer Onetouch 4400 USB (Visioneer/Primax Primascan Colorado 2600u, Memorex 6142u)

m. allan noah anoah at pfeiffer.edu
Sat Dec 6 17:28:10 GMT 2003


duh, forgot to attach log formatter...

On Sat, 6 Dec 2003, m. allan noah wrote:

> keith, i dont like snoopypro, i prefer either the original (non-pro) or 
> even better, SniffUSB.exe v1.8 from 
> http://benoit.papillault.free.fr/usbsnoop/index.php
> 
> the latter is easier to install, and i like the debug log it makes better.
> 
> you can cat the output from it into the attached perl script, which cleans 
> things up some, though it does not deal with control packets fully...
> 
> i usually work on adf scanners, which have alot of sensors and buttons, 
> usually, so i test them by doing one thing at a time with a pause between 
> each, ie: start sniffer, open lid, wait 15 seconds, close lid, wait, push 
> paper sensor, wait, button1, wait, button2, etc. then i add paper to the 
> scanner, and press the buttons again, etc.
> 
> then you stare at the output for awhile, and try to find patterns.
> 
> allan
>  
> On Sat, 6 Dec 2003, Keith Watson wrote:
> 
> > Ok, so I've grabbed a copy of SnoopyPro and installed it on Windows2000.  I've
> > opened the TWAIN interface got the scanner to scan an image.  SnoopyPro has
> > captured a load of things called URBs (what's a URB daddy?).
> > 
> > Presumably I really should approach this methodically and perform a series of
> > smaller captures with each one addressing a specific operation. Is there any
> > material anywhere which covers this?  Failing that is anyone able to mentor me
> > through this? e.g. suggest what operations I need to capture and in what order?
> > 
> > If someone could tell me what to do, I could then post the output somewhere so
> > that others more knowledgeable and able than me can look at them and perhaps
> > deduce what's going on.
> > 
> > Keith
> > 
> > 
> 
> 

-- 
"so don't tell us it can't be done, putting down what you don't know.
money isn't our god, integrity will free our souls" - Max Cavalera
-------------- next part --------------
#! /usr/bin/perl



# simple log reformatter for benoit's sniffusb.exe

# public domain. by anoah at pfeiffer.edu



use strict;



my $count=0;

my @buffer;



while (my $line = <STDIN>) {



        if ( $line =~ m/>>>/ ) {

            dumper(@buffer) if $count;

            @buffer = ();

            $count++;

        }

        push(@buffer,$line);



}

dumper(@buffer) if $count;



sub dumper{



    my $dir='out';

    my $type='C';

    my $data={in=>[],out=>[]};

    my $urb=0;

    my $ep='';



    foreach my $line (@_) {



        if ( $line =~ m/>>>/ ) {

          $dir='out';

          if($line =~ m/URB (\d+)/){

            $urb=$1;

          }

        }

        elsif ( $line =~ m/<<</ ) {

          $dir='in';

        }

        elsif ( $line =~ m/-- URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER/ ) {

          $type='B';

        }

        elsif( $line =~ m/PipeHandle.*endpoint (0x\d+)/){

          $ep=$1;

        }

        elsif ( $line =~ m /  ([0-9a-f]{8}: )([0-9a-f ]*)/ ) {

                push(@{$data->{$dir}},$1 . $2);

        }



    }



    if(scalar(@{$data->{'in'}})){

        print "Urb $urb ($type) ep=$ep <<<<\n";

        foreach my $line (@{$data->{'in'}}) {

                printf(" %s", $line);

                print "\n";

        }

        print "\n";

    }

    else{

        print "Urb $urb ($type) ep=$ep >>>>\n";

        foreach my $line (@{$data->{'out'}}) {

                printf(" %s", $line);

                print "\n";

        }

        print "\n";

    }



}



exit 0;



More information about the sane-devel mailing list