-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathAT_Webserver.h
56 lines (52 loc) · 1.69 KB
/
AT_Webserver.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
/*
||
|| @file ATWEBSERVER.h
|| @version 0.5
|| @author Gerald Lechner
|| @contact lechge@gmail.com
||
|| @description
|| |This library defines functions to show lists and forms on a TFT display
|| |It also interacts with Touch-Screen events
|| #
||
|| @license
|| | This library is free software; you can redistribute it and/or
|| | modify it under the terms of the GNU Lesser General Public
|| | License as published by the Free Software Foundation; version
|| | 2.1 of the License.
|| |
|| | This library is distributed in the hope that it will be useful,
|| | but WITHOUT ANY WARRANTY; without even the implied warranty of
|| | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|| | Lesser General Public License for more details.
|| |
|| | You should have received a copy of the GNU Lesser General Public
|| | License along with this library; if not, write to the Free Software
|| | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|| #
||
*/
#include <Arduino.h>
#include <AT_Database.h>
#include "WebServer.h"
#ifndef AT_Webserver_h
#define AT_Webserver_h
class AT_Webserver {
public:
AT_Webserver(WebServer * srv, AT_Database *database);
void begin();
void handleClient();
void handleRoot(uint8_t refresh = 10);
void handleNotFound();
//register a callback function result change event
void registerOnResultChange(void (*callback)(uint16_t index));
private:
uint32_t convertColor(uint16_t color565);
void sendResults();
void sendSimpleWidget(ATDISPLAYWIDGET wdg);
AT_Database * _database;
WebServer * _server;
void(*_onResultChange)(uint16_t index) = NULL;
};
#endif