MqttFrameMetadata

MQTT topic/qos/retained metadata carried in SocketMessage.contentType rather than as new fields on SocketMessage -- see the design spec's "MQTT capture reuses the socket pipeline" section. The encoding is hand-rolled and dependency-free (no JSON/URL-encoding library pulled into sdk:socket just for this): "application/mqtt; topic=<enc>; qos=<n>; retained=<bool>", where <enc> escapes only the three characters that would otherwise break this format's own delimiters.

Every parser here is fail-soft: malformed input, a non-MQTT content type, or null all return null rather than throw, matching this module's fail-open recording discipline.

Properties

Link copied to clipboard
const val CONTENT_TYPE: String

Functions

Link copied to clipboard
fun format(topic: String, qos: Int = 0, retained: Boolean = false): String
Link copied to clipboard
fun isMqtt(contentType: String?): Boolean
Link copied to clipboard
fun qos(contentType: String?): Int?
Link copied to clipboard
fun retained(contentType: String?): Boolean?
Link copied to clipboard
fun topic(contentType: String?): String?