mirror of
https://github.com/espressif/esp-idf.git
synced 2025-11-02 08:01:43 +01:00
advanced_https_ota: Add example_test for partial HTTP download
This commit is contained in:
@@ -28,4 +28,18 @@ menu "Example Configuration"
|
||||
help
|
||||
Maximum time for reception
|
||||
|
||||
config EXAMPLE_ENABLE_PARTIAL_HTTP_DOWNLOAD
|
||||
bool "Enable partial HTTP download"
|
||||
default n
|
||||
help
|
||||
This enables use of Range header in esp_https_ota component.
|
||||
Firmware image will be downloaded over multiple HTTP requests.
|
||||
|
||||
config EXAMPLE_HTTP_REQUEST_SIZE
|
||||
int "HTTP request size"
|
||||
default MBEDTLS_SSL_IN_CONTENT_LEN
|
||||
depends on EXAMPLE_ENABLE_PARTIAL_HTTP_DOWNLOAD
|
||||
help
|
||||
This options specifies HTTP request size. Number of bytes specified
|
||||
in this option will be downloaded in single HTTP request.
|
||||
endmenu
|
||||
|
||||
@@ -110,6 +110,10 @@ void advanced_ota_example_task(void *pvParameter)
|
||||
esp_https_ota_config_t ota_config = {
|
||||
.http_config = &config,
|
||||
.http_client_init_cb = _http_client_init_cb, // Register a callback to be invoked after esp_http_client is initialized
|
||||
#ifdef CONFIG_EXAMPLE_ENABLE_PARTIAL_HTTP_DOWNLOAD
|
||||
.partial_http_download = true,
|
||||
.max_http_request_size = CONFIG_EXAMPLE_HTTP_REQUEST_SIZE,
|
||||
#endif
|
||||
};
|
||||
|
||||
esp_https_ota_handle_t https_ota_handle = NULL;
|
||||
|
||||
Reference in New Issue
Block a user