mirror of
https://github.com/meshtastic/firmware.git
synced 2025-12-17 16:22:48 +00:00
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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user