mirror of
https://github.com/espressif/esp-mqtt.git
synced 2025-07-30 18:58:07 +02:00
Merge branch 'feature/set_config_error_reporting' into 'master'
Reports config conflicts error to the user See merge request espressif/esp-mqtt!102
This commit is contained in:
@ -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);
|
||||||
|
@ -550,11 +550,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);
|
||||||
|
Reference in New Issue
Block a user