AWS IoT Embedded C Device SDK
MQTT Publish and Subscribe

A device can interact with AWS IoT using MQTT pub/sub alone. This mode is preferred if the device is extremely resource constrained and does not want to do any string or JSON parsing of Thing Shadow protocol. The sample_apps subscribe_publish_sample.c is a good place to start.

Any time if you would like to just use the MQTT interface without shadow, include the aws_iot_mqtt_interface.h file . This file has all the APIs needed for a device to communicate with the AWS IoT Platform

Connection Management

aws_iot_mqtt_connect()

aws_iot_mqtt_disconnect()

Publishing message

aws_iot_mqtt_publish()

Subscribe to a topic filter

aws_iot_mqtt_subscribe()

aws_iot_mqtt_unsubscribe()

Yield(background MQTT tasks)

aws_iot_mqtt_yield()

Generally this function could be called in a separate thread and all the callbacks will be called from the context of this thread. Other threads can publish.

Note
In a multi-threaded environment always acquire a lock before performing any operation on the MQTT library. This library is not thread safe.

Known Issues

Configuration associated with MQTT layer

#AWS_IOT_MQTT_TX_BUF_LEN

#AWS_IOT_MQTT_RX_BUF_LEN

#AWS_IOT_MQTT_NUM_SUBSCRIBE_HANDLERS