Skip to content

Commit

Permalink
Use human readable reason code in disconnect handler
Browse files Browse the repository at this point in the history
  • Loading branch information
halfgaar committed Mar 20, 2024
1 parent 9c24283 commit 6486c06
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mqttpacket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1230,7 +1230,7 @@ void MqttPacket::handleDisconnect()

DisconnectData data = parseDisconnectData();

std::string disconnectReason = formatString("MQTT Disconnect received (code %d).", static_cast<uint8_t>(data.reasonCode));
std::string disconnectReason = "MQTT Disconnect received (reason '" + reasonCodeToString(data.reasonCode) + "').";

if (!data.reasonString.empty())
disconnectReason += data.reasonString;
Expand Down

0 comments on commit 6486c06

Please sign in to comment.