Skip to content

Commit

Permalink
WSD: workaround for ADF Duplex on Brother MFC-9370CDW (closes #346)
Browse files Browse the repository at this point in the history
This device reports ADFSupportsDuplex as 0 but returns both ADFFront and
ADFBack elements.

As a workaround, we assume that if both ADFFront and ADFBack are present,
the scanner supports ADF duplex mode, regardless of the value returned by
ADFSupportsDuplex.
  • Loading branch information
alexpevzner committed Nov 18, 2024
1 parent 235dfa0 commit 7a88b37
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions airscan-wsd.c
Original file line number Diff line number Diff line change
Expand Up @@ -535,6 +535,20 @@ wsd_devcaps_parse_configuration (proto_handler_wsd *wsd,
}
}

/* Workaround for Brother MFC-9340CDW
*
* This device reports ADFSupportsDuplex as 0, but returns both
* ADFFront and ADFBack elements.
*
* As a workaround, we assume that if both ADFFront and ADFBack are
* present (temporary saved under the ID_SOURCE_ADF_SIMPLEX and
* ID_SOURCE_ADF_DUPLEX slots), scanner supports duplex mode,
* regardless of the ADFSupportsDuplex value it returns
*/
if (adf && caps->src[ID_SOURCE_ADF_DUPLEX] != NULL) {
duplex = true;
}

/* Please note that the standard model for SANE and for our implementation
* involves having two separate configurations for the duplex ADF: one for
* simplex mode and another for duplex mode. In duplex mode, it is assumed
Expand All @@ -553,8 +567,8 @@ wsd_devcaps_parse_configuration (proto_handler_wsd *wsd,
* assumed to be the same as ADFFront.
*
* During the decoding process, we temporarily store the ADF front
* information under the IDSOURCEADFSIMPLEX and the ADF back information
* under the IDSOURCEADFDUPLEX slots, and then make adjustments.
* information under the ID_SOURCE_ADF_SIMPLEX and the ADF back information
* under the ID_SOURCE_ADF_DUPLEX slots, and then make adjustments.
*
* When adjusting, we assume that the ADF front applies to both simplex and
* duplex modes, while the ADF back applies only to duplex mode.
Expand Down

0 comments on commit 7a88b37

Please sign in to comment.