Skip to content

Commit

Permalink
Add WORKAROUND_IGNORE_RX_TIME to disable rxtime parsing.
Browse files Browse the repository at this point in the history
  • Loading branch information
brocaar committed Apr 18, 2022
1 parent 83cbf0e commit db0b7ed
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion internal/backend/basicstation/structs/radio_meta_data.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package structs
import (
"encoding/binary"
"math"
"os"
"time"

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

}

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

0 comments on commit db0b7ed

Please sign in to comment.