LabelSpec

sealed interface LabelSpec(source)

A label the print sheet can draw: what it says, what its QR encodes, and the words in its band.

Inheritors

Types

Link copied to clipboard
data class Channels(val content: ChannelLabelContent, val url: String, val band: String) : LabelSpec

A channel set as a channel label. The QR encodes url, the link Share Channels shows.

Link copied to clipboard
data class Connect(val content: NameTagContent, val link: String, val linkWithoutPin: String?, val band: String, val network: String, val pinWord: String) : LabelSpec

The connected radio as a connect label: the name tag's layout around link, the meshtastic/design#177 connect link. linkWithoutPin is set only when link carries the radio's fixed pairing PIN, which is in the QR alone and never printed as text. The bottom row says how scanning connects: network, the link's transport, with pinWord after it when the QR carries the PIN.

Link copied to clipboard
data class NameTag(val content: NameTagContent, val contact: SharedContact, val band: String) : LabelSpec

A contact as labeltastic's name tag. The QR encodes contact, which is what Share Contact shows.

Properties

Link copied to clipboard
abstract val band: String

Functions

Link copied to clipboard
fun LabelSpec.layout(lengthDots: Int, measurer: LabelTextMeasurer, encoder: QrEncoder = LabelQrEncoder): LabelLayout?

Lays this out for a label lengthDots long, or returns null when its QR does not fit the head at 2 dots per module. A contact's long name is cut in the QR payload first; a channel or connect link has nothing to cut.