[sane-devel] problem with UMAX 2000P scanner

aneesh m raj aneeshmraj@hotmail.com
Fri, 13 Jun 2003 17:16:18 +0530


This is a multi-part message in MIME format.

------=_NextPart_000_0086_01C331CF.80C1C640
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Hi ,
Thank u it worked the mode was in ECP+EPP . Im using a program to detect =
scanner devices but I cant retrieve the device by calling =
sane_get_devices() function .The=20
SANE_Device structure is NULL.


%%%%%%%%%%%%scanner.h%%%%%%%

#include <sane/sane.h>
#define SANE_MAX_USERNAME_LEN 128
#define SANE_MAX_PASSWORD_LEN 128
typedef void (*SANE_Authorization_Callback)
      (SANE_String_Const resource,
       SANE_Char username[SANE_MAX_USERNAME_LEN],
       SANE_Char password[SANE_MAX_PASSWORD_LEN]);
SANE_Status initialize_scanner(SANE_Int* =
version,SANE_Authorization_Callback callback);
void exit_scanner(void);
SANE_Status get_scanners(const SANE_Device*** device, SANE_Bool local);

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
//scanner.c

#include <stdio.h>
#include "scanner.h"

int main()
{
  SANE_Status status=3D 0;=20
  const SANE_Device** dev;
  int i =3D 0;
  status =3D initialize_scanner(NULL,NULL);
  if(status !=3D SANE_STATUS_GOOD)
  {
  printf("Scanner not properly initialized...\nExit code: %d\n",status);
  exit(0);

  }
  else
  {=20
        status =3D get_scanners(&dev,1);
        if(status =3D=3D SANE_STATUS_GOOD)
          {=20
            /*
            dev[i] is NULL
            */
            while(dev[i] !=3D NULL)
                {
                   printf("Name - %s\n", ((const =
SANE_Device*)dev[i])->name);
                    printf("Vendor - %s\n",((const =
SANE_Device*)dev[i])->vendor);
                    printf("Model - %s\n",((const =
SANE_Device*)dev[i])->model);
                    printf("Type - %s\n\n",((const =
SANE_Device*)dev[i])->type);
                    i++;
                }
           }

        =20
  }
  exit_scanner(); =20
  return 0;
}

SANE_Status initialize_scanner(SANE_Int* =
version,SANE_Authorization_Callback callback)
{
  return sane_init (version,callback);

}

void exit_scanner(void)
{

  sane_exit();

}


SANE_Status get_scanners(const SANE_Device*** device, SANE_Bool local)
{
 =20
  return  sane_get_devices (device,local);

}

Thanks in advance
Aneesh
  ----- Original Message -----=20
  From: aneesh m raj=20
  To: sane-devel@www.mostang.com=20
  Sent: Friday, June 13, 2003 2:59 PM
  Subject: [sane-devel] problem with UMAX 2000P printer


  Hi ,
  Im using a UMAX 2000P parallel port printer and I have downloaded SANE =
and the patch for UMAX, when I run the umax_pp tool I receive a message =
"No scanner found Status 134 not expected" .Im using debian linux kernel =
2.2.20. Any help is appreciated.
  Regards
  Aneesh
