Method is used to add MqttSessionListener class element
which will notify about MQTT session connection state changes.
Note: Do not forget to remove listener if it is no longer needed!
listener Corresponding MqttSessionListener class.
Method is used to connect to MQTT broker and start publishing position data.
server MQTT broker server hostname or IP address.
port MQTT broker server port.
username MQTT broker username for authentication.
password MQTT broker password for authentication.
Method is used to publish a custom message to a specified MQTT topic.
The message will be sent asynchronously and the result will be notified through
Note: The MQTT session must be connected before calling this method. Use connect method first.
MqttSessionListener callbacks (onMessagePublished for success, onError for failure).
topic MQTT topic to publish the message to. Can be any valid MQTT topic string.
message Message content to publish. Can be any string (JSON, plain text, etc.).
Method is used to set MQTT sub-topic for publishing position data.
The final topic will be "navigine/mobile/positions/" + subTopic + "/" + deviceId.
subTopic MQTT sub-topic for publishing position data. Must match pattern 0-9a-zA-Z_-+ and cannot be empty.