* backend/fujitsu.c, doc/descriptions/fujitsu.desc: backend v93

- return cmd status for reads of sensor options
* backend/canon_dr.c, doc/descriptions/canon_dr.desc: backend v26
- return cmd status for reads of sensor options
- allow rs to adjust read length for all bad status responses
merge-requests/1/head
m. allan noah 2009-04-15 13:13:35 +00:00
rodzic a7a759b896
commit 3654ff9d43
5 zmienionych plików z 105 dodań i 84 usunięć

Wyświetl plik

@ -1,3 +1,10 @@
2009-04-15 m. allan noah <kitno455 a t gmail d o t com>
* backend/fujitsu.c, doc/descriptions/fujitsu.desc: backend v93
- return cmd status for reads of sensor options
* backend/canon_dr.c, doc/descriptions/canon_dr.desc: backend v26
- return cmd status for reads of sensor options
- allow rs to adjust read length for all bad status responses
2009-04-14 Stéphane Voltz <stef.dev@free.fr> 2009-04-14 Stéphane Voltz <stef.dev@free.fr>
* backend/genesys.c backend/genesys_devices.c backend/genesys_gl646.c: * backend/genesys.c backend/genesys_devices.c backend/genesys_gl646.c:
shading calibration rework for GL646 based scanners shading calibration rework for GL646 based scanners
@ -6,7 +13,7 @@
* tools/sane-desc.c: fix double summing of untested column * tools/sane-desc.c: fix double summing of untested column
2009-04-13 Stéphane Voltz <stef.dev@free.fr> 2009-04-13 Stéphane Voltz <stef.dev@free.fr>
* backend/rts8891.c: minor version chnage to test commit scripts * backend/rts8891.c: minor version change to test commit scripts
2009-04-13 Stéphane Voltz <stef.dev@free.fr> 2009-04-13 Stéphane Voltz <stef.dev@free.fr>
* backend/pnm.c: conditional handling of STATUS_HW_LOCKED * backend/pnm.c: conditional handling of STATUS_HW_LOCKED

Wyświetl plik

