mirror of
https://github.com/meshtastic/firmware.git
synced 2025-12-29 06:00:33 +00:00
oops - we weren't properly stripping timestamps from new style positions
This commit is contained in:
@@ -31,14 +31,25 @@ MeshPacket *PositionPlugin::allocReply()
|
||||
{
|
||||
NodeInfo *node = service.refreshMyNodeInfo(); // should guarantee there is now a position
|
||||
assert(node->has_position);
|
||||
|
||||
return allocDataProtobuf(node->position);
|
||||
|
||||
Position p = node->position;
|
||||
|
||||
// Strip out any time information before sending packets to other nodes - to keep the wire size small (and because other
|
||||
// nodes shouldn't trust it anyways) Note: we allow a device with a local GPS to include the time, so that gpsless
|
||||
// devices can get time.
|
||||
if (getRTCQuality() < RTCQualityGPS) {
|
||||
DEBUG_MSG("Stripping time %u from position send\n", p.time);
|
||||
p.time = 0;
|
||||
} else
|
||||
DEBUG_MSG("Providing time to mesh %u\n", p.time);
|
||||
|
||||
return allocDataProtobuf(p);
|
||||
}
|
||||
|
||||
void PositionPlugin::sendOurPosition(NodeNum dest, bool wantReplies)
|
||||
{
|
||||
// cancel any not yet sent (now stale) position packets
|
||||
if(prevPacketId) // if we wrap around to zero, we'll simply fail to cancel in that rare case (no big deal)
|
||||
if (prevPacketId) // if we wrap around to zero, we'll simply fail to cancel in that rare case (no big deal)
|
||||
service.cancelSending(prevPacketId);
|
||||
|
||||
MeshPacket *p = allocReply();
|
||||
@@ -49,4 +60,3 @@ void PositionPlugin::sendOurPosition(NodeNum dest, bool wantReplies)
|
||||
|
||||
service.sendToMesh(p);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user