SANE2 was: Re: [sane-devel] Infrared channel

m. allan noah anoah@pfeiffer.edu
Tue, 22 Feb 2005 12:10:53 -0500 (EST)


>>> i would like to see a few things done in the sane2 standard:
>>> 3. more consistent config file interface for all backends
>> 
>> I would appreciate this very much.
>> 
>> At the moment all what the Suse scanner config tool does is:
>> a) show a list of model names made from the *.desc files
>> b) let the user select a model from this list
>> c) activate the matching backend in dll.conf
>> 
>> At the moment it is simply ignored when particular models require
>> special settings in <backend>.conf
>> 
>> I think we should discuss about an enhanced *.desc file format
>> to specify autodetected model strings and model dependent
>> parameter settings in <backend>.conf
>>

ok, so here is what i have been working on for the fujitsu backend conf 
file. i have situations where 2 of the same model of scanner may be 
connected to one machine, or where the order of insertion of two scanners 
may be different, so it is difficult to tell which one is where. there are 
also situations where the scanner is new but similar to an existing model, 
so being able to tell the backend to treat it as such is nice.

so what i have been trying to do is something more like either the syntax 
of samba's config (with [sections] followed by key=value pairs) or a 
simple grid with '*' for the missing items (like crontab)

ie:

# /etc/sane/fujitsu.conf
# global section:
default=main_scanner

[main_scanner]
connection=usb
vid=1234
pid=5678
SN=12345670001
fw_file='/etc/fw/blah.bin'
vid2=9090
pid2=a556
SN2=123412341234

[sec_scanner]
connection=scsi
name='Mega Scanner 3000'
acts_like='Mega Scanner 2700'

this gives a permanent 'name' to a particular scanner, so that if you have 
more than one scanner on the computer, you dont have to guess which to 
use. when the user asks for 'fujitsu', you could use the 'default', and 
go lookup that vid/pid/SN on the usb bus, and upload the firmware, then 
look for the changed vid/pid/sn

if they say 'fujitsu:sec_scanner' then we scan the scsi bus for that 
name, but after we find it, pretend its a different model.

i suppose, if you even went so far, you could make just one of these 
files, instead of one for each backend, with the sections imported from 
external text files. this is a big reason i like the ppd or external desc 
files over the backend having a special mode: you could give someone a ppd 
that makes their new scanner work with an older backend easily (disable 
some options, etc)

allan

-- 
"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