[sane-devel] proper use of GT68XX_FLAG_NO_POWER_STATUS?
Nico Hoffmann
oxensepp at gmx.de
Sun May 19 15:29:33 UTC 2013
On Sun, 17 Mar 2013, Stef wrote:
> On 16/03/2013 13:38, Nico Hoffmann wrote:
>>
>> Hi,
>>
>> i've have maybe a rather stupid question, but here we go:
>>
>> I own an older scanner plustek optic slim 1200, which uses the gt68xx
>> backend. For years, it worked fine with sane. Since several month (at
>> least with sane-backends 1.0.23), I can not use this scanner anymore,
>> because it fails with following message:
>>
>> | # ./scanimage -x 10cm -y 10 cm > bla.img
>> | [gt68xx] sane_open: power control failure: check power plug!
>> | scanimage: open of device gt68xx:libusb:004:006 failed: Error during
>> device I/O
>>
>> One must know: The plustek optic slim 1200 is powrered by USB
>> only. There is no possibillity to plug in a power adapter...
>>
>> So I asked google and got a hint to "GT68XX_FLAG_NO_POWER_STATUS".
>>
>> I found it in sane-backends-1.0.23/backend/gt68xx_low.h:
>>
>> #define GT68XX_FLAG_NO_POWER_STATUS (1 << 7) /*
>> get_power_status_doesn't work */
>>
>> I am not familiar with the use of such flags, but for my
>> understanding, actually this flag should be set. At least, one bit in
>> it is set (and, despite of that, I get the power plug error).
>>
>> I set
>>
>> #define GT68XX_FLAG_NO_POWER_STATUS (0 << 7)
>>
>> and recompiled sane, but no change.
>>
>> Additionally, I erased all appearances of
>> "GT68XX_FLAG_NO_POWER_STATUS" in gt68xx_devices.c and gt68xx_gt6816.c,
>> and recompiled it again, but no change.
>>
>>
>> So my stupid question is: How I have to change the sources to
>> get this scanner working?
>>
>>
>> kind regards,
>>
>> N.
>>
>
> Hello,
>
> you don't need to change the meaning of the flag. You have to add it to
> the description matching your scanner in the devices description in
> gt68xx_devices.c . You can find the right by the vendor/product ids at the
> end of the file.
Thank you for your hint. I finally got it working.
In gt68xx_devices.c, struct "static GT68xx_Model
plustek_opticslim1200_model", I exchanged the last entry "0" with
"GT68XX_FLAG_NO_POWER_STATUS". This is line 1752 in v-1.0.23.
In words of diff:
diff gt68xx_devices.c_bak gt68xx_devices.c
1752c1752
< 0
---
> GT68XX_FLAG_NO_POWER_STATUS
After recompiling, the scanner is working now as expected.
That's all.
Of course, this small change should inserted into the sources. Can do
this someone for me? Otherwise, I would have to create a bug tracker
account only for this small issue, if I understood it correctly.
regards,
N.
More information about the sane-devel
mailing list