mirror of
https://github.com/openharmony/third_party_sane-airscan.git
synced 2026-06-30 21:17:55 -04:00
WSD: workaround for ADF Duplex on Brother MFC-9370CDW (closes #346)
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.
This commit is contained in:
+16
-2
@@ -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
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user