Re: [sane-devel] [PATCH] pieusb: Support ProScan 10T and Reflecta CrystalScan 3600

2017-05-04 Thread Olaf Meeuwissen
Hi Klaus,

Klaus Kaempf writes:

> Neither of these scanner have an automated slide transport and fail on
> respective SCSI commands.
>
> - Add flags parameter to control if automatic slide transport is available
> - Reflect flags in pieusb.conf.in
> - rename SLIDE_LAMP_ON to SLIDE_INIT
>   it fails on scanners without automatic slide transport, so it has
>   nothing to do with the lamp.
> - run SLIDE_INIT only FLAG_SLIDE_TRANSPORT is set
> - pieusb.conf.in: Add Reflecta CrystalScan 3600

Thanks for the patch, it looks good so I'll push it but shouldn't you
list the ProScan 10T and Reflecta CrystalScan 3600 as supported to at
least some extent in doc/descriptions/pieusb.desc now?

Waiting for your doc-fix ;-)

Hope this helps,
--
Olaf Meeuwissen, LPIC-2FSF Associate Member since 2004-01-27
 GnuPG key: F84A2DD9/B3C0 2F47 EA19 64F4 9F13  F43E B8A4 A88A F84A 2DD9
 Support Free Softwarehttps://my.fsf.org/donate
 Join the Free Software Foundation  https://my.fsf.org/join

-- 
sane-devel mailing list: sane-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
Unsubscribe: Send mail with subject "unsubscribe your_password"
 to sane-devel-requ...@lists.alioth.debian.org


[sane-devel] [PATCH] pieusb: Support ProScan 10T and Reflecta CrystalScan 3600

2017-05-03 Thread Klaus Kaempf
Neither of these scanner have an automated slide transport and fail on
respective SCSI commands.

- Add flags parameter to control if automatic slide transport is available
- Reflect flags in pieusb.conf.in
- rename SLIDE_LAMP_ON to SLIDE_INIT
  it fails on scanners without automatic slide transport, so it has
  nothing to do with the lamp.
- run SLIDE_INIT only FLAG_SLIDE_TRANSPORT is set
- pieusb.conf.in: Add Reflecta CrystalScan 3600
---
 backend/pieusb.c  | 89 ---
 backend/pieusb.conf.in| 15 ++--
 backend/pieusb.h  |  1 +
 backend/pieusb_scancmd.c  |  2 +-
 backend/pieusb_scancmd.h  |  2 +-
 backend/pieusb_specific.c | 48 ++---
 backend/pieusb_specific.h | 11 --
 7 files changed, 113 insertions(+), 55 deletions(-)

diff --git a/backend/pieusb.c b/backend/pieusb.c
index 4b0730403aeb..973088849ca8 100644
--- a/backend/pieusb.c
+++ b/backend/pieusb.c
@@ -109,6 +109,10 @@ extern void write_tiff_rgbi_header (FILE *fptr, int width, 
int height, int depth
 #define DBG_info_scan   11  /* information scanner commands */
 #define DBG_info_usb13  /* information usb level functions */
 
+/* device flags */
+
+#define FLAG_SLIDE_TRANSPORT 0x01
+
 /* --
  *
  * SUPPORTED DEVICES SPECIFICS
@@ -150,7 +154,8 @@ sane_init (SANE_Int * version_code, SANE_Auth_Callback 
__sane_unused__ authorize
 char config_line[PATH_MAX];
 SANE_Word vendor_id;
 SANE_Word product_id;
-SANE_Word model_number;
+SANE_Int model_number;
+SANE_Int flags;
 SANE_Status status;
 int i;
 
@@ -183,18 +188,22 @@ sane_init (SANE_Int * version_code, SANE_Auth_Callback 
__sane_unused__ authorize
 pieusb_supported_usb_device_list[0].vendor = 0x05e3;
 pieusb_supported_usb_device_list[0].product = 0x0145;
 pieusb_supported_usb_device_list[0].model = 0x30;
+pieusb_supported_usb_device_list[0].flags = 0;
 /* Reflecta ProScan 7200, model number 0x36 */
 pieusb_supported_usb_device_list[1].vendor = 0x05e3;
 pieusb_supported_usb_device_list[1].product = 0x0145;
 pieusb_supported_usb_device_list[1].model = 0x36;
-/* Reflecta 6000 Multiple Slide Scanner */
+pieusb_supported_usb_device_list[1].flags = 0;
+/* Reflecta 6000 Multiple Slide Scanner, model number 0x3a */
 pieusb_supported_usb_device_list[2].vendor = 0x05e3;
 pieusb_supported_usb_device_list[2].product = 0x0142;
 pieusb_supported_usb_device_list[2].model = 0x3a;
+pieusb_supported_usb_device_list[2].flags = FLAG_SLIDE_TRANSPORT;
 /* end of list */
 pieusb_supported_usb_device_list[3].vendor = 0;
 pieusb_supported_usb_device_list[3].product = 0;
 pieusb_supported_usb_device_list[3].model = 0;
+pieusb_supported_usb_device_list[3].flags = 0;
 
 /* Add entries from config file */
 fp = sanei_config_open (PIEUSB_CONFIG_FILE);
@@ -209,14 +218,14 @@ sane_init (SANE_Int * version_code, SANE_Auth_Callback 
__sane_unused__ authorize
 if (strncmp (config_line, "usb ", 4) != 0) continue;
 /* Parse vendor-id, product-id and model number and add to list */
 DBG (DBG_info_sane, "sane_init() config file parsing %s\n", 
config_line);
-status = sanei_pieusb_parse_config_line(config_line, _id, 
_id, _number);
+status = sanei_pieusb_parse_config_line(config_line, _id, 
_id, _number, );
 if (status == SANE_STATUS_GOOD) {
-DBG (DBG_info_sane, "sane_init() config file lists device %04x 
%04x %02x\n",vendor_id, product_id, model_number);
-if (!sanei_pieusb_supported_device_list_contains(vendor_id, 
product_id, model_number)) {
-DBG (DBG_info_sane, "sane_init() adding device %04x %04x 
%02x\n",vendor_id, product_id, model_number);
-sanei_pieusb_supported_device_list_add(vendor_id, 
product_id, model_number);
+DBG (DBG_info_sane, "sane_init() config file lists device %04x 
%04x %02x %02x\n",vendor_id, product_id, model_number, flags);
+if (!sanei_pieusb_supported_device_list_contains(vendor_id, 
product_id, model_number, flags)) {
+DBG (DBG_info_sane, "sane_init() adding device %04x %04x 
%02x %02x\n",vendor_id, product_id, model_number, flags);
+sanei_pieusb_supported_device_list_add(vendor_id, 
product_id, model_number, flags);
 } else {
-DBG (DBG_info_sane, "sane_init() list already contains 
%04x %04x %02x\n", vendor_id, product_id, model_number);
+DBG (DBG_info_sane, "sane_init() list already contains 
%04x %04x %02x %02x\n", vendor_id, product_id, model_number, flags);
 }
 } else {
 DBG (DBG_info_sane, "sane_init() config file parsing %s: 
error\n", config_line);
@@ -235,8 +244,13 @@ sane_init (SANE_Int * version_code,