[sane-devel] Button-controlled scan for Canon XK90 and TS8030 (sane-pixma)

WATANABE Kazuhiro CQG00620 at nifty.ne.jp
Mon Dec 6 09:41:19 GMT 2021


Hi, all.

Currently sane-pixma doesn't support button-controlled scan for my
Canon XK90 and TS8030.


From sane-backends-1.0.32/backend/pixma/pixma_mp150.c:

| static int
| handle_interrupt (pixma_t * s, int timeout)
| {
(snip)
|  if (s->cfg->pid == MG5300_PID
|      || s->cfg->pid == MG5400_PID
|      || s->cfg->pid == MG6200_PID
(snip)
|      || s->cfg->pid == MB5400_PID
|      || s->cfg->pid == TR4500_PID)
|  /* button no. in buf[7]
|   * size in buf[10] 01=A4; 02=Letter; 08=10x15; 09=13x18; 0b=auto
|   * format in buf[11] 01=JPEG; 02=TIFF; 03=PDF; 04=Kompakt-PDF
|   * dpi in buf[12] 01=75; 02=150; 03=300; 04=600
|   * target = format; original = size; scan-resolution = dpi */
|  {

XK90 and TS8030 has a similar "Scan settings" menu on the LCD panel.

 Scan size
 Format
 Scan res
  ...and so on.

So I've tried to add XK90_PID and TS8000_PID to this part:

--- sane-backends-1.0.32/backend/pixma/pixma_mp150.c.orig       2021-02-14 20:25:19.000000000 +0900
+++ sane-backends-1.0.32/backend/pixma/pixma_mp150.c    2021-11-22 15:41:20.917920000 +0900
@@ -938,6 +938,8 @@
       || s->cfg->pid == MB2300_PID
       || s->cfg->pid == MB5000_PID
       || s->cfg->pid == MB5400_PID
+      || s->cfg->pid == TS8000_PID
+      || s->cfg->pid == XK90_PID
       || s->cfg->pid == TR4500_PID)
   /* button no. in buf[7]
    * size in buf[10] 01=A4; 02=Letter; 08=10x15; 09=13x18; 0b=auto

As a result, the Color, Stop, and Black (as "cancel") buttons worked
on both XK90 and TS8030.
Combination with the batch mode also works:

| $ scanimage -d pixma --format png --button-controlled --batch
| Scanning infinity pages, incrementing by 1, numbering from 1
| Scanning page 1                               ## pause
| Scanned page 1. (scanner status = 5)          ## tap "Color"
| Scanning page 2                               ## pause
| Scanned page 2. (scanner status = 5)          ## tap "Color"
| Scanning page 3                               ## pause
| scanimage: sane_read: Operation was canceled  ## tap "Black"
| Scanned page 3. (scanner status = 2)
| Batch terminated, 3 pages scanned
| $ scanimage -d pixma --format png --button-controlled --batch
| Scanning infinity pages, incrementing by 1, numbering from 1
| Scanning page 1                               ## pause
| scanimage: sane_read: Operation was canceled  ## tap "Color", then tap "Stop" during the scan
| Scanned page 1. (scanner status = 2)
| Batch terminated, 1 page scanned
| $ 

-- 
WATANABE Kazuhiro (CQG00620 at nifty.ne.jp)



More information about the sane-devel mailing list