-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdebugWeb.h
More file actions
32 lines (27 loc) · 760 Bytes
/
debugWeb.h
File metadata and controls
32 lines (27 loc) · 760 Bytes
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
#ifndef _DEBUGWEB_h
#define _DEBUGWEB_h
#if defined(ARDUINO) && ARDUINO >= 100
#include "arduino.h"
#else
#include "WProgram.h"
#endif
#include "ESPAsyncWebServer.h"
//AsyncEventSource debugWEvent("/debugMsg"); // event source (Server-Sent events)
extern String ntpTime;
#define DEBUG_PRINT(x) debugWeb.sendWeb (x)
#define DEBUG_PRINTF(x,...) debugWeb.sendWebF (x,__VA_ARGS__)
#define DEBUG_PRINTF(x,...) {char buf[128]; sprintf(buf, x,__VA_ARGS__); debugWeb.sendWeb(buf);}
#define DEBUG_PRINTLN(x) debugWeb.sendWebln (x)
#ifdef ESP8266
#define __builtin_va_start
#define __builtin_va_end
#endif
class DebugWeb
{
public:
bool wifiActive = false;
void sendWeb(const char *data);
void sendWebln(const char * data);
};
extern DebugWeb debugWeb;
#endif