[sane-devel] [scanbd] using scanbd and saned over network at the same time
Wilhelm
wilhelm.meier at fh-kl.de
Fri Feb 19 14:52:45 UTC 2016
Am 19.02.2016 um 14:38 schrieb Rolf Leggewie:
> Hello,
>
> I'd like to know if it is possible to have a computer that does
> button-triggered scanning via scanbd but also exports the scanner over
> the network to be accesible via the common. How would one do that?
Well, absolutely: thats the whole story of scanbd (see the readme.txt of
scanbd). With scanbd all scan-request must be via network, even local
applications must use network-scanning instead of local (via usb) access
to the scanner.
>From ReadMe.txt:
0.1) the solution
scanbd (the scanner button daemon) opens and polls the scanner and
therefore
locks the device. So no other application can access the device directly
(open
the /dev/..., or via libusb, etc).
To solve this, we use a second daemon (in the so called "manager-mode" of
scanbd): scanbm is configured as a "proxy" to access the scanner and, if
another
application tries to use the scanner, the polling daemon is ordered to
disable
polling for the time the other scan-application wants to use the scanner.
To make this happen, scanbm is configured instead of saned as the network
scanning daemon. If a scan request arrives to scanbm on the sane-port,
scanbm
stops the polling by sending a dbus-signal (default) or a posix-signal
(SIGUSR1)
(signal-mode) to the polling scanbd-daemon. Then it starts the real
saned which
scans and sends the data back to the requesting application. Afterwards the
scanbd-manager scanbm restarts the polling by sending another
dbus-signal (or the
posix-signal SIGUSR2) to scanbd. scanbd now reenables polling of the
devices.
Scanbm is actually only a symbolic link to scanbd. Manager mode can be
activatied by calling scanbd as scanbm OR as scanbd -m as in previous
version
of scanbd.
So all applications must be enabled to use network-scanning (even if the
scanner is local, see below)!
Hth
--
Wilhelm
More information about the sane-devel
mailing list