Companion

Properties

Link copied to clipboard
const val TIER_ELSEWHERE: Int = 2
Link copied to clipboard
const val TIER_NEARBY: Int = 1
Link copied to clipboard
const val TIER_OWN_AREA: Int = 0

Functions

Link copied to clipboard

The activity recorded for a topic, with the spelling the broker used: the topic's own spelling when the broker carries it, otherwise the lowest case-insensitive match, so a row does not flip between variants from one snapshot to the next.

Link copied to clipboard
fun build(regionName: String, place: GeocodedPlace?, at: LatLon?, directory: MqttRootDirectory, activity: Map<String, MqttTopicDiscovery.Activity> = emptyMap()): TopicPlan

Region, then the country when the sample shows the broker uses it, then subdivision and city, then the community roots that serve the place. Each ladder rung is trimmed from the end of its last segment to fit the byte cap; a rung that empties is dropped with everything below it. Rebuilt as activity grows.

Link copied to clipboard
fun segment(place: String, lowercased: Boolean): String?

Letters and digits in any script kept as they are (æ, ø, å, ü, 東京), _ and - kept, anything else dropped, lowercased when asked. Subdivisions keep their case ("WA"); cities follow the community's lowercase convention. Null when nothing is left. Communities write their roots in their own letters (msh/EU_868/NO/Østlandet), so a suggestion does the same rather than folding to ASCII.