@ -178,6 +178,9 @@
- rewrite do_usb_cmd() to use remainder from RS info - rewrite do_usb_cmd() to use remainder from RS info
v25 2009-04-12, MAN v25 2009-04-12, MAN
- disable SANE_FRAME_JPEG - disable SANE_FRAME_JPEG
v26 2009-04-14, MAN (SANE 1.0.20)
- return cmd status for reads on sensors
- allow rs to adjust read length for all bad status responses
SANE FLOW DIAGRAM SANE FLOW DIAGRAM
@ -238,7 +241,7 @@
#include "canon_dr.h" #include "canon_dr.h"
#define DEBUG 1 #define DEBUG 1
#define BUILD 25 #define BUILD 26
/* values for SANE_DEBUG_CANON_DR env var: /* values for SANE_DEBUG_CANON_DR env var:
- errors 5 - errors 5
@ -2051,6 +2054,7 @@ sane_control_option (SANE_Handle handle, SANE_Int option,
{ {
struct scanner *s = (struct scanner *) handle; struct scanner *s = (struct scanner *) handle;
SANE_Int dummy = 0; SANE_Int dummy = 0;
SANE_Status ret = SANE_STATUS_GOOD;
/* Make sure that all those statements involving *info cannot break (better /* Make sure that all those statements involving *info cannot break (better
* than having to do "if (info) ..." everywhere!) * than having to do "if (info) ..." everywhere!)
@ -2249,34 +2253,34 @@ sane_control_option (SANE_Handle handle, SANE_Int option,
/* Sensor Group */ /* Sensor Group */
case OPT_START: case OPT_START:
read_panel(s,OPT_START); ret = read_panel(s,OPT_START);
*val_p = s->panel_start; *val_p = s->panel_start;
return SANE_STATUS_GOOD; return ret;
case OPT_STOP: case OPT_STOP:
read_panel(s,OPT_STOP); ret = read_panel(s,OPT_STOP);
*val_p = s->panel_stop; *val_p = s->panel_stop;
return SANE_STATUS_GOOD; return ret;
case OPT_NEWFILE: case OPT_NEWFILE:
read_panel(s,OPT_NEWFILE); ret = read_panel(s,OPT_NEWFILE);
*val_p = s->panel_new_file; *val_p = s->panel_new_file;
return SANE_STATUS_GOOD; return ret;
case OPT_COUNTONLY: case OPT_COUNTONLY:
read_panel(s,OPT_COUNTONLY); ret = read_panel(s,OPT_COUNTONLY);
*val_p = s->panel_count_only; *val_p = s->panel_count_only;
return SANE_STATUS_GOOD; return ret;
case OPT_BYPASSMODE: case OPT_BYPASSMODE:
read_panel(s,OPT_BYPASSMODE); ret = read_panel(s,OPT_BYPASSMODE);
*val_p = s->panel_bypass_mode; *val_p = s->panel_bypass_mode;
return SANE_STATUS_GOOD; return ret;
case OPT_COUNTER: case OPT_COUNTER:
read_panel(s,OPT_COUNTER); ret = read_panel(s,OPT_COUNTER);
*val_p = s->panel_counter; *val_p = s->panel_counter;
return SANE_STATUS_GOOD; return ret;
} }
} }
@ -4610,6 +4614,10 @@ do_usb_cmd(struct scanner *s, int runRS, int shortTime,
inLength = inOffset+*inLen; inLength = inOffset+*inLen;
inActual = inLength; inActual = inLength;
/*blast caller's copy in case we error out*/
*inLen = 0;
inTimeout = USB_DATA_TIME; inTimeout = USB_DATA_TIME;
/* change timeout */ /* change timeout */
@ -4630,19 +4638,16 @@ do_usb_cmd(struct scanner *s, int runRS, int shortTime,
hexdump(30, "in: <<", inBuffer, inActual); hexdump(30, "in: <<", inBuffer, inActual);
if(!inActual){ if(!inActual){
*inLen = 0;
DBG(5,"in: got no data, clearing\n"); DBG(5,"in: got no data, clearing\n");
free(inBuffer); free(inBuffer);
return do_usb_clear(s,1,runRS); return do_usb_clear(s,1,runRS);
} }
if(inActual < inOffset){ if(inActual < inOffset){
*inLen = 0;
DBG(5,"in: read shorter than inOffset\n"); DBG(5,"in: read shorter than inOffset\n");
free(inBuffer); free(inBuffer);
return SANE_STATUS_IO_ERROR; return SANE_STATUS_IO_ERROR;
} }
if(ret != SANE_STATUS_GOOD){ if(ret != SANE_STATUS_GOOD){
*inLen = 0;
DBG(5,"in: return error '%s'\n",sane_strstatus(ret)); DBG(5,"in: return error '%s'\n",sane_strstatus(ret));
free(inBuffer); free(inBuffer);
return ret; return ret;
@ -4679,27 +4684,18 @@ do_usb_cmd(struct scanner *s, int runRS, int shortTime,
DBG(25, "stat: read %d bytes, retval %d\n", (int)statActual, ret2); DBG(25, "stat: read %d bytes, retval %d\n", (int)statActual, ret2);
hexdump(30, "stat: <<", statBuffer, statActual); hexdump(30, "stat: <<", statBuffer, statActual);
if(!statActual){ /*weird status*/
DBG(5,"stat: got no data, clearing\n");
free(statBuffer);
if(inBuffer) free(inBuffer);
return do_usb_clear(s,1,runRS);
}
if(ret2 != SANE_STATUS_GOOD){ if(ret2 != SANE_STATUS_GOOD){
DBG(5,"stat: return error '%s'\n",sane_strstatus(ret2)); DBG(5,"stat: clearing error '%s'\n",sane_strstatus(ret2));
free(statBuffer); ret2 = do_usb_clear(s,1,runRS);
if(inBuffer) free(inBuffer);
return ret2;
} }
if(statLength != statActual){ /*short read*/
DBG(5,"stat: short read, %d/%d\n",(int)statLength,(int)statActual); else if(statLength != statActual){
free(statBuffer); DBG(5,"stat: clearing short %d/%d\n",(int)statLength,(int)statActual);
if(inBuffer) free(inBuffer); ret2 = do_usb_clear(s,1,runRS);
return SANE_STATUS_IO_ERROR;
} }
/*inspect the last byte of the status response*/ /*inspect the last byte of the status response*/
if(statBuffer[statLength-1]){ else if(statBuffer[statLength-1]){
DBG(5,"stat: status %d\n",statBuffer[statLength-1]); DBG(5,"stat: status %d\n",statBuffer[statLength-1]);
ret2 = do_usb_clear(s,0,runRS); ret2 = do_usb_clear(s,0,runRS);
} }

Wyświetl plik

@ -425,6 +425,8 @@
- remove unused temp file code - remove unused temp file code
v92 2009-04-12, MAN v92 2009-04-12, MAN
- disable SANE_FRAME_JPEG support (again) - disable SANE_FRAME_JPEG support (again)
v93 2009-04-14, MAN (SANE 1.0.20)
- return cmd status for reads on sensors
SANE FLOW DIAGRAM SANE FLOW DIAGRAM
@ -485,7 +487,7 @@
#include "fujitsu.h" #include "fujitsu.h"
#define DEBUG 1 #define DEBUG 1
#define BUILD 92 #define BUILD 93
/* values for SANE_DEBUG_FUJITSU env var: /* values for SANE_DEBUG_FUJITSU env var:
- errors 5 - errors 5
@ -4056,6 +4058,7 @@ sane_control_option (SANE_Handle handle, SANE_Int option,
{ {
struct fujitsu *s = (struct fujitsu *) handle; struct fujitsu *s = (struct fujitsu *) handle;
SANE_Int dummy = 0; SANE_Int dummy = 0;
SANE_Status ret = SANE_STATUS_GOOD;
/* Make sure that all those statements involving *info cannot break (better /* Make sure that all those statements involving *info cannot break (better
* than having to do "if (info) ..." everywhere!) * than having to do "if (info) ..." everywhere!)
@ -4497,104 +4500,104 @@ sane_control_option (SANE_Handle handle, SANE_Int option,
/* Sensor Group */ /* Sensor Group */
case OPT_TOP: case OPT_TOP:
get_hardware_status(s,option); ret = get_hardware_status(s,option);
*val_p = s->hw_top; *val_p = s->hw_top;
return SANE_STATUS_GOOD; return ret;
case OPT_A3: case OPT_A3:
get_hardware_status(s,option); ret = get_hardware_status(s,option);
*val_p = s->hw_A3; *val_p = s->hw_A3;
return SANE_STATUS_GOOD; return ret;
case OPT_B4: case OPT_B4:
get_hardware_status(s,option); ret = get_hardware_status(s,option);
*val_p = s->hw_B4; *val_p = s->hw_B4;
return SANE_STATUS_GOOD; return ret;
case OPT_A4: case OPT_A4:
get_hardware_status(s,option); ret = get_hardware_status(s,option);
*val_p = s->hw_A4; *val_p = s->hw_A4;
return SANE_STATUS_GOOD; return ret;
case OPT_B5: case OPT_B5:
get_hardware_status(s,option); ret = get_hardware_status(s,option);
*val_p = s->hw_B5; *val_p = s->hw_B5;
return SANE_STATUS_GOOD; return ret;
case OPT_HOPPER: case OPT_HOPPER:
get_hardware_status(s,option); ret = get_hardware_status(s,option);
*val_p = s->hw_hopper; *val_p = s->hw_hopper;
return SANE_STATUS_GOOD; return ret;
case OPT_OMR: case OPT_OMR:
get_hardware_status(s,option); ret = get_hardware_status(s,option);
*val_p = s->hw_omr; *val_p = s->hw_omr;
return SANE_STATUS_GOOD; return ret;
case OPT_ADF_OPEN: case OPT_ADF_OPEN:
get_hardware_status(s,option); ret = get_hardware_status(s,option);
*val_p = s->hw_adf_open; *val_p = s->hw_adf_open;
return SANE_STATUS_GOOD; return ret;
case OPT_SLEEP: case OPT_SLEEP:
get_hardware_status(s,option); ret = get_hardware_status(s,option);
*val_p = s->hw_sleep; *val_p = s->hw_sleep;
return SANE_STATUS_GOOD; return ret;
case OPT_SEND_SW: case OPT_SEND_SW:
get_hardware_status(s,option); ret = get_hardware_status(s,option);
*val_p = s->hw_send_sw; *val_p = s->hw_send_sw;
return SANE_STATUS_GOOD; return ret;
case OPT_MANUAL_FEED: case OPT_MANUAL_FEED:
get_hardware_status(s,option); ret = get_hardware_status(s,option);
*val_p = s->hw_manual_feed; *val_p = s->hw_manual_feed;
return SANE_STATUS_GOOD; return ret;
case OPT_SCAN_SW: case OPT_SCAN_SW:
get_hardware_status(s,option); ret = get_hardware_status(s,option);
*val_p = s->hw_scan_sw; *val_p = s->hw_scan_sw;
return SANE_STATUS_GOOD; return ret;
case OPT_FUNCTION: case OPT_FUNCTION:
get_hardware_status(s,option); ret = get_hardware_status(s,option);
*val_p = s->hw_function; *val_p = s->hw_function;
return SANE_STATUS_GOOD; return ret;
case OPT_INK_EMPTY: case OPT_INK_EMPTY:
get_hardware_status(s,option); ret = get_hardware_status(s,option);
*val_p = s->hw_ink_empty; *val_p = s->hw_ink_empty;
return SANE_STATUS_GOOD; return ret;
case OPT_DOUBLE_FEED: case OPT_DOUBLE_FEED:
get_hardware_status(s,option); ret = get_hardware_status(s,option);
*val_p = s->hw_double_feed; *val_p = s->hw_double_feed;
return SANE_STATUS_GOOD; return ret;
case OPT_ERROR_CODE: case OPT_ERROR_CODE:
get_hardware_status(s,option); ret = get_hardware_status(s,option);
*val_p = s->hw_error_code; *val_p = s->hw_error_code;
return SANE_STATUS_GOOD; return ret;
case OPT_SKEW_ANGLE: case OPT_SKEW_ANGLE:
get_hardware_status(s,option); ret = get_hardware_status(s,option);
*val_p = s->hw_skew_angle; *val_p = s->hw_skew_angle;
return SANE_STATUS_GOOD; return ret;
case OPT_INK_REMAIN: case OPT_INK_REMAIN:
get_hardware_status(s,option); ret = get_hardware_status(s,option);
*val_p = s->hw_ink_remain; *val_p = s->hw_ink_remain;
return SANE_STATUS_GOOD; return ret;
case OPT_DENSITY_SW: case OPT_DENSITY_SW:
get_hardware_status(s,option); ret = get_hardware_status(s,option);
*val_p = s->hw_density_sw; *val_p = s->hw_density_sw;
return SANE_STATUS_GOOD; return ret;
case OPT_DUPLEX_SW: case OPT_DUPLEX_SW:
get_hardware_status(s,option); ret = get_hardware_status(s,option);
*val_p = s->hw_duplex_sw; *val_p = s->hw_duplex_sw;
return SANE_STATUS_GOOD; return ret;
} }
} }
@ -5191,6 +5194,8 @@ get_hardware_status (struct fujitsu *s, SANE_Int option)
if(inLen > 9){ if(inLen > 9){
s->hw_ink_remain = get_GHS_ink_remain(in); s->hw_ink_remain = get_GHS_ink_remain(in);
} }
ret = SANE_STATUS_GOOD;
} }
} }
@ -5216,8 +5221,8 @@ get_hardware_status (struct fujitsu *s, SANE_Int option)
); );
/* parse the rs data */ /* parse the rs data */
if(ret == SANE_STATUS_GOOD && get_RS_sense_key(in)==0 if(ret == SANE_STATUS_GOOD){
&& get_RS_ASC(in)==0x80){ if(get_RS_sense_key(in)==0 && get_RS_ASC(in)==0x80){
s->hw_adf_open = get_RS_adf_open(in); s->hw_adf_open = get_RS_adf_open(in);
s->hw_send_sw = get_RS_send_sw(in); s->hw_send_sw = get_RS_send_sw(in);
@ -5227,9 +5232,10 @@ get_hardware_status (struct fujitsu *s, SANE_Int option)
s->hw_hopper = get_RS_hopper(in); s->hw_hopper = get_RS_hopper(in);
s->hw_function = get_RS_function(in); s->hw_function = get_RS_function(in);
s->hw_density_sw = get_RS_density(in); s->hw_density_sw = get_RS_density(in);
} }
else{ else{
return SANE_STATUS_GOOD; DBG (10, "get_hardware_status: unexpected RS values\n");
}
} }
} }
} }

