summaryrefslogtreecommitdiff
path: root/backend/pixma/pixma_mp800.c
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhosting.net>2021-05-18 07:43:35 +0200
committerJörg Frings-Fürst <debian@jff-webhosting.net>2021-05-18 07:43:35 +0200
commit9f8889f928ce86ba4a78659d378c6ba29bc9f735 (patch)
treec9567cb0d015b68ce3da8d03472b6443f1cb1ca9 /backend/pixma/pixma_mp800.c
parent446e9454b8cbe5b689149415d11d36e88442ca88 (diff)
parent154785ab2d5df7ddc8c2cf813b773c340e5e2aea (diff)
Merge branch 'release/debian/1.0.32-1'debian/1.0.32-1
Diffstat (limited to 'backend/pixma/pixma_mp800.c')
-rw-r--r--backend/pixma/pixma_mp800.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/backend/pixma/pixma_mp800.c b/backend/pixma/pixma_mp800.c
index 905c246..fba7553 100644
--- a/backend/pixma/pixma_mp800.c
+++ b/backend/pixma/pixma_mp800.c
@@ -17,9 +17,7 @@
General Public License for more details.
You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330, Boston,
- MA 02111-1307, USA.
+ along with this program. If not, see <https://www.gnu.org/licenses/>.
As a special exception, the authors of SANE give permission for
additional uses of the libraries contained in this release of SANE.
@@ -152,6 +150,10 @@
<ivec:param_set servicetype=\"scan\"><ivec:jobID>00000001</ivec:jobID>\
</ivec:param_set></ivec:contents></cmd>"
+#if !defined(HAVE_LIBXML2)
+#define XML_OK "<ivec:response>OK</ivec:response>"
+#endif
+
enum mp810_state_t
{
state_idle,
@@ -291,7 +293,11 @@ static int send_xml_dialog (pixma_t * s, const char * xml_message)
PDBG(pixma_dbg (10, "XML message sent to scanner:\n%s\n", xml_message));
PDBG(pixma_dbg (10, "XML response back from scanner:\n%s\n", mp->cb.buf));
+#if defined(HAVE_LIBXML2)
return pixma_parse_xml_response((const char*)mp->cb.buf) == PIXMA_STATUS_OK;
+#else
+ return (strcasestr ((const char *) mp->cb.buf, XML_OK) != NULL);
+#endif
}
static void new_cmd_tpu_msg (pixma_t *s, pixma_cmdbuf_t * cb, uint16_t cmd)
@@ -401,6 +407,10 @@ static int select_source (pixma_t * s)
data[0] = 4;
data[1] = 2;
break;
+
+ case PIXMA_SOURCE_NONE:
+ /* this source can not be selected */
+ break;
}
return pixma_exec (s, &mp->cb);
}
@@ -483,7 +493,7 @@ static unsigned calc_raw_width (const mp810_t * mp,
const pixma_scan_param_t * param)
{
unsigned raw_width;
- /* NOTE: Actually, we can send arbitary width to MP810. Lines returned
+ /* NOTE: Actually, we can send arbitrary width to MP810. Lines returned
are always padded to multiple of 4 or 12 pixels. Is this valid for
other models, too? */
if (mp->generation >= 2)
@@ -929,8 +939,7 @@ static int send_scan_param (pixma_t * s)
data[0x02] = 0x03;
data[0x03] = 0x03;
}
- if (s->cfg->pid != MG8200_PID)
- data[0x05] = 0x01; /* This one also seen at 0. Don't know yet what's used for */
+ data[0x05] = pixma_calc_calibrate (s);
/* the scanner controls the scan */
/* no software control needed */
pixma_set_be16 (s->param->xdpi | 0x8000, data + 0x08);