allow a printer to raise the default status timeout

The PT-E560BT stays busy about 2.2 s after even an 8 mm label, so the
1 second default timeout cannot succeed on a job sent straight after
another: printing five chained labels gives a strip carrying three of
them. ptouch-print reports the timeout and exits non-zero correctly every
time, but no amount of waiting helps when the default is below the
printer's fixed overhead.

Add a trailing min_timeout to the device table. Every other row keeps its
initialiser and gets 0, which resolves to the old default of 1; only the
E560BT carries a value. An explicit --timeout always wins.

Raising the global default would also be defensible: ptouch_getstatus()
returns as soon as the status arrives, measured 0.13 s with --timeout 30
against 0.14 s with --timeout 1, so a higher ceiling costs nothing on a
printer that is ready. But that is a judgement about printers I do not
have, so this keeps it to the one that was measured.
This commit is contained in:
Kevin Bradenstein
2026-09-08 07:19:13 +02:00
committed by Dominic Radermacher
parent ef6e6f4925
commit 41c4af0d0d
3 changed files with 13 additions and 3 deletions
+4
View File
@@ -62,6 +62,10 @@ struct _pt_dev_info {
Brother "Software Developer's Manual - Raster Command Reference,
PT-P900/P900W/P950NW", section 2.3.5 "Raster line". 0 = centred. */
int pin_offset;
/* Seconds to wait for a status response when the user did not ask for a
particular --timeout. 0 means use the global default; a printer only
needs an entry here if the global default is too short for it. */
int min_timeout;
};
typedef struct _pt_dev_info *pt_dev_info;