Package-level declarations

Types

Link copied to clipboard
@Serializable
data class BootloaderOtaQuirk(val hwModel: Int, val hwModelSlug: String? = null, val requiresBootloaderUpgradeForOta: Boolean = false, val infoUrl: String? = null)
Link copied to clipboard
@Serializable
data class BootloaderOtaQuirksResponse(val devices: List<BootloaderOtaQuirk> = emptyList())

Envelope of the bundled device_bootloader_ota_quirks.json asset.

Link copied to clipboard
data class Capabilities(val firmwareVersion: String?, forceEnableAll: Boolean = isDebug)

Defines the capabilities and feature support based on the device firmware version.

Link copied to clipboard
data class Channel(val settings: ChannelSettings = default.settings, val loraConfig: Config.LoRaConfig = default.loraConfig)
Link copied to clipboard
Link copied to clipboard
sealed interface ConnectionState
Link copied to clipboard
data class Contact(val contactKey: String, val shortName: String, val longName: String, val lastMessageTime: Long?, val lastMessageText: String?, val unreadCount: Int, val messageCount: Int, val isMuted: Boolean, val isUnmessageable: Boolean, val nodeColors: Pair<Int, Int>? = null)
Link copied to clipboard
value class ContactKey(val value: String)

Type-safe wrapper for contact key strings (channel index + node address).

Link copied to clipboard
data class ContactSettings(val contactKey: String, val muteUntil: Long = 0, val lastReadMessageUuid: Long? = null, val lastReadMessageTimestamp: Long? = null, val filteringDisabled: Boolean = false, val isMuted: Boolean = false)
Link copied to clipboard
@Serializable
data class DataPacket(var to: String? = NodeAddress.ID_BROADCAST, var bytes: ByteString?, var dataType: Int, var from: String? = NodeAddress.ID_LOCAL, var time: Long = nowMillis, var id: Int = 0, var status: MessageStatus? = MessageStatus.UNKNOWN, var hopLimit: Int = 0, var channel: Int = 0, var wantAck: Boolean = true, var hopStart: Int = 0, var snr: Float = 0.0f, var rssi: Int = 0, var replyId: Int? = null, var relayNode: Int? = null, var relays: Int = 0, var viaMqtt: Boolean = false, var emoji: Int = 0, var sfppHash: ByteString? = null, var transportMechanism: Int = 0, var xeddsaSigned: Boolean = false)

A data class version of the protobuf MeshPacket + Data subpacket.

Link copied to clipboard
@Serializable
data class DeviceHardware(val activelySupported: Boolean = false, val architecture: String = "", val displayName: String = "", val hasInkHud: Boolean? = null, val hasMui: Boolean? = null, val hwModel: Int = 0, val hwModelSlug: String = "", val images: List<String>? = null, val partitionScheme: String? = null, val platformioTarget: String = "", val requiresDfu: Boolean? = null, val requiresBootloaderUpgradeForOta: Boolean? = null, val bootloaderInfoUrl: String? = null, val supportLevel: Int? = null, val tags: List<String>? = null)
Link copied to clipboard
@Serializable
data class DeviceLink(val shortCode: String, val description: String? = null, val isVendor: Boolean = false, val regions: List<String>? = null, val targets: List<String>? = null)

A msh.to device link resolved by the Meshtastic API (/resource/deviceLinks) and cached locally. Every link routes through the msh.to redirect service.

Link copied to clipboard
data class DeviceMetrics(val time: Int = currentTime(), val batteryLevel: Int = 0, val voltage: Float, val channelUtilization: Float, val airUtilTx: Float, val uptimeSeconds: Int)
Link copied to clipboard

Represent the different ways a device can connect to the client.

Link copied to clipboard
value class DeviceVersion(val asString: String) : Comparable<DeviceVersion>

Zero-overhead wrapper providing structured access to parse and compare device version strings.

Link copied to clipboard
data class EnvironmentMetrics(val time: Int = currentTime(), val temperature: Float?, val relativeHumidity: Float?, val soilTemperature: Float?, val soilMoisture: Int?, val barometricPressure: Float?, val gasResistance: Float?, val voltage: Float?, val current: Float?, val iaq: Int?, val lux: Float? = null, val uvLux: Float? = null)
Link copied to clipboard
@Serializable
data class EventFirmwareEdition(val edition: String = "", val displayName: String = "", val welcomeMessage: String = "", val eventStart: String? = null, val eventEnd: String? = null, val timeZone: String? = null, val location: String? = null, val iconUrl: String? = null, val accentColor: String? = null, val links: List<EventFirmwareLink> = emptyList())

