wip: fix timestamps
This commit is contained in:
parent
96796ad794
commit
e8ef22c0d0
|
@ -11,6 +11,7 @@ import (
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
"syscall"
|
"syscall"
|
||||||
|
"time"
|
||||||
|
|
||||||
"github.com/kschamplin/gotelem/skylab"
|
"github.com/kschamplin/gotelem/skylab"
|
||||||
"github.com/urfave/cli/v2"
|
"github.com/urfave/cli/v2"
|
||||||
|
@ -94,7 +95,10 @@ func run(ctx *cli.Context) (err error) {
|
||||||
|
|
||||||
var cd skylab.BusEvent
|
var cd skylab.BusEvent
|
||||||
// this is cursed but easiest way to get a float from a string.
|
// this is cursed but easiest way to get a float from a string.
|
||||||
fmt.Sscanf(segments[0], "(%g)", &cd.Timestamp)
|
var unixSeconds, unixNanos int64
|
||||||
|
fmt.Sscanf(segments[0], "(%d.%d)", &unixSeconds, &unixNanos)
|
||||||
|
slog.Info("hihi hi", "time", unixSeconds)
|
||||||
|
cd.Timestamp = time.Unix(unixSeconds, unixNanos)
|
||||||
|
|
||||||
// this is for the latter part, we need to split id/data
|
// this is for the latter part, we need to split id/data
|
||||||
hexes := strings.Split(segments[2], "#")
|
hexes := strings.Split(segments[2], "#")
|
||||||
|
|
Loading…
Reference in a new issue