esp32-warm-water
esp32 based project for the control of a heating element based on temperature
webserver.h
Go to the documentation of this file.
1 /*
2  * MIT License
3  *
4  * Copyright (c) 2021 wolffshots
5  *
6  * Permission is hereby granted, free of charge, to any person obtaining a copy
7  * of this software and associated documentation files (the "Software"), to deal
8  * in the Software without restriction, including without limitation the rights
9  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10  * copies of the Software, and to permit persons to whom the Software is
11  * furnished to do so, subject to the following conditions:
12  *
13  * The above copyright notice and this permission notice shall be included in all
14  * copies or substantial portions of the Software.
15  *
16  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22  * SOFTWARE.
23  */
24 
30 #ifndef WEBSERVER_H
31 #define WEBSERVER_H
32 
33 #ifdef __cplusplus
34 extern "C"
35 {
36 #endif // __cplusplus
37 
38 // includes pertinent to this file
39 #include "esp_err.h"
40 #include "esp_http_server.h"
41 
42 // defines
43 #define IS_FILE_EXT(filename, ext) \
44  (strcasecmp(&filename[strlen(filename) - sizeof(ext) + 1], ext) == 0)
45  extern volatile float temp;
46  extern volatile float goal;
47  extern volatile float under;
48  extern volatile float over;
49  extern void update_display(void);
50 
51  // function declarations
52  esp_err_t start_file_server(const char *base_path);
53 
54 #ifdef __cplusplus
55 }
56 #endif // __cplusplus
57 
58 #endif // WEBSERVER_H
volatile float temp
current temp
Definition: main.c:72
volatile float under
margin below goal temp at which to turn relay on
Definition: main.c:73
esp_err_t start_file_server(const char *base_path)
Definition: webserver.c:429
volatile float goal
goal temp for the system to aim for
Definition: main.c:71
volatile float over
margin above goal temp at which to turn relay off
Definition: main.c:74
void update_display(void)
Definition: main.c:86