forked from espressif/esp-idf
Whitespace: Automated whitespace fixes (large commit)
Apply the pre-commit hook whitespace fixes to all files in the repo. (Line endings, blank lines at end of file, trailing whitespace)
This commit is contained in:
@@ -39,12 +39,12 @@ typedef struct {
|
||||
/**
|
||||
* @brief HTTPS OTA Firmware upgrade.
|
||||
*
|
||||
* This function allocates HTTPS OTA Firmware upgrade context, establishes HTTPS connection,
|
||||
* reads image data from HTTP stream and writes it to OTA partition and
|
||||
* This function allocates HTTPS OTA Firmware upgrade context, establishes HTTPS connection,
|
||||
* reads image data from HTTP stream and writes it to OTA partition and
|
||||
* finishes HTTPS OTA Firmware upgrade operation.
|
||||
* This API supports URL redirection, but if CA cert of URLs differ then it
|
||||
* should be appended to `cert_pem` member of `config`.
|
||||
*
|
||||
*
|
||||
* @param[in] config pointer to esp_http_client_config_t structure.
|
||||
*
|
||||
* @note This API handles the entire OTA operation, so if this API is being used
|
||||
@@ -86,19 +86,19 @@ esp_err_t esp_https_ota(const esp_http_client_config_t *config);
|
||||
* - ESP_OK: HTTPS OTA Firmware upgrade context initialised and HTTPS connection established
|
||||
* - ESP_FAIL: For generic failure.
|
||||
* - ESP_ERR_INVALID_ARG: Invalid argument (missing/incorrect config, certificate, etc.)
|
||||
* - For other return codes, refer documentation in app_update component and esp_http_client
|
||||
* - For other return codes, refer documentation in app_update component and esp_http_client
|
||||
* component in esp-idf.
|
||||
*/
|
||||
esp_err_t esp_https_ota_begin(esp_https_ota_config_t *ota_config, esp_https_ota_handle_t *handle);
|
||||
|
||||
/**
|
||||
* @brief Read image data from HTTP stream and write it to OTA partition
|
||||
* @brief Read image data from HTTP stream and write it to OTA partition
|
||||
*
|
||||
* This function reads image data from HTTP stream and writes it to OTA partition. This function
|
||||
* This function reads image data from HTTP stream and writes it to OTA partition. This function
|
||||
* must be called only if esp_https_ota_begin() returns successfully.
|
||||
* This function must be called in a loop since it returns after every HTTP read operation thus
|
||||
* This function must be called in a loop since it returns after every HTTP read operation thus
|
||||
* giving you the flexibility to stop OTA operation midway.
|
||||
*
|
||||
*
|
||||
* @param[in] https_ota_handle pointer to esp_https_ota_handle_t structure
|
||||
*
|
||||
* @return
|
||||
@@ -150,14 +150,14 @@ esp_err_t esp_https_ota_finish(esp_https_ota_handle_t https_ota_handle);
|
||||
/**
|
||||
* @brief Reads app description from image header. The app description provides information
|
||||
* like the "Firmware version" of the image.
|
||||
*
|
||||
*
|
||||
* @note This API can be called only after esp_https_ota_begin() and before esp_https_ota_perform().
|
||||
* Calling this API is not mandatory.
|
||||
*
|
||||
* @param[in] https_ota_handle pointer to esp_https_ota_handle_t structure
|
||||
* @param[out] new_app_info pointer to an allocated esp_app_desc_t structure
|
||||
*
|
||||
* @return
|
||||
*
|
||||
* @return
|
||||
* - ESP_ERR_INVALID_ARG: Invalid arguments
|
||||
* - ESP_FAIL: Failed to read image descriptor
|
||||
* - ESP_OK: Successfully read image descriptor
|
||||
|
||||
@@ -76,7 +76,7 @@ static esp_err_t _http_handle_response_code(esp_http_client_handle_t http_client
|
||||
ESP_LOGE(TAG, "Server error occurred(%d)", status_code);
|
||||
return ESP_FAIL;
|
||||
}
|
||||
|
||||
|
||||
char upgrade_data_buf[DEFAULT_OTA_BUF_SIZE];
|
||||
// process_again() returns true only in case of redirection.
|
||||
if (process_again(status_code)) {
|
||||
@@ -165,7 +165,7 @@ esp_err_t esp_https_ota_begin(esp_https_ota_config_t *ota_config, esp_https_ota_
|
||||
*handle = NULL;
|
||||
return ESP_ERR_NO_MEM;
|
||||
}
|
||||
|
||||
|
||||
/* Initiate HTTP Connection */
|
||||
https_ota_handle->http_client = esp_http_client_init(ota_config->http_config);
|
||||
if (https_ota_handle->http_client == NULL) {
|
||||
@@ -264,7 +264,7 @@ esp_err_t esp_https_ota_get_img_desc(esp_https_ota_handle_t https_ota_handle, es
|
||||
}
|
||||
handle->binary_file_len = bytes_read;
|
||||
memcpy(new_app_info, &handle->ota_upgrade_buf[sizeof(esp_image_header_t) + sizeof(esp_image_segment_header_t)], sizeof(esp_app_desc_t));
|
||||
return ESP_OK;
|
||||
return ESP_OK;
|
||||
}
|
||||
|
||||
esp_err_t esp_https_ota_perform(esp_https_ota_handle_t https_ota_handle)
|
||||
@@ -398,7 +398,7 @@ esp_err_t esp_https_ota(const esp_http_client_config_t *config)
|
||||
if (!config) {
|
||||
ESP_LOGE(TAG, "esp_http_client config not found");
|
||||
return ESP_ERR_INVALID_ARG;
|
||||
}
|
||||
}
|
||||
|
||||
esp_https_ota_config_t ota_config = {
|
||||
.http_config = config,
|
||||
|
||||
Reference in New Issue
Block a user