[sane-devel] Problem with setting Fujitsu fi-4120c to Grayscale

m. allan noah anoah at pfeiffer.edu
Thu Apr 24 23:33:38 BST 2003


ok, in your prior mails it would have been helpful to explain the you were 
writing an application, not just trying to use the scanner with the 
existing frontends.

can you set the grayscale and resolution without error using scanimage? 
does it work every time? if not, then it is likely a driver problem, try 
it with the scsi port as well. if there is a difference, then you might be 
onto something.

i have just plugged my 4120c into a usb port for the first time, and i 
get device errors that lock scanadf hard. i should have some time to play 
with it next week (finally). anything you come up with between now and 
then, please mail the list, so that others can see.

allan

On Thu, 24 Apr 2003, Peter Chen wrote:

> Hi all,
> 
> I tried to set fi-4120c to Grayscale. I used the following code flow:
> 
>         status = sane_init(version_code, NULL);
>         status = sane_get_devices(&device_list, true);
>         ...
>         sane_exit();
> 
>         status = sane_init(version_code, NULL);
>         status = sane_open("dev/usb/scanner0", &device );
>         sane_control_option (device, 0, SANE_ACTION_GET_VALUE,
> &num_dev_options, 0);
>   for (i = 0; i < num_dev_options; ++i)
>     {
>       opt = sane_get_option_descriptor (device, i);
>       // Set the resolutions to 300 dpi
>       if ( strcmp(opt->name, SANE_NAME_SCAN_X_RESOLUTION) == 0)
>       {
>           value = 300;
>           sane_control_option (device, i, SANE_ACTION_SET_VALUE, &value,
> &info);
>       }
>       if ( strcmp(opt->name, SANE_NAME_SCAN_Y_RESOLUTION) == 0)
>       {
>           value = 300;
>           sane_control_option (device, i, SANE_ACTION_SET_VALUE, &value,
> &info);
>       }
>       // Set the scan mode to GrayScale
>       if ( strcmp(opt->name, SANE_NAME_SCAN_MODE) == 0)
>       {
>           value = 3;
>           sane_control_option (device, i, SANE_ACTION_SET_VALUE, &value,
> &info);
>       }
>     }
> 
> The first time I ran it, it successfully set fi-4120c to GrayScale (when I
> debug, I could see that), but then later when I did that, it always returned
> SANE_STATUS_INVAL, even after I rebooted my linux box and fi-4120c. I could
> set the resolutions successfully. What did I do wrong?
> 
> Thanks,
> 
> Peter
> _______________________________________________
> Sane-devel mailing list
> Sane-devel at www.mostang.com
> http://www.mostang.com/mailman/listinfo/sane-devel
> 

-- 
"so don't tell us it can't be done, putting down what you don't know.
money isn't our god, integrity will free our souls" - Max Cavalera




More information about the sane-devel mailing list