Reports config conflicts error to the user

- Configuration conflicts were verified, logged but not reported to the
  user.
This commit is contained in:
Euripedes Rocha
2021-06-04 17:29:41 +01:00
committed by David Čermák
parent 026ea95338
commit 88f4b8ed50
2 changed files with 3 additions and 2 deletions

View File

@ -375,6 +375,7 @@ esp_err_t esp_mqtt_client_destroy(esp_mqtt_client_handle_t client);
* @param config mqtt configuration structure * @param config mqtt configuration structure
* *
* @return ESP_ERR_NO_MEM if failed to allocate * @return ESP_ERR_NO_MEM if failed to allocate
* ESP_ERR_INVALID_ARG if conflicts on transport configuration.
* ESP_OK on success * ESP_OK on success
*/ */
esp_err_t esp_mqtt_set_config(esp_mqtt_client_handle_t client, const esp_mqtt_client_config_t *config); esp_err_t esp_mqtt_set_config(esp_mqtt_client_handle_t client, const esp_mqtt_client_config_t *config);

View File

@ -536,11 +536,11 @@ esp_err_t esp_mqtt_set_config(esp_mqtt_client_handle_t client, const esp_mqtt_cl
goto _mqtt_set_config_failed; goto _mqtt_set_config_failed;
} }
} }
esp_mqtt_check_cfg_conflict(client->config, config); esp_err_t config_has_conflict = esp_mqtt_check_cfg_conflict(client->config, config);
MQTT_API_UNLOCK(client); MQTT_API_UNLOCK(client);
return ESP_OK; return config_has_conflict;
_mqtt_set_config_failed: _mqtt_set_config_failed:
esp_mqtt_destroy_config(client); esp_mqtt_destroy_config(client);
MQTT_API_UNLOCK(client); MQTT_API_UNLOCK(client);