AWS IoT Device SDK C:
MQTT
MQTT 3.1.1 client library
|
Return to main page ↑ |
Publishes a message to the given topic name and optionally receive an asynchronous notification when the publish completes.
This function sends an MQTT PUBLISH packet to the server. A PUBLISH packet contains a payload and a topic name. Any clients with a subscription on a topic filter matching the PUBLISH topic name will receive a copy of the PUBLISH packet from the server.
If a PUBLISH packet fails to reach the server and it is not a QoS 0 message, it will be retransmitted. See IotMqttPublishInfo_t for a description of the retransmission strategy.
[in] | mqttConnection | The MQTT connection to use for the publish. |
[in] | pPublishInfo | MQTT publish parameters. |
[in] | flags | Flags which modify the behavior of this function. See MQTT Function Flags. |
[in] | pCallbackInfo | Asynchronous notification of this function's completion (NULL to disable). |
[out] | pPublishOperation | Set to a handle by which this operation may be referenced after this function returns. This reference is invalidated once the publish operation completes. |
pCallbackInfo
and pPublishOperation
should only be used for QoS 1 publishes. For QoS 0, they should both be NULL
.Example