summaryrefslogtreecommitdiff
path: root/backend/pixma/pixma_mp800.c
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhosting.net>2021-02-16 18:24:19 +0100
committerJörg Frings-Fürst <debian@jff-webhosting.net>2021-02-16 18:24:19 +0100
commit351b7328520c16730ceb46e5acae16038c42185e (patch)
treefae21fd5c94f3c3ed0202a95c9ada705482e647b /backend/pixma/pixma_mp800.c
parentad38bc6ecb80ddeb562841b33258dd53659b1da6 (diff)
New upstream version 1.0.32upstream/1.0.32
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);