mirror of
https://github.com/openharmony/third_party_sane-airscan.git
synced 2026-07-01 21:14:00 -04:00
eSCL: support both forms, scan:SupportedIntent and scan:Intent in capabilities
Some printers use the "scan:SupportedIntent" name for intents in the
ScannerCapabilities, while other use the "scan:Intent" name:
<scan:SupportedIntents>
<scan:Intent>Document</scan:Intent>
<scan:Intent>Photo</scan:Intent>
<scan:Intent>Preview</scan:Intent>
<scan:Intent>TextAndGraphic</scan:Intent>
</scan:SupportedIntents>
For example, Kyocera ECOSYS, use the first form, while some others,
like HP LaserJet M426fdn or Pantum BM5100ADW, use the second form.
The Mopria eSCL specification doesn't cleanly state which form is
correct.
So for compatibility with both variants used by firmwares, now
both forms are accepted.
This commit is contained in:
+2
-1
@@ -351,7 +351,8 @@ escl_devcaps_source_parse_supported_intents (xml_rd *xml, devcaps_source *src)
|
||||
|
||||
xml_rd_enter(xml);
|
||||
for (; !xml_rd_end(xml); xml_rd_next(xml)) {
|
||||
if(xml_rd_node_name_match(xml, "scan:SupportedIntent")) {
|
||||
if(xml_rd_node_name_match(xml, "scan:SupportedIntent") ||
|
||||
xml_rd_node_name_match(xml, "scan:Intent")) {
|
||||
const char *v = xml_rd_node_value(xml);
|
||||
if (!strcmp(v, "Document")) {
|
||||
src->scanintents |= 1 << ID_SCANINTENT_DOCUMENT;
|
||||
|
||||
Reference in New Issue
Block a user