MQTT-SN Gateway Library
Library that allows implementation of MQTT-SN gateway.
|
The MQTT-SN Gateway Library provides simple, asynchronous, non-blocking, and easy to use interface to implement and operate MQTT-SN gateway. The library doesn't make any assumption on the system it is running on, as well as on the type of I/O links being used to communicate with MQTT-SN clients as well as MQTT broker.
Having a gateway library instead of stand alone application allows implementation of any custom gateway that is suitable for the environment it is running on, working with any I/O link, and using any other additional transport protocol to exchange data with clients and/or broker.
The library is implemented in C++(11). It provides two separate APIs: C++ and C. The C interface is a wrapper around C++ one, but provides an interface to be used with any project developed using C.
MQTT-SN is designed to be a datagram protocol, i.e. if sent message is received by the other side, it is received in full and without errors. If sent over UDP link, it can be used as is. The UDP transport cares about all the rest. However, when sent over other I/O link, such as RS-232 serial connection, the protocol may require additional transport wrapping to insure correct delivery and differentiate between packets.
The interface, this MQTT-SN Gateway Library provides, allows any sent or received data to be wrapped with or unwrapped from additional independent transport data, that insures safe and correct delivery.
To use the C++ interface, use the following include statement:
Per-entity includes can also be used (see Entities)
And for C interface, use the the following include statement:
The gateway library works with and provides an interface for three intependent entities.
Parallel access to the distinct objects is safe, but parallel access to the same one is NOT.