Skip to content

Commit

Permalink
simulator: mqtt log readability
Browse files Browse the repository at this point in the history
  • Loading branch information
openshwprojects committed Oct 3, 2023
1 parent 344251e commit 8a288bc
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/selftest/selftest_util_mqtt.c
Original file line number Diff line number Diff line change
Expand Up @@ -194,13 +194,15 @@ void SIM_OnMQTTPublish(const char *topic, const char *value, int len, int qos, b
f = fopen("sim_lastPublish.txt", "wb");
if (f != 0) {
fprintf(f, "Topic: %s", topic);
fprintf(f, "\n");
fprintf(f, "Payload: %s", value);
fclose(f);
}
if (strlen(value) > 32) {
f = fopen("sim_lastPublish_long.txt", "wb");
if (f != 0) {
fprintf(f, "Topic: %s", topic);
fprintf(f, "\n");
fprintf(f, "Payload: %s", value);
fclose(f);
}
Expand All @@ -209,6 +211,7 @@ void SIM_OnMQTTPublish(const char *topic, const char *value, int len, int qos, b
if (f != 0) {
fprintf(f, "\n");
fprintf(f, "Topic: %s", topic);
fprintf(f, "\n");
fprintf(f, "Payload: %s", value);
fclose(f);
}
Expand Down

0 comments on commit 8a288bc

Please sign in to comment.