diff --git a/telemetry_docs.pdf b/telemetry_docs.pdf new file mode 100644 index 0000000..2abc714 Binary files /dev/null and b/telemetry_docs.pdf differ diff --git a/variables.go b/variables.go index 2bdf80d..735b843 100644 --- a/variables.go +++ b/variables.go @@ -210,6 +210,9 @@ func (i *IBT) Update(timeout time.Duration) (IRacingState, error) { start := i.Headers.BufOffset + i.Vars.Tick*i.Headers.BufLen buf := make([]byte, i.Headers.BufLen) _, err := i.File.ReadAt(buf, int64(start)) + if err == io.EOF { + return Ended, nil + } if err != nil { return Unknown, err } @@ -219,10 +222,6 @@ func (i *IBT) Update(timeout time.Duration) (IRacingState, error) { log.Fatalf("What happened?\n%v\n", err) } - if err == io.EOF { - return Ended, nil - } - // This was previously in the read data method, but it probably fits here better i.Vars.Tick++ }