Skip to main content

Crate thermark

Crate thermark 

Source
Expand description

§thermark

Local sticker printing for pocket thermal label printers (B1, B1 Pro, D11, …) over Bluetooth LE or USB serial — no vendor app, no cloud.

Typical jobs: guest Wi‑Fi join stickers, QR + text links, inventory tags, name badges, line-art stickers, and calibration patterns.

§Features

FeatureDefaultEnables
bleyesBleTransport via btleplug
serialyesSerialTransport via serialport

Protocol-only / mock testing: cargo test --no-default-features.

Protocol: see protocol.rs for command IDs and packet.rs for framing.

Re-exports§

pub use config::Config;
pub use config::ConnPref;
pub use errors::Error;
pub use errors::PrinterFault;
pub use errors::Result;
pub use geometry::DEFAULT_B1_LABEL;
pub use geometry::HEAD_NARROW_PX;
pub use geometry::HEAD_WIDE_PX;
pub use geometry::LabelMm;
pub use geometry::LabelPx;
pub use geometry::PX_PER_MM;
pub use image_encode::Raster;
pub use label::TextAlign;
pub use label::TextLabelOptions;
pub use label::TextSide;
pub use label::make_qr_label_opts;
pub use label::make_text_label;
pub use mock::MockTransport;
pub use packet::Packet;
pub use print_task::PrintTask;
pub use printer::Heartbeat;
pub use printer::InfoValue;
pub use printer::OnTimeout;
pub use printer::Pacing;
pub use printer::PrintOptions;
pub use printer::PrintStatus;
pub use printer::PrinterClient;
pub use printer::PrinterSummary;
pub use printer::RawPrinter;
pub use printer::RfidInfo;
pub use profile::PROFILES;
pub use profile::PrintDirection;
pub use profile::PrinterDevice;
pub use profile::PrinterIdentity;
pub use profile::PrinterProfile;
pub use profile::SupportStatus;
pub use profile::profile_for_identity;
pub use profile::profile_for_model;
pub use profile::task_for_identity;
pub use protocol::Model;
pub use transport::BleCandidate;
pub use transport::BleMatchMode;
pub use transport::Transport;
pub use transport::name_looks_like_label_printer;
pub use transport::score_ble_candidate;
pub use transport::select_ble_candidate;
pub use types::Density;
pub use types::Rotation;
pub use types::Threshold;
pub use wifi::WifiLabelOptions;
pub use wifi::WifiSecurity;
pub use wifi::make_wifi_label;
pub use wifi::wifi_qr_payload;
pub use wifi::wifi_side_text;

Modules§

batch
CSV batches reuse the existing label renderers and keep a durable print journal.
config
User config: default printer address and connection prefs (JSON only).
doctor
Environment + printer readiness checks (thermark doctor).
errors
Library error type and printer In_PrintError (0xDB) reason codes.
font
Deterministic default fonts and script-aware text layout.
geometry
Print geometry helpers.
image_encode
Image composition and NIIMBOT 1-bit row encoding.
label
Compose printable labels: square QR + shaped text.
mock
In-memory transport for tests (no Bluetooth / USB).
packet
NIIMBOT binary packet framing.
prepared
Disk-backed, content-addressed monochrome jobs. Hashes detect changes, not authorship.
print_task
Complete on-wire print sequences used by supported protocol generations.
printer
High-level printer client and parsed status types.
profile
Detected printer identity and model capabilities.
protocol
Command IDs and high-level request helpers for the NIIMBOT protocol.
session
Opening a printer session and running one job through it.
testing
Offline protocol replay and deterministic fault injection. These are not hardware evidence.
transport
Transports: Bluetooth LE (macOS-friendly) and USB serial.
types
Shared domain newtypes: density, rotation, threshold.
wifi
Guest Wi‑Fi stickers: standard WIFI:… QR payload + human-readable SSID.