Browse Source

NetworkCLient debugging

v0.9.4
Guy Turcotte 2 years ago
parent
commit
33b8768eca
  1. 8
      examples/Others/Inkplate_VariPass_Graphs/src/main.cpp
  2. 2
      src/services/network_client.cpp

8
examples/Others/Inkplate_VariPass_Graphs/src/main.cpp

@ -27,6 +27,7 @@
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "logging.hpp"
#include "nvs_flash.h"
#include "secur.hpp"
@ -89,6 +90,13 @@ extern "C" {
void app_main()
{
esp_err_t ret = nvs_flash_init();
if (ret == ESP_ERR_NVS_NO_FREE_PAGES || ret == ESP_ERR_NVS_NEW_VERSION_FOUND) {
ESP_ERROR_CHECK(nvs_flash_erase());
ret = nvs_flash_init();
}
ESP_ERROR_CHECK(ret);
TaskHandle_t xHandle = NULL;
xTaskCreate(mainTask, "mainTask", STACK_SIZE, (void *) 1, tskIDLE_PRIORITY, &xHandle);

2
src/services/network_client.cpp

@ -211,6 +211,7 @@ static esp_err_t http_event_handler(esp_http_client_event_t * evt)
//ESP_LOGI(TAG, "key = %s, value = %s", evt->header_key, evt->header_value);
if (strcmp("Content-Length", evt->header_key) == 0) {
buffer_size = atoi(evt->header_value);
ESP_LOGI(TAG, "Donwload file size: %d", buffer_size);
}
break;
case HTTP_EVENT_ON_DATA:
@ -234,7 +235,6 @@ static esp_err_t http_event_handler(esp_http_client_event_t * evt)
}
}
}
break;
case HTTP_EVENT_ON_FINISH:
ESP_LOGI(TAG, "HTTP_EVENT_ON_FINISH");

Loading…
Cancel
Save