Package-level declarations

Types

Link copied to clipboard
object ByteStringParceler : CommonParceler<ByteString?>

Parceler for Okio ByteString for Android Parcelable support

Link copied to clipboard
object ByteStringSerializer : KSerializer<ByteString>

Serializer for Okio ByteString using kotlinx.serialization

Link copied to clipboard
Link copied to clipboard

Common geographic constants for coordinate conversions.

Link copied to clipboard

Exception thrown when a Meshtastic URL cannot be parsed.

Link copied to clipboard
open class MeshDataMapper(nodeIdLookup: NodeIdLookup)

Utility class to map MeshPacket protobufs to DataPacket domain models.

Link copied to clipboard
interface NodeIdLookup

Interface for looking up Node IDs from Node Numbers.

Link copied to clipboard
object SfppHasher

Computes SFPP (Store-Forward-Plus-Plus) message hashes for deduplication.

Link copied to clipboard

Common time-related constants.

Link copied to clipboard

Properties

Link copied to clipboard

When printing strings to logs sometimes we want to print useful debugging information about users or positions. But we don't want to leak things like usernames or locations. So this function if given a string, will return a string which is a maximum of three characters long, taken from the tail of the string. Which should effectively hide real usernames and locations, but still let us see if values were zero, empty or different.

Link copied to clipboard

Path segment for Channel Set URIs.

Link copied to clipboard

Full prefix for Channel Set URIs: https://meshtastic.org/e/

Link copied to clipboard

Path segment for Shared Contact URIs.

Link copied to clipboard

Full prefix for Shared Contact URIs: https://meshtastic.org/v/#

Link copied to clipboard
const val isDebug: Boolean = false

Whether the app is running in debug mode.

Link copied to clipboard

The base domain for all Meshtastic URIs.

Link copied to clipboard
val ChannelSet.primaryChannel: Channel?

Return the primary channel info

Link copied to clipboard
val ChannelSet.subscribeList: List<String>

Functions

Link copied to clipboard
fun Any?.anonymize(maxLen: Int = 3): String

A version of anonymize that allows passing in a custom minimum length

Link copied to clipboard
fun String.base64ToByteString(): ByteString

Decodes a Base64 string into a ByteString.

Link copied to clipboard
fun byteArrayOfInts(vararg ints: Int): ByteArray

Utility function to make it easy to declare byte arrays

Link copied to clipboard
fun compareUsers(oldUser: User, newUser: User): String

Compares two User objects and returns a string detailing the differences.

Link copied to clipboard
fun <T : Message<T, *>> ProtoAdapter<T>.decodeOrNull(bytes: ByteArray?, logger: Logger? = null): T?

Safely decode a proto message from ByteArray, returning null on error.

fun <T : Message<T, *>> ProtoAdapter<T>.decodeOrNull(bytes: ByteString?, logger: Logger? = null): T?
Link copied to clipboard
fun Uri.dispatchMeshtasticUri(onChannel: (ChannelSet) -> Unit, onContact: (SharedContact) -> Unit, onInvalid: () -> Unit)

Bridge extension for Android clients.

fun CommonUri.dispatchMeshtasticUri(onChannel: (ChannelSet) -> Unit, onContact: (SharedContact) -> Unit, onInvalid: () -> Unit)

Tries to parse a Meshtastic URI as a Channel Set or Shared Contact, including fallback logic.

Link copied to clipboard
fun ByteString.encodeToString(): String
Link copied to clipboard
fun formatMuteRemainingTime(remainingMillis: Long): Pair<Int, Double>

Calculates the remaining mute time in days and hours.

Link copied to clipboard
fun formatUptime(seconds: Int): String

Formats a duration in seconds as a human-readable uptime string (e.g., "1d 2h 3m 4s").

Link copied to clipboard
fun ChannelSet.getChannel(index: Int): Channel?
Link copied to clipboard
fun ChannelSet.getChannelUrl(upperCasePrefix: Boolean = false, shouldAdd: Boolean = false): CommonUri

Return a URL that represents the ChannelSet

Link copied to clipboard
fun getInitials(fullName: String): String

Given a human name, strip out the first letter of the first three words and return that as the initials for that user, ignoring emojis. If the original name is only one word, strip vowels from the original name and if the result is 3 or more characters, use the first three characters. If not, just take the first 3 characters of the original name.

