mirror of
https://github.com/meshtastic/firmware.git
synced 2025-04-28 02:32:09 +00:00
fix #710. nodes disappearing from map. thanks @DylanHoen for noticing!
This commit is contained in:
parent
418a12e75f
commit
b2c47a7dea
@ -7,7 +7,6 @@
|
||||
#include "CryptoEngine.h"
|
||||
#include "FSCommon.h"
|
||||
#include "GPS.h"
|
||||
#include "main.h"
|
||||
#include "MeshRadio.h"
|
||||
#include "NodeDB.h"
|
||||
#include "PacketHistory.h"
|
||||
@ -16,6 +15,7 @@
|
||||
#include "Router.h"
|
||||
#include "configuration.h"
|
||||
#include "error.h"
|
||||
#include "main.h"
|
||||
#include "mesh-pb-constants.h"
|
||||
#include <pb_decode.h>
|
||||
#include <pb_encode.h>
|
||||
@ -489,7 +489,15 @@ void NodeDB::updatePosition(uint32_t nodeId, const Position &p)
|
||||
|
||||
DEBUG_MSG("DB update position node=0x%x time=%u, latI=%d, lonI=%d\n", nodeId, p.time, p.latitude_i, p.longitude_i);
|
||||
|
||||
info->position = p;
|
||||
// Be careful to only update fields that have been set by the sender
|
||||
if (p.time)
|
||||
info->position.time = p.time;
|
||||
if(p.battery_level)
|
||||
info->position.battery_level = p.battery_level;
|
||||
if (p.latitude_i || p.longitude_i) {
|
||||
info->position.latitude_i = p.latitude_i;
|
||||
info->position.longitude_i = p.longitude_i;
|
||||
}
|
||||
info->has_position = true;
|
||||
updateGUIforNode = info;
|
||||
notifyObservers(true); // Force an update whether or not our node counts have changed
|
||||
@ -606,5 +614,4 @@ void recordCriticalError(CriticalErrorCode code, uint32_t address)
|
||||
myNodeInfo.error_code = code;
|
||||
myNodeInfo.error_address = address;
|
||||
myNodeInfo.error_count++;
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user