Documentation ¶
Index ¶
- Constants
- Variables
- func CheckIfSimIsRunning() bool
- type ApiConfig
- type Flags
- type Header
- type Irsdk
- func (irsdk *Irsdk) Close()
- func (irsdk *Irsdk) DumpHeaders()
- func (irsdk *Irsdk) GetBoolValue(name string) (bool, error)
- func (irsdk *Irsdk) GetBoolValues(name string) ([]bool, error)
- func (irsdk *Irsdk) GetData() bool
- func (irsdk *Irsdk) GetDataWithDataReadyTimeout(dataReadyTimeout time.Duration) bool
- func (irsdk *Irsdk) GetDoubleValue(name string) (float64, error)
- func (irsdk *Irsdk) GetDoubleValues(name string) ([]float64, error)
- func (irsdk *Irsdk) GetFloatValue(name string) (float32, error)
- func (irsdk *Irsdk) GetFloatValues(name string) ([]float32, error)
- func (irsdk *Irsdk) GetIntValue(name string) (int32, error)
- func (irsdk *Irsdk) GetIntValues(name string) ([]int32, error)
- func (irsdk *Irsdk) GetLatestYaml() *yaml.IrsdkYaml
- func (irsdk *Irsdk) GetValue(name string) (any, error)
- func (irsdk *Irsdk) GetValueKeys() []string
- func (irsdk *Irsdk) GetVarHeaders() []VarHeader
- func (irsdk *Irsdk) GetYaml() (*yaml.IrsdkYaml, error)
- func (irsdk *Irsdk) GetYamlString() string
- func (irsdk *Irsdk) RepairedYaml(s string) string
- func (irsdk *Irsdk) WaitForValidData() bool
- func (irsdk *Irsdk) WriteDump(w io.Writer) (int, error)
- type MMap
- type Option
- type SessionState
- type VarBuffer
- type VarHeader
- type VarType
Constants ¶
View Source
const ( SimStatusUrl = "http://127.0.0.1:32034/get_sim_status?object=simStatus" DataValidEventName = "Local\\IRSDKDataValidEvent" )
View Source
const ( MemMapFileSize = 1164 * 1024 MemMapFile = "Local\\IRSDKMemMapFileName" IrsdkMaxBufs = 3 IrsdkMaxString = 32 IrsdkMaxDesc = 64 )
View Source
const ( TrackWetnessUnknown = iota TrackWetnessDry TrackWetnessMostlyDry TrackWetnessVeryLightlyWet TrackWetnessLightlyWet TrackWetnessModeratelyWet TrackWetnessVeryWet TrackWetnessExtremeWet )
Variables ¶
View Source
var ( ErrInvalidDataRequest = errors.New("Invalid data request") ErrNoMatchingDataType = errors.New("requested data type does not match iRacing data type") )
Functions ¶
func CheckIfSimIsRunning ¶
func CheckIfSimIsRunning() bool
Types ¶
type Flags ¶
type Flags int64
const ( FlagCheckered Flags = 1 << iota FlagWhite FlagGreen FlagYello FlagRed FlagBlue FlagDebris FlagCrossed FlagYellowWaving FlagOneLapToGreen FlagGreenHeld FlagTenToGo FlagFiveToGo FlagRandomWaving FlagCaution FlagCautionWaving // driver black flacks FlagBlack Flags = 0x010000 FlagDisqualify Flags = 0x020000 FlagServicible Flags = 0x040000 FlagFurled Flags = 0x080000 FlagRepair Flags = 0x100000 // start lights FlagStartHidden Flags = 0x10000000 FlagStartReady Flags = 0x20000000 FlagStartSet Flags = 0x40000000 FlagStartGo Flags = 0x80000000 )
type Irsdk ¶
type Irsdk struct { SimIsRunning bool // contains filtered or unexported fields }
func NewIrsdkWithFile ¶
func (*Irsdk) DumpHeaders ¶
func (irsdk *Irsdk) DumpHeaders()
func (*Irsdk) GetData ¶
returns true if new valid data is copied from iRacing telemetry to this Irdsk struct
func (*Irsdk) GetDataWithDataReadyTimeout ¶ added in v0.5.0
returns true if new valid data is copied from iRacing telemetry to this Irdsk struct The call will wait up to dataReadyTimeout for new data to arrive
func (*Irsdk) GetLatestYaml ¶
func (*Irsdk) GetValueKeys ¶
func (*Irsdk) GetVarHeaders ¶ added in v0.6.0
func (*Irsdk) GetYamlString ¶
func (*Irsdk) RepairedYaml ¶ added in v0.4.3
replaces the yaml team and user name with a quoted string these values are not quoted in the original yaml and most certainly cause issues
func (*Irsdk) WaitForValidData ¶
type Option ¶ added in v0.5.0
type Option interface {
// contains filtered or unexported methods
}
func WithWaitForValidDataTimeout ¶ added in v0.5.0
type SessionState ¶
type SessionState int32
const ( StateInvalid SessionState = iota StateGetInCar StateWarmup StateParadeLaps StateRacing StateCheckered StateCoolDown )
type VarHeader ¶
type VarHeader struct { Type VarType Offset int32 Count int32 CountAsTime bool Pad [3]byte Name [IrsdkMaxString]byte Desc [IrsdkMaxDesc]byte Unit [IrsdkMaxString]byte }
Click to show internal directories.
Click to hide internal directories.