Package-level declarations
Types
EPA NowCast + AQI breakpoint math for PM2.5, per meshtastic/design#54.
How a received Mesh Beacon invitation can be joined, given the connected radio's current settings.
Serializer for Okio ByteString using kotlinx.serialization
Semantic channel identity based on the effective name and effective PSK.
One conversation re-key. displayName is the effective channel name at the time of the change, kept so a retired conversation can still be labelled once its slot belongs to someone else.
A normalized authoritative channel set and the complete radio writes needed to materialize it.
Where a broadcast conversation's messages live: a configured channel slot, or parked under a retired identity.
Common geographic constants for coordinate conversions.
Exception thrown when a Meshtastic URL cannot be parsed.
Utility class to map MeshPacket protobufs to DataPacket domain models.
Interface for looking up Node IDs from Node Numbers.
Computes SFPP (Store-Forward-Plus-Plus) message hashes for deduplication.
Common time-related constants.
Properties
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.
Hex characters of the identity digest kept in a retired contact key.
Firmware channel files expose eight slots: one primary plus up to seven secondary channels.
Path segment for Channel Set URIs.
Full prefix for Channel Set URIs: https://meshtastic.org/e/
Path segment for Shared Contact URIs.
Full prefix for Shared Contact URIs: https://meshtastic.org/v/#
The bit depths firmware degrades a shared position to.
The base domain for all Meshtastic URIs.
How recently a node must have been heard to count as online, in seconds.
Return the primary channel info
Round Pushpin (📍) — the default waypoint icon, and the fallback for an unusable code point.
Channel count for the per-channel EnvironmentMetrics telemetry fields — one_wire_temperature_ch0..ch7 and adc_voltage_ch0..ch7.
Functions
Decodes a Base64 string into a ByteString.
Decides whether a beacon can be joined by simply adding its channel (no reboot) or requires a switch (retune + reboot). Adding works only when the offered mesh sits on the radio's current frequency slot — Meshtastic secondary channels ride the primary channel's frequency, so the offered channel must resolve (name-hash) to the same slot the radio's primary is on, under a matching preset and region. Mirrors the Apple 014-mesh-beacons FR-016/FR-017 logic.
Utility function to make it easy to declare byte arrays
Resolves this setting's semantic identity under loraConfig.
Compares two User objects and returns a string detailing the differences.
Bridge extension for Android clients.
Tries to parse a Meshtastic URI as a Channel Set or Shared Contact, including fallback logic.
The first Unicode code point in this string, combining a surrogate pair into the single value it encodes.
Calculates the remaining mute time in days and hours.
Formats a duration in seconds as a human-readable uptime string (e.g., "1d 2h 3m 4s").
Return a URL that represents the ChannelSet
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.
Converts a SharedContact to its corresponding URI representation.
Returns a short string representing the time if it's within the last 24 hours, otherwise returns a combined short date/time string.
Returns a short string representing the time if it's within the last 24 hours, otherwise returns a combined short date/time string.
Returns true if this telemetry packet contains valid, plot-able environment metrics.
True when this beacon's offered channel is already configured on the radio; see ChannelSettings.isAlreadyJoined.
True when this is a channel the radio already has configured (design#140 behavior 10). Null currentLora or an empty currentChannels means "can't tell" and returns false, never hiding a still-relevant invitation on missing data. Comparison uses resolved ChannelIdentity (effective name plus expanded PSK) so a blank-name primary or a short-code PSK still matches; differing PSK under an identical name is deliberately not a match, since same name with a different key is a different mesh. Secondary slots are skipped when isChannelPlaceholder (blank name, no PSK): SwitchingChannelSetDataSource pads a gap left by a removed channel with a bare ChannelSettings, and those placeholders are read back unfiltered here, so without this exclusion a beacon offering a genuinely blank/cleartext channel would misclassify a padding slot as a real match. The primary slot (index 0) is never skipped: it always represents a real channel, matching the same convention in normalizeReplacementSettings.
True when these settings carry no name and no PSK, making them padding rather than an intended channel.
Returns true if this packet is a direct LoRa signal (not MQTT, and hop count matches).
OTA-status detector matching the firmware update preflight gate's criterion: any ClientNotification whose message contains "OTA" as a whole word (e.g. "Rebooting to BLE OTA", "Cannot start OTA: ...") is consumed by the firmware update flow and suppressed as a generic alert. Uses word-boundary matching so unrelated messages containing the substring (e.g. "ROTATE", "QUOTA") are not misclassified.
Whether this is a Unicode scalar value: within the code point range and not an unpaired surrogate.
Converts a speed already expressed in km/h (e.g. protobuf Position.ground_speed) to system's unit, rounded to a whole number. Callers render the result through a localized string resource so the unit label itself stays translatable (see speed_kmh/speed_mph).
Normalizes replacement settings so firmware only materializes real, distinct channels.
Index-to-field accessors for the per-channel telemetry fields.
Radius, in metres, of the uncertainty circle a firmware precision_bits implies, or null when the position is not degraded.
Arrival time in epoch seconds, or null when the radio had no clock at reception.
Produces the canonical authoritative replacement plan used by every full channel-set import path.
Bridge extension for Android clients.
Return a ChannelSet that represents the ChannelSet encoded by the URL.
Renders this Unicode code point as a string, substituting fallback when the value is not a usable scalar value.
Extension to bridge android.net.Uri to CommonUri for shared dispatch logic.
Formats a distance in metres for display, choosing the unit from the magnitude.
Formats an altitude/elevation in metres for display, in the whole metres or feet of system.
Builds the ChannelSet to hand the QR channel-import dialog for a given option.
Generates a POSIX time zone string from a TimeZone.
Bridge extension for Android clients.
Return a SharedContact that represents the contact encoded by the URL.
The SharedContact to encode for node.
Whole units for the small denominations, one decimal for the large ones — a node 1.2 km away, not 1.234 km.
Converts a User object to a string representation of its fields and values.
The icon to render for a waypoint, where 0 on the wire means "unset" and selects PUSHPIN_CODE_POINT.
Lifts the deprecated repeated one_wire_temperature list onto the per-channel fields, for telemetry stored before firmware 2.8 moved to one_wire_temperature_chN.