forked from pilight/pilight
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpilight.h.in
125 lines (103 loc) · 3.37 KB
/
pilight.h.in
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
/*
Copyright (C) 2013 CurlyMo
This file is part of pilight.
pilight is free software: you can redistribute it and/or modify it under the
terms of the GNU General Public License as published by the Free Software
Foundation, either version 3 of the License, or (at your option) any later
version.
pilight 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 General Public License for more details.
You should have received a copy of the GNU General Public License
along with pilight. If not, see <http://www.gnu.org/licenses/>
*/
#ifndef _PILIGHT_H_
#define _PILIGHT_H_
#include "json.h"
/* Internals */
#cmakedefine WEBSERVER
#cmakedefine DEBUG
#cmakedefine UPDATE
/* Protocol support */
#cmakedefine PROTOCOL_ALECTO
#cmakedefine PROTOCOL_RPI_TEMP
#cmakedefine PROTOCOL_BRENNENSTUHL_SWITCH
#cmakedefine PROTOCOL_CLARUS
#cmakedefine PROTOCOL_COCO_SWITCH
#cmakedefine PROTOCOL_COGEX_SWITCH
#cmakedefine PROTOCOL_CONRAD_RSL_SWITCH
#cmakedefine PROTOCOL_CONRAD_RSL_CONTACT
#cmakedefine PROTOCOL_DS18B20
#cmakedefine PROTOCOL_DS18S20
#cmakedefine PROTOCOL_DHT11
#cmakedefine PROTOCOL_DHT22
#cmakedefine PROTOCOL_DIO_SWITCH
#cmakedefine PROTOCOL_GENERIC_DIMMER
#cmakedefine PROTOCOL_GENERIC_SWITCH
#cmakedefine PROTOCOL_GENERIC_WEATHER
#cmakedefine PROTOCOL_HOMEEASY_OLD
#cmakedefine PROTOCOL_IMPULS
#cmakedefine PROTOCOL_INTERTECHNO_SWITCH
#cmakedefine PROTOCOL_INTERTECHNO_OLD
#cmakedefine PROTOCOL_KAKU_DIMMER
#cmakedefine PROTOCOL_KAKU_SWITCH_OLD
#cmakedefine PROTOCOL_KAKU_SCREEN_OLD
#cmakedefine PROTOCOL_KAKU_SWITCH
#cmakedefine PROTOCOL_KAKU_SCREEN
#cmakedefine PROTOCOL_KAKU_CONTACT
#cmakedefine PROTOCOL_LM75
#cmakedefine PROTOCOL_LM76
#cmakedefine PROTOCOL_MUMBI_SWITCH
#cmakedefine PROTOCOL_NEXA_SWITCH
#cmakedefine PROTOCOL_OPENWEATHERMAP
#cmakedefine PROTOCOL_POLLIN_SWITCH
#cmakedefine PROTOCOL_RAW
#cmakedefine PROTOCOL_RELAY
#cmakedefine PROTOCOL_REV
#cmakedefine PROTOCOL_ELRO_SWITCH
#cmakedefine PROTOCOL_SELECTREMOTE
#cmakedefine PROTOCOL_SILVERCREST
#cmakedefine PROTOCOL_WUNDERGROUND
/* Hardware support */
#cmakedefine HARDWARE_433_GPIO
#cmakedefine HARDWARE_433_LIRC
#cmakedefine HARDWARE_433_PILIGHT
#define VERSION "3.0"
#define PULSE_DIV 34
#ifdef WEBSERVER
#define WEBSERVER_PORT 5001
#define WEBSERVER_ROOT "/usr/local/share/pilight/"
#define WEBSERVER_ENABLE 1
#define WEBSERVER_CACHE 1
#define WEBGUI_TEMPLATE "default"
#endif
#define MAX_CLIENTS 30
#define BUFFER_SIZE 1025
#define BIG_BUFFER_SIZE 1024001
#define PID_FILE "/var/run/pilight.pid"
#define CONFIG_FILE "/etc/pilight/config.json"
#define LOG_FILE "/var/log/pilight.log"
#define SETTINGS_FILE "/etc/pilight/settings.json"
#define LOG_MAX_SIZE 1048576 // 1024*1024
#define SEND_REPEATS 10
#define RECEIVE_REPEATS 1
#define UUID_LENGTH 21
#ifdef UPDATE
#define UPDATE_MIRROR "http://apt.pilight.org/mirror.txt"
#define UPDATE_CHECK 1
#define UPDATE_DEVELOPMENT 0
#endif
typedef struct pilight_t {
void (*broadcast)(char *name, JsonNode *message);
void (*send)(JsonNode *json);
void (*receive)(int *rawcode, int rawlen, int plslen, int hwtype);
} pilight_t;
typedef struct firmware_t {
int lpf;
int hpf;
int version;
} firmware_t;
struct pilight_t pilight;
struct firmware_t firmware;
char pilight_uuid[UUID_LENGTH];
#endif