On 1/22/21 9:38 PM, Thiago Milczarek Sayão wrote:
I've been getting lots of attention to make my scanner work, thanks!

But one question remains: Is it possible to make saned list network scanners?

With existent saned - no. It requires some patching, though minimal.

saned obtains list of devices from the configured backends, using sane_get_devices() call of each backend. The second parameter of this call tells backend, should it return all devices, or only local devices. saned hardcodes this parameter to SANE_TRUE. Network backends consider their devices as non-local, and return empty list.

The simple trick could be to set this parameter to SANE_FALSE. However, if sane-net backend is configured, it may discover itself, reexport itself and so on - until saned crashed due to lack of memory. It needs to be handled somehow.

The simplest possible approach is to add an option, that sets second parameter of sane_get_devices() to SANE_FALSE, and document, that if this option is set, sane-net backend must be disabled. More robust approach would be to patch sane-net to ignore discovered addresses that match local interfaces.


--

        Wishes, Alexander Pevzner ([email protected])

Reply via email to