1
6
14
15
22
23
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
45
46
47
48
49
50
/* ... */
/* ... */
#include "esp_event.h"
#include "esp_log.h"
#include "esp_netif.h"
#include "esp_err.h"
#include "nvs_flash.h"
#include "protocol_examples_common.h"
#include "file_serving_example_common.h"7 includes
/* ... */
static const char *TAG = "example";
void app_main(void)
{
ESP_LOGI(TAG, "Starting example");
ESP_ERROR_CHECK(nvs_flash_init());
ESP_ERROR_CHECK(esp_netif_init());
ESP_ERROR_CHECK(esp_event_loop_create_default());
const char* base_path = "/data";
ESP_ERROR_CHECK(example_mount_storage(base_path));
/* ... */
ESP_ERROR_CHECK(example_connect());
ESP_ERROR_CHECK(example_start_file_server(base_path));
ESP_LOGI(TAG, "File server started");
}{ ... }