sdk

package
v0.0.0-...-08f7386 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2022 License: BSD-3-Clause Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CharType     int32 = iota
	BoolType     int32 = iota
	IntType      int32 = iota
	BitfieldType int32 = iota
	FloatType    int32 = iota
	DoubleType   int32 = iota
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Header struct {
	Version  int32 // api version 1 for now
	Status   int32 // bitfield using StatusField
	TickRate int32 // ticks per second (60 or 360 etc)

	// session information, updated periodicaly
	SessionInfoUpdate int32 // Incremented when session info changes
	SessionInfoLen    int32 // Length in bytes of session info string
	SessionInfoOffset int32 // Session info, encoded in YAML format

	// State data, output at tickRate
	NumVars      int32 // length of array pointed to by varHeaderOffset
	HeaderOffset int32 // offset to VarHeader[numVars] array, Describes the variables recieved in varBuf

	NumBuf int32
	BufLen int32
}

Header please keep in mind that order is important

type SDK

type SDK struct {
	Header Header

	TelemetryVars TelemetryVars

	Timeout time.Duration
	// contains filtered or unexported fields
}

func InitSdk

func InitSdk(r reader) (SDK, error)

func (SDK) FindLatestBuffer

func (s SDK) FindLatestBuffer() varBuffer

func (SDK) GetSessionData

func (s SDK) GetSessionData() ([]byte, error)

func (*SDK) GetVar

func (sdk *SDK) GetVar(name string) (Variable, error)

func (SDK) ReadHeader

func (s SDK) ReadHeader() (Header, error)

func (*SDK) ReadVariableValues

func (sdk *SDK) ReadVariableValues() bool

func (SDK) SessionStatusOK

func (s SDK) SessionStatusOK() bool

func (SDK) Unmarshal

func (sdk SDK) Unmarshal(out interface{}) error

type TelemetryVars

type TelemetryVars struct {
	Vars map[string]Variable
	// contains filtered or unexported fields
}

type Variable

type Variable struct {
	VarType     int32 // irsdk_VarType
	Offset      int32 // Offset fron start of buffer row
	Count       int32 // number of entrys (array) so length in bytes would be irsdk_VarTypeBytes[type] * Count
	CountAsTime bool
	Name        string
	Desc        string
	Unit        string
	Value       interface{}
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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