MqttRootTopic

The root topic rules the firmware and broker impose.

Types

Link copied to clipboard

Properties

Link copied to clipboard
const val BYTE_CAP: Int = 31

The firmware's buffer: 31 UTF-8 bytes plus the terminator.

Functions

Link copied to clipboard
fun hasPrefix(root: String, prefix: String): Boolean

Segment-wise, case-insensitive prefix: "msh/US/WA" prefixes "msh/US/WA/seattle" but not "msh/US/WAX".

Link copied to clipboard

Whether root holds an MQTT wildcard, which makes every filter built under it invalid.

Link copied to clipboard

Whether name can be interpolated into a topic filter without adding a level or a wildcard.

Link copied to clipboard
fun isUnder(root: String, topic: String): Boolean

Whether topic is root, a "/" and a non-empty remainder, with no wildcard. root is compared as typed.

Link copied to clipboard

First rule broken, in enum order; null when the radio accepts the root as typed.

Link copied to clipboard
Link copied to clipboard
fun sanitized(text: String): String

Whitespace trimmed at both ends, runs of "/" collapsed to one, one trailing "/" dropped.

Link copied to clipboard
fun segments(root: String): List<String>

Split on "/", each segment trimmed, empties dropped.