Fix print completion flow for PT-P710BT and PT-P900W.
Align raster protocol bytes and print-end sequencing by printer family, add safer status polling/retry behavior, and document the changes with regression coverage to prevent protocol regressions. Made-with: Cursor
This commit is contained in:
@@ -15,21 +15,13 @@ void ptouch_fill_gf_header(uint8_t out[3], size_t line_payload_bytes)
|
||||
void ptouch_fill_esc_iz(uint8_t out[13], uint8_t media_kind, uint8_t media_width,
|
||||
uint32_t raster_lines)
|
||||
{
|
||||
uint8_t n2_paper = 0x09u;
|
||||
if (media_kind == 0x03u)
|
||||
n2_paper = 0x00u;
|
||||
else if (media_kind == 0x11u)
|
||||
n2_paper = 0x11u;
|
||||
else if (media_kind == 0x17u)
|
||||
n2_paper = 0x17u;
|
||||
else if (media_kind == 0x13u)
|
||||
n2_paper = 0x13u;
|
||||
|
||||
out[0] = 0x1Bu;
|
||||
out[1] = 0x69u;
|
||||
out[2] = 0x7Au;
|
||||
out[3] = 0x0Eu;
|
||||
out[4] = n2_paper;
|
||||
/* PI flags: enable media/width/length with quality bit for broad compatibility. */
|
||||
out[3] = 0x8Eu;
|
||||
/* Use status media-kind byte directly (e.g., 0x01 laminated, 0x03 non-laminate). */
|
||||
out[4] = media_kind;
|
||||
out[5] = media_width;
|
||||
out[6] = 0x00u;
|
||||
out[7] = (uint8_t)(raster_lines & 0xFFu);
|
||||
@@ -39,3 +31,9 @@ void ptouch_fill_esc_iz(uint8_t out[13], uint8_t media_kind, uint8_t media_width
|
||||
out[11] = 0x00u; /* first page */
|
||||
out[12] = 0x00u; /* fixed */
|
||||
}
|
||||
|
||||
uint8_t ptouch_esc_ik_value(unsigned head_dots)
|
||||
{
|
||||
/* Preserve legacy 560-dot behaviour (0x0C), 128-dot uses 0x08. */
|
||||
return head_dots > 128u ? 0x0Cu : 0x08u;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user