Display metadata for one event-specific firmware edition (Hamvention, DEFCON, …).

Link copied to clipboard
@Serializable
data class EventFirmwareLink(val label: String = "", val url: String = "")

A labeled link for an event (website, schedule, map, …).

Link copied to clipboard
@Serializable
data class EventFirmwareResponse(val version: Int = 1, val generatedAt: String? = null, val source: String? = null, val editions: List<EventFirmwareEdition> = emptyList())

Response envelope for event-firmware display metadata. Matches the bundled event_firmware.json and the planned GET /resource/eventFirmware API, sharing the {version, generatedAt, source, <payload>[]} shape used by NetworkDeviceLinksResponse. See schemas/event_firmware.schema.json for the authoring contract.

Link copied to clipboard

Address identifiers for all supported radio backend implementations.

Link copied to clipboard
sealed class MeshActivity

Represents activity on the mesh network.

Link copied to clipboard
data class MeshBeaconOffer(val fromNodeNum: Int, val beacon: MeshBeacon, val snr: Float = 0.0f, val rssi: Int = 0)

A received Mesh Beacon invitation — an advisory, zero-hop advertisement from another mesh offering a channel to join. Beacons are unsigned and originate from nodes outside the local NodeDB, so this is deliberately not a message/contact; it lives in the Discovery surface instead.

Link copied to clipboard
data class MeshLog(val uuid: String, val message_type: String, val received_date: Long, val raw_message: String, val fromNum: Int = 0, val portNum: Int = 0, val fromRadio: FromRadio = FromRadio())

Represents a log entry in shared repository/domain code.

Link copied to clipboard
data class MeshUser(val id: String, val longName: String, val shortName: String, val hwModel: HardwareModel, val isLicensed: Boolean = false, val role: Int = 0)
Link copied to clipboard
data class Message(val uuid: Long, val receivedTime: Long, val node: Node, val text: String, val fromLocal: Boolean, val time: String, val read: Boolean, val status: MessageStatus?, val routingError: Int, val packetId: Int, val emojis: List<Reaction>, val snr: Float, val rssi: Int, val hopsAway: Int, val replyId: Int?, val originalMessage: Message? = null, val viaMqtt: Boolean = false, val relayNode: Int? = null, val relays: Int = 0, val filtered: Boolean = false, val transportMechanism: Int = 0, val xeddsaSigned: Boolean = false, val translatedText: String? = null, val showTranslated: Boolean = false)
Link copied to clipboard
Link copied to clipboard
sealed class MqttConnectionState

App-level MQTT proxy connection state, decoupled from the MQTT library's internal type.

Link copied to clipboard
@Serializable
data class MqttJsonPayload(val type: String, val from: Long, val to: Long? = null, val channel: Int? = null, val payload: String? = null, val hopLimit: Int? = null, val id: Long? = null, val time: Long? = null, val sender: String? = null)
Link copied to clipboard
sealed class MqttProbeStatus

UI-friendly outcome of a one-shot MQTT broker reachability probe.

Link copied to clipboard
data class MyNodeInfo(val myNodeNum: Int, val hasGPS: Boolean, val model: String?, val firmwareVersion: String?, val couldUpdate: Boolean, val shouldUpdate: Boolean, val currentPacketId: Long, val messageTimeoutMsec: Int, val minAppVersion: Int, val maxChannels: Int, val hasWifi: Boolean, val channelUtilization: Float, val airUtilTx: Float, val deviceId: String?, val pioEnv: String? = null)
Link copied to clipboard
@Serializable
data class NetworkDeviceHardware(val activelySupported: Boolean = false, val architecture: String = "", val displayName: String = "", val hasInkHud: Boolean? = null, val hasMui: Boolean? = null, val hwModel: Int = 0, val hwModelSlug: String = "", val images: List<String>? = null, val key: String? = null, val partitionScheme: String? = null, val platformioTarget: String = "", val requiresDfu: Boolean? = null, val supportLevel: Int? = null, val tags: List<String>? = null, val variant: String? = null)
Link copied to clipboard
@Serializable
data class NetworkDeviceLink(val shortCode: String = "", val url: String = "", val description: String? = null, val type: String = TYPE_INTERNAL, val targets: List<String>? = null, val hwModels: List<Int>? = null, val marketplace: String? = null, val regions: List<String>? = null)

