-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGNTP.h
54 lines (48 loc) · 1.18 KB
/
GNTP.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
#ifndef HomeAuto_h
#define HomeAuto_h
#include "Arduino.h"
#include "Ethernet.h"
#include "Ethernet.h"
#define NEWLINE do{ Serial.println("");}while(false)
#define DBG(X) do{ if(debugging_enabled) { X ;}}while(false)
class GNTPNotification
{
public:
char* title;
char* description;
char* name;
GNTPNotification(char *name, char *title, char *description);
};
struct notificationsList
{
GNTPNotification notification;
struct notificationsList* nextNotification;
};
typedef struct notificationsList notificationsList;
class GNTP
{
public:
const static int DEFAULT_PORT = 23053;
GNTP(char *appName, IPAddress server);
void add(GNTPNotification notification);
void registerNotifications(void);
void checkConnection(void);
void sendNotification(char* name);
void sendNotification(GNTPNotification notification);
int count(void);
void begin(void);
void begin(char* pass);
void setDebugging(bool dbg);
EthernetClient client;
IPAddress server;
char* appName;
notificationsList* myNotifications;
private:
bool debugging_enabled;
int port;
unsigned char* salt;
unsigned char* digest;
unsigned char* generate_salt(void);
char* season_string(char* arg, unsigned char* salt);
};
#endif