[sane-devel] Generate C source code from a USBSnoopy log

Thomas Soumarmon soumarmt@nerim.net
Fri, 24 Jan 2003 13:30:02 +0100


Hi everybody,

I have been playing around with my HP5470c scanner for some days without =
any=20
good results. I tried to handwrite C code corresponding to USBSnoopy logs=
 I=20
got before as the logs are a bit long and tough, it never worked fully. S=
o I=20
decided to replay the log with usb-robot. Logs did not fit with the expec=
ted=20
syntax... annoying.
So I decided to write an awk program that would write for me the C source=
code=20
that replays the log, and it works.
Now I'll need to add the code to write the image to a file. Could anybody=
 tell=20
me which format should I expect for the image (RGB pixels from top left ?=
).=20
Is there a library I should use for image saving and processing (ImageMag=
ick=20
?). Thank you for your help.

I suppose that tha tool could be of interest for more people so it is=20
available for download at sourceforge :
http://prdownloads.sourceforge.net/hp5400backend/USBSnoopy2CsourceCode.ta=
r.gz?download

Just a few notes :
* This tool works with libusb. Feell free to port it to the kernel USB li=
b if=20
you know how to do it.
* you need awk and a C compiler to use it (if you don't have them, it is=20
probably of no use for you)

Regs,

Thomas.