embedded-software
reusable software modules for embedded systems
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
mqtt.h File Reference
#include <stdint.h>
#include "aws_iot_mqtt_client.h"
#include "aws_iot_error.h"
Include dependency graph for mqtt.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define MQTT_CONNECT_MAX_ATTEMPT_COUNT   3
 
#define MQTT_YIELD_TIME   10
 
#define MQTT_YIELD_PERIOD   100
 

Functions

IoT_Error_t MQTT_Init (void)
 
IoT_Error_t MQTT_Subscribe (char *topic, QoS qos, pApplicationHandler_t callback, char *pData)
 
IoT_Error_t MQTT_Publish (char *topic, QoS qos, char *pData, size_t dLen)
 
IoT_Error_t MQTT_Unsubscribe (char *topic)
 

Macro Definition Documentation

#define MQTT_CONNECT_MAX_ATTEMPT_COUNT   3
#define MQTT_YIELD_PERIOD   100
#define MQTT_YIELD_TIME   10

Function Documentation

IoT_Error_t MQTT_Init ( void  )

Initalize the MQTT Device

Here is the call graph for this function:

Here is the caller graph for this function:

IoT_Error_t MQTT_Publish ( char *  topic,
QoS  qos,
char *  pData,
size_t  dLen 
)

Publish to a topic

Parameters
topic- Topic to publish to
qos- Quality of service of the MQTT connection
pData- Data being published
dLen- Length of the data

Here is the caller graph for this function:

IoT_Error_t MQTT_Subscribe ( char *  topic,
QoS  qos,
pApplicationHandler_t  callback,
char *  pData 
)

Subscribe to a topic

Parameters
topic- Topic to subscribe to
qos- Quality of Service of the MQTT connection
callback- Handles receiving data from the broker
pData- Pointer to data that gets sent to the callback handler (make it NULL / 0 if not used)

Here is the caller graph for this function:

IoT_Error_t MQTT_Unsubscribe ( char *  topic)

Unsubscribe from a topic

Parameters
topic- The topic to unsubscribe from