-
Notifications
You must be signed in to change notification settings - Fork 0
/
domotica.h
54 lines (38 loc) · 810 Bytes
/
domotica.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 domotica_h
#define domotica_h
#if defined(ARDUINO) && ARDUINO >= 100
#include "Arduino.h"
#else
#include "WProgram.h"
#endif
#include <NRF905.h>
#define BUF_LEN 32
#define CONF_LEN 10
#define NRF905_CSN 10
#define MSG_LEN 28
#define MASTER 1
#define LEDSTRIP 2
#define THERMO 3
#define LIGHTS 4
//int addresses[4][4];
class Domotica {
public:
Domotica();
void init(int);
char** split(char*);
bool checkNewMsg(void);
char* getMsg(void);
void setDebug(bool);
void sendToNode(int, char*);
void sendToAddress(char*, char*buffer);
private:
int my_node;
//char tx_buf[BUF_LEN];
char rx_buf[BUF_LEN];
char read_config_buf[CONF_LEN];
char buffer[BUF_LEN];
NRF905 transmitter;
//char addresses[4][4];
bool debug;
};
#endif