Wyświetl plik

@ -11,9 +11,9 @@
:backend "canon_dr" ; name of backend :backend "canon_dr" ; name of backend
:url "http://www.thebility.com/canon/" :url "http://www.thebility.com/canon/"
:version "24" ; version of backend :version "26" ; version of backend
:manpage "sane-canon_dr" ; name of manpage (if it exists) :manpage "sane-canon_dr" ; name of manpage (if it exists)
:comment "New backend as of SANE release 1.1.0, testers needed, see manpage" :comment "New backend as of SANE release 1.0.20, testers needed, see manpage"
:devicetype :scanner ; start of a list of devices.... :devicetype :scanner ; start of a list of devices....
; other types: :stillcam, :vidcam, ; other types: :stillcam, :vidcam,
; :meta, :api ; :meta, :api

Wyświetl plik

@ -11,9 +11,9 @@
:backend "fujitsu" ; name of backend :backend "fujitsu" ; name of backend
:url "http://www.thebility.com/fujitsu/" :url "http://www.thebility.com/fujitsu/"
:version "90" ; version of backend :version "93" ; version of backend
:manpage "sane-fujitsu" ; name of manpage (if it exists) :manpage "sane-fujitsu" ; name of manpage (if it exists)
:comment "Backend updated for SANE release 1.1.0, see sane-fujitsu manpage" :comment "Backend updated for SANE release 1.0.20, see sane-fujitsu manpage"
:devicetype :scanner ; start of a list of devices.... :devicetype :scanner ; start of a list of devices....
; other types: :stillcam, :vidcam, ; other types: :stillcam, :vidcam,
; :meta, :api ; :meta, :api
@ -144,6 +144,18 @@
:usbid "0x04c5" "0x1150" :usbid "0x04c5" "0x1150"
:comment "small, current" :comment "small, current"
:model "ScanSnap S1500"
:interface "USB"
:status :untested
;:usbid "0x04c5" "0x1155"
:comment "small, current"
:model "ScanSnap S1500M"
:interface "USB"
:status :untested
;:usbid "0x04c5" "0x"
:comment "small, current"
;================================================== ;==================================================
; DISCONTINUED OLDER MODELS, MEDIUM ; DISCONTINUED OLDER MODELS, MEDIUM
:model "M3093E" :model "M3093E"