mirror of
https://github.com/Laxilef/OTGateway.git
synced 2025-12-12 03:04:27 +05:00
memory optimization
This commit is contained in:
@@ -629,17 +629,20 @@ protected:
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (settings.debug) {
|
if (settings.debug) {
|
||||||
String payloadStr;
|
Log.strace("MQTT.MSG", "Topic: %s\r\n> ", topic);
|
||||||
payloadStr.reserve(length);
|
|
||||||
for (unsigned int i = 0; i < length; i++) {
|
for (unsigned int i = 0; i < length; i++) {
|
||||||
if ( payload[i] == 10 ) {
|
if ( payload[i] == 10 ) {
|
||||||
payloadStr += "\r\n> ";
|
Log.print("\r\n> ");
|
||||||
} else {
|
|
||||||
payloadStr += (char) payload[i];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Log.strace("MQTT.MSG", "Topic: %s\r\n> %s\n\r\n", topic, payloadStr.c_str());
|
} else {
|
||||||
|
Log.print((char) payload[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Log.print("\r\n\n");
|
||||||
|
|
||||||
|
for (Stream* stream : Log.getStreams()) {
|
||||||
|
stream->flush();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
StaticJsonDocument<2048> doc;
|
StaticJsonDocument<2048> doc;
|
||||||
|
|||||||
Reference in New Issue
Block a user