STIMA  3
mqtt_config.h
Go to the documentation of this file.
1 
3 /*********************************************************************
4 Copyright (C) 2017 Marco Baldinetti <m.baldinetti@digiteco.it>
5 authors:
6 Paolo Patruno <p.patruno@iperbole.bologna.it>
7 Marco Baldinetti <m.baldinetti@digiteco.it>
8 
9 This program is free software; you can redistribute it and/or
10 modify it under the terms of the GNU General Public License as
11 published by the Free Software Foundation; either version 2 of
12 the License, or (at your option) any later version.
13 
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
18 
19 You should have received a copy of the GNU General Public License
20 along with this program. If not, see <http://www.gnu.org/licenses/>.
21 **********************************************************************/
22 
23 #ifndef _MQTT_CONFIG_H
24 #define _MQTT_CONFIG_H
25 
30 #define MQTT_ROOT_TOPIC_LENGTH (50)
31 
36 #define MQTT_MAINT_TOPIC_LENGTH (MQTT_ROOT_TOPIC_LENGTH)
37 
42 #define MQTT_RPC_TOPIC_LENGTH (MQTT_ROOT_TOPIC_LENGTH)
43 
48 #define MQTT_SENSOR_TOPIC_LENGTH (38)
49 
54 #define MQTT_CLIENT_ID_LENGTH (MQTT_ROOT_TOPIC_LENGTH)
55 
60 #define MQTT_MESSAGE_LENGTH (100)
61 
66 #define MQTT_RPC_COMMAND_LENGTH (200)
67 
72 #define MQTT_RPC_RESPONSE_LENGTH (80)
73 
78 #define MQTT_PACKET_SIZE (220)
79 
84 #define MQTT_SERVER_LENGTH (30)
85 
90 #define MQTT_USERNAME_LENGTH (30)
91 
96 #define MQTT_PASSWORD_LENGTH (30)
97 
102 #define STATIONSLUG_LENGTH (30)
103 
108 #define BOARDSLUG_LENGTH (30)
109 
114 #define MQTT_TIMEOUT_MS (6000)
115 
120 #define MQTT_DEFAULT_SERVER ("rmap.cc")
121 
126 #define MQTT_DEFAULT_PORT (1883)
127 
132 #define MQTT_DEFAULT_ROOT_TOPIC ("test")
133 
138 #define MQTT_DEFAULT_MAINT_TOPIC ("test")
139 
144 #define MQTT_DEFAULT_RPC_TOPIC ("test")
145 
150 #define MQTT_DEFAULT_USERNAME ("")
151 
156 #define MQTT_DEFAULT_PASSWORD ("")
157 
162 #define DEFAULT_STATIONSLUG ("")
163 
168 #define DEFAULT_BOARDSLUG ("")
169 
174 #define MQTT_STATUS_TOPIC ("254,0,0/265,0,-,-/B01213")
175 
180 #define MQTT_ON_CONNECT_MESSAGE ("{\"v\":\"conn\",\"s\":%d,\"m\":%d}")
181 
186 #define MQTT_ON_DISCONNECT_MESSAGE ("{\"v\":\"disconn\"}")
187 
192 #define MQTT_ON_ERROR_MESSAGE ("{\"v\":\"error01\"}")
193 
194 #if (MQTT_ROOT_TOPIC_LENGTH + MQTT_SENSOR_TOPIC_LENGTH > 100)
195 #error MQTT root/sensor topic is too big!
196 #endif
197 
198 #endif