Look at the source code for scanimage, see how it translates SANE_status to
exit codes. If that is not sufficient, you might need to catch its STDERR
stream, and parse it.

Really, for what you are trying to do, you might be better off interfacing
with the SANE API instead of trying to drive scanimage.

allan

On Sat, Dec 9, 2023 at 2:25 PM Wes Rishel <wris...@gmail.com> wrote:

> I have a program that uses SANE to run a Fujitsu fi-5900c scanner, but I
> only have access to the scanner when I am doing production work. So I am
> writing code on a system where the scanner is not available.
>
> It would help to have a list of the return codes from scanimage while
> working on a Fujitsu scanner. In particular, I would like to identify the
> error codes returned for various errors where the operator might correct
> them. Examples include stops due to double feeds, due to something stuck on
> the page (like a sticky note), due to a failure to pass a single page
> through the scanner, and so forth. I know that fujitsu.c somehow sets
> different return codes for some of these situations but I haven't found the
> list in sane-fujitsu(5) or sane-epjitsu(5).
>
> I believe that a good enough list is the SANE_status enum for the general
> SANE specification.
>
> What I don't know is how to map the various values in the enum to the
> return codes that scanimage uses on exit or whether there are specific
> additional values for Fujitsu.
>
> Can someone share the secret decoder ring ;-) or point me to a document or
> source file that has this info?
>
> Thanks in advance.
>
> -- Wes
>


-- 
"well, I stand up next to a mountain- and I chop it down with the edge of
my hand"

Reply via email to