A single resolved device link from the Meshtastic API.

Link copied to clipboard
@Serializable
data class NetworkDeviceLinksResponse(val version: Int = 1, val generatedAt: String? = null, val source: String? = null, val links: List<NetworkDeviceLink> = emptyList())

Response envelope of GET /resource/deviceLinks on the Meshtastic API. The server resolves meshtastic/msh.to's catalog into fully-classified links (type + targets + regions), so the client only stores and filters them — no client-side matching heuristic.

Link copied to clipboard
@Serializable
data class NetworkFirmwareRelease(val id: String = "", val pageUrl: String = "", val releaseNotes: String = "", val title: String = "", val zipUrl: String = "")
Link copied to clipboard
@Serializable
data class NetworkFirmwareReleases(val pullRequests: List<NetworkFirmwareRelease> = listOf(), val releases: Releases = Releases())
Link copied to clipboard
data class Node(val num: Int, val metadata: DeviceMetadata? = null, val user: User = User(), val position: Position = Position(), val snr: Float = Float.MAX_VALUE, val rssi: Int = Int.MAX_VALUE, val lastHeard: Int = 0, val deviceMetrics: DeviceMetrics = DeviceMetrics(), val channel: Int = 0, val viaMqtt: Boolean = false, val hopsAway: Int = -1, val isFavorite: Boolean = false, val isIgnored: Boolean = false, val isMuted: Boolean = false, val environmentMetrics: EnvironmentMetrics = EnvironmentMetrics(), val powerMetrics: PowerMetrics = PowerMetrics(), val airQualityMetrics: AirQualityMetrics = AirQualityMetrics(), val paxcounter: Paxcount = Paxcount(), val publicKey: ByteString? = null, val notes: String = "", val powerChannelLabels: List<String> = emptyList(), val manuallyVerified: Boolean = false, val signsPackets: Boolean = false, val nodeStatus: String? = null, val lastTransport: Int = 0)

Domain model representing a node in the mesh network.

Link copied to clipboard
sealed class NodeAddress

Type-safe representation of a mesh node address.

Link copied to clipboard

Controls the visual density of the node list.

Link copied to clipboard
Link copied to clipboard
data class Position(val latitude: Double, val longitude: Double, val altitude: Int, val time: Int = currentTime(), val satellitesInView: Int = 0, val groundSpeed: Int = 0, val groundTrack: Int = 0, val precisionBits: Int = 0)
Link copied to clipboard
open class RadioNotConnectedException(message: String = "Not connected to radio", cause: Throwable? = null) : Exception

Exception thrown when an operation is attempted while not connected to a mesh radio.

Link copied to clipboard
data class Reaction(val replyId: Int, val user: User, val emoji: String, val timestamp: Long, val snr: Float, val rssi: Int, val hopsAway: Int, val packetId: Int = 0, val status: MessageStatus = MessageStatus.UNKNOWN, val routingError: Int = 0, val relays: Int = 0, val relayNode: Int? = null, val to: String? = null, val channel: Int = 0, val sfppHash: ByteString? = null)
Link copied to clipboard

Regulatory regions for radio usage

Link copied to clipboard
data class RegionPresetConstraint(val presets: List<Config.LoRaConfig.ModemPreset>, val defaultPreset: Config.LoRaConfig.ModemPreset, val licensedOnly: Boolean)

The modem presets the firmware advertised as legal for one LoRa region, decoded from a LoRaRegionPresetMap.

Link copied to clipboard
@Serializable
data class Releases(val alpha: List<NetworkFirmwareRelease> = listOf(), val stable: List<NetworkFirmwareRelease> = listOf())
Link copied to clipboard
sealed interface SessionStatus

Durable per-node remote-administration session status, derived from the time of the last admin response that carried a session_passkey from the target node.

Link copied to clipboard
Link copied to clipboard
data class TracerouteOverlay(val requestId: Int, val forwardRoute: List<Int> = emptyList(), val returnRoute: List<Int> = emptyList())

Represents a traceroute result with forward and return routes as ordered lists of node nums.

Properties

Link copied to clipboard

Type-safe interpretation of DataPacket.to.

Link copied to clipboard
val MeshPacket.fullRouteDiscovery: RouteDiscovery?
Link copied to clipboard

Checks whether this packet is addressed to the broadcast channel.

Link copied to clipboard

