From 81a629034296b2f00202d018e8086dae6f837f1b Mon Sep 17 00:00:00 2001 From: Colin Ru <103983752+HalterCru@users.noreply.github.com> Date: Fri, 24 May 2024 09:49:05 +1200 Subject: [PATCH] Revert "gs: Ignore stale tmms (#208)" (#209) This reverts commit 82b3647c40d667d0b8add0a83aa1c7064e0c3027. --- pkg/ttnpb/udp/translation.go | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/pkg/ttnpb/udp/translation.go b/pkg/ttnpb/udp/translation.go index 638c9dfe91..d2eb31120b 100644 --- a/pkg/ttnpb/udp/translation.go +++ b/pkg/ttnpb/udp/translation.go @@ -29,11 +29,10 @@ import ( ) const ( - gpsTimeDelta = 5 * time.Second // for validating tmms/GPS time - delta = 0.001 // For GPS comparisons - lora = "LORA" - fsk = "FSK" - lrfhss = "LR-FHSS" + delta = 0.001 // For GPS comparisons + lora = "LORA" + fsk = "FSK" + lrfhss = "LR-FHSS" // eirpDelta is the delta between EIRP and ERP. eirpDelta = 2.15 @@ -202,15 +201,8 @@ func convertUplink(rx RxPacket, md UpstreamMetadata) (*ttnpb.UplinkMessage, erro var goTime, goGpsTime time.Time switch { case rx.Tmms != nil: - - ggt := gpstime.Parse(time.Duration(*rx.Tmms) * time.Millisecond) - currentUTC := time.Now().UTC() - diff := ggt.Sub(currentUTC).Abs().Seconds() - if diff < gpsTimeDelta.Seconds() { - goGpsTime = ggt - goTime = goGpsTime - } - + goGpsTime = gpstime.Parse(time.Duration(*rx.Tmms) * time.Millisecond) + goTime = goGpsTime case rx.Time != nil: goTime = time.Time(*rx.Time) }