Another attempt transmit metrics on streaming

This commit is contained in:
Carsten Schmiemann 2022-05-23 23:11:27 +02:00
parent d9d0e00435
commit 2b6285307e

View file

@ -758,26 +758,16 @@ void OvmsServerV3::MetricModified(OvmsMetric* metric)
return;
//metric->ClearModified(MyOvmsServerV3Modifier);
//Set important metrics to modified and clear, to transmit them while streaming
StandardMetrics.ms_v_pos_latitude->IsModifiedAndClear(MyOvmsServerV3Modifier);
StandardMetrics.ms_v_pos_longitude->IsModifiedAndClear(MyOvmsServerV3Modifier);
StandardMetrics.ms_v_pos_direction->IsModifiedAndClear(MyOvmsServerV3Modifier);
StandardMetrics.ms_v_pos_altitude->IsModifiedAndClear(MyOvmsServerV3Modifier);
StandardMetrics.ms_v_pos_gpslock->IsModifiedAndClear(MyOvmsServerV3Modifier);
StandardMetrics.ms_v_pos_gpssq->IsModifiedAndClear(MyOvmsServerV3Modifier);
StandardMetrics.ms_v_pos_gpsmode->IsModifiedAndClear(MyOvmsServerV3Modifier);
StandardMetrics.ms_v_pos_gpshdop->IsModifiedAndClear(MyOvmsServerV3Modifier);
StandardMetrics.ms_v_pos_satcount->IsModifiedAndClear(MyOvmsServerV3Modifier);
StandardMetrics.ms_v_pos_gpsspeed->IsModifiedAndClear(MyOvmsServerV3Modifier);
StandardMetrics.ms_v_pos_speed->IsModifiedAndClear(MyOvmsServerV3Modifier);
StandardMetrics.ms_v_env_drivemode->IsModifiedAndClear(MyOvmsServerV3Modifier);
StandardMetrics.ms_v_bat_power->IsModifiedAndClear(MyOvmsServerV3Modifier);
StandardMetrics.ms_v_bat_energy_used->IsModifiedAndClear(MyOvmsServerV3Modifier);
StandardMetrics.ms_v_bat_energy_recd->IsModifiedAndClear(MyOvmsServerV3Modifier);
StandardMetrics.ms_v_inv_power->IsModifiedAndClear(MyOvmsServerV3Modifier);
StandardMetrics.ms_v_inv_efficiency->IsModifiedAndClear(MyOvmsServerV3Modifier);
TransmitMetric(metric);
while (metric != NULL)
{
if (metric->IsModifiedAndClear(MyOvmsServerV3Modifier))
{
TransmitMetric(metric);
ESP_LOGD(TAG, "metric: %s", (char*)metric);
}
metric = metric->m_next;
}
//TransmitMetric(metric);
m_lasttx_stream = now;
}
}