We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 9471f3e + f94ed5c commit eb8378aCopy full SHA for eb8378a
src/MqttClient.cpp
@@ -260,13 +260,14 @@ bool MqttClient::connect(String id) {
260
connected = false;
261
if (user.isEmpty()) {
262
logInfo("Connect without auth");
263
- if(CLIENT()->connect(id.c_str())) {
264
- connected = true;
265
- }
266
- return connected;
+ connected = CLIENT()->connect(id.c_str());
+ } else {
+ logInfo("Connect with auth");
+ connected = CLIENT()->connect(id.c_str(), user.c_str(), password.c_str());
267
}
268
- return CLIENT()->connect(id.c_str(), user.c_str(), password.c_str());
+ return connected;
269
270
+
271
void MqttClient::handle(void) {
272
if (isBegin == false) {
273
return;
0 commit comments