I stumbled upon this weird behaviour:
Calling listDevices() seems to leave the session in a broken state. When trying to open a device afterwards, it throws a SaneException with STATUS_UNSUPPORTED.
The next attempt on opening the device works again.
Example
listDevices()
session.getDevice("mydevice")
device.open() // throws SaneException(STATUS_UNSUPPORTED)
device.open() // works again
Obvious workarounds would be closing and reopening the session after listDevices() or calling device.open() twice while catching the first exception.
I figured this could also be somehow related to the issue described in SaneSessionTest.java:multipleListDevicesCalls()
I stumbled upon this weird behaviour: Calling listDevices() seems to leave the session in a broken state. When trying to open a device afterwards, it throws a SaneException with STATUS_UNSUPPORTED. The next attempt on opening the device works again.
Example
Obvious workarounds would be closing and reopening the session after listDevices() or calling device.open() twice while catching the first exception.
I figured this could also be somehow related to the issue described in SaneSessionTest.java:multipleListDevicesCalls()