Skip to content

Commit db0b7ed

Browse files
committed
Add WORKAROUND_IGNORE_RX_TIME to disable rxtime parsing.
1 parent 83cbf0e commit db0b7ed

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

internal/backend/basicstation/structs/radio_meta_data.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package structs
33
import (
44
"encoding/binary"
55
"math"
6+
"os"
67
"time"
78

89
"github.com/brocaar/chirpstack-api/go/v3/common"
@@ -87,7 +88,9 @@ func SetRadioMetaDataToProto(loraBand band.Band, gatewayID lorawan.EUI64, rmd Ra
8788

8889
}
8990

90-
if rxTime := rmd.UpInfo.RxTime; rxTime != 0 {
91+
// The WORKAROUND_IGNORE_RX_TIME flag is a workaround in case the reported
92+
// rxtime from the Basics Station must be ignored (e.g. it is not accurate).
93+
if rxTime := rmd.UpInfo.RxTime; rxTime != 0 && os.Getenv("WORKAROUND_IGNORE_RX_TIME") == "" {
9194
sec, nsec := math.Modf(rmd.UpInfo.RxTime)
9295
if sec != 0 {
9396
val := time.Unix(int64(sec), int64(nsec))

0 commit comments

Comments
 (0)