MQTT: MQTT communication |
Top Previous Next |
The MQTT functions implement the Message Queue Telemetry Transport (MQTT) protocol. MQTT is a open message protocol for M2M communications that enables transfer of telemetry-style data in the form of messages.
The MQTT protocol is based on the principle of publishing messages and subscribing to topics, or "pub/sub". Multiple clients connect to a server and subscribe to topics that they are interested in. Clients also connect to the server and publish messages to topics. Many clients may subscribe to the same topics and do with the information as they please. The server and MQTT act as a simple, common interface for everything to connect to. Please visit www.mqtt.org detailed information on the MQTT protocol.
Unicode Support for Unicode strings are included in the MQTT API, which means that text (topics, username, etc.) can be in the local language rather than in English. For more information, please refer to mqttOpen. Unicode strings uses UTF-8 encoding.
Topic Topics are treated as a hierarchy, using slash (/) as a separator. This allows sensible arrangement of common themes to be created, much in the same way as a file system. For example, multiple RTCU devices may publish their temperature information on the following topic:
RTCU/222135115/temperature
where 222135115 is the serial number of the RTCU device.
Quality of Service (QoS) The MQTT protocol supports 3 levels of QoS:
Last Will and Testament (LWT) When the RTCU connects to a server, it may inform the server that it has a will. This is a message that it wishes the server to send when it disconnects unexpectedly.
Limitations •Up to 10 received messages are buffered for removal by the application. •Maximum of 3 messages inflight from the server.This is the maximum number of QoS 2 messages that are not fully acknowledged. •Maximum size of message: oX32 architecture: 1024 bytes, oNX32 architecture: 4096 bytes. oNX32L architecture: 16384 bytes.
|