[sane-devel] CX5200 problem ...[debianbugs@saahbs.net: recompiled libsane with debugging symbols and stepped through the code...]

Olaf Meeuwissen olaf.meeuwissen at avasys.jp
Wed Dec 20 00:53:14 CET 2006


Michal Sabala <debianbugs at saahbs.net> writes:

> I traced the problem to epson.c's get_identity2_information() where it
> fails due to an "incorrect" value in the return buffer. My cx5200, along
> other users cx5200s, has 0xb0 (176) in buf[0] which has the most
> significant bit (0x80) set.

You can just remove the if block.  I think it got in there by analogy
of the check_ext_status() function.  There the first byte of the reply
has a bunch of flags in the first byte and 0x80 signals a fatal error.

With the get_identity2_information() the first two bytes hold the
optical resolution (as can be infered from the code, see below).

  /* from get_identity2_information() */
  receive (s, buf, len, &status);	/* reveive actual status data */

  if (buf[0] & 0x80)
  {
    close_scanner (s);
    return SANE_STATUS_INVAL;
  }

  /* the first two bytes of the buffer contain the optical resolution */
  s->hw->optical_res = buf[1] << 8 | buf[0];


# BTW, the epkowa backend does this correctly.

Hope this helps,
-- 
Olaf Meeuwissen                          EPSON AVASYS Corporation, SE1
FSF Associate Member #1962           sign up at http://member.fsf.org/
GnuPG key: 6BE37D90/AB6B 0D1F 99E7 1BF5 EB97  976A 16C7 F27D 6BE3 7D90
Penguin's lib!       -- I hack, therefore I am --               LPIC-2



More information about the sane-devel mailing list