From 9fbd7d9244bacdd2eddec9e9d5b4f7e5d7b0ce9d Mon Sep 17 00:00:00 2001 From: David Cermak Date: Fri, 27 Sep 2019 16:23:24 +0200 Subject: [PATCH] docs: Updated publish message return code to make it clear that message_id is always 0 for QoS 0 Closes https://github.com/espressif/esp-mqtt/issues/127 --- include/mqtt_client.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/mqtt_client.h b/include/mqtt_client.h index 2f5aacc..b29255e 100644 --- a/include/mqtt_client.h +++ b/include/mqtt_client.h @@ -225,8 +225,8 @@ int esp_mqtt_client_unsubscribe(esp_mqtt_client_handle_t client, const char *top * @param qos qos of publish message * @param retain ratain flag * - * @return message_id of the subscribe message on success - * 0 if cannot publish + * @return message_id of the publish message (for QoS 0 message_id will always be zero) on success. + * -1 on failure. */ int esp_mqtt_client_publish(esp_mqtt_client_handle_t client, const char *topic, const char *data, int len, int qos, int retain);