GithubHelp home page GithubHelp logo

iracing-sdk's Introduction

Golang iRacing SDK

Golang implementation of iRacing SDK

Install

You need a gcc compiler to build the SDK, Golang does not have (as far as I know) unsafe low level access to memory map files and windows broadcast events, so CGO is used to bridge this functions with C native ones. The easiest way is to install MiniGw for 64 bits: https://sourceforge.net/projects/mingw-w64/

With a gcc compiler in place, you can follow the standard path get to external libs in Go

  1. Execute go get github.com/quimcalpe/iracing-sdk

Usage

Simplest example:

package main

import (
    "fmt"
    "github.com/quimcalpe/iracing-sdk"
)

func main() {
    var sdk irsdk.IRSDK
    sdk = irsdk.Init(nil)
    defer sdk.Close()
    speed, _ := sdk.GetVar("Speed")
    fmt.Printf("Speed: %s", speed)
}

Get data in a loop live

package main

import (
    "fmt"
    "log"

    "github.com/quimcalpe/iracing-sdk"
)

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

    for {
        sdk.WaitForData(100 * time.Millisecond)
        speed, err := sdk.GetVar("Speed")
        if err != nil {
            log.Fatal(err)
        }
        fmt.Printf("Speed: %s", speed)
    }
}

Work with an offline ibt file

reader, err := os.Open("data.ibt")
if err != nil {
    log.Fatal(err)
}
sdk = irsdk.Init(reader)
...

Examples

  • Export Telemetry Data and Session yaml to files

  • Broadcast Commands to iRacing

  • Simple Dashboard for external monitors or phones

iracing-sdk's People

Contributors

krajcik avatar quimcalpe avatar sj-si avatar

Forkers

ianhaycox

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.