[sane-devel] TPU functionality in epson2-backend.

Martin Zackrisson martin.zackrisson at cmb.gu.se
Tue Nov 22 15:56:03 UTC 2011



On 11/22/2011 02:12 AM, m. allan noah wrote:
> Sane is free/open source software. Take a spin thru the backend, and 
> see if you can find a good place to send this command.
>
> allan
>
>

I've dug through the code and made copy/paste/rename adjustments 
everywhere it seemed reasonable (first day with c-code...). This will 
probably more show how lost I am than anything else, but below are the 
diffs for all files I've been poking around (don't think I forgot any). 
I think my main issue is that I have no clue how to connect the static 
that I made (SANE_EPSON_CAP_FULL_SENSOR_IN_TPU) to what is being sent in 
the scanner in "define esci_set_full_sensor(s,v)            e2_esc_cmd( 
s,(s)->hw->cmd->set_full_sensor, v)". That is to give set_full_sensor 
the value of SANE_EPSON_CAP_FULL_SENSOR_IN_TPU.

/Martin

***epson2.h

100,102d99
< /* undocumented sensor feature for V700 */
< #define SANE_EPSON_CAP_FULL_SENSOR_IN_TPU   0x803D
<
224d220
<     unsigned char set_full_sensor; /* For scanning the full area in 
TPU on V700*/
267d262
<     OPT_FULL_SENSOR,
346d340
<     SANE_Bool sensorSupport; /* does the scanner have support for full 
sensor mode when TPU is source? */
400d393
<     SANE_Bool fullSensor;



***epson2.c

1341,1354d1340
<     /* full sensor in TPU */
<     s->opt[OPT_FULL_SENSOR].name = "full-sensor";
<     s->opt[OPT_FULL_SENSOR].title = SANE_I18N("TPU sensor modes");
<     s->opt[OPT_FULL_SENSOR].desc = SANE_I18N("In TPU mode some 
scanners (e.g. V700) reduce the max parameters for the scanning area. 
This option by-passes that 'functionality'");
<     s->opt[OPT_FULL_SENSOR].type = SANE_TYPE_BOOL;
<     s->val[OPT_FULL_SENSOR].w = SANE_FALSE;
<
<     s->opt[OPT_FULL_SENSOR].cap |= SANE_CAP_ADVANCED;
<
<     if (s->hw->sensorSupport == SANE_TRUE)
<         s->opt[OPT_FULL_SENSOR].cap &= ~SANE_CAP_INACTIVE;
<     else
<         s->opt[OPT_FULL_SENSOR].cap |= SANE_CAP_INACTIVE;
<
1637d1622
<     case OPT_FULL_SENSOR:
1731d1715
<     /*s->fullSensor = SANE_FALSE;     since this option isn't 
documented best not always activate */
1751,1752d1734
<         deactivateOption(s, OPT_FULL_SENSOR, &dummy);
<
1769,1776d1750
<         /* enable full size scanning */
<         if (s->hw->cmd->set_full_sensor != 0) {
<             s->hw->x_range = &s->hw->x_range;
<             s->hw->y_range = &s->hw->y_range;
<             activateOption(s, OPT_FULL_SENSOR, &dummy);
<         } else {
<             deactivateOption(s, OPT_FULL_SENSOR, &dummy);
<         }
1799d1772
<         deactivateOption(s, OPT_FULL_SENSOR, &dummy);
1986d1958
<     case OPT_FULL_SENSOR:


***epson2-commands.h

32d31
< #define esci_set_full_sensor(s,v)            e2_esc_cmd( 
s,(s)->hw->cmd->set_full_sensor, v)


***epson2-ops.c

762,766d761
<     /* There should be a proper way to test if scanner supports
<        full sensor mode */
<
<     dev->sensorSupport = SANE_TRUE;
<
774d768
<
1001,1009d994
<         if (s->hw->sensorSupport == SANE_TRUE) {
<             if (s->val[OPT_FULL_SENSOR].w == SANE_FALSE) {
<                 DBG(1, "setting sensor to capture full area");
<                 esci_set_full_sensor(s, SANE_TRUE);
<             } else {
<                 DBG(1, "setting sensor to standard capture area");
<                 esci_set_full_sensor(s, SANE_FALSE);
<             }
<         }
1081,1087d1065
<         if (status != SANE_STATUS_GOOD)
<             return status;
<     }
<
<     if (SANE_OPTION_IS_ACTIVE(s->opt[OPT_FULL_SENSOR].cap)) {
<         status = esci_set_full_sensor(s, s->val[OPT_FULL_SENSOR].w);
<



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.alioth.debian.org/pipermail/sane-devel/attachments/20111122/49cccc41/attachment.html>


More information about the sane-devel mailing list