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_SUBSCRIBE_TOPIC_LENGTH (50)
43 
48 #define MQTT_SENSOR_TOPIC_LENGTH (30)
49 
54 #define MQTT_CLIENT_ID_LENGTH (MQTT_ROOT_TOPIC_LENGTH)
55 
60 #define MQTT_MESSAGE_LENGTH (200)
61 
66 #define MQTT_SERVER_LENGTH (30)
67 
72 #define MQTT_USERNAME_LENGTH (30)
73 
78 #define MQTT_PASSWORD_LENGTH (30)
79 
84 #define MQTT_TIMEOUT_MS (6000)
85 
90 #define MQTT_DEFAULT_SERVER ("rmap.cc")
91 
96 #define MQTT_DEFAULT_PORT (1883)
97 
102 #define MQTT_DEFAULT_ROOT_TOPIC ("")
103 
108 #define MQTT_DEFAULT_MAINT_TOPIC ("")
109 
114 #define MQTT_DEFAULT_SUBSCRIBE_TOPIC ("")
115 
120 #define MQTT_DEFAULT_USERNAME ("")
121 
126 #define MQTT_DEFAULT_PASSWORD ("")
127 
132 #define MQTT_STATUS_TOPIC ("254,0,0/265,0,-,-/B01213")
133 
138 #define MQTT_ON_CONNECT_MESSAGE ("{\"v\":\"conn\"}")
139 
144 #define MQTT_ON_DISCONNECT_MESSAGE ("{\"v\":\"disconn\"}")
145 
150 #define MQTT_ON_ERROR_MESSAGE ("{\"v\":\"error01\"}")
151 
152 #if (MQTT_ROOT_TOPIC_LENGTH + MQTT_SENSOR_TOPIC_LENGTH > 100)
153 #error MQTT root/sensor topic is too big!
154 #endif
155 
156 #endif