The @mention wire token: @ followed by a node's hex user id (@!ffccee11). This is the single source of truth for the cross-platform wire format (see meshtastic/design#21) so the compose input, message rendering, and notification paths all detect it identically. The 8-hex run plus the negative lookahead reject a partial match against a longer id.

Link copied to clipboard
val MeshPacket.neighborInfo: NeighborInfo?
Link copied to clipboard
val Config.LoRaConfig.numChannels: Int
Link copied to clipboard
val Config.LoRaConfig.ModemPreset?.snrLimit: Float

The SNR (in dB) at or above which a packet sent with this modem preset can still be demodulated — i.e. the spreading-factor-determined demodulation floor. Signal quality should be judged relative to this limit, since the same SNR means very different things per preset: -15 dB is excellent on LongSlow (SF12) yet unusable on ShortFast (SF7).

Link copied to clipboard

Type-safe interpretation of DataPacket.from.

Functions

Link copied to clipboard
fun LoRaRegionPresetMap?.constraintFor(region: Config.LoRaConfig.RegionCode): RegionPresetConstraint?

Resolves the RegionPresetConstraint the firmware advertised for region, or null when there is no constraint information and the client must therefore NOT restrict the preset list. A null result happens when:

Link copied to clipboard
fun defaultPresetFor(region: Config.LoRaConfig.RegionCode): Config.LoRaConfig.ModemPreset?

The app's preferred default preset for region, or null when it has no region-specific default and the caller should fall back to ChannelOption.DEFAULT / the current preset.

Link copied to clipboard
fun evaluateTracerouteMapAvailability(forwardRoute: List<Int>, returnRoute: List<Int>, positionedNodeNums: Set<Int>): TracerouteMapAvailability
Link copied to clipboard
fun getColorFrom(team: Team): Long
Link copied to clipboard
fun getMessageRoutingErrorStringResFrom(routingError: Int): StringResource
Link copied to clipboard
fun getMessageStatusStringRes(status: MessageStatus?, routingError: Int, isDirectMessage: Boolean = false): Pair<StringResource, StringResource>
Link copied to clipboard
fun MeshPacket.getNeighborInfoResponse(getUser: (nodeNum: Int) -> String, header: String = "Neighbors:"): String?
fun NeighborInfo.getNeighborInfoResponse(getUser: (nodeNum: Int) -> String, header: String = "Neighbors:"): String
Link copied to clipboard
fun getStringResFrom(routingError: Int): StringResource
fun getStringResFrom(role: MemberRole): StringResource
fun getStringResFrom(team: Team): StringResource
Link copied to clipboard
fun MeshPacket.getTracerouteResponse(getUser: (nodeNum: Int) -> String, headerTowards: String = "Route traced toward destination:", headerBack: String = "Route traced back to us:"): String?
fun RouteDiscovery.getTracerouteResponse(getUser: (nodeNum: Int) -> String, headerTowards: String = "Route traced toward destination:", headerBack: String = "Route traced back to us:"): String
Link copied to clipboard
fun DataPacket.isFromLocal(myNodeNum: Int? = null): Boolean

Checks whether this packet originated from the local device.

Link copied to clipboard
fun isMessageStatusRetryable(status: MessageStatus?, routingError: Int, isDirectMessage: Boolean = false): Boolean
Link copied to clipboard
fun Config.DeviceConfig.Role?.isUnmessageableRole(): Boolean
Link copied to clipboard
fun mergePowerChannelLabel(existing: List<String>, channelIndex: Int, label: String): List<String>

Merges a user-editable power-channel label into existing at the 0-based channelIndex.

Link copied to clipboard
fun nodeColorsFromNum(nodeNum: Int): Pair<Int, Int>

Derives a unique color pair from a node number. Returns (foreground, background) as @ColorInt.

Link copied to clipboard
fun LoRaRegionPresetMap?.repairPresetFor(region: Config.LoRaConfig.RegionCode, current: Config.LoRaConfig.ModemPreset): Config.LoRaConfig.ModemPreset

Returns the modem preset the LoRa form should hold for region given the currently-selected current preset.

Link copied to clipboard
fun textMentionsNode(text: String?, userId: String): Boolean

True if text @mentions the node whose hex user id is userId (e.g. !ffccee11), honoring the token boundary — a trailing hex digit (@!ffccee11a) is a different, longer id and is not a match.

Link copied to clipboard

Pure mapping to the cached domain model. Callers are expected to drop TYPE_INTERNAL links (GitHub, YouTube, …), which never belong to a device's purchase section.