Package-level declarations

Types

Link copied to clipboard
interface AdminApi

Device configuration and control RPCs.

Link copied to clipboard
interface AdminEdit

Receiver type for AdminApi.editSettings — exposes the subset of admin writes that may be batched inside a begin_edit_settings / commit_edit_settings envelope.

Link copied to clipboard
sealed interface AdminResult<out T>

Result of an admin (configuration) RPC operation.

Link copied to clipboard
data class AutoReconnectConfig(val enabled: Boolean = true, val initialBackoff: Duration = 1.seconds, val maxBackoff: Duration = 60.seconds, val maxAttempts: Int? = null, val backoffMultiplier: Double = 2.0, val jitter: Double = 0.2)

Tunables for the engine's built-in auto-reconnect supervisor.

Link copied to clipboard
data class BatteryStatus(val percent: Int?, val voltageVolts: Float?, val pluggedIn: Boolean)

Curated battery health and state information.

Link copied to clipboard
value class ChannelIndex(val raw: Int)

Type-safe wrapper for channel indices.

Link copied to clipboard
object ChannelUrl

Static helpers for encoding and parsing Meshtastic channel URLs (https://meshtastic.org/e/#...).

Link copied to clipboard
data class ConfigBundle(val myInfo: MyNodeInfo, val metadata: DeviceMetadata, val configs: List<Config>, val moduleConfigs: List<ModuleConfig>)

Aggregate of configuration and device metadata received during the handshake.

Link copied to clipboard

Handshake phase for progress reporting.

Link copied to clipboard
sealed interface ConnectionState

Lifecycle of the SDK's connection to a device.

Link copied to clipboard

Device storage backend.

Link copied to clipboard

Which flow type dropped messages.

Link copied to clipboard
data class Frame(val bytes: ByteString)

A framed packet ready for transmission or received from the device.

Link copied to clipboard

Key-verification prompt details surfaced via MeshEvent.KeyVerification.

Link copied to clipboard
data class LatLng(val latitude: Double, val longitude: Double, val altitudeMeters: Int? = null)

A geographic coordinate pair with an optional altitude.

Link copied to clipboard

Severity level for log messages.

Link copied to clipboard
fun interface LogSink

Functional interface for consuming log messages.

Link copied to clipboard
sealed interface MeshEvent

Side-channel event from the SDK engine.

Link copied to clipboard
annotation class MeshSendDsl

DSL marker for the SendBuilder outbound-packet builder. Restricts implicit-receiver scoping so that nested DSLs do not accidentally capture builder methods from an outer scope.

Link copied to clipboard

Sealed hierarchy of Meshtastic SDK exceptions.

Link copied to clipboard

Tracks the lifecycle of a packet enqueued via RadioClient.send.

Link copied to clipboard
value class MessageId(val raw: Int)

Type-safe wrapper for message/packet IDs (uint32).

Link copied to clipboard
sealed interface NodeChange

A delta notification of node state changes.

Link copied to clipboard

Fields that may change in a NodeInfo.

Link copied to clipboard
value class NodeId(val raw: Int)

Type-safe wrapper for Meshtastic node identifiers (uint32).

Link copied to clipboard
interface PayloadRedactor

Strategy for redacting sensitive payload data in protocol logs.

Link copied to clipboard

The main entry point to the Meshtastic SDK.

Link copied to clipboard
data class RadioMetrics(val rssiDbm: Int, val snrDb: Float, val hopsAway: Int?, val viaMqtt: Boolean)

Physical layer metrics for a received packet.

Link copied to clipboard
interface RadioTransport

Interface that transports (BLE, TCP, serial, etc.) must implement.

Link copied to clipboard
interface RoutingApi

Mesh route discovery and neighbor enumeration RPCs.

Link copied to clipboard

Builder for an outbound MeshPacket. Created by RadioClient.send (DSL form).

Link copied to clipboard
sealed interface SendFailure

Reason a packet could not be delivered.

Link copied to clipboard
sealed interface SendOutcome

Outcome of awaiting a MessageHandle.

Link copied to clipboard
sealed interface SendState

Lifecycle state of a packet sent via RadioClient.send.

Link copied to clipboard
data class SessionPasskey(val bytes: ByteString, val expiresAtEpochMs: Long)

Persisted session passkey.

Link copied to clipboard
interface StorageProvider

Storage provider factory.

Link copied to clipboard
interface TelemetryApi

Telemetry RPCs and observation.

Link copied to clipboard
sealed class TelemetryReading

A type-safe wrapper for the different categories of telemetry data reported by the mesh.

Link copied to clipboard
value class TransportIdentity(val raw: String)

Deterministic identity for a transport configuration.

Link copied to clipboard
sealed interface TransportSpec

Specification of which radio to connect to and how.

Link copied to clipboard
sealed interface TransportState

State of the transport connection.

Link copied to clipboard
object WireCodec

Pure codec for wire framing and protobuf serialization.

Link copied to clipboard

Single source of truth for the Meshtastic STREAM_API wire-framing constants shared by every stream-oriented transport (TCP, USB-CDC serial, BLE).

Properties

Link copied to clipboard
const val DATA_PAYLOAD_LEN: Int = 233

Maximum application-layer payload length (bytes).

Link copied to clipboard

The default Pre-Shared Key (AES-128) used for the Meshtastic primary channel.

Link copied to clipboard
val NodeInfo.displayId: String

Returns the display-friendly hex ID of this node (e.g., "!aabbccdd").

Link copied to clipboard
val HardwareModel.displayName: String

Returns a human-friendly display name for this HardwareModel (e.g., "T-Beam").

Link copied to clipboard

Returns true if this is NodeId.BROADCAST.

Link copied to clipboard

Returns true if this is a specific node address (neither local nor broadcast).

Link copied to clipboard
val NodeInfo.longName: String

Returns the long name of this node (e.g., "James Arich").

Link copied to clipboard
val NodeInfo.shortName: String

Returns the short name of this node (e.g., "ABCD").

Functions

Link copied to clipboard
fun Routing.Error.actionableMessage(): String

Human-readable, action-hinting message for a wire-level Routing.Error. Suitable for direct surfacing in logs, snackbars, or developer tools without further translation.

Link copied to clipboard
fun MeshPacket.asAdminMessage(): AdminMessage?

Decodes the payload as AdminMessage if MeshPacket.decoded.portnum matches PortNum.ADMIN_APP.

Link copied to clipboard
fun MeshPacket.asNodeInfo(): NodeInfo?

Decodes the payload as NodeInfo if MeshPacket.decoded.portnum matches PortNum.NODEINFO_APP.

Link copied to clipboard
fun MeshPacket.asNodeInfoUser(): User?

Decodes the payload as User if MeshPacket.decoded.portnum matches PortNum.NODEINFO_APP.

Link copied to clipboard
fun MeshPacket.asPosition(): Position?

Decodes the payload as Position if MeshPacket.decoded.portnum matches PortNum.POSITION_APP.

Link copied to clipboard
fun MeshPacket.asRouting(): Routing?

Decodes the payload as Routing if MeshPacket.decoded.portnum matches PortNum.ROUTING_APP.

Link copied to clipboard
fun MeshPacket.asTelemetry(): Telemetry?

Decodes the payload as Telemetry if MeshPacket.decoded.portnum matches PortNum.TELEMETRY_APP.

Link copied to clipboard
fun MeshPacket.asText(): String?

Decodes the payload as a UTF-8 string if MeshPacket.decoded.portnum matches PortNum.TEXT_MESSAGE_APP.

Link copied to clipboard
suspend fun RadioClient.awaitInitialNodeDb(): Map<NodeId, NodeInfo>

Suspend until the device finishes streaming its NodeDB during handshake, then return the current node-snapshot map.

Link copied to clipboard
suspend fun RadioClient.connectAndAwaitReady(timeout: Duration = 30.seconds): ConfigBundle

Connect and suspend until the handshake settles, returning the resolved ConfigBundle (HLP-34).

Link copied to clipboard
fun <T : Message<T, *>> MeshPacket.decodeAs(adapter: ProtoAdapter<T>): T?

Decode this packet's decoded.payload using the supplied Wire adapter.

Link copied to clipboard
fun MeshPacket.decodeAsAdmin(): AdminMessage?

Decode the payload as AdminMessage iff decoded.portnum == ADMIN_APP.

Link copied to clipboard
fun MeshPacket.decodeAsNodeInfo(): NodeInfo?

Decode the payload as a full NodeInfo iff decoded.portnum == NODEINFO_APP.

Link copied to clipboard
fun MeshPacket.decodeAsPosition(): Position?

Decode the payload as a Position iff decoded.portnum == POSITION_APP.

Link copied to clipboard
fun MeshPacket.decodeAsRouting(): Routing?

Decode the payload as Routing iff decoded.portnum == ROUTING_APP.

Link copied to clipboard
fun MeshPacket.decodeAsTelemetry(): Telemetry?

Decode the payload as Telemetry iff decoded.portnum == TELEMETRY_APP.

Link copied to clipboard
fun MeshPacket.decodeAsText(): String?

Decode the payload as UTF-8 text iff decoded.portnum == TEXT_MESSAGE_APP.

Link copied to clipboard
fun MeshPacket.decodeAsUser(): User?

Decode the payload as a User (NodeInfo user record) iff decoded.portnum == NODEINFO_APP.

Link copied to clipboard
fun Channel.Companion.default(): Channel

Returns a standard PRIMARY Channel configuration (index 0, empty name, default PSK).

Link copied to clipboard

Converts a 32-bit unsigned firmware timestamp (seconds since epoch) to an SDK Instant. Returns null if the timestamp is 0 (the firmware's "never/unset" sentinel).

Link copied to clipboard

Parses an 8-character hex string (optionally prefixed with ! or 0x) into a NodeId. Returns null if the string is not a valid 8-character hex value.

Link copied to clipboard
fun ChannelSettings.Companion.hash(name: String, psk: ByteArray): Int

Computes the 8-bit hash of name and psk, used by firmware to identify channels on the wire.

Link copied to clipboard

Plain-language message for any SendFailure. Never empty.

Link copied to clipboard
fun NodeId.isLocal(own: NodeId? = null): Boolean

Returns true if this is NodeId.LOCAL or matches the supplied own ID. Useful for filtering packets originating from the host.

Link copied to clipboard
fun Instant.relativeTo(now: Instant = Clock.System.now()): String

Returns a human-friendly relative time string (e.g., "5m ago", "2h ago").

Link copied to clipboard
fun Instant?.relativeToOrNever(now: Instant = Clock.System.now()): String

Returns a relative time string, or "never" if the instant is null.

Link copied to clipboard
fun RadioClient.requestPosition(from: NodeId, channel: ChannelIndex = ChannelIndex(0)): MessageHandle

Request the current Position from node from.

Link copied to clipboard

Re-enqueue the same packet that produced this MessageHandle. The engine assigns a fresh MessageId and returns a new handle, leaving the original handle's terminal state unchanged.

Link copied to clipboard
suspend fun RadioClient.send(block: SendBuilder.() -> Unit): MessageHandle

DSL form of RadioClient.send. Builds a MeshPacket via SendBuilder and enqueues it.

Link copied to clipboard
suspend fun RadioClient.sendDirectMessage(to: NodeId, text: String, channel: ChannelIndex = ChannelIndex(0), wantAck: Boolean = true): MessageHandle

Send a unicast text message to to. Defaults wantAck to true.

Link copied to clipboard

Send a PKI-encrypted unicast text message to to.

Link copied to clipboard
suspend fun RadioClient.sendPosition(latLng: LatLng, to: NodeId = NodeId.BROADCAST, channel: ChannelIndex = ChannelIndex(0), wantAck: Boolean = false): MessageHandle

Send a Position payload to to (defaults to broadcast).

Link copied to clipboard
fun MeshPacket.signalQuality(): Int?

Returns a signal quality estimate from 1 (poor) to 5 (excellent) based on SNR.

Link copied to clipboard
fun Routing.Error.suggestedAction(): String?

Tag categorising the recommended remediation for a Routing.Error. Returns null when no error was reported (NONE).

Link copied to clipboard
fun DeviceMetrics.toBatteryStatus(): BatteryStatus?

Converts protobuf DeviceMetrics to BatteryStatus.

fun Telemetry.toBatteryStatus(): BatteryStatus?

Converts protobuf Telemetry to BatteryStatus by inspecting its DeviceMetrics.

Link copied to clipboard
fun FromRadio.toByteArray(): ByteArray

Encode this FromRadio envelope to its wire byte representation.

fun MeshPacket.toByteArray(): ByteArray

Encode this MeshPacket to its wire byte representation.

fun ToRadio.toByteArray(): ByteArray

Encode this ToRadio envelope to its wire byte representation.

Link copied to clipboard

Converts an SDK Instant to a 32-bit unsigned firmware timestamp.

Link copied to clipboard
fun ByteArray.toFromRadio(): FromRadio?

Decode a FromRadio envelope from raw wire bytes. Returns null on parse failure.

Link copied to clipboard

Returns the 8-character hex representation of this NodeId (e.g., "aabbccdd"). Does not include the ! or 0x prefix.

Link copied to clipboard
fun Position.toLatLng(): LatLng?

Converts a protobuf Position to an SDK LatLng.

Link copied to clipboard
fun ByteArray.toMeshPacket(): MeshPacket?

Decode a MeshPacket from raw wire bytes. Returns null if this is not a valid MeshPacket proto encoding (any decoding Throwable is swallowed).

Link copied to clipboard
fun MeshPacket.toRadioMetrics(): RadioMetrics?

Extracts RadioMetrics from a MeshPacket. Returns null if metrics are missing.

Link copied to clipboard
fun Telemetry.toReading(): TelemetryReading?

Maps a protobuf Telemetry packet to its corresponding type-safe TelemetryReading.

Link copied to clipboard
fun ByteArray.toToRadio(): ToRadio?

Decode a ToRadio envelope from raw wire bytes. Returns null on parse failure.

Link copied to clipboard
fun ChannelSet.toUrl(): String

Converts this ChannelSet into a base64-url-safe Meshtastic share link.