Hey Roland,
You should be able to use multiple devices in the one session, e.g.
SaneDevice a = session.getDevice("a");
SaneDevice b = session.getDevice("b");
The thing to realize is that each of these devices shares a pointer to
a single underlying session stream. You should take care to ensure
that calls to the various SaneDevice methods are serialized across all
devices in a given SaneSession.
Something I hadn't really thought about was acquiring images from two
scanners simultaneously. In theory, it's possible but JFreeSane makes
it a bit tricky: you need to call acquireImage on both devices, but
you can't call it on the second device until you're sure that
JFreeSane has sent the SANE_NET_START RPC for the first call. You can
use the ScanListener interface to know when this happens, but it's
tricky. At this point it's probably easier to just use two separate
SaneSessions. :)
If you do use more than one SaneSession, be aware that you may receive
a SANE_STATUS_DEVICE_BUSY error (see
http://www.sane-project.org/html/doc011.html#s4.2.7) if you try to do
multiple operations on a single scanner. I've never tested JFreeSane
(or SANE) like this, so I'd be happy to hear any feedback!
Hope this helps!
Regards,
James
> --
> You received this message because you are subscribed to the Google Groups
> "jfreesane-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to
jfreesane-disc...@googlegroups.com.
> For more options, visit
https://groups.google.com/d/optout.