mirror of
https://github.com/airgradienthq/arduino.git
synced 2025-09-25 12:10:56 +02:00
Merge pull request #338 from Adrien-P/fix/mqtt-with-auth-connected-flag
fix: ensure connected flag set for both authenticated connections.
This commit is contained in:
@@ -260,13 +260,14 @@ bool MqttClient::connect(String id) {
|
|||||||
connected = false;
|
connected = false;
|
||||||
if (user.isEmpty()) {
|
if (user.isEmpty()) {
|
||||||
logInfo("Connect without auth");
|
logInfo("Connect without auth");
|
||||||
if(CLIENT()->connect(id.c_str())) {
|
connected = CLIENT()->connect(id.c_str());
|
||||||
connected = true;
|
} else {
|
||||||
}
|
logInfo("Connect with auth");
|
||||||
return connected;
|
connected = CLIENT()->connect(id.c_str(), user.c_str(), password.c_str());
|
||||||
}
|
}
|
||||||
return CLIENT()->connect(id.c_str(), user.c_str(), password.c_str());
|
return connected;
|
||||||
}
|
}
|
||||||
|
|
||||||
void MqttClient::handle(void) {
|
void MqttClient::handle(void) {
|
||||||
if (isBegin == false) {
|
if (isBegin == false) {
|
||||||
return;
|
return;
|
||||||
|
Reference in New Issue
Block a user