Hi, On Mon, Apr 12, 2004 at 05:08:27PM +0200, Thibault North wrote: > ok let's go for a test. But I'am beginning, don't go to quickly :)
Ok. First: reply to the sane-devel mailing list, not to me personally :-) > You are talking of check-usb-chip.c in sane-backend 1.4pre tools directory ? Yes. It's part of sane-find-scanner. It's used by sane-find-scanner to find out which kind of USB chip is used. The code tries one chip after the other. It first tests for the characteristics of the USB device descriptor and interface descriptors (e.g. USB version, number of endpoints). If it finds out that the current USB version is 1.1 but the vhipset has usually 2.0 it's not that chip so the next test is executed. If all the descriptor characteristics are found to be met, a short command is sent to the scanner, e.g. to write to a register and read that value from it again. If that's also ok, the chip is detected for sure. > What do I have to do with it ? how to add a test ? Read the source code. You'll see tests for different chipsets. At the end of the code, all the different tests are executed one after the other. Add one test as mentioned in my previous mail. Check at which test it fails and have a look at the output of sane-find-scanner -v -v. That output contains all the fields the USB provides. > Maybe I should read the documentation first... I'll print it now, > perhaps I'll undestand it :) Have a look at the USB specification. It explains what all these descriptors are and what the balues mean. > Programming: i didn't go far, but I will be pleased to learn more... (I > did a little of C++, but I don't know C structures at all...) You'll learn to use them. But in this case, you can just copy the already existing tests and change the values. Bye, Henning