Battery level / telemetry rework (first pass) (#1306)

* Update protos

* Removed battery level from position packets

* Send internal metrics

* Handle telemetry on node info for now

* Fixes

* Default telemetry to enabled and same interval as position

* Fixes for lots of interval issues

* Fixed interval

* Regen

* Cleanup

* Newline

* Update proto ref
This commit is contained in:
Ben Meadors
2022-03-20 14:55:38 +00:00
committed by GitHub
parent bbf044795a
commit e97bd4f9f9
12 changed files with 158 additions and 141 deletions

View File

@@ -488,6 +488,28 @@ void NodeDB::updatePosition(uint32_t nodeId, const Position &p, RxSource src)
notifyObservers(true); // Force an update whether or not our node counts have changed
}
/** Update telemetry info for this node based on received metrics
*/
void NodeDB::updateTelemetry(uint32_t nodeId, const Telemetry &t, RxSource src)
{
NodeInfo *info = getOrCreateNode(nodeId);
if (!info) {
return;
}
if (src == RX_SRC_LOCAL) {
// Local packet, fully authoritative
DEBUG_MSG("updateTelemetry LOCAL\n");
} else {
DEBUG_MSG("updateTelemetry REMOTE node=0x%x \n", nodeId);
}
info->telemetry = t;
info->has_telemetry = true;
updateGUIforNode = info;
notifyObservers(true); // Force an update whether or not our node counts have changed
}
/** Update user info for this node based on received user data
*/
void NodeDB::updateUser(uint32_t nodeId, const User &p)