-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathServerSide.h
executable file
·70 lines (53 loc) · 1.71 KB
/
ServerSide.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#pragma once
#define SERVER_DEBUG
#define DIRECT_UPDATE
#define ENABLE_WEBSOCKET_SERVER
#include <ESP8266WiFi.h>
#include <ESP8266WiFiMulti.h>
#include <ESP8266WebServer.h>
#include <ESP8266mDNS.h>
#include <FS.h>
#ifdef ENABLE_WEBSOCKET_SERVER
#include <WebSocketsServer.h>
#endif
#ifdef DIRECT_UPDATE
#include <ESP8266HTTPUpdateServer.h>
#endif
#ifdef ESP8266
extern "C" {
#include "user_interface.h" // Used to get Wifi status information
}
#endif
#include "global.h"
#include "WebUpdate.h"
#include "SPIFFS_Params.h"
// https://github.com/bblanchon/ArduinoJson
#include <ArduinoJson.h>
extern bool inAPMode;
extern ESP8266HTTPUpdateServer updateServer;
extern ESP8266WebServer server;
#ifdef ENABLE_WEBSOCKET_SERVER
extern WebSocketsServer webSocket; // create a websocket server on port 81
#endif
void ICACHE_FLASH_ATTR beginServerServices();
void ICACHE_FLASH_ATTR connectNetwork();
bool ICACHE_FLASH_ATTR connectWIFI_STA_Mode();
bool ICACHE_FLASH_ATTR connectWIFI_AP_Mode();
void ICACHE_FLASH_ATTR fallbacktoAPMode();
void ICACHE_FLASH_ATTR startServer();
void ICACHE_FLASH_ATTR handleNotFound();
#ifdef ENABLE_WEBSOCKET_SERVER
void ICACHE_FLASH_ATTR webSocketEvent(uint8_t num, WStype_t type, uint8_t * payload, size_t payload_length);
void ICACHE_FLASH_ATTR startWebSocket();
#endif
void sendStatusUpdate();
void sendDeviceInformation();
void send_Device_Information();
void send_General_Information();
void send_OTA_Information();
void send_Network_Information();
void send_MQTT_Information();
void send_NTP_Information();
void send_Transitions_Information();
bool ICACHE_FLASH_ATTR checkForUpdates();
void ICACHE_FLASH_ATTR restartESP();