mqtt: esp_mqtt_client_publish now returns msd id for QoS>0 when offline

This commit is contained in:
Marius Vikhammer
2020-08-10 14:47:05 +08:00
parent 702da6d528
commit f7325bfa10

View File

@ -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) */
if (client->state != MQTT_STATE_CONNECTED) {
ESP_LOGD(TAG, "Publish: client is not connected");
if (qos > 0) {
ret = pending_msg_id;
}
goto cannot_publish;
}