Skip to content

Commit a94f4d5

Browse files
committed
carter feedback implemented
1 parent dd72b39 commit a94f4d5

File tree

1 file changed

+1
-39
lines changed

1 file changed

+1
-39
lines changed

Adafruit_MQTT.cpp

Lines changed: 1 addition & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -329,46 +329,9 @@ uint16_t Adafruit_MQTT::readFullPacket(uint8_t *buffer, uint16_t maxsize,
329329

330330
#ifdef ARDUINO_ARCH_ESP32
331331
const char *Adafruit_MQTT::connectErrorString(int8_t code) {
332-
const char *statusMsg;
333-
switch (code) {
334-
case 1:
335-
statusMsg =
336-
"The Server does not support the level of the MQTT protocol requested";
337-
break;
338-
case 2:
339-
statusMsg =
340-
"The Client identifier is correct UTF-8 but not allowed by the Server";
341-
break;
342-
case 3:
343-
statusMsg = "The MQTT service is unavailable";
344-
break;
345-
case 4:
346-
statusMsg = "The data in the user name or password is malformed";
347-
break;
348-
case 5:
349-
statusMsg = "Not authorized to connect";
350-
break;
351-
case 6:
352-
statusMsg = "Exceeded reconnect rate limit. Please try again later.";
353-
break;
354-
case 7:
355-
statusMsg = "You have been banned from connecting. Please contact the MQTT "
356-
"server administrator for more details.";
357-
break;
358-
case -1:
359-
statusMsg = "Connection failed";
360-
break;
361-
case -2:
362-
statusMsg = "Failed to subscribe";
363-
break;
364-
default:
365-
statusMsg = "Unknown error";
366-
break;
367-
}
368-
return statusMsg;
369-
}
370332
#else
371333
const __FlashStringHelper *Adafruit_MQTT::connectErrorString(int8_t code) {
334+
#endif
372335
switch (code) {
373336
case 1:
374337
return F(
@@ -395,7 +358,6 @@ const __FlashStringHelper *Adafruit_MQTT::connectErrorString(int8_t code) {
395358
return F("Unknown error");
396359
}
397360
}
398-
#endif
399361

400362
bool Adafruit_MQTT::disconnect() {
401363

0 commit comments

Comments
 (0)