KMQTTHandler

class KMQTTHandler(flags: GenericFlags, host: String, port: Int, val mqttPrefix: String, retryPeriod: Long = 500, shutdownDelay: Long = 500) : MqttClientHandler

Constructors

Link copied to clipboard
constructor(flags: GenericFlags, host: String, port: Int, mqttPrefix: String, retryPeriod: Long = 500, shutdownDelay: Long = 500)

Types

Link copied to clipboard
inner class Worker

Properties

Link copied to clipboard
open override val mqttPrefix: String
Link copied to clipboard
open override val name: String

Name of the source

Link copied to clipboard
val retries: Int = 3
Link copied to clipboard
open override val server: String

Functions

Link copied to clipboard
open fun addCallback(callback: (MQTTMessageEntry) -> Unit)
Link copied to clipboard
open override fun close()
Link copied to clipboard
open override fun connect()

Start the MQTT client. The host and port of the message broker are provided as parameters.

Link copied to clipboard
open fun init()

Initialize the meter source.

Link copied to clipboard
open override fun sendMqttMsg(prefix: String, topic: String, content: String)

Simply send a MQTT message, using the provided topic and message payload (string).

Link copied to clipboard
open fun sendStatusEvent(event: StatusEvent)

Asynchronous method for broadcasting MQTT status events.

Link copied to clipboard
open override fun status(): String

Meter source status

Link copied to clipboard
open override fun toString(): String