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

From: Frederik Ramm (frederik@remote.org)
Date: Thu Mar 08 2001 - 12:19:20 PST

  • Next message: Douglas Gilbert: "Re: Have a "scan" button? Read this..."

    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?

    Bye
    Frederik

    -- 
    Frederik Ramm  ##  eMail frederik@remote.org  ##  N57°48.10' W005°40.32'
    

    -- 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:04:00 PST