[sane-devel] sanei_usb_read_bulk: problem in handling of NAK

Wittawat Yamwong wy-sane-devel at arcor.de
Fri May 26 20:45:04 UTC 2006


On Friday 26 May 2006 21:52, Lauri Pirttiaho wrote:
> [...]
> I would propose changing the behavior of sanei_usb_read bulk
> so that in the case of NAK (resource temporarily unavailable)
> the size is returned as 0 and the return value is set
> either to SANE_STATUS_GOOD (read OK, just no data
> at this moment) or SANE_STATUS_BUSY (device can not
> respond right now). Both will work even though probably
> the latter one is more in line with the meaning of USB NAK
> in this case.

I vote for the latter (SANE_STATUS_BUSY) so that it is possible to distinguish 
between NAK and zero-length packet. 

Regards
-- 
Wittawat Yamwong
Hannover, Germany



More information about the sane-devel mailing list