@@ -158,11 +158,11 @@ class MQTTClient {
158
158
this ->timeout = (uint32_t )timeout;
159
159
}
160
160
161
- boolean connect (const char clientId[]) { return this ->connect (clientId, nullptr , nullptr ); }
161
+ bool connect (const char clientId[]) { return this ->connect (clientId, nullptr , nullptr ); }
162
162
163
- boolean connect (const char clientId[], const char username[]) { return this ->connect (clientId, username, nullptr ); }
163
+ bool connect (const char clientId[], const char username[]) { return this ->connect (clientId, username, nullptr ); }
164
164
165
- boolean connect (const char clientId[], const char username[], const char password[]) {
165
+ bool connect (const char clientId[], const char username[], const char password[]) {
166
166
// close left open connection if still connected
167
167
if (this ->connected ()) {
168
168
this ->close ();
@@ -209,35 +209,35 @@ class MQTTClient {
209
209
return true ;
210
210
}
211
211
212
- boolean publish (const String &topic) { return this ->publish (topic.c_str (), " " ); }
212
+ bool publish (const String &topic) { return this ->publish (topic.c_str (), " " ); }
213
213
214
- boolean publish (const char topic[]) { return this ->publish (topic, " " ); }
214
+ bool publish (const char topic[]) { return this ->publish (topic, " " ); }
215
215
216
- boolean publish (const String &topic, const String &payload) { return this ->publish (topic.c_str (), payload.c_str ()); }
216
+ bool publish (const String &topic, const String &payload) { return this ->publish (topic.c_str (), payload.c_str ()); }
217
217
218
- boolean publish (const String &topic, const String &payload, bool retained, int qos) {
218
+ bool publish (const String &topic, const String &payload, bool retained, int qos) {
219
219
return this ->publish (topic.c_str (), payload.c_str (), retained, qos);
220
220
}
221
221
222
- boolean publish (const char topic[], const String &payload) { return this ->publish (topic, payload.c_str ()); }
222
+ bool publish (const char topic[], const String &payload) { return this ->publish (topic, payload.c_str ()); }
223
223
224
- boolean publish (const char topic[], const String &payload, bool retained, int qos) {
224
+ bool publish (const char topic[], const String &payload, bool retained, int qos) {
225
225
return this ->publish (topic, payload.c_str (), retained, qos);
226
226
}
227
227
228
- boolean publish (const char topic[], const char payload[]) {
228
+ bool publish (const char topic[], const char payload[]) {
229
229
return this ->publish (topic, (char *)payload, (int )strlen (payload));
230
230
}
231
231
232
- boolean publish (const char topic[], const char payload[], bool retained, int qos) {
232
+ bool publish (const char topic[], const char payload[], bool retained, int qos) {
233
233
return this ->publish (topic, (char *)payload, (int )strlen (payload), retained, qos);
234
234
}
235
235
236
- boolean publish (const char topic[], const char payload[], int length) {
236
+ bool publish (const char topic[], const char payload[], int length) {
237
237
return this ->publish (topic, payload, length, false , 0 );
238
238
}
239
239
240
- boolean publish (const char topic[], const char payload[], int length, bool retained, int qos) {
240
+ bool publish (const char topic[], const char payload[], int length, bool retained, int qos) {
241
241
// return immediately if not connected
242
242
if (!this ->connected ()) {
243
243
return false ;
@@ -259,13 +259,13 @@ class MQTTClient {
259
259
return true ;
260
260
}
261
261
262
- boolean subscribe (const String &topic) { return this ->subscribe (topic.c_str ()); }
262
+ bool subscribe (const String &topic) { return this ->subscribe (topic.c_str ()); }
263
263
264
- boolean subscribe (const String &topic, int qos) { return this ->subscribe (topic.c_str (), qos); }
264
+ bool subscribe (const String &topic, int qos) { return this ->subscribe (topic.c_str (), qos); }
265
265
266
- boolean subscribe (const char topic[]) { return this ->subscribe (topic, 0 ); }
266
+ bool subscribe (const char topic[]) { return this ->subscribe (topic, 0 ); }
267
267
268
- boolean subscribe (const char topic[], int qos) {
268
+ bool subscribe (const char topic[], int qos) {
269
269
// return immediately if not connected
270
270
if (!this ->connected ()) {
271
271
return false ;
@@ -280,9 +280,9 @@ class MQTTClient {
280
280
return true ;
281
281
}
282
282
283
- boolean unsubscribe (const String &topic) { return this ->unsubscribe (topic.c_str ()); }
283
+ bool unsubscribe (const String &topic) { return this ->unsubscribe (topic.c_str ()); }
284
284
285
- boolean unsubscribe (const char topic[]) {
285
+ bool unsubscribe (const char topic[]) {
286
286
// return immediately if not connected
287
287
if (!this ->connected ()) {
288
288
return false ;
@@ -297,7 +297,7 @@ class MQTTClient {
297
297
return true ;
298
298
}
299
299
300
- boolean loop () {
300
+ bool loop () {
301
301
// return immediately if not connected
302
302
if (!this ->connected ()) {
303
303
return false ;
@@ -323,7 +323,7 @@ class MQTTClient {
323
323
return true ;
324
324
}
325
325
326
- boolean connected () {
326
+ bool connected () {
327
327
// a client is connected if the network is connected, a client is available and
328
328
// the connection has been properly initiated
329
329
return this ->netClient != nullptr && this ->netClient ->connected () == 1 && this ->_connected ;
@@ -333,7 +333,7 @@ class MQTTClient {
333
333
334
334
lwmqtt_return_code_t returnCode () { return this ->_returnCode ; }
335
335
336
- boolean disconnect () {
336
+ bool disconnect () {
337
337
// return immediately if not connected anymore
338
338
if (!this ->connected ()) {
339
339
return false ;
@@ -349,7 +349,7 @@ class MQTTClient {
349
349
}
350
350
351
351
private:
352
- boolean close () {
352
+ bool close () {
353
353
// set flag
354
354
this ->_connected = false ;
355
355
0 commit comments