Skip to content

riccardotornesello/irsdk-go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Golang iRacing SDK

Golang implementation of iRacing SDK.

This project is a functional prototype and is not yet ready for production use.

It can be used to read telemetry and session data but some features are still missing.

Install

  1. Execute go get github.com/riccardotornesello/irsdk-go
  2. Enjoy

Usage

Get session info:

package main

import (
    "fmt"
    "github.com/riccardotornesello/irsdk-go"
)

func main() {
    var sdk irsdk.IRSDK
    sdk = irsdk.Init(nil)
    defer sdk.Close()

    userId := sdk.Session.DriverInfo.DriverUserID
    fmt.Printf("User ID: %s", userId)
}

Get telemetry in a loop live

package main

import (
    "fmt"
    "log"

    "github.com/riccardotornesello/irsdk-go"
)

func main() {
    var sdk irsdk.IRSDK
    sdk = irsdk.Init(nil)
    defer sdk.Close()

    for {
        sdk.Update(true)
        speed := sdk.Telemetry["Speed"]
        fmt.Printf("Speed: %s", speed)
    }
}

Examples

Missing features

  • Sending commands to iRacing
  • Better documentation

Credits

  • quimcalpe's iracing-sdk package for the original package, used to better understand the iRacing SDK
  • Iracing C++ SDK for the original implementation of the SDK, useful to get all the defines and structs

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages