esp32-warm-water
esp32 based project for the control of a heating element based on temperature
Data Structures | Macros | Functions
webserver.c File Reference

implementations for component webserver More...

#include "webserver.h"
#include <stdio.h>
#include <string.h>
#include <sys/param.h>
#include <sys/unistd.h>
#include <sys/stat.h>
#include <dirent.h>
#include "esp_log.h"
#include "esp_vfs.h"
#include "esp_spiffs.h"
#include "esp_http_server.h"
Include dependency graph for webserver.c:

Go to the source code of this file.

Data Structures

struct  file_server_data
 

Macros

#define FILE_PATH_MAX   (ESP_VFS_PATH_MAX + CONFIG_SPIFFS_OBJ_NAME_LEN)
 
#define MAX_FILE_SIZE   (200 * 1024)
 
#define MAX_FILE_SIZE_STR   "200KB"
 
#define SCRATCH_BUFSIZE   8192
 

Functions

off_t ws_get_file_size (const char *filename)
 
esp_err_t start_file_server (const char *base_path)
 

Detailed Description

implementations for component webserver

Definition in file webserver.c.

Macro Definition Documentation

◆ FILE_PATH_MAX

#define FILE_PATH_MAX   (ESP_VFS_PATH_MAX + CONFIG_SPIFFS_OBJ_NAME_LEN)

Definition at line 49 of file webserver.c.

◆ MAX_FILE_SIZE

#define MAX_FILE_SIZE   (200 * 1024)

Definition at line 53 of file webserver.c.

◆ MAX_FILE_SIZE_STR

#define MAX_FILE_SIZE_STR   "200KB"

Definition at line 54 of file webserver.c.

◆ SCRATCH_BUFSIZE

#define SCRATCH_BUFSIZE   8192

Definition at line 57 of file webserver.c.

Function Documentation

◆ start_file_server()

esp_err_t start_file_server ( const char *  base_path)

function to start the file server

Parameters
base_paththe local base path to serve files from (eg. "/spiffs")
Returns
error value

Definition at line 429 of file webserver.c.

Here is the caller graph for this function:

◆ ws_get_file_size()

off_t ws_get_file_size ( const char *  filename)

Definition at line 167 of file webserver.c.