Use the _init_zero macro correctly for HostMetrics (#6837)

This commit is contained in:
Jonathan Bennett 2025-05-17 14:02:39 -05:00 committed by GitHub
parent 5b312ab917
commit 61e4eb12e6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -69,8 +69,9 @@ meshtastic_MeshPacket *HostMetricsModule::allocReply()
meshtastic_Telemetry HostMetricsModule::getHostMetrics() meshtastic_Telemetry HostMetricsModule::getHostMetrics()
{ {
std::string file_line; std::string file_line;
meshtastic_Telemetry t = meshtastic_HostMetrics_init_zero; meshtastic_Telemetry t = meshtastic_Telemetry_init_zero;
t.which_variant = meshtastic_Telemetry_host_metrics_tag; t.which_variant = meshtastic_Telemetry_host_metrics_tag;
t.variant.host_metrics = meshtastic_HostMetrics_init_zero;
if (access("/proc/uptime", R_OK) == 0) { if (access("/proc/uptime", R_OK) == 0) {
std::ifstream proc_uptime("/proc/uptime"); std::ifstream proc_uptime("/proc/uptime");