Package-level declarations

Types

Link copied to clipboard
data class LatLon(val latitude: Double, val longitude: Double)
Link copied to clipboard
data class MqttRootDirectory(val entries: List<MqttRootEntry>, val neighbors: Map<String, Set<String>>, val subdivisionSegments: Map<String, Map<String, String>>)

The geography a sample cannot learn on its own: named community roots, which subdivisions border which, and the code a geocoder's subdivision name maps to.

Link copied to clipboard
data class MqttRootEntry(val root: String, val name: String, val subdivisions: Set<String> = emptySet(), val center: LatLon? = null, val radiusKm: Double? = null)

A community root whose name says nothing about where it is ("msh/US/DMV", "msh/US/MeshSTL"), with the area it serves. Subdivisions are ISO 3166-2 ("US-VA"); a metro mesh may give a center and radius instead or as well.

Link copied to clipboard

The root topic rules the firmware and broker impose.

Link copied to clipboard

Broker topic strings and map-report payloads turned into per-root activity.

Link copied to clipboard
class MqttTopicSampler(clientFactory: (ModuleConfig.MQTTConfig?) -> TopicSamplerClient = ::defaultSamplerClient, duration: Duration = DEFAULT_DURATION, connectDeadline: Duration = 15.seconds, subscribeDeadline: Duration = 10.seconds, timeSource: TimeSource = TimeSource.Monotonic)

A subscribe-only broker connection that listens for a fixed time and tallies the roots it hears. Every topic it sees is location-derived, so nothing here logs a topic, root or count tied to one.

Link copied to clipboard
data class RankedRoot(val root: String, val activity: MqttTopicDiscovery.Activity, val tier: Int, val distanceMeters: Double?)
Link copied to clipboard
data class TopicPlan(val suggestions: List<TopicSuggestion>, val neighborRoots: List<String>)

The topics worth offering for a place, and every other heard root ordered by how near it is likely to be.

Link copied to clipboard

The slice of an MQTT client a sample needs, so tests can drive the sampler without a broker.

Link copied to clipboard
data class TopicSuggestion(val kind: TopicSuggestion.Kind, val topic: String, val placeName: String)