#include <stdint.h>
#include "aws_iot_mqtt_client.h"
#include "aws_iot_error.h"
Go to the source code of this file.
#define MQTT_CONNECT_MAX_ATTEMPT_COUNT 3 |
#define MQTT_YIELD_PERIOD 100 |
#define MQTT_YIELD_TIME 10 |
IoT_Error_t MQTT_Init |
( |
void |
| ) |
|
Initalize the MQTT Device
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 |
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) |
IoT_Error_t MQTT_Unsubscribe |
( |
char * |
topic | ) |
|
Unsubscribe from a topic
- Parameters
-
topic | - The topic to unsubscribe from |