mirror of
https://github.com/espressif/esp-mqtt.git
synced 2025-07-30 10:48:06 +02:00
mqtt: esp_mqtt_client_publish now returns msd id for QoS>0 when offline
This commit is contained in:
@ -1634,6 +1634,9 @@ int esp_mqtt_client_publish(esp_mqtt_client_handle_t client, const char *topic,
|
|||||||
/* Skip sending if not connected (rely on resending) */
|
/* Skip sending if not connected (rely on resending) */
|
||||||
if (client->state != MQTT_STATE_CONNECTED) {
|
if (client->state != MQTT_STATE_CONNECTED) {
|
||||||
ESP_LOGD(TAG, "Publish: client is not connected");
|
ESP_LOGD(TAG, "Publish: client is not connected");
|
||||||
|
if (qos > 0) {
|
||||||
|
ret = pending_msg_id;
|
||||||
|
}
|
||||||
goto cannot_publish;
|
goto cannot_publish;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user