kopia lustrzana https://gitlab.com/sane-project/website
397 wiersze
10 KiB
HTML
397 wiersze
10 KiB
HTML
|
<!-- received="Wed Jun 3 08:32:46 1998 PDT" -->
|
||
|
<!-- sent="Wed, 03 Jun 1998 14:34:02 +0200" -->
|
||
|
<!-- name="Christian Bucher" -->
|
||
|
<!-- email="bucher@navd.alcatel.de" -->
|
||
|
<!-- subject="Re: Epson GT9000" -->
|
||
|
<!-- id="357542BA.41C80AD2@navd.alcatel.de" -->
|
||
|
<!-- inreplyto="Epson GT9000" -->
|
||
|
<title>sane-devel: Re: Epson GT9000</title>
|
||
|
<h1>Re: Epson GT9000</h1>
|
||
|
<b>Christian Bucher</b> (<a href="mailto:bucher@navd.alcatel.de"><i>bucher@navd.alcatel.de</i></a>)<br>
|
||
|
<i>Wed, 03 Jun 1998 14:34:02 +0200</i>
|
||
|
<p>
|
||
|
<ul>
|
||
|
<li> <b>Messages sorted by:</b> <a href="date.html#19">[ date ]</a><a href="index.html#19">[ thread ]</a><a href="subject.html#19">[ subject ]</a><a href="author.html#19">[ author ]</a>
|
||
|
<!-- next="start" -->
|
||
|
<li> <b>Next message:</b> <a href="0020.html">Oliver.Rauch@Wolfsburg.DE: "umax-backend"</a>
|
||
|
<li> <b>Previous message:</b> <a href="0018.html">Luca Balzano: "Mustek scanner doesn't work"</a>
|
||
|
<!-- nextthread="start" -->
|
||
|
<!-- reply="end" -->
|
||
|
</ul>
|
||
|
<!-- body="start" -->
|
||
|
This is a multi-part message in MIME format.<br>
|
||
|
--------------1FBDF1229EF3D4F801326BAC<br>
|
||
|
Content-Type: text/plain; charset=us-ascii<br>
|
||
|
Content-Transfer-Encoding: 7bit<br>
|
||
|
<p>
|
||
|
Colm Buckley wrote:<br>
|
||
|
<i>> </i><br>
|
||
|
<i>> Hi folks -</i><br>
|
||
|
<i>> </i><br>
|
||
|
<i>> I'd just like to report (I don't know whether this has been done</i><br>
|
||
|
<i>> before), that the sane-epson backend does *not* work with the Epson</i><br>
|
||
|
<i>> GT9000. I have such a scanner, and a good knowledge of C and Unix - is</i><br>
|
||
|
<i>> there any way I can help to get this scanner working with SANE?</i><br>
|
||
|
<i>> </i><br>
|
||
|
<i>> Colm</i><br>
|
||
|
<i>> </i><br>
|
||
|
<i>> --</i><br>
|
||
|
<i>> Colm Buckley B.A. B.F. # Trinity College, Dublin 2, Ireland.</i><br>
|
||
|
<i>> <a href="mailto:colm@tuatha.org">colm@tuatha.org</a> | colm@lspace.org # +353 87 2469146 # whois cb3765</i><br>
|
||
|
<i>> <a href="http://www.tuatha.org/~cbuckley/">http://www.tuatha.org/~cbuckley/</a> # finger <a href="mailto:cbuckley@tuatha.org">cbuckley@tuatha.org</a></i><br>
|
||
|
<i>> Out of my mind. Back in five minutes.</i><br>
|
||
|
<i>> </i><br>
|
||
|
<i>> --</i><br>
|
||
|
<i>> Source code, list archive, and docs: <a href="http://www.mostang.com/sane/">http://www.mostang.com/sane/</a></i><br>
|
||
|
<i>> To unsubscribe: echo unsubscribe sane-devel | mail <a href="mailto:majordomo@mostang.com">majordomo@mostang.com</a></i><br>
|
||
|
<p>
|
||
|
<p>
|
||
|
With this patch it should work. Thanks to Colm and Derek for helping.<br>
|
||
|
<p>
|
||
|
<p>
|
||
|
christian<br>
|
||
|
<p>
|
||
|
<p>
|
||
|
<pre>
|
||
|
--
|
||
|
Christian Bucher
|
||
|
<p>
|
||
|
phone: +43 1 5488640
|
||
|
mobil: +43 676 4208334
|
||
|
<p>
|
||
|
<a href="mailto:bucher@navd.alcatel.de">mailto:bucher@navd.alcatel.de</a>
|
||
|
<a href="mailto:cbucher@vernetzt.at">mailto:cbucher@vernetzt.at</a>
|
||
|
--------------1FBDF1229EF3D4F801326BAC
|
||
|
Content-Type: text/plain; charset=us-ascii; name="epson.1.patch"
|
||
|
Content-Transfer-Encoding: 7bit
|
||
|
Content-Disposition: inline; filename="epson.1.patch"
|
||
|
<p>
|
||
|
*** backend/epson.c~ Sat May 9 21:53:44 1998
|
||
|
--- backend/epson.c Wed Jun 3 14:03:31 1998
|
||
|
***************
|
||
|
*** 60,65 ****
|
||
|
--- 60,66 ----
|
||
|
#include <stdio.h>
|
||
|
#include <string.h>
|
||
|
#include <stdlib.h>
|
||
|
+ #include <ctype.h>
|
||
|
|
||
|
#include <sane/sane.h>
|
||
|
#include <sane/saneopts.h>
|
||
|
***************
|
||
|
*** 97,102 ****
|
||
|
--- 98,104 ----
|
||
|
#define EPSON_LEVEL_B1 2
|
||
|
#define EPSON_LEVEL_B2 3
|
||
|
#define EPSON_LEVEL_B3 4
|
||
|
+ #define EPSON_LEVEL_B4 5
|
||
|
|
||
|
#define EPSON_LEVEL_DEFAULT EPSON_LEVEL_B3
|
||
|
|
||
|
***************
|
||
|
*** 130,135 ****
|
||
|
--- 132,139 ----
|
||
|
{"B2", 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1}
|
||
|
,
|
||
|
{"B3", 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1}
|
||
|
+ ,
|
||
|
+ {"B4", 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1}
|
||
|
};
|
||
|
|
||
|
/* TODO: speed */
|
||
|
***************
|
||
|
*** 147,153 ****
|
||
|
cmd[4] = buf_size;
|
||
|
memcpy (cmd + 6, buf, buf_size);
|
||
|
|
||
|
! if (SANE_STATUS_GOOD == (*status = sanei_scsi_cmd (fd, cmd, sizeof (cmd) + buf_size, NULL, NULL)))
|
||
|
return buf_size;
|
||
|
|
||
|
return 0;
|
||
|
--- 151,157 ----
|
||
|
cmd[4] = buf_size;
|
||
|
memcpy (cmd + 6, buf, buf_size);
|
||
|
|
||
|
! if (SANE_STATUS_GOOD == (*status = sanei_scsi_cmd (fd, cmd, 6 + buf_size, NULL, NULL)))
|
||
|
return buf_size;
|
||
|
|
||
|
return 0;
|
||
|
***************
|
||
|
*** 157,162 ****
|
||
|
--- 161,177 ----
|
||
|
send (Epson_Scanner * s, const void *buf, size_t buf_size, SANE_Status * status)
|
||
|
{
|
||
|
|
||
|
+ DBG( 3, "send buf, size = %u\n", buf_size);
|
||
|
+ /*
|
||
|
+ {
|
||
|
+ size_t k;
|
||
|
+ const char * s = buf;
|
||
|
+
|
||
|
+ for( k = 0; k < buf_size; k++) {
|
||
|
+ DBG( 3, "buf[%u] %02x %c\n", k, s[ k], isprint( s[ k]) ? s[ k] : '.');
|
||
|
+ }
|
||
|
+ }
|
||
|
+ */
|
||
|
if (s->hw->is_scsi)
|
||
|
{
|
||
|
return scsi_write (s->fd, buf, buf_size, status);
|
||
|
***************
|
||
|
*** 196,209 ****
|
||
|
static int
|
||
|
receive (Epson_Scanner * s, void *buf, size_t buf_size, SANE_Status * status)
|
||
|
{
|
||
|
|
||
|
if (s->hw->is_scsi)
|
||
|
{
|
||
|
! return scsi_read (s->fd, buf, buf_size, status);
|
||
|
}
|
||
|
else
|
||
|
{
|
||
|
- int n;
|
||
|
|
||
|
if (buf_size == (n = sanei_pio_read (s->fd, buf, buf_size)))
|
||
|
*status = SANE_STATUS_GOOD;
|
||
|
--- 211,224 ----
|
||
|
static int
|
||
|
receive (Epson_Scanner * s, void *buf, size_t buf_size, SANE_Status * status)
|
||
|
{
|
||
|
+ int n;
|
||
|
|
||
|
if (s->hw->is_scsi)
|
||
|
{
|
||
|
! n = scsi_read (s->fd, buf, buf_size, status);
|
||
|
}
|
||
|
else
|
||
|
{
|
||
|
|
||
|
if (buf_size == (n = sanei_pio_read (s->fd, buf, buf_size)))
|
||
|
*status = SANE_STATUS_GOOD;
|
||
|
***************
|
||
|
*** 210,220 ****
|
||
|
else
|
||
|
*status = SANE_STATUS_INVAL;
|
||
|
|
||
|
- return n;
|
||
|
}
|
||
|
|
||
|
! /* never reached */
|
||
|
}
|
||
|
|
||
|
static SANE_Status
|
||
|
inquiry (int fd, int page_code, void *buf, size_t * buf_size)
|
||
|
--- 225,245 ----
|
||
|
else
|
||
|
*status = SANE_STATUS_INVAL;
|
||
|
|
||
|
}
|
||
|
|
||
|
! DBG( 3, "receive buf, expected = %u, got = %u\n", buf_size, n);
|
||
|
! /*
|
||
|
! {
|
||
|
! int k;
|
||
|
! const char * s = buf;
|
||
|
!
|
||
|
! for( k = 0; k < n; k++) {
|
||
|
! DBG( 3, "buf[%u] %02x %c\n", k, s[ k], isprint( s[ k]) ? s[ k] : '.');
|
||
|
! }
|
||
|
}
|
||
|
+ */
|
||
|
+ return n;
|
||
|
+ }
|
||
|
|
||
|
static SANE_Status
|
||
|
inquiry (int fd, int page_code, void *buf, size_t * buf_size)
|
||
|
***************
|
||
|
*** 598,612 ****
|
||
|
if (SANE_STATUS_GOOD != *status)
|
||
|
return (EpsonHdr) 0;
|
||
|
|
||
|
! buf = (u_char *) head;
|
||
|
! receive (s, buf, 1, status);
|
||
|
|
||
|
if (SANE_STATUS_GOOD != *status)
|
||
|
return (EpsonHdr) 0;
|
||
|
|
||
|
- buf++;
|
||
|
|
||
|
! DBG (4, "code %02x\n", (int) head->code);
|
||
|
|
||
|
switch (head->code)
|
||
|
{
|
||
|
--- 623,643 ----
|
||
|
if (SANE_STATUS_GOOD != *status)
|
||
|
return (EpsonHdr) 0;
|
||
|
|
||
|
! buf = (u_char *) head;
|
||
|
|
||
|
+ if( s->hw->is_scsi) {
|
||
|
+ receive (s, buf, 4, status);
|
||
|
+ /* buf += 4;*/
|
||
|
+ } else {
|
||
|
+ receive (s, buf, 1, status);
|
||
|
+ buf += 1;
|
||
|
+ }
|
||
|
+
|
||
|
if (SANE_STATUS_GOOD != *status)
|
||
|
return (EpsonHdr) 0;
|
||
|
|
||
|
|
||
|
! DBG (4, "code 0x%02x\n", (int) head->code);
|
||
|
|
||
|
switch (head->code)
|
||
|
{
|
||
|
***************
|
||
|
*** 626,638 ****
|
||
|
break;
|
||
|
|
||
|
case STX:
|
||
|
- receive (s, buf, 3, status);
|
||
|
|
||
|
if (SANE_STATUS_GOOD != *status)
|
||
|
return (EpsonHdr) 0;
|
||
|
|
||
|
- /* buf += 3; */
|
||
|
-
|
||
|
DBG (4, "status %02x\n", (int) head->status);
|
||
|
DBG (4, "count %d\n", (int) head->count);
|
||
|
|
||
|
--- 657,673 ----
|
||
|
break;
|
||
|
|
||
|
case STX:
|
||
|
|
||
|
+ if( s->hw->is_scsi) {
|
||
|
+ /* nope */
|
||
|
+ } else {
|
||
|
+ receive (s, buf, 3, status);
|
||
|
+ /* buf += 3;*/
|
||
|
+ }
|
||
|
+
|
||
|
if (SANE_STATUS_GOOD != *status)
|
||
|
return (EpsonHdr) 0;
|
||
|
|
||
|
DBG (4, "status %02x\n", (int) head->status);
|
||
|
DBG (4, "count %d\n", (int) head->count);
|
||
|
|
||
|
***************
|
||
|
*** 708,721 ****
|
||
|
return status;
|
||
|
}
|
||
|
|
||
|
! if (buf[0] != TYPE_PROCESSOR
|
||
|
! || strncmp (buf + 8, "EPSON", 5) != 0
|
||
|
! || strncmp (buf + 16, "SCANNER ", 8) != 0)
|
||
|
! {
|
||
|
! DBG (1, "attach: device doesn't look like an Epson scanner\n");
|
||
|
! myclose (s);
|
||
|
! return SANE_STATUS_INVAL;
|
||
|
! }
|
||
|
}
|
||
|
else
|
||
|
{
|
||
|
--- 743,758 ----
|
||
|
return status;
|
||
|
}
|
||
|
|
||
|
! if (buf[0] != TYPE_PROCESSOR
|
||
|
! || strncmp (buf + 8, "EPSON", 5) != 0
|
||
|
! || (strncmp (buf + 16, "SCANNER ", 8) != 0 &&
|
||
|
! strncmp (buf + 14, "SCANNER ", 8) != 0))
|
||
|
! {
|
||
|
! DBG (1, "attach: device doesn't look like an Epson scanner\n");
|
||
|
! myclose (s);
|
||
|
! return SANE_STATUS_INVAL;
|
||
|
! }
|
||
|
!
|
||
|
}
|
||
|
else
|
||
|
{
|
||
|
***************
|
||
|
*** 731,752 ****
|
||
|
|
||
|
{
|
||
|
EpsonIdent ident = (EpsonIdent) command (s, "\033I", 2, &status);
|
||
|
! u_char *buf = ident->buf;
|
||
|
int n, k;
|
||
|
|
||
|
! DBG (1, "type %3c %02x\n", ident->type, ident->type);
|
||
|
! DBG (1, "level %3c %02x\n", ident->level, ident->level);
|
||
|
|
||
|
s->hw->res_list_size = 0;
|
||
|
s->hw->res_list = (SANE_Int *) calloc (s->hw->res_list_size, sizeof (SANE_Int));
|
||
|
|
||
|
if (NULL == s->hw->res_list)
|
||
|
{
|
||
|
! DBG (0, "problem\n");
|
||
|
exit (0);
|
||
|
}
|
||
|
|
||
|
! for (n = ident->count; n; n -= k, buf += k)
|
||
|
{
|
||
|
switch (*buf)
|
||
|
{
|
||
|
--- 768,794 ----
|
||
|
|
||
|
{
|
||
|
EpsonIdent ident = (EpsonIdent) command (s, "\033I", 2, &status);
|
||
|
! u_char *buf;
|
||
|
int n, k;
|
||
|
|
||
|
! if( NULL == ident) {
|
||
|
! DBG (0, "ident failed\n");
|
||
|
! return status;
|
||
|
! }
|
||
|
|
||
|
+ DBG (1, "type %3c 0x%02x\n", ident->type, ident->type);
|
||
|
+ DBG (1, "level %3c 0x%02x\n", ident->level, ident->level);
|
||
|
+
|
||
|
s->hw->res_list_size = 0;
|
||
|
s->hw->res_list = (SANE_Int *) calloc (s->hw->res_list_size, sizeof (SANE_Int));
|
||
|
|
||
|
if (NULL == s->hw->res_list)
|
||
|
{
|
||
|
! DBG (0, "no mem\n");
|
||
|
exit (0);
|
||
|
}
|
||
|
|
||
|
! for (n = ident->count, buf = ident->buf; n; n -= k, buf += k)
|
||
|
{
|
||
|
switch (*buf)
|
||
|
{
|
||
|
***************
|
||
|
*** 759,765 ****
|
||
|
|
||
|
if (NULL == s->hw->res_list)
|
||
|
{
|
||
|
! DBG (0, "problem\n");
|
||
|
exit (0);
|
||
|
}
|
||
|
|
||
|
--- 801,807 ----
|
||
|
|
||
|
if (NULL == s->hw->res_list)
|
||
|
{
|
||
|
! DBG (0, "no mem\n");
|
||
|
exit (0);
|
||
|
}
|
||
|
|
||
|
<p>
|
||
|
--------------1FBDF1229EF3D4F801326BAC--
|
||
|
<p>
|
||
|
<p>
|
||
|
<pre>
|
||
|
--
|
||
|
Source code, list archive, and docs: <a href="http://www.mostang.com/sane/">http://www.mostang.com/sane/</a>
|
||
|
To unsubscribe: echo unsubscribe sane-devel | mail <a href="mailto:majordomo@mostang.com">majordomo@mostang.com</a>
|
||
|
</pre>
|
||
|
<!-- body="end" -->
|
||
|
<p>
|
||
|
<ul>
|
||
|
<!-- next="start" -->
|
||
|
<li> <b>Next message:</b> <a href="0020.html">Oliver.Rauch@Wolfsburg.DE: "umax-backend"</a>
|
||
|
<li> <b>Previous message:</b> <a href="0018.html">Luca Balzano: "Mustek scanner doesn't work"</a>
|
||
|
<!-- nextthread="start" -->
|
||
|
<!-- reply="end" -->
|
||
|
</ul>
|