Browse Source

changed allowed time hour

master
Angga Bayu Marthafifsa 6 years ago
parent
commit
e3e548b181
  1. 6
      parser/devicePrsInternal.go

6
parser/devicePrsInternal.go

@ -18,6 +18,10 @@ import (
"../model"
)
const (
ALLOWED_TIME_HOUR = -1
)
type ruptelaTchHeader struct {
Length uint16
IMEI uint64
@ -324,7 +328,7 @@ func parseData(data []byte, imei uint64, tagOption *opt.Options) (rec DeviceReco
tstampToNow := time.Since(deviceRecord.Tstamp)
hCurr := math.Round(tstampToNow.Hours()*100)/100
if hCurr >= -24 {
if hCurr >= ALLOWED_TIME_HOUR {
deviceRecords = append(deviceRecords, deviceRecord)
}

Loading…
Cancel
Save