forked from pilight/pilight
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pilight.h.in
124 lines (97 loc) · 3.06 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
/*
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_CLARUS
#cmakedefine PROTOCOL_COGEX_SWITCH
#cmakedefine PROTOCOL_COCO_SWITCH
#cmakedefine PROTOCOL_DS18B20
#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_NEXA_SWITCH
#cmakedefine PROTOCOL_RAW
#cmakedefine PROTOCOL_RELAY
#cmakedefine PROTOCOL_ELRO_SWITCH
#cmakedefine PROTOCOL_SELECTREMOTE
/* Hardware support */
#cmakedefine HARDWARE_433_GPIO
#cmakedefine HARDWARE_433_MODULE
#define VERSION "2.1"
#ifdef HARDWARE_433_GPIO
#define HW_MODE "gpio"
#elif defined(HARDWARE_433_MODULE)
#define HW_MODE "module"
#else
#define HW_MODE "none"
#endif
#ifdef HARDWARE_433_GPIO
#define GPIO_IN_PIN 1
#define GPIO_OUT_PIN 0
#define POLL_TIMEOUT 1000
#define RDBUF_LEN 5
#define GPIO_FN_MAXLEN 32
#endif
#ifdef HARDWARE_433_MODULE
#define DEFAULT_LIRC_SOCKET "/dev/lirc0"
#define FREQ433 433920
#define FREQ38 38000
#endif
#define PULSE_DIV 34
#define PORT 5000
#ifdef WEBSERVER
#define WEBSERVER_PORT 5001
#define WEBSERVER_ROOT "/usr/local/share/pilight/"
#define WEBSERVER_ENABLE 1
#define WEBSERVER_CACHE 1
#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 SEND_REPEATS 10
#define RECEIVE_REPEATS 1
#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);
} pilight_t;
struct pilight_t pilight;
#endif