Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
This commit is contained in:
Wolfgang Nagele 2023-12-25 23:40:16 +01:00 committed by GitHub
parent ba98da55a7
commit 7334ee7349
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -61,7 +61,7 @@ bool PositionModule::handleReceivedProtobuf(const meshtastic_MeshPacket &mp, mes
p.altitude_geoidal_separation, p.PDOP, p.HDOP, p.VDOP, p.sats_in_view, p.fix_quality, p.fix_type, p.timestamp,
p.time);
if (p.time) {
if (p.time && channels.getByIndex(mp.channel).role == meshtastic_Channel_Role_PRIMARY) {
struct timeval tv;
uint32_t secs = p.time;
@ -87,6 +87,7 @@ bool PositionModule::handleReceivedProtobuf(const meshtastic_MeshPacket &mp, mes
meshtastic_MeshPacket *PositionModule::allocReply()
{
if (ignoreRequest) {
ignoreRequest = false; // Reset for next request
return nullptr;
}
@ -150,6 +151,7 @@ meshtastic_MeshPacket *PositionModule::allocReply()
LOG_INFO("Stripping time %u from position send\n", p.time);
p.time = 0;
} else {
p.time = getValidTime(RTCQualityDevice);
LOG_INFO("Providing time to mesh %u\n", p.time);
}
@ -166,7 +168,7 @@ void PositionModule::sendOurPosition(NodeNum dest, bool wantReplies, uint8_t cha
meshtastic_MeshPacket *p = allocReply();
if (p == nullptr) {
LOG_WARN("allocReply returned a nullptr");
LOG_WARN("allocReply returned a nullptr\n");
return;
}