mirror of
https://github.com/espressif/ESP8266_RTOS_SDK.git
synced 2025-06-01 08:09:49 +08:00
Merge branch 'feature/add_kconfig_for_http_ota_buff_size' into 'master'
feat(http): Add Kconfig for user to configure HTTP buffer and ota buffer size See merge request sdk/ESP8266_RTOS_SDK!1055
This commit is contained in:
@ -7,4 +7,12 @@ config ESP_HTTP_CLIENT_ENABLE_HTTPS
|
|||||||
help
|
help
|
||||||
This option will enable https protocol by linking mbedtls library and initializing SSL transport
|
This option will enable https protocol by linking mbedtls library and initializing SSL transport
|
||||||
|
|
||||||
|
config HTTP_BUF_SIZE
|
||||||
|
int "Default HTTP Buffer Size (both send and receive)"
|
||||||
|
default 512
|
||||||
|
range 512 1460
|
||||||
|
help
|
||||||
|
Set HTTP Buffer Size. The larger buffer size will make send and receive more size packet once.
|
||||||
|
|
||||||
|
|
||||||
endmenu
|
endmenu
|
||||||
|
@ -24,7 +24,7 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define DEFAULT_HTTP_BUF_SIZE (512)
|
#define DEFAULT_HTTP_BUF_SIZE CONFIG_HTTP_BUF_SIZE
|
||||||
|
|
||||||
typedef struct esp_http_client *esp_http_client_handle_t;
|
typedef struct esp_http_client *esp_http_client_handle_t;
|
||||||
typedef struct esp_http_client_event *esp_http_client_event_handle_t;
|
typedef struct esp_http_client_event *esp_http_client_event_handle_t;
|
||||||
|
12
components/esp_https_ota/Kconfig
Normal file
12
components/esp_https_ota/Kconfig
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
menu "ESP HTTPS OTA"
|
||||||
|
|
||||||
|
config OTA_BUF_SIZE
|
||||||
|
int "Default OTA Buffer Size"
|
||||||
|
default 256
|
||||||
|
range 256 1460
|
||||||
|
help
|
||||||
|
Set OTA Buffer Size. The larger buffer size will read more size packet once and can reduce upgrade cost time.
|
||||||
|
This buffer size depends on CONFIG_HTTP_BUF_SIZE. If you want to enlarge ota buffer size, please also enlarge CONFIG_HTTP_BUF_SIZE.
|
||||||
|
OTA_BUF_SIZE equals to 1460 can save 40% upgrade time in contrast to OTA_BUF_SIZE which equals to 256.
|
||||||
|
|
||||||
|
endmenu
|
@ -18,8 +18,9 @@
|
|||||||
#include <esp_https_ota.h>
|
#include <esp_https_ota.h>
|
||||||
#include <esp_ota_ops.h>
|
#include <esp_ota_ops.h>
|
||||||
#include <esp_log.h>
|
#include <esp_log.h>
|
||||||
|
#include "sdkconfig.h"
|
||||||
|
|
||||||
#define OTA_BUF_SIZE 256
|
#define OTA_BUF_SIZE CONFIG_OTA_BUF_SIZE
|
||||||
static const char *TAG = "esp_https_ota";
|
static const char *TAG = "esp_https_ota";
|
||||||
|
|
||||||
static void http_cleanup(esp_http_client_handle_t client)
|
static void http_cleanup(esp_http_client_handle_t client)
|
||||||
|
Reference in New Issue
Block a user