Link copied to clipboard
fun SharedContact.getSharedContactUrl(): CommonUri

Converts a SharedContact to its corresponding URI representation.

Link copied to clipboard
expect fun getShortDateTime(time: Long): String

Returns a short string representing the time if it's within the last 24 hours, otherwise returns a combined short date/time string.

actual fun getShortDateTime(time: Long): String

Returns a short string representing the time if it's within the last 24 hours, otherwise returns a combined short date/time string.

Link copied to clipboard
fun handleMeshtasticUri(uri: CommonUri, onChannel: (CommonUri) -> Unit = {}, onContact: (CommonUri) -> Unit = {}): Boolean

Dispatches an incoming Meshtastic URI to the appropriate handler based on its path.

Link copied to clipboard
fun ChannelSet.hasLoraConfig(): Boolean
Link copied to clipboard

Returns true if this telemetry packet contains valid, plot-able environment metrics.

Link copied to clipboard
fun MeshPacket.isDirectSignal(): Boolean

Returns true if this packet is a direct LoRa signal (not MQTT, and hop count matches).

Link copied to clipboard
fun MeshPacket.isLora(): Boolean

Returns true if this packet arrived via a LoRa transport mechanism.

Link copied to clipboard
fun <T : Message<T, *>> ProtoAdapter<T>.isWithinSizeLimit(message: T, maxBytes: Int): Boolean

Check if an encoded message would fit within a size limit.

Link copied to clipboard
fun <T : Message<T, *>> ProtoAdapter<T>.logMessage(message: T, logger: Logger, prefix: String = "")

Log a proto message with readable formatting.

Link copied to clipboard
fun Int.metersIn(system: Config.DisplayConfig.DisplayUnits): Float
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
expect fun platformRandomBytes(size: Int): ByteArray
actual fun platformRandomBytes(size: Int): ByteArray
Link copied to clipboard
Link copied to clipboard
fun <T : Message<T, *>> ProtoAdapter<T>.sizeInBytes(message: T): Int

Get the estimated encoded size of a message in bytes.

Link copied to clipboard
fun Uri.toChannelSet(): ChannelSet

Bridge extension for Android clients.

fun CommonUri.toChannelSet(): ChannelSet

Return a ChannelSet that represents the ChannelSet encoded by the URL.

Link copied to clipboard

Extension to bridge android.net.Uri to CommonUri for shared dispatch logic.

Link copied to clipboard
fun Int.toDistanceString(system: Config.DisplayConfig.DisplayUnits): String
Link copied to clipboard
Link copied to clipboard
fun <T : Message<T, *>> ProtoAdapter<T>.toOneLiner(message: T): String

Get a compact single-line string representation for JSON/API serialization.

Link copied to clipboard
fun Channel.toOneLineString(): String
fun Config.toOneLineString(): String
fun MeshPacket.toOneLineString(): String
fun ModuleConfig.toOneLineString(): String
fun MyNodeInfo.toOneLineString(): String
Link copied to clipboard
Link copied to clipboard

Generates a POSIX time zone string from a ZoneId. Uses the specification found here.

@RequiresApi(value = 26)
fun TimeZone.toPosixString(): String

Generates a POSIX time zone string from a TimeZone.

Link copied to clipboard
fun <T : Message<T, *>> ProtoAdapter<T>.toReadableString(message: T): String

Convert a proto message to a pretty-printed string representation.

Link copied to clipboard
fun Uri.toSharedContact(): SharedContact

Bridge extension for Android clients.

fun CommonUri.toSharedContact(): SharedContact

Return a SharedContact that represents the contact encoded by the URL.

Link copied to clipboard
fun Float.toSmallDistanceString(system: Config.DisplayConfig.DisplayUnits): String
Link copied to clipboard
fun Float.toSpeedString(system: Config.DisplayConfig.DisplayUnits): String
Link copied to clipboard
fun Float.toString(system: Config.DisplayConfig.DisplayUnits): String
Link copied to clipboard
fun userFieldsToString(user: User): String

Converts a User object to a string representation of its fields and values.

Link copied to clipboard
Link copied to clipboard