forked from uzbhutta/XlightSmartController
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathxliConfig.h
More file actions
155 lines (128 loc) · 5.2 KB
/
xliConfig.h
File metadata and controls
155 lines (128 loc) · 5.2 KB
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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
// xliConfig.h - Xlight SmartController configuration header
#ifndef xliConfig_h
#define xliConfig_h
//==============================================================
// Product Edition
#define XLIGHT_HOME_EDITION 0
#define XLIGHT_CLASSROOM_EDITION 1
#define XLIGHT_OFFICE_EDITION 2
// Important: set product edition
//#define XLIGHT_EDITION_ID XLIGHT_HOME_EDITION
#define XLIGHT_EDITION_ID XLIGHT_CLASSROOM_EDITION
//#define XLIGHT_EDITION_ID XLIGHT_OFFICE_EDITION
// Module configuration for different editions
#if XLIGHT_EDITION_ID == XLIGHT_OFFICE_EDITION
#define DISABLE_ASR
#endif
#if XLIGHT_EDITION_ID == XLIGHT_CLASSROOM_EDITION
#define DISABLE_ASR
#define DISABLE_BLE
#endif
//==============================================================
/*** USER DEFINES: ***/
#define FAILURE_HANDLING
//#define SYS_SERIAL_DEBUG
#define SYS_RELEASE
#define SYS_TEST
//#define SERIAL_DEBUG
//#define MAINLOOP_TIMER
/**********************/
#define PRIPSTR "%s"
#ifndef pgm_read_word
#define pgm_read_word(p) (*(p))
#endif
#ifdef SERIAL_DEBUG
#define IF_SERIAL_DEBUG(x) ({x;})
#else
#define IF_SERIAL_DEBUG(x)
#endif
#ifdef MAINLOOP_TIMER
#define IF_MAINLOOP_TIMER(x, name) ({unsigned long ulStart = millis(); x; SERIAL_LN("%s spent %lu ms", (name), millis() - ulStart);})
#else
#define IF_MAINLOOP_TIMER(x, name) ({x;})
#endif
// Main Version. Must change if Config_t structure is updated
#define VERSION_CONFIG_DATA 27
// Xlight Application Identification
#define XLA_ORGANIZATION "xlight.ca" // Default value. Read from EEPROM
#define XLA_PRODUCT_NAME "XController" // Default value. Read from EEPROM
#define XLA_AUTHORIZATION "use-token-auth"
#define XLA_TOKEN "your-access-token" // Can update online
//------------------------------------------------------------------
// System level working constants
//------------------------------------------------------------------
// Running Time Environment Parameters
#define RTE_DELAY_PUBLISH 60 // Maximum publish data refresh time in seconds
#define RTE_DELAY_SYSTIMER 10 // System Timer interval, can be very fast, e.g. 50 means 25ms
#define RTE_DELAY_SELFCHECK 100 // Self-check interval
#define RTE_CLOUD_CONN_TIMEOUT 3500 // Timeout for connecting to the Cloud
#define RTE_WIFI_CONN_TIMEOUT 20000 // Timeout for attempting to connect WIFI
#define RTE_WATCHDOG_TIMEOUT 30000 // Maxium WD feed duration
// Number of ticks on System Timer
#define RTE_TICK_FASTPROCESS 1 // Pace of execution of FastProcess
#define RTE_TICK_SLOWPROCESS 10 // Pace of execution of slow process
// Keep alive message timeout
#define RTE_TM_KEEP_ALIVE 16
// Panel Operarion Timers
#define RTE_TM_MAX_CCT_IDLE 6 // Maximum idle time (seconds) in CCT control mode
#define RTE_TM_HELD_TO_DFU 30 // Held duration threshold for DFU
#define RTE_TM_HELD_TO_WIFI 15 // Held duration threshold to enter Wi-Fi setup
#define RTE_TM_HELD_TO_RESET 10 // Held duration threshold to reset
#define RTE_TM_HELD_TO_BASENW 5 // Held duration threshold to enable Base Network
#define RTE_TM_LOOP_KEYCODE 3 // Max idle time of changing loop keycode
// Maximum number of rows for any working memory table implimented using ChainClass
#define MAX_TABLE_SIZE 8
// Maximum number of device associated to one controller
#if XLIGHT_EDITION_ID == XLIGHT_HOME_EDITION
#define MAX_DEVICE_PER_CONTROLLER 8
#else
#define MAX_DEVICE_PER_CONTROLLER 16
#endif
// Maximum number of nodes under one controller
#if XLIGHT_EDITION_ID == XLIGHT_HOME_EDITION
#define MAX_NODE_PER_CONTROLLER 12
#else
#define MAX_NODE_PER_CONTROLLER 48
#endif
// Maximum conditions within a rule
#define MAX_CONDITION_PER_RULE 2
// Default value for maxBaseNetworkDuration (in seconds)
#define MAX_BASE_NETWORK_DUR 180
// Maximum JSON data length
#define COMMAND_JSON_SIZE 64
#define SENSORDATA_JSON_SIZE 196
// Maximum RF messages buffered
#if XLIGHT_EDITION_ID == XLIGHT_HOME_EDITION
#define MQ_MAX_RF_RCVMSG 3
#define MQ_MAX_RF_SNDMSG 5
#else
#define MQ_MAX_RF_RCVMSG 8
#define MQ_MAX_RF_SNDMSG 12
#endif
// Maximum Cloud Command messages buffered
#if XLIGHT_EDITION_ID == XLIGHT_HOME_EDITION
#define MQ_MAX_CLOUD_MSG 5
#else
#define MQ_MAX_CLOUD_MSG 12
#endif
// NodeID Convention
#define NODEID_GATEWAY 0
#define NODEID_MAINDEVICE 1
#define NODEID_MIN_DEVCIE 8
#define NODEID_MAX_DEVCIE 63
#define NODEID_MIN_REMOTE 64
#define NODEID_MAX_REMOTE 127
#define NODEID_PROJECTOR 128
#define NODEID_KEYSIMULATOR 129
#define NODEID_SUPERSENSOR 130
#define NODEID_SMARTPHONE 139
#define NODEID_MIN_GROUP 192
#define NODEID_MAX_GROUP 223
#define NODEID_RF_SCANNER 250
#define NODEID_DUMMY 255
#define BR_MIN_VALUE 1
#define CT_MIN_VALUE 2700
#define CT_MAX_VALUE 6500
#define CT_SCOPE 38
#define CT_STEP ((CT_MAX_VALUE-CT_MIN_VALUE)/10)
#endif /* xliConfig_h */