[sane-devel] help for write back-end

m. allan noah anoah@pfeiffer.edu
Tue, 15 Feb 2005 13:40:35 -0500 (EST)


  This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.

--1386613362-1823208418-1108492835=:16899
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed


attached is a perl script i wrote, it only works with benoit's usb 
sniffer, not the usbsnoopy or snoopypro that you get from source forge.

allan

On Tue, 15 Feb 2005, Bertrik Sikken wrote:

> corwin wrote:
>> Hi,
>> 
>> I have a CanoScan 3200F (Product Id : 2216) and this scanner are not 
>> supported by sane.
>> But i'm very interresting for write a back end.
>> 
>> I use "usb snoopy log" for extract usb log under WinXP. And I had writing a 
>> perl script (based on awk Thomas Soumarmon's script) for genrate c code for 
>> replaying log-script under linux (debian, 2.6.9).
>> For the moment I reading libusb documentation and my first objective is to 
>> write a small program (sane independant) for activate the scanner.
>> 
>> But actually i'm completly lost into the log data and i don't know how to 
>> begin !!!
>
> Zip the logs and put them somewhere on your webpage (if you have one),
> then post a link to the mailing list. This way, other people with
> previous experience in decoding logs can try to see if there is
> something that matches an existing protocol.
>
>> So my questions :
>> 
>> Have you a methodology for extract information of data log ?
>
> I think that there is no fixed methodology, you just have to be a
> little creative.
>
> In my experience it helps to look for patterns in the log, like:
> * are there some USB transfers that always appear in some particular
>  order?
> * some scanners use a "register model", which means that initialising
>  the scanner consists of several write(register, data), which each
>  can consist of several USB transfers. See if this applies to your
>  scanner and find out the sequence to read or write a scanner register.
> * record lots of logs, where each time a single thing is changed, for
>  example record a log of starting the scan software, record a log for
>  a scan of 150 dpi, record a log for 300 dpi. If there is an option
>  to turn the scanner lamp on or off, record a log of this.
>
> For some scanners, the settings are sent using USB control transfers
> or rather small USB bulk transfers. Try to concentrate on these small
> transfers and don't bother too much yet about the bulky USB bulk
> transfers that contain the image data.
>
>> Where can I found script (perl, ..) for parsing and cleaning log data ?
>
> I don't know of a central place for log analysis scripts.
>
>> Have you trics ?
>> 
>> ludovic (corwin)
>> 
>> 
>> ps: I don't know the model of chips into the scanner and i don't open this 
>> because it is one plastic box and there are no visible screw...
>> pps : I'm very sorry for my poor english :(
>> 
>
> Kind regards,
> Bertrik
>
>
>

-- 
"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
--1386613362-1823208418-1108492835=:16899
Content-Type: TEXT/PLAIN; charset=US-ASCII; name="spike4.pl"
Content-Transfer-Encoding: BASE64
Content-ID: <Pine.LNX.4.61.0502151340350.16899@limos.pfeiffer.edu>
Content-Description: 
Content-Disposition: attachment; filename="spike4.pl"

IyEgL3Vzci9iaW4vcGVybA0KDQojIHNpbXBsZSBsb2cgcmVmb3JtYXR0ZXIg
Zm9yIGJlbm9pdCdzIHNuaWZmdXNiLmV4ZQ0KIyBwdWJsaWMgZG9tYWluLiBi
eSBhbm9haEBwZmVpZmZlci5lZHUNCg0KdXNlIHN0cmljdDsNCg0KbXkgJGNv
dW50PTA7DQpteSAkbGFzdFVyYkxUaW1lPTA7DQpteSBAYnVmZmVyOw0KDQp3
aGlsZSAobXkgJGxpbmUgPSA8U1RESU4+KSB7DQoNCiAgICAgICAgaWYgKCAk
bGluZSA9fiBtLz4+Pi8gKSB7DQogICAgICAgICAgICBkdW1wZXIoQGJ1ZmZl
cikgaWYgJGNvdW50Ow0KICAgICAgICAgICAgQGJ1ZmZlciA9ICgpOw0KICAg
ICAgICAgICAgJGNvdW50Kys7DQogICAgICAgIH0NCiAgICAgICAgaWYgKCAk
bGluZSA9fiBtL1VzYlNub29wLyApe25leHQ7fQ0KICAgICAgICBwdXNoKEBi
dWZmZXIsJGxpbmUpOw0KDQp9DQpkdW1wZXIoQGJ1ZmZlcikgaWYgJGNvdW50
Ow0KDQpzdWIgZHVtcGVyIHsNCg0KICAgIG15ICRkaXI9J291dCc7DQogICAg
bXkgJHR5cGU9J0MnOw0KICAgIG15ICRkYXRhPSgpOw0KICAgIG15ICR1cmI9
MDsNCiAgICBteSAkZXA9Jyc7DQogICAgbXkgJGZUaW1lPTA7DQogICAgbXkg
JGxUaW1lPTA7DQoNCiAgICBmb3JlYWNoIG15ICRsaW5lIChAXykgew0KDQog
ICAgICAgIGlmKCRsaW5lID1+IG0vXFsoXGQrKSBtc1xdIC4qIFVSQiAoXGQr
KSBnb2luZyBkb3duLyl7DQogICAgICAgICAgJGZUaW1lPSQxOw0KICAgICAg
ICAgICR1cmI9JDI7DQogICAgICAgICAgcHJpbnQgIlxucGF1c2UgIiAuICgk
ZlRpbWUtJGxhc3RVcmJMVGltZSkgLiAiIG1zXG5cbiI7DQogICAgICAgIH0N
CiAgICAgICAgZWxzaWYgKCAkbGluZSA9fiBtL1VTQkRfVFJBTlNGRVJfRElS
RUNUSU9OX0lOLyApIHsNCiAgICAgICAgICAkZGlyPSdpbic7DQogICAgICAg
ICAgJGRhdGE9KCk7DQogICAgICAgIH0NCiAgICAgICAgZWxzaWYgKCAkbGlu
ZSA9fiBtLy0tIFVSQl9GVU5DVElPTl9CVUxLX09SX0lOVEVSUlVQVF9UUkFO
U0ZFUi8gKSB7DQogICAgICAgICAgJHR5cGU9J0InOw0KICAgICAgICB9DQog
ICAgICAgIGVsc2lmKCAkbGluZSA9fiBtL1BpcGVIYW5kbGUuKmVuZHBvaW50
ICgweFxkKykvKXsNCiAgICAgICAgICAkZXA9JDE7DQogICAgICAgIH0NCiAg
ICAgICAgZWxzaWYgKCAkbGluZSA9fiBtIC8gIChbMC05YS1mXXs4fTogKShb
MC05YS1mIF0qKS8gKSB7DQogICAgICAgICAgcHVzaChAeyRkYXRhfSwgJDEg
LiAkMik7DQogICAgICAgIH0NCg0KICAgICAgICBpZiAoICRsaW5lID1+IG0v
XFsoXGQrKSBtc1xdLyApew0KICAgICAgICAgICRsVGltZT0kMTsNCiAgICAg
ICAgfQ0KDQogICAgICAgICRlcD1+cy9eMHgwKy8vOw0KICAgIH0NCg0KICAg
IGlmKCRkaXIgZXEgJ2luJyl7DQogICAgICAgIHByaW50ICJVcmIgJHVyYiAo
JHR5cGUpIGVwPSRlcCAocmVhZCkgIjsNCiAgICB9DQogICAgZWxzZXsNCiAg
ICAgICAgcHJpbnQgIlVyYiAkdXJiICgkdHlwZSkgZXA9JGVwICh3cml0ZSkg
IjsNCiAgICB9DQogICAgcHJpbnQgJGxUaW1lLSRmVGltZSAuICIgbXNcbiI7
DQoNCiAgICBmb3JlYWNoIG15ICRsaW5lIChAeyRkYXRhfSkgew0KICAgICAg
ICAgICAgcHJpbnRmKCIgJXMiLCAkbGluZSk7DQogICAgICAgICAgICBwcmlu
dCAiXG4iOw0KICAgIH0NCg0KICAgICRsYXN0VXJiTFRpbWU9JGxUaW1lOw0K
DQp9DQoNCmV4aXQgMDsNCg==

--1386613362-1823208418-1108492835=:16899--