[go: up one dir, main page]

Skip to content

CommsChampion Ecosystem MQTT-SN client / gateway libraries and applications

License

Notifications You must be signed in to change notification settings

commschamp/cc.mqttsn.libs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Overview

The MQTT-SN protocol is a sibling of MQTT. While MQTT is designed to be used over a reliable stream transport protocol (such as TCP/IP), the MQTT-SN was designed to be used over a datagram transport protocol. It means, that if a message is received by the other end on the communication link, it is received in full and correctly.

There are multiple implementations of MQTT-SN client libraries and/or gateway applications. Most of them support only UDP/IP and/or ZigBee transport layers. However, it is possible to use MQTT-SN protocol with any other I/O link, such as RS-232 serial or CAN bus, as long as additional "packatisation" of the native MQTT-SN message is provided, to insure the message is delivered in full and without errors.

This repository provides single threaded, asynchronous, non-blocking, easy to use, suitable for embedded platforms, well documented libraries of MQTT-SN client and gateway, which are completely generic and allow usage of MQTT-SN protocol over any I/O link. See details below.

Client Library

This repository provides the MQTT-SN client library. It is implemented using C++(17) programming language, but provides C interface. The library's code doesn't use RTTI or exceptions. By default the library's implementation uses C++ STL data types, such as std::string and std::vector. However, it is possible to compile the library not to use any dynamic memory allocation, and make it suitable for bare-metal environment without any heap. Please refer to doc/custom_client_build.md for instructions on how to do it.

The doxygen generated documentation of the library with its full tutorial can be downloaded from the release artefacts or browsed online.

Client Applications

This repository also provides extra utilities (example applications) which use the client library described above.

  • cc_mqttsn_gw_discover - Discover available gateways client application
  • cc_mqttsn_client_pub - Publish client application
  • cc_mqttsn_client_sub - Subscribe client application

These applications use Boost libraries, (boost::program_options to parse the command line arguments and boost::asio to run the events loop and manage network connection(s)). Currently only UDP/IP network connection type is supported.

Gateway Library

Just like the Client Library allows additional data packatisation for correct delivery, the gateway application must implement the same functionality. As the result there is a need for a gateway library, which provides the required core functionality and allows implementation of any gateway application, suitable for the type of I/O link to the client(s) being used.

This repository provides such a library. It is implemented using C++(17) programming language and provides both C++ and C interfaces to use. The gateway uses v3.1.1 of the MQTT protocol to connect to and communicate with the broker.

The doxygen generated documentation of the library with its full tutorial can be downloaded from the release artefacts or browsed online.

Gateway Applications

This repository also provides extra applications which use the gateway library described above.

  • cc_mqttsn_gateway_app - Transparent gateway application.

These applications use Boost libraries, (boost::program_options to parse the command line arguments and boost::asio to run the events loop and manage network connection(s)). Currently only UDP/IP network connection type is supported.

How to Build

Detailed instructions on how to build and install all the components can be found in doc/BUILD.md file.

Branching Model

This repository will follow the Successful Git Branching Model.

The master branch will always point to the latest release, the development is performed on develop branch. As the result it is safe to just clone the sources of this repository and use it without any extra manipulations of looking for the latest stable version among the tags and checking it out.

Contact Information

For bug reports, feature requests, or any other question you may open an issue here in github or e-mail me directly to: arobenko@gmail.com