Reworked metrics structure and split telemetry into device or environ… (#1331)

* Reworked metrics structure and split telemetry into device or environment

* Comment cleanup
This commit is contained in:
Ben Meadors
2022-03-27 14:55:35 +00:00
committed by GitHub
parent 7b8096f5b2
commit ba2fa84ebd
23 changed files with 584 additions and 379 deletions

View File

@@ -490,11 +490,13 @@ void NodeDB::updatePosition(uint32_t nodeId, const Position &p, RxSource src)
/** Update telemetry info for this node based on received metrics
* We only care about device telemetry here
*/
void NodeDB::updateTelemetry(uint32_t nodeId, const Telemetry &t, RxSource src)
{
NodeInfo *info = getOrCreateNode(nodeId);
if (!info) {
// Environment metrics should never go to NodeDb but we'll safegaurd anyway
if (!info || t.which_variant != Telemetry_device_metrics_tag) {
return;
}