diff --git a/backend/pixma_common.c b/backend/pixma_common.c index ce240e653..3588329e0 100644 --- a/backend/pixma_common.c +++ b/backend/pixma_common.c @@ -651,8 +651,8 @@ pixma_cmd_transaction (pixma_t * s, const void *cmd, unsigned cmdlen, immediatly answer with PIXMA_STATUS_BUSY. Is 8 seconds timeout enough? This affects ALL commands that use - pixma_cmd_transaction(). */ - tmo = 8; + pixma_cmd_transaction(). Default value set in pixma_open(). */ + tmo = s->rec_tmo; do { error = pixma_read (s->io, data, expected_len); @@ -769,6 +769,7 @@ pixma_open (unsigned devnr, pixma_t ** handle) first_pixma = s; s->cfg = cfg; + s->rec_tmo = 8; /* set receive timeout to 8 seconds */ error = pixma_connect (devnr, &s->io); if (error < 0) { diff --git a/backend/pixma_common.h b/backend/pixma_common.h index 12dd9b34a..6c55c7184 100644 --- a/backend/pixma_common.h +++ b/backend/pixma_common.h @@ -118,6 +118,7 @@ struct pixma_t int cancel; /* NOTE: It can be set in a signal handler. */ uint32_t events; void *subdriver; /* can be used by model driver. */ + int rec_tmo; /* receive timeout [s] */ /* private */ uint64_t cur_image_size;