14
14
@brief Constructor for ELClientMqtt
15
15
@par Example
16
16
@code
17
- ELClientMqtt(ELClient* elc);
17
+ ELClientMqtt(ELClient* elc);
18
18
@endcode
19
19
*/
20
20
ELClientMqtt::ELClientMqtt (ELClient* elc) :_elc(elc) {}
@@ -24,11 +24,11 @@ ELClientMqtt::ELClientMqtt(ELClient* elc) :_elc(elc) {}
24
24
@details Send callback functions for MQTT events to the ESP
25
25
@par Example
26
26
@code
27
- mqtt.connectedCb.attach(mqttConnected);
28
- mqtt.disconnectedCb.attach(mqttDisconnected);
29
- mqtt.publishedCb.attach(mqttPublished);
30
- mqtt.dataCb.attach(mqttData);
31
- mqtt.setup();
27
+ mqtt.connectedCb.attach(mqttConnected);
28
+ mqtt.disconnectedCb.attach(mqttDisconnected);
29
+ mqtt.publishedCb.attach(mqttPublished);
30
+ mqtt.dataCb.attach(mqttData);
31
+ mqtt.setup();
32
32
@endcode
33
33
*/
34
34
void ELClientMqtt::setup (void ) {
@@ -51,18 +51,18 @@ void ELClientMqtt::setup(void) {
51
51
@brief Set MQTT last will.
52
52
@details Sends the "last will" to the ESP.
53
53
@param topic
54
- Last will topic name
54
+ Last will topic name
55
55
@param message
56
- Last will message
56
+ Last will message
57
57
@param qos
58
- (optional) Requested qos level, default 0
58
+ (optional) Requested qos level, default 0
59
59
@param retain
60
- (optional) Requested retain level, default 0
60
+ (optional) Requested retain level, default 0
61
61
@warning At the moment only qos level 0 is implemented and supported!
62
62
@par Example
63
63
@code
64
- Serial.println("ARDUINO: setup mqtt lwt");
65
- mqtt.lwt("/lwt", "offline", 0, 0); //or mqtt.lwt("/lwt", "offline");
64
+ Serial.println("ARDUINO: setup mqtt lwt");
65
+ mqtt.lwt("/lwt", "offline", 0, 0); //or mqtt.lwt("/lwt", "offline");
66
66
@endcode
67
67
*/
68
68
void ELClientMqtt::lwt (const char * topic, const char * message, uint8_t qos, uint8_t retain) {
@@ -78,17 +78,17 @@ void ELClientMqtt::lwt(const char* topic, const char* message, uint8_t qos, uint
78
78
@brief Set MQTT last will.
79
79
@details Sends the "last will" to the ESP with the topic and message stored in program memory
80
80
@param topic
81
- Last will topic name
81
+ Last will topic name
82
82
@param message
83
- Last will message
83
+ Last will message
84
84
@param qos
85
- (optional) Requested qos level, default 0
85
+ (optional) Requested qos level, default 0
86
86
@param retain
87
- (optional) Requested retain level, default 0
87
+ (optional) Requested retain level, default 0
88
88
@warning At the moment only qos level 0 is implemented and supported!
89
89
@par Example
90
90
@code
91
- no example code yet
91
+ no example code yet
92
92
@endcode
93
93
*/
94
94
void ELClientMqtt::lwt (const __FlashStringHelper* topic, const __FlashStringHelper* message,
@@ -108,14 +108,14 @@ void ELClientMqtt::lwt(const __FlashStringHelper* topic, const __FlashStringHelp
108
108
@brief Subscribe to MQTT topic
109
109
@details Sends the MQTT subscription request to the ESP
110
110
@param topic
111
- Topic name
111
+ Topic name
112
112
@param qos
113
- (optional) Requested qos level, default 0
113
+ (optional) Requested qos level, default 0
114
114
@warning At the moment only qos level 0 is implemented and supported!
115
115
@par Example
116
116
@code
117
- mqtt.subscribe("/esp-link/1");
118
- mqtt.subscribe("/hello/world/#");
117
+ mqtt.subscribe("/esp-link/1");
118
+ mqtt.subscribe("/hello/world/#");
119
119
@endcode
120
120
*/
121
121
void ELClientMqtt::subscribe (const char * topic, uint8_t qos) {
@@ -129,13 +129,13 @@ void ELClientMqtt::subscribe(const char* topic, uint8_t qos) {
129
129
@brief Subscribe to MQTT topic
130
130
@details Sends the MQTT subscription request to the ESP with the topic and message stored in program memory
131
131
@param topic
132
- Topic name
132
+ Topic name
133
133
@param qos
134
- (optional) Requested qos level, default 0
134
+ (optional) Requested qos level, default 0
135
135
@warning At the moment only qos level 0 is implemented and supported!
136
136
@par Example
137
137
@code
138
- no example code yet
138
+ no example code yet
139
139
@endcode
140
140
*/
141
141
void ELClientMqtt::subscribe (const __FlashStringHelper* topic, uint8_t qos) {
@@ -151,23 +151,23 @@ void ELClientMqtt::subscribe(const __FlashStringHelper* topic, uint8_t qos) {
151
151
@brief Subscribe to MQTT topic
152
152
@details Sends the MQTT subscription request to the ESP
153
153
@param topic
154
- Topic name
154
+ Topic name
155
155
@param data
156
- Pointer to data buffer
156
+ Pointer to data buffer
157
157
@param len
158
- Size of data buffer
158
+ Size of data buffer
159
159
@param qos
160
- (optional) Requested qos level, default 0
160
+ (optional) Requested qos level, default 0
161
161
@param retain
162
- (optional) Requested retain level, default 0
162
+ (optional) Requested retain level, default 0
163
163
@warning At the moment only qos level 0 is implemented and supported!
164
164
@par Example
165
165
@code
166
- char buf[12];
167
- itoa(count++, buf, 10);
168
- mqtt.publish("/esp-link/1", buf);
169
- itoa(count+99, buf, 10);
170
- mqtt.publish("/hello/world/arduino", buf, 12);
166
+ char buf[12];
167
+ itoa(count++, buf, 10);
168
+ mqtt.publish("/esp-link/1", buf);
169
+ itoa(count+99, buf, 10);
170
+ mqtt.publish("/hello/world/arduino", buf, 12);
171
171
@endcode
172
172
*/
173
173
void ELClientMqtt::publish (const char * topic, const uint8_t * data, const uint16_t len,
@@ -186,21 +186,21 @@ void ELClientMqtt::publish(const char* topic, const uint8_t* data, const uint16_
186
186
@brief Subscribe to MQTT topic
187
187
@details Sends the MQTT subscription request to the ESP. Data must be null-terminated
188
188
@param topic
189
- Topic name
189
+ Topic name
190
190
@param data
191
- Pointer to data buffer
191
+ Pointer to data buffer
192
192
@param qos
193
- (optional) Requested qos level, default 0
193
+ (optional) Requested qos level, default 0
194
194
@param retain
195
- (optional) Requested retain level, default 0
195
+ (optional) Requested retain level, default 0
196
196
@warning At the moment only qos level 0 is implemented and supported!
197
197
@par Example
198
198
@code
199
- char buf[12];
200
- itoa(count++, buf, 10);
201
- mqtt.publish("/esp-link/1", buf);
202
- itoa(count+99, buf, 10);
203
- mqtt.publish("/hello/world/arduino", buf);
199
+ char buf[12];
200
+ itoa(count++, buf, 10);
201
+ mqtt.publish("/esp-link/1", buf);
202
+ itoa(count+99, buf, 10);
203
+ mqtt.publish("/hello/world/arduino", buf);
204
204
@endcode
205
205
*/
206
206
void ELClientMqtt::publish (const char * topic, const char * data, uint8_t qos, uint8_t retain)
@@ -212,19 +212,19 @@ void ELClientMqtt::publish(const char* topic, const char* data, uint8_t qos, uin
212
212
@brief Subscribe to MQTT topic
213
213
@details Sends the MQTT subscription request to the ESP with the topic and data stored in program memory
214
214
@param topic
215
- Topic name
215
+ Topic name
216
216
@param data
217
- Pointer to data buffer
217
+ Pointer to data buffer
218
218
@param len
219
- Size of data buffer
219
+ Size of data buffer
220
220
@param qos
221
- (optional) Requested qos level, default 0
221
+ (optional) Requested qos level, default 0
222
222
@param retain
223
- (optional) Requested retain level, default 0
223
+ (optional) Requested retain level, default 0
224
224
@warning At the moment only qos level 0 is implemented and supported!
225
225
@par Example
226
226
@code
227
- no example code yet
227
+ no example code yet
228
228
@endcode
229
229
*/
230
230
void ELClientMqtt::publish (const __FlashStringHelper* topic, const __FlashStringHelper* data,
@@ -243,19 +243,19 @@ void ELClientMqtt::publish(const __FlashStringHelper* topic, const __FlashString
243
243
@brief Subscribe to MQTT topic
244
244
@details Sends the MQTT subscription request to the ESP with the data stored in program memory
245
245
@param topic
246
- Topic name
246
+ Topic name
247
247
@param data
248
- Pointer to data buffer
248
+ Pointer to data buffer
249
249
@param len
250
- Size of data buffer
250
+ Size of data buffer
251
251
@param qos
252
- (optional) Requested qos level, default 0
252
+ (optional) Requested qos level, default 0
253
253
@param retain
254
- (optional) Requested retain level, default 0
254
+ (optional) Requested retain level, default 0
255
255
@warning At the moment only qos level 0 is implemented and supported!
256
256
@par Example
257
257
@code
258
- no example code yet
258
+ no example code yet
259
259
@endcode
260
260
*/
261
261
void ELClientMqtt::publish (const char * topic, const __FlashStringHelper* data,
@@ -274,19 +274,19 @@ void ELClientMqtt::publish(const char* topic, const __FlashStringHelper* data,
274
274
@brief Subscribe to MQTT topic
275
275
@details Sends the MQTT subscription request to the ESP with the topic stored in program memory
276
276
@param topic
277
- Topic name
277
+ Topic name
278
278
@param data
279
- Pointer to data buffer
279
+ Pointer to data buffer
280
280
@param len
281
- Size of data buffer
281
+ Size of data buffer
282
282
@param qos
283
- (optional) Requested qos level, default 0
283
+ (optional) Requested qos level, default 0
284
284
@param retain
285
- (optional) Requested retain level, default 0
285
+ (optional) Requested retain level, default 0
286
286
@warning At the moment only qos level 0 is implemented and supported!
287
287
@par Example
288
288
@code
289
- no example code yet
289
+ no example code yet
290
290
@endcode
291
291
*/
292
292
void ELClientMqtt::publish (const __FlashStringHelper* topic, const uint8_t * data,
0 commit comments