Skip to content

Commit f75acd8

Browse files
authored
fix: Log correct host (GoogleCloudPlatform#192)
1 parent bb89792 commit f75acd8

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

src/CloudIoTCoreMqtt.cpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -161,11 +161,8 @@ void CloudIoTCoreMqtt::mqttConnectAsync(bool skip) {
161161
}
162162

163163
void CloudIoTCoreMqtt::startMQTT() {
164-
if (this->useLts) {
165-
this->mqttClient->begin(CLOUD_IOT_CORE_MQTT_HOST_LTS, CLOUD_IOT_CORE_MQTT_PORT, *netClient);
166-
} else {
167-
this->mqttClient->begin(CLOUD_IOT_CORE_MQTT_HOST, CLOUD_IOT_CORE_MQTT_PORT, *netClient);
168-
}
164+
this->mqttClient->begin(useLts ? CLOUD_IOT_CORE_MQTT_HOST_LTS : CLOUD_IOT_CORE_MQTT_HOST,
165+
CLOUD_IOT_CORE_MQTT_PORT, *netClient);
169166
this->mqttClient->onMessage(messageReceived);
170167
}
171168

@@ -251,7 +248,7 @@ void CloudIoTCoreMqtt::logError() {
251248
}
252249

253250
void CloudIoTCoreMqtt::logConfiguration(bool showJWT) {
254-
Serial.println("Connect with " + String(CLOUD_IOT_CORE_MQTT_HOST_LTS) +
251+
Serial.println("Connect with " + String(useLts ? CLOUD_IOT_CORE_MQTT_HOST_LTS : CLOUD_IOT_CORE_MQTT_HOST) +
255252
":" + String(CLOUD_IOT_CORE_MQTT_PORT));
256253
Serial.println("ClientId: " + device->getClientId());
257254
if (showJWT) {

0 commit comments

Comments
 (0)