mirror of
https://github.com/meshtastic/firmware.git
synced 2025-08-15 09:45:06 +00:00
Update HostMetrics.cpp - don't try to print the user string (#7081)
* Update HostMetrics.cpp - don't try to print the user string * Make Trunk Happy
This commit is contained in:
parent
5e92145324
commit
f71fdef3fd
@ -32,12 +32,12 @@ bool HostMetricsModule::handleReceivedProtobuf(const meshtastic_MeshPacket &mp,
|
|||||||
if (t->variant.host_metrics.has_user_string)
|
if (t->variant.host_metrics.has_user_string)
|
||||||
t->variant.host_metrics.user_string[sizeof(t->variant.host_metrics.user_string) - 1] = '\0';
|
t->variant.host_metrics.user_string[sizeof(t->variant.host_metrics.user_string) - 1] = '\0';
|
||||||
|
|
||||||
LOG_INFO("(Received Host Metrics from %s): uptime=%u, diskfree=%lu, memory free=%lu, load=%04.2f, %04.2f, %04.2f, %s",
|
LOG_INFO("(Received Host Metrics from %s): uptime=%u, diskfree=%lu, memory free=%lu, load=%04.2f, %04.2f, %04.2f", sender,
|
||||||
sender, t->variant.host_metrics.uptime_seconds, t->variant.host_metrics.diskfree1_bytes,
|
t->variant.host_metrics.uptime_seconds, t->variant.host_metrics.diskfree1_bytes,
|
||||||
t->variant.host_metrics.freemem_bytes, static_cast<float>(t->variant.host_metrics.load1) / 100,
|
t->variant.host_metrics.freemem_bytes, static_cast<float>(t->variant.host_metrics.load1) / 100,
|
||||||
static_cast<float>(t->variant.host_metrics.load5) / 100,
|
static_cast<float>(t->variant.host_metrics.load5) / 100,
|
||||||
static_cast<float>(t->variant.host_metrics.load15) / 100,
|
static_cast<float>(t->variant.host_metrics.load15) / 100);
|
||||||
t->variant.host_metrics.has_user_string ? t->variant.host_metrics.user_string : "");
|
// t->variant.host_metrics.has_user_string ? t->variant.host_metrics.user_string : "");
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
return false; // Let others look at this message also if they want
|
return false; // Let others look at this message also if they want
|
||||||
@ -124,12 +124,12 @@ meshtastic_Telemetry HostMetricsModule::getHostMetrics()
|
|||||||
bool HostMetricsModule::sendMetrics()
|
bool HostMetricsModule::sendMetrics()
|
||||||
{
|
{
|
||||||
meshtastic_Telemetry telemetry = getHostMetrics();
|
meshtastic_Telemetry telemetry = getHostMetrics();
|
||||||
LOG_INFO("Send: uptime=%u, diskfree=%lu, memory free=%lu, load=%04.2f, %04.2f, %04.2f %s",
|
LOG_INFO("Send: uptime=%u, diskfree=%lu, memory free=%lu, load=%04.2f, %04.2f, %04.2f",
|
||||||
telemetry.variant.host_metrics.uptime_seconds, telemetry.variant.host_metrics.diskfree1_bytes,
|
telemetry.variant.host_metrics.uptime_seconds, telemetry.variant.host_metrics.diskfree1_bytes,
|
||||||
telemetry.variant.host_metrics.freemem_bytes, static_cast<float>(telemetry.variant.host_metrics.load1) / 100,
|
telemetry.variant.host_metrics.freemem_bytes, static_cast<float>(telemetry.variant.host_metrics.load1) / 100,
|
||||||
static_cast<float>(telemetry.variant.host_metrics.load5) / 100,
|
static_cast<float>(telemetry.variant.host_metrics.load5) / 100,
|
||||||
static_cast<float>(telemetry.variant.host_metrics.load15) / 100,
|
static_cast<float>(telemetry.variant.host_metrics.load15) / 100);
|
||||||
telemetry.variant.host_metrics.has_user_string ? telemetry.variant.host_metrics.user_string : "");
|
// telemetry.variant.host_metrics.has_user_string ? telemetry.variant.host_metrics.user_string : "");
|
||||||
|
|
||||||
meshtastic_MeshPacket *p = allocDataProtobuf(telemetry);
|
meshtastic_MeshPacket *p = allocDataProtobuf(telemetry);
|
||||||
p->to = NODENUM_BROADCAST;
|
p->to = NODENUM_BROADCAST;
|
||||||
@ -140,4 +140,4 @@ bool HostMetricsModule::sendMetrics()
|
|||||||
service->sendToMesh(p, RX_SRC_LOCAL, true);
|
service->sendToMesh(p, RX_SRC_LOCAL, true);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user