mirror of
https://github.com/meshtastic/firmware.git
synced 2025-04-24 17:32:18 +00:00
tryfix random values (#4034)
This commit is contained in:
parent
9632e4c405
commit
181f03cb95
@ -92,7 +92,7 @@ bool AirQualityTelemetryModule::sendTelemetry(NodeNum dest, bool phoneOnly)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
meshtastic_Telemetry m;
|
meshtastic_Telemetry m = meshtastic_Telemetry_init_zero;
|
||||||
m.time = getTime();
|
m.time = getTime();
|
||||||
m.which_variant = meshtastic_Telemetry_air_quality_metrics_tag;
|
m.which_variant = meshtastic_Telemetry_air_quality_metrics_tag;
|
||||||
m.variant.air_quality_metrics.pm10_standard = data.pm10_standard;
|
m.variant.air_quality_metrics.pm10_standard = data.pm10_standard;
|
||||||
|
@ -64,7 +64,7 @@ meshtastic_MeshPacket *DeviceTelemetryModule::allocReply()
|
|||||||
|
|
||||||
meshtastic_Telemetry DeviceTelemetryModule::getDeviceTelemetry()
|
meshtastic_Telemetry DeviceTelemetryModule::getDeviceTelemetry()
|
||||||
{
|
{
|
||||||
meshtastic_Telemetry t;
|
meshtastic_Telemetry t = meshtastic_Telemetry_init_zero;
|
||||||
|
|
||||||
t.time = getTime();
|
t.time = getTime();
|
||||||
t.which_variant = meshtastic_Telemetry_device_metrics_tag;
|
t.which_variant = meshtastic_Telemetry_device_metrics_tag;
|
||||||
|
@ -261,7 +261,7 @@ bool EnvironmentTelemetryModule::handleReceivedProtobuf(const meshtastic_MeshPac
|
|||||||
|
|
||||||
bool EnvironmentTelemetryModule::sendTelemetry(NodeNum dest, bool phoneOnly)
|
bool EnvironmentTelemetryModule::sendTelemetry(NodeNum dest, bool phoneOnly)
|
||||||
{
|
{
|
||||||
meshtastic_Telemetry m;
|
meshtastic_Telemetry m = meshtastic_Telemetry_init_zero;
|
||||||
bool valid = true;
|
bool valid = true;
|
||||||
bool hasSensor = false;
|
bool hasSensor = false;
|
||||||
m.time = getTime();
|
m.time = getTime();
|
||||||
@ -337,7 +337,7 @@ bool EnvironmentTelemetryModule::sendTelemetry(NodeNum dest, bool phoneOnly)
|
|||||||
hasSensor = true;
|
hasSensor = true;
|
||||||
} else {
|
} else {
|
||||||
// prefer bmp280 temp if both sensors are present, fetch only humidity
|
// prefer bmp280 temp if both sensors are present, fetch only humidity
|
||||||
meshtastic_Telemetry m_ahtx;
|
meshtastic_Telemetry m_ahtx = meshtastic_Telemetry_init_zero;
|
||||||
LOG_INFO("AHTX0+BMP280 module detected: using temp from BMP280 and humy from AHTX0\n");
|
LOG_INFO("AHTX0+BMP280 module detected: using temp from BMP280 and humy from AHTX0\n");
|
||||||
aht10Sensor.getMetrics(&m_ahtx);
|
aht10Sensor.getMetrics(&m_ahtx);
|
||||||
m.variant.environment_metrics.relative_humidity = m_ahtx.variant.environment_metrics.relative_humidity;
|
m.variant.environment_metrics.relative_humidity = m_ahtx.variant.environment_metrics.relative_humidity;
|
||||||
|
@ -165,7 +165,7 @@ bool PowerTelemetryModule::handleReceivedProtobuf(const meshtastic_MeshPacket &m
|
|||||||
|
|
||||||
bool PowerTelemetryModule::sendTelemetry(NodeNum dest, bool phoneOnly)
|
bool PowerTelemetryModule::sendTelemetry(NodeNum dest, bool phoneOnly)
|
||||||
{
|
{
|
||||||
meshtastic_Telemetry m;
|
meshtastic_Telemetry m = meshtastic_Telemetry_init_zero;
|
||||||
bool valid = false;
|
bool valid = false;
|
||||||
m.time = getTime();
|
m.time = getTime();
|
||||||
m.which_variant = meshtastic_Telemetry_power_metrics_tag;
|
m.which_variant = meshtastic_Telemetry_power_metrics_tag;
|
||||||
|
Loading…
Reference in New Issue
Block a user