Jim Flynn / Mbed OS aws-iot-device-sdk-mbed-c
Embed: (wiki syntax)

« Back to documentation index

aws_iot_mqtt_client_unsubscribe.c File Reference

aws_iot_mqtt_client_unsubscribe.c File Reference

MQTT client unsubscribe API definitions. More...

Go to the source code of this file.

Functions

static IoT_Error_t _aws_iot_mqtt_serialize_unsubscribe (unsigned char *pTxBuf, size_t txBufLen, uint8_t dup, uint16_t packetId, uint32_t count, const char **pTopicNameList, uint16_t *pTopicNameLenList, uint32_t *pSerializedLen)
 Serializes the supplied unsubscribe data into the supplied buffer, ready for sending.
static IoT_Error_t _aws_iot_mqtt_deserialize_unsuback (uint16_t *pPacketId, unsigned char *pRxBuf, size_t rxBufLen)
 Deserializes the supplied (wire) buffer into unsuback data.
static IoT_Error_t _aws_iot_mqtt_internal_unsubscribe (AWS_IoT_Client *pClient, const char *pTopicFilter, uint16_t topicFilterLen)
 Unsubscribe to an MQTT topic.
IoT_Error_t aws_iot_mqtt_unsubscribe (AWS_IoT_Client *pClient, const char *pTopicFilter, uint16_t topicFilterLen)
 Unsubscribe to an MQTT topic.

Detailed Description

MQTT client unsubscribe API definitions.

Definition in file aws_iot_mqtt_client_unsubscribe.c.


Function Documentation

static IoT_Error_t _aws_iot_mqtt_deserialize_unsuback ( uint16_t *  pPacketId,
unsigned char *  pRxBuf,
size_t  rxBufLen 
) [static]

Deserializes the supplied (wire) buffer into unsuback data.

Parameters:
pPacketIdreturned integer - the MQTT packet identifier
pRxBufthe raw buffer data, of the correct length determined by the remaining length field
rxBufLenthe length in bytes of the data in the supplied buffer
Returns:
IoT_Error_t indicating function execution status

Definition at line 103 of file aws_iot_mqtt_client_unsubscribe.c.

static IoT_Error_t _aws_iot_mqtt_internal_unsubscribe ( AWS_IoT_Client pClient,
const char *  pTopicFilter,
uint16_t  topicFilterLen 
) [static]

Unsubscribe to an MQTT topic.

Called to send an unsubscribe message to the broker requesting removal of a subscription to an MQTT topic.

Note:
Call is blocking. The call returns after the receipt of the UNSUBACK control packet. This is the internal function which is called by the unsubscribe API to perform the operation. Not meant to be called directly as it doesn't do validations or client state changes
Parameters:
pClientReference to the IoT Client
pTopicNameTopic Name to publish to
topicNameLenLength of the topic name
Returns:
An IoT Error Type defining successful/failed unsubscribe call

Definition at line 133 of file aws_iot_mqtt_client_unsubscribe.c.

static IoT_Error_t _aws_iot_mqtt_serialize_unsubscribe ( unsigned char *  pTxBuf,
size_t  txBufLen,
uint8_t  dup,
uint16_t  packetId,
uint32_t  count,
const char **  pTopicNameList,
uint16_t *  pTopicNameLenList,
uint32_t *  pSerializedLen 
) [static]

Serializes the supplied unsubscribe data into the supplied buffer, ready for sending.

Parameters:
pTxBufthe raw buffer data, of the correct length determined by the remaining length field
txBufLenthe length in bytes of the data in the supplied buffer
dupinteger - the MQTT dup flag
packetIdinteger - the MQTT packet identifier
count- number of members in the topicFilters array
pTopicNameList- array of topic filter names
pTopicNameLenList- array of length of topic filter names in pTopicNameList
pSerializedLen- the length of the serialized data
Returns:
IoT_Error_t indicating function execution status

Definition at line 56 of file aws_iot_mqtt_client_unsubscribe.c.

IoT_Error_t aws_iot_mqtt_unsubscribe ( AWS_IoT_Client pClient,
const char *  pTopicFilter,
uint16_t  topicFilterLen 
)

Unsubscribe to an MQTT topic.

Called to send an unsubscribe message to the broker requesting removal of a subscription to an MQTT topic.

Note:
Call is blocking. The call returns after the receipt of the UNSUBACK control packet. This is the outer function which does the validations and calls the internal unsubscribe above to perform the actual operation. It is also responsible for client state changes
Parameters:
pClientReference to the IoT Client
pTopicNameTopic Name to publish to
topicNameLenLength of the topic name
Returns:
An IoT Error Type defining successful/failed unsubscribe call

Definition at line 214 of file aws_iot_mqtt_client_unsubscribe.c.