|
AWS IoT Device SDK C:
MQTT
MQTT 3.1.1 client library
|
| Return to main page ↑ |
MQTT client publish API definitions. More...
#include "aws_iot_mqtt_client_common_internal.h"Functions | |
| IoT_Error_t | aws_iot_mqtt_internal_serialize_ack (unsigned char *pTxBuf, size_t txBufLen, MessageTypes msgType, uint8_t dup, uint16_t packetId, uint32_t *pSerializedLen) |
| IoT_Error_t | aws_iot_mqtt_publish (AWS_IoT_Client *pClient, const char *pTopicName, uint16_t topicNameLen, IoT_Publish_Message_Params *pParams) |
| Publish an MQTT message on a topic. More... | |
| IoT_Error_t | aws_iot_mqtt_internal_deserialize_publish (uint8_t *dup, QoS *qos, uint8_t *retained, uint16_t *pPacketId, char **pTopicName, uint16_t *topicNameLen, unsigned char **payload, size_t *payloadLen, unsigned char *pRxBuf, size_t rxBufLen) |
| IoT_Error_t | aws_iot_mqtt_internal_deserialize_ack (unsigned char *pPacketType, unsigned char *dup, uint16_t *pPacketId, unsigned char *pRxBuf, size_t rxBuflen) |
MQTT client publish API definitions.
| IoT_Error_t aws_iot_mqtt_internal_serialize_ack | ( | unsigned char * | pTxBuf, |
| size_t | txBufLen, | ||
| MessageTypes | msgType, | ||
| uint8_t | dup, | ||
| uint16_t | packetId, | ||
| uint32_t * | pSerializedLen | ||
| ) |
Serializes the ack packet into the supplied buffer.
| pTxBuf | the buffer into which the packet will be serialized |
| txBufLen | the length in bytes of the supplied buffer |
| msgType | the MQTT packet type |
| dup | the MQTT dup flag |
| packetId | the MQTT packet identifier |
| pSerializedLen | uint32_t - pointer to the variable that stores serialized len |
| IoT_Error_t aws_iot_mqtt_publish | ( | AWS_IoT_Client * | pClient, |
| const char * | pTopicName, | ||
| uint16_t | topicNameLen, | ||
| IoT_Publish_Message_Params * | pParams | ||
| ) |
Publish an MQTT message on a topic.
Called to publish an MQTT message on a topic.
| pClient | Reference to the IoT Client |
| pTopicName | Topic Name to publish to |
| topicNameLen | Length of the topic name |
| pParams | Pointer to Publish Message parameters |
| IoT_Error_t aws_iot_mqtt_internal_deserialize_publish | ( | uint8_t * | dup, |
| QoS * | qos, | ||
| uint8_t * | retained, | ||
| uint16_t * | pPacketId, | ||
| char ** | pTopicName, | ||
| uint16_t * | topicNameLen, | ||
| unsigned char ** | payload, | ||
| size_t * | payloadLen, | ||
| unsigned char * | pRxBuf, | ||
| size_t | rxBufLen | ||
| ) |
Deserializes the supplied (wire) buffer into publish data
| dup | returned uint8_t - the MQTT dup flag |
| qos | returned QoS type - the MQTT QoS value |
| retained | returned uint8_t - the MQTT retained flag |
| pPacketId | returned uint16_t - the MQTT packet identifier |
| pTopicName | returned String - the MQTT topic in the publish |
| topicNameLen | returned uint16_t - the length of the MQTT topic in the publish |
| payload | returned byte buffer - the MQTT publish payload |
| payloadLen | returned size_t - the length of the MQTT payload |
| pRxBuf | the raw buffer data, of the correct length determined by the remaining length field |
| rxBufLen | the length in bytes of the data in the supplied buffer |
| IoT_Error_t aws_iot_mqtt_internal_deserialize_ack | ( | unsigned char * | pPacketType, |
| unsigned char * | dup, | ||
| uint16_t * | pPacketId, | ||
| unsigned char * | pRxBuf, | ||
| size_t | rxBuflen | ||
| ) |
Deserializes the supplied (wire) buffer into an ack
| pPacketType | returned integer - the MQTT packet type |
| dup | returned integer - the MQTT dup flag |
| pPacketId | returned integer - the MQTT packet identifier |
| pRxBuf | the raw buffer data, of the correct length determined by the remaining length field |
| rxBuflen | the length in bytes of the data in the supplied buffer |