|
|
|
@ -9,6 +9,7 @@ import (
|
|
|
|
|
"encoding/binary" |
|
|
|
|
"fmt" |
|
|
|
|
"time" |
|
|
|
|
"math" |
|
|
|
|
//"encoding/hex"
|
|
|
|
|
"strconv" |
|
|
|
|
"sort" |
|
|
|
@ -320,10 +321,18 @@ func parseData(data []byte, imei uint64, tagOption *opt.Options) (rec DeviceReco
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
deviceRecord.TagDevices = tags_ |
|
|
|
|
deviceRecords = append(deviceRecords, deviceRecord) |
|
|
|
|
|
|
|
|
|
tstampToNow := time.Since(deviceRecord.Tstamp) |
|
|
|
|
hCurr := math.Round(tstampToNow.Hours()*100)/100 |
|
|
|
|
if hCurr >= -24 { |
|
|
|
|
deviceRecords = append(deviceRecords, deviceRecord) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
rec.NumRec = uint16(len(deviceRecords)) |
|
|
|
|
|
|
|
|
|
//sort ascending by date
|
|
|
|
|
sort.Sort(ByTstamp(deviceRecords)) |
|
|
|
|
|
|
|
|
|