Skip to content

[13] VKP80III / K80 serial thermal printer emulator and screen #16

Description

@jvwaldrich0

Task 13 of 16 — these are sequential, do them in order.

Previous: #15 · Next: #17

Port target: cloudpark-toolkit (Go) → this repo (Rust). Reference paths below are relative to that repo.

Goal

The VKP80III / K80 thermal-printer emulator on a serial line, plus its screen.

Scope

  • Open the port: ttyS1, ttyS2, or pty (allocate a pty and print the slave path). Baud from --baud (ignored for pty). Crate: serialport or raw nix termios.
  • Answer the host's probes so it believes a real printer is attached:
    • GS I FF = 1D 49 FF (model query) → 02 05 (VKP80)
    • DLE EOT 0x14 = 10 04 14 (status query) → 10 04 00 00 00 00 (paper present, ticket removed)
  • Ticket framing: serial has no end-of-ticket marker — flush after 300 ms of line silence and treat the buffer as one ticket, rendered to PDF via task 10. Keep the window a named constant.
  • Ticket counter exposed to the TUI.

Screen: menu Get info — port, baud, pty path, tickets saved, last ticket filename + log pane.

Reference

cloudpark-toolkit/internal/serialprinter/serialprinter.go, device_linux.go, serialprinter_test.go, internal/tui/printer.go

Done when

  • Test: feeding a captured ESC/POS stream into the emulator writes exactly one PDF.
  • Model and status queries get the exact byte replies above.
  • A busy/absent serial port shows a readable error, not a panic.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions