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.
|
immediatly answer with PIXMA_STATUS_BUSY.
|
||||||
|
|
||||||
Is 8 seconds timeout enough? This affects ALL commands that use
|
Is 8 seconds timeout enough? This affects ALL commands that use
|
||||||
pixma_cmd_transaction(). */
|
pixma_cmd_transaction(). Default value set in pixma_open(). */
|
||||||
tmo = 8;
|
tmo = s->rec_tmo;
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
error = pixma_read (s->io, data, expected_len);
|
error = pixma_read (s->io, data, expected_len);
|
||||||
|
@ -769,6 +769,7 @@ pixma_open (unsigned devnr, pixma_t ** handle)
|
||||||
first_pixma = s;
|
first_pixma = s;
|
||||||
|
|
||||||
s->cfg = cfg;
|
s->cfg = cfg;
|
||||||
|
s->rec_tmo = 8; /* set receive timeout to 8 seconds */
|
||||||
error = pixma_connect (devnr, &s->io);
|
error = pixma_connect (devnr, &s->io);
|
||||||
if (error < 0)
|
if (error < 0)
|
||||||
{
|
{
|
||||||
|
|
|
@ -118,6 +118,7 @@ struct pixma_t
|
||||||
int cancel; /* NOTE: It can be set in a signal handler. */
|
int cancel; /* NOTE: It can be set in a signal handler. */
|
||||||
uint32_t events;
|
uint32_t events;
|
||||||
void *subdriver; /* can be used by model driver. */
|
void *subdriver; /* can be used by model driver. */
|
||||||
|
int rec_tmo; /* receive timeout [s] */
|
||||||
|
|
||||||
/* private */
|
/* private */
|
||||||
uint64_t cur_image_size;
|
uint64_t cur_image_size;
|
||||||
|
|
Ładowanie…
Reference in New Issue