telemetry

package
v0.0.0-...-6e8560c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 29, 2017 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TypeTelemetry = 1
	TypeTiming    = 2
)

Variables

This section is empty.

Functions

func Decode

func Decode(data []byte) (interface{}, error)

func MaxTelemetrySize

func MaxTelemetrySize() int

Types

type Header struct {
	Type uint8
}

same definition and order as common.h in jd3nn1s/nerdobd2

type JSONDuration

type JSONDuration time.Duration

func (JSONDuration) MarshalJSON

func (d JSONDuration) MarshalJSON() ([]byte, error)

type Telemetry

type Telemetry struct {
	RPM         float32
	OilPressure float32
	Speed       float32

	FuelRemaining float32
	FuelLevel     uint8

	OilTemp        float32
	CoolantTemp    float32
	AirIntakeTemp  float32
	BatteryVoltage float32

	Latitude      float64
	Longitude     float64
	Altitude      float32
	Track         float32
	GPSSpeed      float32
	GasPedalAngle uint8
}

func (Telemetry) Encode

func (t Telemetry) Encode() ([]byte, error)

type TelemetryWithStatus

type TelemetryWithStatus struct {
	*Telemetry
	WarningFields []string `json:",omitempty"`
	ErrorFields   []string `json:",omitempty"`
}

func (TelemetryWithStatus) JSONEncode

func (t TelemetryWithStatus) JSONEncode() ([]byte, error)

type Timing

type Timing struct {
	BestLap       JSONDuration
	BestLapDriver string
	LastLap       JSONDuration
	LapCount      int
	DriverName    string

	TeamAheadName     string
	TeamAheadLapCount int
	TeamAheadLastLap  JSONDuration
	TeamAheadSplit    JSONDuration
}

func (Timing) Encode

func (t Timing) Encode() ([]byte, error)

func (Timing) JSONEncode

func (t Timing) JSONEncode() ([]byte, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL