Expand description
ZPL Print Client — send ZPL to Zebra and ZPL-compatible printers.
Supports TCP (port 9100), USB, and serial/Bluetooth SPP transports.
The core API is synchronous (std::net), with no async runtime required.
Structs§
- Batch
Options - Options for batch printing operations.
- Batch
Progress - Progress report for batch printing.
- Batch
Result - Result of a batch print operation.
- Host
Status - Parsed
~HS(Host Status) response. - JobId
- Opaque identifier for a logical print job (single label or batch).
- Printer
Config - Complete printer configuration: timeouts + retry settings.
- Printer
Info - Parsed
~HI(Host Identification) response. - Printer
Timeouts - Timeout settings for printer connections.
- Reconnect
Retry Printer - A retry wrapper that reconnects between attempts.
- Retry
Config - Retry settings for transient failures.
- Retry
Printer - A wrapper that adds retry-with-backoff to any
Printerimplementation. - TcpPrinter
- A synchronous TCP connection to a ZPL printer.
Enums§
- JobPhase
- Lifecycle phase of a print job.
- Print
Error - Printer error conditions, categorized by type.
- Print
Mode - Zebra print mode, as reported in
~HSline 2 field 4. - Printer
Error Kind - Specific printer error conditions derived from
~HSstatus flags.
Traits§
- Printer
- Send data to a printer. All transports implement this.
- Reconnectable
- A printer that can re-establish its connection after a failure.
- Status
Query - Query printer status. Only bidirectional transports implement this.
Functions§
- create_
job_ id - Generate a new unique job ID.
- expected_
frame_ count - Determine the expected number of STX/ETX frames for a given command.
- read_
frames - Read exactly
expected_countSTX/ETX framed responses from a stream. - resolve_
printer_ addr - Resolve a user-provided printer address string to a
SocketAddr. - send_
batch - Send a batch of labels with optional progress reporting.
- send_
batch_ with_ status - Send a batch of labels with status polling (requires bidirectional transport).
- wait_
for_ completion - Poll
~HSuntil the printer reports no formats in buffer and no labels remaining, or until the timeout elapses.