[sane-devel] ADF support in SANE API

Alexander Pevzner pzz at apevzner.com
Mon Jun 29 00:09:37 BST 2020


Hi Jürgen,

I'm the author of sane-airscan, the eSCL/WSD backend for SANE 
(https://github.com/alexpevzner/sane-airscan)

At some point, your AirSane was one of my knowledge sources to learn the 
eSCL protocol :-)

> I’m trying to incorporate ADF support into a SANE frontend that I have written
> (github.com/SimulPiscator/AirSane).
> The frontend is a web server that needs to report or announce the scanner’s status to its clients.
> Without an ADF, scanner status is just idle vs busy, and any error state is only temporary.
> With an ADF, the "ADF empty" state prevents scanning but needs to be monitored such that
> a client can know it may initiate a scan when it switches to "ADF loaded".

It would be enough, if in a case of empty ADF,
ScanJobs will fail with, say, HTTP 409 status, and subsequent 
ScannerStatus will return the reason of this failure.

Hardware scanners are not very accurate in reporting current ADF status, 
and actually all behave the slightly different way.

My backend even doesn't bother to request ScannerStatus until ScanJobs 
or NextDocument fails.

> So my question is: What can I do in order to monitor ADF status? Call sane_start() after setting an empty
> scan region, so the scan is done at the first call to sane_read()? This is obviously not an option, as in the
> case of a loaded feeder this would consume the first original rather than just read ADF status.
> Cancel the scan immediately after sane_start() using sane_cancel()? I have no idea whether this is possible.

There are actually no such API that will return ADF status before actual 
scan attempt.

BTW, some hardware scanners scan all pages loaded into ADF when
ScanJobs command is issues and requires multiple NextDocument to gather 
all scanned pages, while others scan only one page.

-- 

	Wishes, Alexander Pevzner (pzz at apevzner.com)



More information about the sane-devel mailing list