sane-project-website/old-archive/2000-12/0053.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=&lt;007501c060cb$44d4d3c0$6425530a@necpcuser&gt;"><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>
&nbsp;&nbsp;static u_char cmd[10];
<BR>
&nbsp;&nbsp;int status;
<BR>
&nbsp;&nbsp;DBG (31, &quot;&gt;&gt; reset_scanner\n&quot;);
<BR>
<P>&nbsp;&nbsp;memset (cmd, 0, sizeof (cmd));
<BR>
&nbsp;&nbsp;cmd[0] = 0xc1;
<BR>
&nbsp;&nbsp;status = sanei_scsi_cmd (fd, cmd, sizeof (cmd), 0, 0);
<BR>
<P>&nbsp;&nbsp;DBG (31, &quot;&lt;&lt; reset_scanner\n&quot;);
<BR>
&nbsp;&nbsp;return (status);
<BR>
}
<BR>
<P><P>static SANE_Status
<BR>
execute_calibration (int fd)
<BR>
{
<BR>
&nbsp;&nbsp;static u_char cmd[6 + 2];
<BR>
&nbsp;&nbsp;int status;
<BR>
&nbsp;&nbsp;DBG (31, &quot;&gt;&gt; execute_calibration\n&quot;);
<BR>
&nbsp;&nbsp;memset (cmd, 0, sizeof (cmd));
<BR>
&nbsp;&nbsp;cmd[0] = 0xc2;
<BR>
&nbsp;&nbsp;cmd[4] = 2;
<BR>
&nbsp;&nbsp;status = sanei_scsi_cmd (fd, cmd, sizeof (cmd), 0, 0);
<BR>
&nbsp;&nbsp;DBG (31, &quot;&lt;&lt; execute_calibration\n&quot;);
<BR>
&nbsp;&nbsp;return (status);
<BR>
}
<BR>
<P><P>static SANE_Status
<BR>
get_calibration_status (int fd, void *buf, size_t *buf_size)
<BR>
{
<BR>
&nbsp;&nbsp;static u_char cmd[6];
<BR>
&nbsp;&nbsp;int status;
<BR>
&nbsp;&nbsp;DBG (31, &quot;&gt;&gt; get_calibration_status\n&quot;);
<BR>
&nbsp;&nbsp;memset (cmd, 0, sizeof (cmd));
<BR>
&nbsp;&nbsp;cmd[0] = 0xc3;
<BR>
&nbsp;&nbsp;cmd[4] = 2;
<BR>
&nbsp;&nbsp;status = sanei_scsi_cmd (fd, cmd, sizeof (cmd), buf, buf_size);
<BR>
&nbsp;&nbsp;DBG (31, &quot;&lt;&lt; get_calibration_status\n&quot;);
<BR>
&nbsp;&nbsp;return (status);
<BR>
}
<BR>
<P><P>static SANE_Status
<BR>
get_switch_status (int fd, void *buf, size_t *buf_size)
<BR>
{
<BR>
&nbsp;&nbsp;static u_char cmd[6];
<BR>
&nbsp;&nbsp;int status;
<BR>
&nbsp;&nbsp;DBG (31, &quot;&gt;&gt; get_switch_status\n&quot;);
<BR>
&nbsp;&nbsp;memset (cmd, 0, sizeof (cmd));
<BR>
&nbsp;&nbsp;cmd[0] = 0xc4;
<BR>
&nbsp;&nbsp;cmd[4] = 2;
<BR>
&nbsp;&nbsp;status = sanei_scsi_cmd (fd, cmd, sizeof (cmd), buf, buf_size);
<BR>
&nbsp;&nbsp;DBG (31, &quot;&lt;&lt; get_switch_status\n&quot;);
<BR>
&nbsp;&nbsp;return (status);
<BR>
}
<BR>
===================================================================
<BR>
<P>for canon.c or canon-sane.c
<BR>
===================================================================
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;status = reset_scanner(s-&gt;fd);
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;if (status != SANE_STATUS_GOOD)
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;{
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;DBG (1, &quot;attach: RESET SCANNER failed\n&quot;);
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;sanei_scsi_close (s-&gt;fd);
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;s-&gt;fd = -1;
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;}
<BR>
<P><P>&nbsp;&nbsp;&nbsp;&nbsp;status = execute_calibration(s-&gt;fd);
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;if (status != SANE_STATUS_GOOD)
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;{
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;DBG (1, &quot;attach: EXECUTE CALIBRATION failed\n&quot;);
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;sanei_scsi_close (s-&gt;fd);
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;s-&gt;fd = -1;
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;}
<BR>
<P><P><P>&nbsp;&nbsp;&nbsp;DBG (3, &quot;sane_start: sending GET CALIBRATION STATUS\n&quot;);
<BR>
&nbsp;&nbsp;&nbsp;memset (ebuf, 0, sizeof (ebuf));
<BR>
&nbsp;&nbsp;&nbsp;buf_size = sizeof (ebuf);
<BR>
&nbsp;&nbsp;&nbsp;status = get_calibration_status (s-&gt;fd, ebuf, &amp;buf_size);
<BR>
&nbsp;&nbsp;&nbsp;if (status != SANE_STATUS_GOOD)
<BR>
&nbsp;&nbsp;&nbsp;{
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;DBG (1, &quot;sane_start: GET CALIBRATION STATUS failed\n&quot;);
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;sanei_scsi_close (s-&gt;fd);
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;return (SANE_STATUS_INVAL);
<BR>
&nbsp;&nbsp;&nbsp;}
<BR>
<P><P><P>&nbsp;&nbsp;&nbsp;DBG (3, &quot;sane_start: sending GET SWITCH STATUS\n&quot;);
<BR>
&nbsp;&nbsp;&nbsp;memset (ebuf, 0, sizeof (ebuf));
<BR>
&nbsp;&nbsp;&nbsp;buf_size = sizeof (ebuf);
<BR>
&nbsp;&nbsp;&nbsp;status = get_switch_status (s-&gt;fd, ebuf, &amp;buf_size);
<BR>
&nbsp;&nbsp;&nbsp;if (status != SANE_STATUS_GOOD)
<BR>
&nbsp;&nbsp;&nbsp;{
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;DBG (1, &quot;sane_start: GET SWITCH STATUS failed\n&quot;);
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;sanei_scsi_close (s-&gt;fd);
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;return (SANE_STATUS_INVAL);
<BR>
&nbsp;&nbsp;&nbsp;}
<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 &quot;running calibration&quot; 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=&lt;007501c060cb$44d4d3c0$6425530a@necpcuser&gt;">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=&lt;007501c060cb$44d4d3c0$6425530a@necpcuser&gt;">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>