AWS IoT Embedded C Device SDK
Functions
aws_iot_mqtt_client_subscribe.c File Reference

MQTT client subscribe API definitions. More...

#include "aws_iot_mqtt_client_common_internal.h"

Functions

IoT_Error_t aws_iot_mqtt_subscribe (AWS_IoT_Client *pClient, const char *pTopicName, uint16_t topicNameLen, QoS qos, pApplicationHandler_t pApplicationHandler, void *pApplicationHandlerData)
 Subscribe to an MQTT topic. More...
 
IoT_Error_t aws_iot_mqtt_resubscribe (AWS_IoT_Client *pClient)
 Subscribe to an MQTT topic. More...
 

Function Documentation

IoT_Error_t aws_iot_mqtt_resubscribe ( AWS_IoT_Client pClient)

Called to send a subscribe message to the broker requesting a subscription to an MQTT topic. This is the outer function which does the validations and calls the internal resubscribe above to perform the actual operation. It is also responsible for client state changes

Note
Call is blocking. The call returns after the receipt of the SUBACK control packet.
Parameters
pClientReference to the IoT Client
Returns
An IoT Error Type defining successful/failed subscription
IoT_Error_t aws_iot_mqtt_subscribe ( AWS_IoT_Client pClient,
const char *  pTopicName,
uint16_t  topicNameLen,
QoS  qos,
pApplicationHandler_t  pApplicationHandler,
void *  pApplicationHandlerData 
)

Called to send a subscribe message to the broker requesting a subscription to an MQTT topic. This is the outer function which does the validations and calls the internal subscribe above to perform the actual operation. It is also responsible for client state changes

Note
Call is blocking. The call returns after the receipt of the SUBACK control packet.
Parameters
pClientReference to the IoT Client
pTopicNameTopic Name to publish to
topicNameLenLength of the topic name
pApplicationHandler_tReference to the handler function for this subscription
Returns
An IoT Error Type defining successful/failed subscription