Quality RTOS & Embedded Software

LIBRARIES
NOTE: The coreMQTT library will be included in the upcoming FreeRTOS LTS release . It is now available with preconfigured examples in the main FreeRTOS download and on GitHub

coreMQTT
MQTT C client library for small IoT devices (MCU or small MPU)

Introduction

The coreMQTT library is a client implementation of the MQTT standard. The MQTT standard provides a lightweight publish/subscribe messaging protocol that runs on top of TCP/IP and is often used in Machine to Machine (M2M) and Internet of Things (IoT) use cases.

The coreMQTT library is compliant with the MQTT 3.1.1 protocol standard. This library has been optimized for a low memory footprint. The design of this library embraces different use-cases, ranging from resource-constrained platforms using only QoS 0 (Quality of Service level 0) MQTT PUBLISH messages, to resource-rich platforms using QoS 2 MQTT PUBLISH over TLS (Transport Layer Security) connections. The library provides a menu of composable functions, a combination of which can be chosen to precisely fit a specific use case.

The library provides a high-level API to connect to an MQTT broker, subscribe or unsubscribe to a topic, publish a message to a topic and receive incoming messages. The library also exposes a low-level serializer/deserializer API. This low-level API handles formatting and parsing messages, leaving the application full, zero-overhead control over the network connection to the MQTT broker.

The library is decoupled from the underlying network drivers through a two-function send and receive transport interface. The application writer can select an existing transport interface or implement their own, as appropriate for their application.

The library is written in C and designed to be compliant with ISO C90 and MISRA C:2012. The library has no dependencies on any additional libraries other than the standard C library. The library has proofs showing safe memory use and no heap allocation, making it suitable for IoT microcontrollers, but also fully portable to other platforms.

When using MQTT connections in IoT applications, we recommend that you use a secure transport interface, such as one that uses the TLS protocol as demonstrated in the MQTT TLS demo.

This library can be freely used and is distributed under the MIT open source license.

 

Code Size of coreMQTT (example generated with GCC for ARM Cortex-M)
FileWith -O1 OptimisationWith -Os Optimisation
core_mqtt.c3.0K2.6K
core_mqtt_state.c1.4K1.1K
core_mqtt_serializer.c2.5K2.0K
Total estimate (configurations defined here)6.9K5.7K
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.