Re: Have a "scan" button? Read this...

From: Douglas Gilbert (dgilbert@interlog.com)
Date: Thu Mar 08 2001 - 12:33:12 PST

  • Next message: Tim Waugh: "Re: Have a "scan" button? Read this..."

    Frederik Ramm wrote:
    >
    > Hi,
    >
    > my scanner has a "scan" button that (at least using their Windows
    > driver) can be used to launch certain programs on the host system.
    >
    > I've written something similar for the SANE environment. It's called
    > "sensed" and works by sending a SCSI "REQUEST SENSE" command to the
    > scanner in regular intervals (every 2 sec). If the response indicates
    > that the scan button has been pressed, a program is launched. (This
    > would usually mean scanadf or scanimage, maybe called by a shell
    > script that stores the results away properly.)
    >
    > The current, initial version is very crude, has only been tested with
    > my Fujitsu M3091DCd scanner, and it doesn't even have a Makefile etc.
    > (it relies on the SANE SCSI core so you'll have to stuff it into the
    > "backend" directory, compile and link with libsanei.a).
    >
    > It's here: http://www.remote.org/frederik/projects/software/sane/
    >
    > Feel free to play with it. If anyone's willing to help me make this a
    > proper part of SANE, including it in the "tools" directory, putting it
    > in CVS and tweaking the Makefiles accordingly, you're most welcome.
    > But perhaps that should wait for a version that is more configurable
    > and supports more scanners.
    >
    > For the SCSI gurus out there, is there any potential disruption by
    > sending REQUEST SENSE to a device every two seconds? I noticed that
    > while someone has "grabbed" the device, the call blocks anyway (which
    > doesn't hurt my program). sensed does not attempt to grab and release
    > the device; should it?

    Frederik,
    There shouldn't be. After all cd player apps send TEST UNIT
    READYs to SCSI cdroms periodically to see if the media is
    ready.

    Doug Gilbert

    --
    Source code, list archive, and docs: http://www.mostang.com/sane/
    To unsubscribe: echo unsubscribe sane-devel | mail majordomo@mostang.com
    



    This archive was generated by hypermail 2b29 : Thu Mar 08 2001 - 12:12:09 PST