core/src
Interfaces
| Interface | Description |
|---|---|
| LetraTagMedia | DYMO LetraTag media descriptor. |
| LetraTagPrintOptions | Public LetraTag print options. |
Type Aliases
| Type Alias | Description |
|---|---|
| LetraTagDevice | DYMO LetraTag device entry. Alias for the contracts DeviceEntry narrowed to family: 'letratag'. |
| LetraTagMaterial | LT cassette substrate family. Picker / preview UX hint — the rasterizer does not branch on this. |
Variables
| Variable | Description |
|---|---|
| BODY_CHUNK | Protocol-level upper bound on body bytes per BLE write. Used as the ceiling when no mtu is provided to chunkPayload; effective chunk size is min(BODY_CHUNK, mtu - 1). |
| CUT_AT_END | CUT command byte for "cut at the end of this copy". |
| CUT_SUPPRESS | CUT command byte for "suppress cut (intermediate copy)". |
| DEFAULT_MEDIA | - |
| DEVICE_REGISTRY_DATA | Compiled DeviceRegistry for the LetraTag driver. Source of truth lives in packages/core/data/devices/<KEY>.json5; scripts/compile-data.mjs aggregates them into the generated TS module imported here. |
| DEVICES | Registry of supported LetraTag devices, keyed by the device's stable key field (LT_200B). Values are the full contracts DeviceEntry. |
| END | [0x1B, 0x51] — end of job marker. |
| FORM_FEED | [0x1B, 0x45] — paper feed. Not emitted on the LT-200B path. |
| LT_PAPER_WHITE | Canonical default — the white-paper cassette ships in the box with every LT-200B. Single named const, not a per-cassette export. |
| MAGIC | Magic bytes appended to the last chunk of a print payload. |
| MEDIA | Indexed registry of every LT cassette SKU the driver knows about, keyed by entry id (e.g. MEDIA['lt-paper-white']). |
| MEDIA_LIST | - |
| PRINTABLE_DOTS | Conventional "printable rows" — the height we recommend authoring to so labels survive any chassis-mechanical clipping. The wire format does not enforce this; it's a media-side fact. |
| PROTOCOL_HEAD_FRAME | Wire-format frame height — PRINT_DATA.height is always 32. The encoder centres shorter source bitmaps within these 32 rows by inserting zero-rasterlines top and bottom. |
| PROTOCOLS | Wire protocols this core's encoder produces correct bytes for. Pair with DEVICE_REGISTRY_DATA and resolveSupportedDevices from @thermal-label/contracts to filter a device list to what this runtime can drive. |
| ROTATE_DIRECTION | Direction the LetraTag print head rotates landscape input. |
| START | [0x1B, 0x73, 154, 2, 0, 0] — start of a print job. |
| STATUS | [0x1B, 0x41] — request a status notification. |
| STATUS_NOTIFICATION_LENGTH | Length in bytes of a well-formed RX status notification frame. |
| STATUS_REQUEST | Status request directive — [0x1B, 0x41]. Embedded in every print payload between CUT and END; on-the-wire observation does not show it sent stand-alone. |
Functions
| Function | Description |
|---|---|
| buildCut | [0x1B, 0x70, command] — cut directive. |
| buildHeader | 9-byte header. Layout: |
| buildMediaType | [0x1B, 0x4D, mediaId, 0x00, 0x00, 0x00] — set cassette type. 6 bytes total; the trailing three zeros are part of the observed wire format. |
| buildNumberOfCopies | [0x1B, 0x23, copies] — number of copies for this job. |
| buildPrintData | [0x1B, 0x44, 0x81, 0x02, ...u32le(width), ...u32le(height), ...image] |
| buildPrintPayload | Build the print payload (everything after the 9-byte header): START + [MEDIA_TYPE] + NUMBER_OF_COPIES + PRINT_DATA + CUT + STATUS + END. |
| chunkPayload | Slice an assembled payload into the ordered list of BLE writes. |
| createPreviewOffline | Generate an offline preview without a live printer connection. |
| encodeBitmap | Encode a head-aligned bitmap into the column-major 4-bytes-per-feed stream the LT-200B expects. |
| encodeLabel | Encode a complete LetraTag print job into the ordered list of BLE writes. The transport calls write() with each entry in turn. |
| encodeSetCassetteType | Build the stand-alone MEDIA_TYPE-only write list. Used by the driver's setCassetteType() path (writes to the printShortCommandUUID characteristic). |
| findMediaBySku | Find a media entry by vendor SKU. LT cassettes ship under many regional part numbers (US 91XXX vs EU S07XXXXX); this helper does the lookup against MediaDescriptor.skus. |
| parseStatus | Parse a 3-byte status notification frame from the printer. |