Relax changes from #4001 to allow GPS and NTP as trusted sources (#4068)

This commit is contained in:
Wolfgang Nagele 2024-06-10 15:10:17 +02:00 committed by GitHub
parent 4f906ae3ae
commit 62b310ac5c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -209,13 +209,13 @@ meshtastic_MeshPacket *PositionModule::allocReply()
p.ground_speed = localPosition.ground_speed;
// 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) {
// nodes shouldn't trust it anyways) Note: we allow a device with a local GPS or NTP to include the time, so that devices
// without can get time.
if (getRTCQuality() < RTCQualityNTP) {
LOG_INFO("Stripping time %u from position send\n", p.time);
p.time = 0;
} else {
p.time = getValidTime(RTCQualityGPS);
p.time = getValidTime(RTCQualityNTP);
LOG_INFO("Providing time to mesh %u\n", p.time);
}