Download raw body.
sane-backends: make SCAN button work on Canon MG3200 series
Hi Antoine,
I would like to add this small patch to make my scanner Canon PIXMA
MG3250 work with the SCAN button.
See:
- https://gitlab.com/sane-project/backends/-/work_items/856
- https://gitlab.com/sane-project/backends/-/merge_requests/933
Index: Makefile
===================================================================
RCS file: /cvs/ports/graphics/sane-backends/Makefile,v
diff -u -p -u -r1.118 Makefile
--- Makefile 1 Nov 2025 11:16:41 -0000 1.118
+++ Makefile 8 Jul 2026 10:02:31 -0000
@@ -3,7 +3,7 @@ BROKEN-alpha= ICE hp5590.c:1141: error:
COMMENT= API for accessing scanners, backends
V= 1.4.0
-REVISION= 2
+REVISION= 3
DISTNAME= backends-${V}
PKGNAME= sane-${DISTNAME}
Index: patches/patch-backend_pixma_pixma_mp150_c
===================================================================
RCS file: patches/patch-backend_pixma_pixma_mp150_c
diff -N patches/patch-backend_pixma_pixma_mp150_c
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-backend_pixma_pixma_mp150_c 8 Jul 2026 10:02:31 -0000
@@ -0,0 +1,30 @@
+PIXMA: decode SCAN button interrupt on MG3200 series (buf[4])
+
+- https://gitlab.com/sane-project/backends/-/work_items/856
+- https://gitlab.com/sane-project/backends/-/merge_requests/933
+
+Index: backend/pixma/pixma_mp150.c
+--- backend/pixma/pixma_mp150.c.orig
++++ backend/pixma/pixma_mp150.c
+@@ -1049,6 +1049,21 @@ handle_interrupt (pixma_t * s, int timeout)
+ s->events = PIXMA_EV_BUTTON1 | (buf[0x13] & 0x0f);
+ }
+ }
++ else if (s->cfg->pid == MG3200_PID)
++ /* MG3200 series: SCAN is the only button reported; flag in buf[4].
++ * buf[3] & 1 is a clock request as in the default branch. */
++ {
++ if (buf[3] & 1)
++ /* FIXME: This function makes trouble with a lot of scanners
++ send_time (s);
++ */
++ PDBG (pixma_dbg (1, "WARNING:send_time() disabled!\n"));
++ if (buf[4] & 1)
++ {
++ /* start scan */
++ s->events = PIXMA_EV_BUTTON1;
++ }
++ }
+ else
+ /* button no. in buf[0]
+ * original in buf[0]
--
Regards,
Mikolaj
sane-backends: make SCAN button work on Canon MG3200 series