------=_NextPart_000_0086_01C331CF.80C1C640
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2800.1106" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>
<DIV><FONT face=3DArial size=3D2>
<DIV><FONT face=3DArial size=3D2>Hi ,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Thank u it worked the mode was in =
ECP+EPP . Im=20
using a program to detect scanner devices but I cant retrieve the device =
by=20
calling&nbsp;sane_get_devices() function&nbsp;.The </FONT></DIV>
<DIV><FONT face=3DArial size=3D2>SANE_Device structure is =
NULL.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial =
size=3D2>%%%%%%%%%%%%scanner.h%%%%%%%</FONT></DIV><FONT=20
face=3DArial size=3D2>
<DIV><BR>#include &lt;sane/sane.h&gt;<BR>#define SANE_MAX_USERNAME_LEN=20
128<BR>#define SANE_MAX_PASSWORD_LEN 128<BR>typedef void=20
(*SANE_Authorization_Callback)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
(SANE_String_Const resource,<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
SANE_Char=20
username[SANE_MAX_USERNAME_LEN],<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =

SANE_Char password[SANE_MAX_PASSWORD_LEN]);<BR>SANE_Status=20
initialize_scanner(SANE_Int* version,SANE_Authorization_Callback=20
callback);<BR>void exit_scanner(void);<BR>SANE_Status get_scanners(const =

SANE_Device*** device, SANE_Bool local);<BR></DIV>
<DIV>%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%</DIV>
<DIV>//scanner.c</DIV>
<DIV>&nbsp;</DIV></FONT>
<DIV><FONT face=3DArial size=3D2>#include &lt;stdio.h&gt;<BR>#include=20
"scanner.h"</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>int main()<BR>{<BR>&nbsp; SANE_Status =
status=3D 0;=20
<BR>&nbsp; const SANE_Device** dev;<BR>&nbsp; int i =3D 0;<BR>&nbsp; =
status =3D=20
initialize_scanner(NULL,NULL);<BR>&nbsp; if(status !=3D=20
SANE_STATUS_GOOD)<BR>&nbsp; {<BR>&nbsp;&nbsp;printf("Scanner not =
properly=20
initialized...\nExit code: =
%d\n",status);<BR>&nbsp;&nbsp;exit(0);</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp; }<BR>&nbsp; else</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp; {=20
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; status =3D=20
get_scanners(&amp;dev,1);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
if(status =3D=3D=20
SANE_STATUS_GOOD)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;=20
{&nbsp;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;=20
&nbsp;&nbsp;&nbsp; /*</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;=20
&nbsp;&nbsp;&nbsp; dev[i] is NULL</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;=20
&nbsp;&nbsp;&nbsp;=20
*/<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =

while(dev[i] !=3D NULL)<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;=20
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; =
{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; printf("Name - =
%s\n",=20
((const SANE_Device*)dev[i])-&gt;name);<BR>&nbsp;&nbsp;&nbsp; =
&nbsp;&nbsp;&nbsp;=20
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; printf("Vendor =
-=20
%s\n",((const SANE_Device*)dev[i])-&gt;vendor);<BR>&nbsp;&nbsp;&nbsp;=20
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; =
&nbsp;&nbsp;&nbsp;=20
printf("Model - %s\n",((const=20
SANE_Device*)dev[i])-&gt;model);<BR>&nbsp;&nbsp;&nbsp; =
&nbsp;&nbsp;&nbsp;=20
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; printf("Type -=20
%s\n\n",((const SANE_Device*)dev[i])-&gt;type);<BR>&nbsp;&nbsp;&nbsp;=20
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; =
&nbsp;&nbsp;&nbsp;=20
i++;<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;=20
&nbsp;&nbsp;&nbsp;=20
}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
}</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial =
size=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp; }</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp; =
exit_scanner();&nbsp;&nbsp;</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp; return 0;<BR>}</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>SANE_Status =
initialize_scanner(SANE_Int*=20
version,SANE_Authorization_Callback callback)<BR>{<BR>&nbsp; return =
sane_init=20
(version,callback);</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>}</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>void =
exit_scanner(void)<BR>{</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp; sane_exit();</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>}</FONT></DIV>
<DIV>&nbsp;</DIV><FONT face=3DArial size=3D2>
<DIV><BR>SANE_Status get_scanners(const SANE_Device*** device, SANE_Bool =

local)<BR>{<BR>&nbsp; <BR>&nbsp; return&nbsp; sane_get_devices=20
(device,local);</DIV>
<DIV>&nbsp;</DIV>
<DIV>}<BR></DIV>
<DIV>Thanks in advance</DIV>
<DIV>Aneesh</DIV></FONT></FONT></DIV></FONT></DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
  <DIV style=3D"FONT: 10pt arial">----- Original Message ----- </DIV>
  <DIV=20
  style=3D"BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: =
black"><B>From:</B>=20
  <A title=3Daneeshmraj@hotmail.com =
href=3D"mailto:aneeshmraj@hotmail.com">aneesh m=20
  raj</A> </DIV>
  <DIV style=3D"FONT: 10pt arial"><B>To:</B> <A =
title=3Dsane-devel@www.mostang.com=20
  =
href=3D"mailto:sane-devel@www.mostang.com">sane-devel@www.mostang.com</A>=
 </DIV>
  <DIV style=3D"FONT: 10pt arial"><B>Sent:</B> Friday, June 13, 2003 =
2:59 PM</DIV>
  <DIV style=3D"FONT: 10pt arial"><B>Subject:</B> [sane-devel] problem =
with UMAX=20
  2000P printer</DIV>
  <DIV><BR></DIV>
  <DIV><FONT face=3DArial size=3D2>
  <DIV><FONT face=3DArial size=3D2>Hi ,</FONT></DIV>
  <DIV><FONT face=3DArial size=3D2>Im using a UMAX 2000P parallel port =
printer=20
  and&nbsp;I have downloaded SANE and the patch for UMAX, when I run the =
umax_pp=20
  tool I receive a message "No scanner found Status 134 not expected" =
.Im using=20
  debian linux kernel 2.2.20. Any help is appreciated.</FONT></DIV>
  <DIV><FONT face=3DArial size=3D2>Regards</FONT></DIV>
  <DIV><FONT face=3DArial=20
size=3D2>Aneesh</FONT></DIV></FONT></DIV></BLOCKQUOTE></BODY></HTML>

------=_NextPart_000_0086_01C331CF.80C1C640--