advanced_https_ota: Add example_test for partial HTTP download

This commit is contained in:
Shubham Kulkarni
2021-02-02 13:26:27 +05:30
parent 2e0e583ad1
commit fb0beefefb
4 changed files with 71 additions and 3 deletions

View File

@@ -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

View File

@@ -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;