<div dir="ltr"><div>Thanks for the reply.</div><div><br></div><div>Another approach is to use the C api directly and map it to java using JNI.</div><div><br></div><div>I'm looking at scanimage.c file, but it deals with lots of things. Is there a high level api?</div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Em sex., 22 de jan. de 2021 às 16:21, Alexander Pevzner <<a href="mailto:pzz@apevzner.com">pzz@apevzner.com</a>> escreveu:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 1/22/21 9:38 PM, Thiago Milczarek Sayão wrote:<br>
> I've been getting lots of attention to make my scanner work, thanks!<br>
> <br>
> But one question remains: Is it possible to make saned list network <br>
> scanners?<br>
<br>
With existent saned - no. It requires some patching, though minimal.<br>
<br>
saned obtains list of devices from the configured backends, using <br>
sane_get_devices() call of each backend. The second parameter of this <br>
call tells backend, should it return all devices, or only local devices. <br>
saned hardcodes this parameter to SANE_TRUE. Network backends consider <br>
their devices as non-local, and return empty list.<br>
<br>
The simple trick could be to set this parameter to SANE_FALSE. However, <br>
if sane-net backend is configured, it may discover itself, reexport <br>
itself and so on - until saned crashed due to lack of memory. It needs <br>
to be handled somehow.<br>
<br>
The simplest possible approach is to add an option, that sets second <br>
parameter of sane_get_devices() to SANE_FALSE, and document, that if <br>
this option is set, sane-net backend must be disabled. More robust <br>
approach would be to patch sane-net to ignore discovered addresses that <br>
match local interfaces.<br>
<br>
<br>
-- <br>
<br>
        Wishes, Alexander Pevzner (<a href="mailto:pzz@apevzner.com" target="_blank">pzz@apevzner.com</a>)<br>
<br>
</blockquote></div>