kopia lustrzana https://gitlab.com/sane-project/backends
pixma: new global parameter to set duration of receive timeout loop
The default value for receive timeout loop duration has not been changed. The loop still takes 8 seconds if a timeout occurs.merge-requests/1/head
rodzic
9897357727
commit
c41640f364
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -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;
|
||||
|
|
Ładowanie…
Reference in New Issue