MQTT client publish API definitions.
More...
|
| 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) |
| |
| 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
- Parameters
-
| 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 |
- Returns
- An IoT Error Type defining successful/failed call
| 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
- Parameters
-
| 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 |
- Returns
- An IoT Error Type defining successful/failed call
| 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.
- Parameters
-
| 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 |
- Returns
- An IoT Error Type defining successful/failed call
Called to publish an MQTT message on a topic.
- Note
- Call is blocking. In the case of a QoS 0 message the function returns after the message was successfully passed to the TLS layer. In the case of QoS 1 the function returns after the receipt of the PUBACK control packet. This is the outer function which does the validations and calls the internal publish above to perform the actual operation. It is also responsible for client state changes
- Parameters
-
| pClient | Reference to the IoT Client |
| pTopicName | Topic Name to publish to |
| topicNameLen | Length of the topic name |
| pParams | Pointer to Publish Message parameters |
- Returns
- An IoT Error Type defining successful/failed publish