kopia lustrzana https://gitlab.com/sane-project/website
287 wiersze
8.6 KiB
HTML
287 wiersze
8.6 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
|
|
"http://www.w3.org/TR/REC-html40/loose.dtd">
|
|
<HTML>
|
|
<HEAD>
|
|
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-2022-jp">
|
|
<TITLE>sane-devel: The calibration function for CanoScanFB620S</TITLE>
|
|
<META NAME="Author" CONTENT="Mitsuru Okaniwa (m-okaniwa@bea.hi-ho.ne.jp)">
|
|
<META NAME="Subject" CONTENT="The calibration function for CanoScanFB620S">
|
|
</HEAD>
|
|
<BODY BGCOLOR="#FFFFFF" TEXT="#000000">
|
|
<H1>The calibration function for CanoScanFB620S</H1>
|
|
<!-- received="Thu Dec 7 19:57:48 2000" -->
|
|
<!-- isoreceived="20001208035748" -->
|
|
<!-- sent="Fri, 8 Dec 2000 12:58:10 +0900" -->
|
|
<!-- isosent="20001208035810" -->
|
|
<!-- name="Mitsuru Okaniwa" -->
|
|
<!-- email="m-okaniwa@bea.hi-ho.ne.jp" -->
|
|
<!-- subject="The calibration function for CanoScanFB620S" -->
|
|
<!-- id="007501c060cb$44d4d3c0$6425530a@necpcuser" -->
|
|
<!-- charset="iso-2022-jp" -->
|
|
<STRONG>From:</STRONG> Mitsuru Okaniwa (<A HREF="mailto:m-okaniwa@bea.hi-ho.ne.jp?Subject=Re:%20The%20calibration%20function%20for%20CanoScanFB620S&In-Reply-To=<007501c060cb$44d4d3c0$6425530a@necpcuser>"><EM>m-okaniwa@bea.hi-ho.ne.jp</EM></A>)<BR>
|
|
<STRONG>Date:</STRONG> Thu Dec 07 2000 - 19:58:10 PST
|
|
<P>
|
|
<!-- next="start" -->
|
|
<LI><STRONG>Next message:</STRONG> <A HREF="0054.html">David Gesswein: "Reverse engineering scsi commands"</A>
|
|
<UL>
|
|
<LI><STRONG>Previous message:</STRONG> <A HREF="0052.html">Jeffrey H. Ingber: "Re: Which scanners REALLY provide 36 bit output? HP?"</A>
|
|
<!-- nextthread="start" -->
|
|
<LI><STRONG>Next in thread:</STRONG> <A HREF="0063.html">abel deuring: "Re: The calibration function for CanoScanFB620S"</A>
|
|
<LI><STRONG>Reply:</STRONG> <A HREF="0063.html">abel deuring: "Re: The calibration function for CanoScanFB620S"</A>
|
|
<!-- reply="end" -->
|
|
<LI><STRONG>Messages sorted by:</STRONG>
|
|
<A HREF="date.html#53">[ date ]</A>
|
|
<A HREF="index.html#53">[ thread ]</A>
|
|
<A HREF="subject.html#53">[ subject ]</A>
|
|
<A HREF="author.html#53">[ author ]</A>
|
|
</UL>
|
|
<HR NOSHADE><P>
|
|
<!-- body="start" -->
|
|
<P>
|
|
Hi
|
|
<BR>
|
|
I tried to write the Calibration function as follows.
|
|
<BR>
|
|
Are they correct ?
|
|
<BR>
|
|
And I have to put them in the canon.c, canon-sane.c, canon-scsi.c and so on.
|
|
<BR>
|
|
But I don't know where I should put them in the canon backend files.
|
|
<BR>
|
|
Would anybody teach me about this ?
|
|
<BR>
|
|
<P>for canon-scsi.c
|
|
<BR>
|
|
===================================================================
|
|
<BR>
|
|
static SANE_Status
|
|
<BR>
|
|
reset_scanner (int fd)
|
|
<BR>
|
|
{
|
|
<BR>
|
|
static u_char cmd[10];
|
|
<BR>
|
|
int status;
|
|
<BR>
|
|
DBG (31, ">> reset_scanner\n");
|
|
<BR>
|
|
<P> memset (cmd, 0, sizeof (cmd));
|
|
<BR>
|
|
cmd[0] = 0xc1;
|
|
<BR>
|
|
status = sanei_scsi_cmd (fd, cmd, sizeof (cmd), 0, 0);
|
|
<BR>
|
|
<P> DBG (31, "<< reset_scanner\n");
|
|
<BR>
|
|
return (status);
|
|
<BR>
|
|
}
|
|
<BR>
|
|
<P><P>static SANE_Status
|
|
<BR>
|
|
execute_calibration (int fd)
|
|
<BR>
|
|
{
|
|
<BR>
|
|
static u_char cmd[6 + 2];
|
|
<BR>
|
|
int status;
|
|
<BR>
|
|
DBG (31, ">> execute_calibration\n");
|
|
<BR>
|
|
memset (cmd, 0, sizeof (cmd));
|
|
<BR>
|
|
cmd[0] = 0xc2;
|
|
<BR>
|
|
cmd[4] = 2;
|
|
<BR>
|
|
status = sanei_scsi_cmd (fd, cmd, sizeof (cmd), 0, 0);
|
|
<BR>
|
|
DBG (31, "<< execute_calibration\n");
|
|
<BR>
|
|
return (status);
|
|
<BR>
|
|
}
|
|
<BR>
|
|
<P><P>static SANE_Status
|
|
<BR>
|
|
get_calibration_status (int fd, void *buf, size_t *buf_size)
|
|
<BR>
|
|
{
|
|
<BR>
|
|
static u_char cmd[6];
|
|
<BR>
|
|
int status;
|
|
<BR>
|
|
DBG (31, ">> get_calibration_status\n");
|
|
<BR>
|
|
memset (cmd, 0, sizeof (cmd));
|
|
<BR>
|
|
cmd[0] = 0xc3;
|
|
<BR>
|
|
cmd[4] = 2;
|
|
<BR>
|
|
status = sanei_scsi_cmd (fd, cmd, sizeof (cmd), buf, buf_size);
|
|
<BR>
|
|
DBG (31, "<< get_calibration_status\n");
|
|
<BR>
|
|
return (status);
|
|
<BR>
|
|
}
|
|
<BR>
|
|
<P><P>static SANE_Status
|
|
<BR>
|
|
get_switch_status (int fd, void *buf, size_t *buf_size)
|
|
<BR>
|
|
{
|
|
<BR>
|
|
static u_char cmd[6];
|
|
<BR>
|
|
int status;
|
|
<BR>
|
|
DBG (31, ">> get_switch_status\n");
|
|
<BR>
|
|
memset (cmd, 0, sizeof (cmd));
|
|
<BR>
|
|
cmd[0] = 0xc4;
|
|
<BR>
|
|
cmd[4] = 2;
|
|
<BR>
|
|
status = sanei_scsi_cmd (fd, cmd, sizeof (cmd), buf, buf_size);
|
|
<BR>
|
|
DBG (31, "<< get_switch_status\n");
|
|
<BR>
|
|
return (status);
|
|
<BR>
|
|
}
|
|
<BR>
|
|
===================================================================
|
|
<BR>
|
|
<P>for canon.c or canon-sane.c
|
|
<BR>
|
|
===================================================================
|
|
<BR>
|
|
status = reset_scanner(s->fd);
|
|
<BR>
|
|
if (status != SANE_STATUS_GOOD)
|
|
<BR>
|
|
{
|
|
<BR>
|
|
DBG (1, "attach: RESET SCANNER failed\n");
|
|
<BR>
|
|
sanei_scsi_close (s->fd);
|
|
<BR>
|
|
s->fd = -1;
|
|
<BR>
|
|
}
|
|
<BR>
|
|
<P><P> status = execute_calibration(s->fd);
|
|
<BR>
|
|
if (status != SANE_STATUS_GOOD)
|
|
<BR>
|
|
{
|
|
<BR>
|
|
DBG (1, "attach: EXECUTE CALIBRATION failed\n");
|
|
<BR>
|
|
sanei_scsi_close (s->fd);
|
|
<BR>
|
|
s->fd = -1;
|
|
<BR>
|
|
}
|
|
<BR>
|
|
<P><P><P> DBG (3, "sane_start: sending GET CALIBRATION STATUS\n");
|
|
<BR>
|
|
memset (ebuf, 0, sizeof (ebuf));
|
|
<BR>
|
|
buf_size = sizeof (ebuf);
|
|
<BR>
|
|
status = get_calibration_status (s->fd, ebuf, &buf_size);
|
|
<BR>
|
|
if (status != SANE_STATUS_GOOD)
|
|
<BR>
|
|
{
|
|
<BR>
|
|
DBG (1, "sane_start: GET CALIBRATION STATUS failed\n");
|
|
<BR>
|
|
sanei_scsi_close (s->fd);
|
|
<BR>
|
|
return (SANE_STATUS_INVAL);
|
|
<BR>
|
|
}
|
|
<BR>
|
|
<P><P><P> DBG (3, "sane_start: sending GET SWITCH STATUS\n");
|
|
<BR>
|
|
memset (ebuf, 0, sizeof (ebuf));
|
|
<BR>
|
|
buf_size = sizeof (ebuf);
|
|
<BR>
|
|
status = get_switch_status (s->fd, ebuf, &buf_size);
|
|
<BR>
|
|
if (status != SANE_STATUS_GOOD)
|
|
<BR>
|
|
{
|
|
<BR>
|
|
DBG (1, "sane_start: GET SWITCH STATUS failed\n");
|
|
<BR>
|
|
sanei_scsi_close (s->fd);
|
|
<BR>
|
|
return (SANE_STATUS_INVAL);
|
|
<BR>
|
|
}
|
|
<BR>
|
|
===================================================================
|
|
<BR>
|
|
Should I write the other code in anywhere ?
|
|
<BR>
|
|
<P>And how would I write the code to make the button of calibration in the
|
|
<BR>
|
|
xscanimage and to show the message "running calibration" during the
|
|
<BR>
|
|
calibration in xscanimage ?
|
|
<BR>
|
|
<P>regards,
|
|
<BR>
|
|
-----------------------------
|
|
<BR>
|
|
Mitsuru Okaniwa
|
|
<BR>
|
|
email : <A HREF="mailto:m-okaniwa@bea.hi-ho.ne.jp?Subject=Re:%20The%20calibration%20function%20for%20CanoScanFB620S&In-Reply-To=<007501c060cb$44d4d3c0$6425530a@necpcuser>">m-okaniwa@bea.hi-ho.ne.jp</A>
|
|
<BR>
|
|
tel : (Japan)0566-26-6105
|
|
<BR>
|
|
-----------------------------
|
|
<BR>
|
|
<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?Subject=Re:%20The%20calibration%20function%20for%20CanoScanFB620S&In-Reply-To=<007501c060cb$44d4d3c0$6425530a@necpcuser>">majordomo@mostang.com</A>
|
|
</PRE>
|
|
<P><!-- body="end" -->
|
|
<HR NOSHADE>
|
|
<UL>
|
|
<!-- next="start" -->
|
|
<LI><STRONG>Next message:</STRONG> <A HREF="0054.html">David Gesswein: "Reverse engineering scsi commands"</A>
|
|
<LI><STRONG>Previous message:</STRONG> <A HREF="0052.html">Jeffrey H. Ingber: "Re: Which scanners REALLY provide 36 bit output? HP?"</A>
|
|
<!-- nextthread="start" -->
|
|
<LI><STRONG>Next in thread:</STRONG> <A HREF="0063.html">abel deuring: "Re: The calibration function for CanoScanFB620S"</A>
|
|
<LI><STRONG>Reply:</STRONG> <A HREF="0063.html">abel deuring: "Re: The calibration function for CanoScanFB620S"</A>
|
|
<!-- reply="end" -->
|
|
<LI><STRONG>Messages sorted by:</STRONG>
|
|
<A HREF="date.html#53">[ date ]</A>
|
|
<A HREF="index.html#53">[ thread ]</A>
|
|
<A HREF="subject.html#53">[ subject ]</A>
|
|
<A HREF="author.html#53">[ author ]</A>
|
|
</UL>
|
|
<!-- trailer="footer" -->
|
|
<HR NOSHADE>
|
|
<P>
|
|
<SMALL>
|
|
<EM>
|
|
This archive was generated by <A HREF="http://www.hypermail.org/">hypermail 2b29</A>
|
|
: <EM>Thu Dec 07 2000 - 19:58:14 PST</EM>
|
|
</EM>
|
|
</SMALL>
|
|
</BODY>
|
|
</HTML>
|