Package-level declarations

Types

Link copied to clipboard
class LabelBitmap(val width: Int, val height: Int)

A one-bit picture in the printer's orientation: width dots across the head, height rows along the feed. Each row is packed most significant bit first, 1 for ink.

Link copied to clipboard
data class NiimbotChannel(val service: Uuid, val characteristic: Uuid)

The service and characteristic the printer talks on.

Link copied to clipboard

Why the printer did not print.

Link copied to clipboard

What a printer fault code means, per MultiMote/niimbluelib as labeltastic's vendored niimprint lists them.

Link copied to clipboard

Turns a bitmap into the printer's row packets: 0x85 for a row with ink, carrying its dot count in each third of the head, and 0x84 for blank rows. Identical neighboring rows go as one packet with a repeat count.

Link copied to clipboard
interface NiimbotLink

The two-way packet link to a printer: BLE in the app, a script in tests.

Link copied to clipboard
class NiimbotPacket(val type: Int, val data: ByteArray)

One packet of the Niimbot label printer protocol, as the printer sends and receives it: 55 55 · type · length · data · checksum · AA AA, where the checksum XORs the type, the length and every data byte.

Link copied to clipboard

Collects bytes from the printer's notifications and yields whole packets. A notification can carry part of a packet or several; bytes that don't start a packet are dropped until the next 55 55. A frame with a bad checksum or tail gives up only its first byte: the search resumes at its second 55, which may be the real head after a stray one.

Link copied to clipboard
class NiimbotPrinter(scanner: BleScanner, connectionFactory: BleConnectionFactory, scope: CoroutineScope)

A Niimbot D110 label printer over Bluetooth LE, on a connection of its own: nothing here reads or changes the radio's connection.

Link copied to clipboard
class NiimbotPrinterFactory(scanner: BleScanner, connectionFactory: BleConnectionFactory)

Creates a NiimbotPrinter that lives in the caller's scope.

Link copied to clipboard

The print sequence, as labeltastic's vendored niimprint and Meshtastic-Apple run it. Printers on protocol v3 and later print blank on the older sequence, so the version the printer reports picks the sequence.

Link copied to clipboard

Request types the print sequence sends. A reply's type is the request's plus an offset that depends on the request.

Functions

Link copied to clipboard
Link copied to clipboard

Finds the print channel the way MultiMote/niimbluelib does: the one characteristic on a vendor service that both notifies and takes writes without response.