Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
*.user
.vs
Samples/**/docs/
Samples/**/.ai/
artifacts/
bin/
dist/
Expand Down
15 changes: 15 additions & 0 deletions NUGET.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,21 @@ Perfect for building:
- **Telemetry Visualizations** - Create charts and graphs from historical data


## Support for AI-Assisted Development

This package includes an **AI agent guide** that can be referenced in your project.

```
.ai/SVappsLAB.iRacingTelemetrySDK/AGENTS.md
```

Point your AI coding agent to this file for SDK-specific patterns, complete examples, and common pitfalls. For example, reference this file in your prompt, or add this to your project's `AGENTS.md`, `CLAUDE.md`, `.cursorrules`, so it's always available:

```
When working with iRacing telemetry, read the .ai/SVappsLAB.iRacingTelemetrySDK/AGENTS.md reference for SDK usage rules and examples.
```


## Installation

```bash
Expand Down
49 changes: 30 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,11 @@ Perfect for building **real-time dashboards**, **data analysis tools**, **race e
- [Quick Example](#quick-example)
- [Getting Started](#getting-started)
- [Understanding Telemetry Variables](#understanding-telemetry-variables)
- [Performance and Design](#performance-and-design)
- [Performance Monitoring](#performance-monitoring)
- [Samples](#samples)
- [Documentation](#documentation)
- [AI-Assisted Development](#ai-assisted-development)
- [Performance and Design](#performance-and-design)
- [Performance Monitoring](#performance-monitoring)
- [License](#license)

## Features
Expand Down Expand Up @@ -69,12 +70,8 @@ public class Program

## Getting Started

> ⚠️ **v1.0+ Breaking Changes**: This 1.0 version introduces significant API changes with enum-based variable identification and async data streaming. If upgrading from a previous version, see [MIGRATION_GUIDE.md](./MIGRATION_GUIDE.md) for detailed migration instructions.

To incorporate **iRacingTelemetrySDK** into your projects, follow these steps:

> 🤖 **For AI-assisted development**, see [AI_USAGE.md](./Sdk/SVappsLAB.iRacingTelemetrySDK/contents/docs/AI_USAGE.md) - a comprehensive guide with tips, best practices, and examples specifically designed for AI agents to help you build telemetry applications more effectively.

1. **Install the Package:** Add the **iRacingTelemetrySDK** NuGet package to your project using your preferred package manager.

```
Expand Down Expand Up @@ -258,6 +255,33 @@ var hasValue = data.Speed.HasValue;
if (data.IsOnTrackCar == true) { /* ... */ }
```

## Samples

See [Samples Directory](./Samples/README.md) for ready-to-run example projects including:
- Basic telemetry monitoring
- IBT file analysis
- Data export utilities
- Track analysis tools

## Documentation

- **[Migration Guide](./MIGRATION_GUIDE.md)** - Upgrading from early pre-1.0 releases
- **[AI Agent Guide](./Sdk/SVappsLAB.iRacingTelemetrySDK/contents/.ai/AGENTS.md)** - Support for AI coding agents: SDK rules, patterns, and examples

## AI-Assisted Development

This package includes an **AI agent guide** that can be referenced in your project.

```
.ai/SVappsLAB.iRacingTelemetrySDK/AGENTS.md
```

Point your AI coding agent to this file for SDK-specific patterns, complete examples, and common pitfalls. For example, reference this file in your prompt, or add this to your project's `AGENTS.md`, `CLAUDE.md`, `.cursorrules`, so it's always available:

```
When working with iRacing telemetry, read the .ai/SVappsLAB.iRacingTelemetrySDK/AGENTS.md reference for SDK usage rules and examples.
```

## Performance and Design

The SDK is designed for high performance with zero data loss through async data streaming architecture.
Expand Down Expand Up @@ -392,19 +416,6 @@ dotnet-counters monitor --name "YourApp" --counters SVappsLAB.iRacingTelemetrySD

This helps identify performance bottlenecks, monitor processing rates, and detect if records are being dropped due to slow consumption.

## Samples

See [Samples Directory](./Samples/README.md) for ready-to-run example projects including:
- Basic telemetry monitoring
- IBT file analysis
- Data export utilities
- Track analysis tools

## Documentation

- **[Migration Guide](./MIGRATION_GUIDE.md)** - Upgrading from previous (pre-release) versions
- **[AI Assistant Instructions](./Sdk/SVappsLAB.iRacingTelemetrySDK/contents/docs/AI_USAGE.md)** - Documentation for AI Assistants

## License

This project is licensed under the Apache License 2.0. See [LICENSE](./LICENSE) file for details.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
Expand All @@ -8,8 +8,14 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="9.0.7" />
<PackageReference Include="SVappsLAB.iRacingTelemetrySDK" Version="1.0.0" />
<Compile Remove=".ai\**" />
<EmbeddedResource Remove=".ai\**" />
<None Remove=".ai\**" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="10.0.3" />
<PackageReference Include="SVappsLAB.iRacingTelemetrySDK" Version="1.1.0" />
</ItemGroup>

</Project>
16 changes: 8 additions & 8 deletions Samples/DumpVariables_DumpSessionInfo/Program.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
/**
* Copyright (C)2024 Scott Velez
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Expand All @@ -25,7 +25,7 @@ internal class Program

static async Task Main(string[] args)
{
string timeStamp = DateTime.Now.ToString("yyyyMMdd-HHMMss");
string timeStamp = DateTime.Now.ToString("yyyyMMdd-HHmmss");
string VARIABLES_FILENAME = $"iRacingVariables-{timeStamp}.csv";
string SESSIONINFO_FILENAME = $"IRacingSessionInfo-{timeStamp}.yaml";
// amount of time to wait for data
Expand Down Expand Up @@ -99,10 +99,10 @@ static async Task Main(string[] args)
}

// wait for 2 seconds to exit
bool success = await Task.WhenAny(monitorTask, rawSessionTask) == monitorTask ?
monitorTask.Wait(2 * 1000) :
rawSessionTask.Wait(2 * 1000);
logger.LogInformation("Done. Status: {status}", success ? "successful" : "timeout");
var success = await Task.WhenAny(
Task.WhenAll(monitorTask, rawSessionTask),
Task.Delay(2000));
logger.LogInformation("Done. Status: {status}", success.IsCompleted ? "successful" : "timeout");



Expand Down
12 changes: 9 additions & 3 deletions Samples/LocationAndWarnings/LocationAndWarnings.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
Expand All @@ -8,8 +8,14 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="9.0.7" />
<PackageReference Include="SVappsLAB.iRacingTelemetrySDK" Version="1.0.0" />
<Compile Remove=".ai\**" />
<EmbeddedResource Remove=".ai\**" />
<None Remove=".ai\**" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="10.0.3" />
<PackageReference Include="SVappsLAB.iRacingTelemetrySDK" Version="1.1.0" />
</ItemGroup>

</Project>
10 changes: 8 additions & 2 deletions Samples/MinimalExample/MinimalExample.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,14 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="9.0.7" />
<PackageReference Include="SVappsLAB.iRacingTelemetrySDK" Version="1.0.0" />
<Compile Remove=".ai\**" />
<EmbeddedResource Remove=".ai\**" />
<None Remove=".ai\**" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="10.0.3" />
<PackageReference Include="SVappsLAB.iRacingTelemetrySDK" Version="1.1.0" />
</ItemGroup>

</Project>
13 changes: 11 additions & 2 deletions Samples/Samples.sln
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.12.35527.113
# Visual Studio Version 18
VisualStudioVersion = 18.2.11430.68 d18.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DumpVariables_DumpSessionInfo", "DumpVariables_DumpSessionInfo\DumpVariables_DumpSessionInfo.csproj", "{E5CD0CFF-6EF7-4A21-8D39-D58DB1F46CAA}"
EndProject
Expand All @@ -14,6 +14,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "data", "data", "{0C7049E3-E
data\formulair04_tsukuba 2kfull 2024-01-09 17-26-10.ibt = data\formulair04_tsukuba 2kfull 2024-01-09 17-26-10.ibt
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MinimalExample", "MinimalExample\MinimalExample.csproj", "{C8AF870D-4460-655D-61E1-90854FF42B96}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand All @@ -32,8 +34,15 @@ Global
{DE6782F3-44AA-404B-B012-C71C5751DEB9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DE6782F3-44AA-404B-B012-C71C5751DEB9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DE6782F3-44AA-404B-B012-C71C5751DEB9}.Release|Any CPU.Build.0 = Release|Any CPU
{C8AF870D-4460-655D-61E1-90854FF42B96}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C8AF870D-4460-655D-61E1-90854FF42B96}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C8AF870D-4460-655D-61E1-90854FF42B96}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C8AF870D-4460-655D-61E1-90854FF42B96}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {365C8709-FC39-4CF3-B207-8EA768E86B2C}
EndGlobalSection
EndGlobal
9 changes: 8 additions & 1 deletion Samples/SpeedRPMGear/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,14 @@ static async Task Main(string[] args)
cts.Cancel();

// await for all tasks to complete
await Task.WhenAll(monitorTask, keyboardTask, telemetryTask);
try
{
await Task.WhenAll(monitorTask, keyboardTask, telemetryTask);
}
catch (OperationCanceledException)
{
// Expected when cancellation is requested
}


// telemetry data handler
Expand Down
14 changes: 10 additions & 4 deletions Samples/SpeedRPMGear/SpeedRPMGear.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,16 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Diagnostics" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="9.0.7" />
<PackageReference Include="SVappsLAB.iRacingTelemetrySDK" Version="1.0.0" />
<Compile Remove=".ai\**" />
<EmbeddedResource Remove=".ai\**" />
<None Remove=".ai\**" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Diagnostics" Version="10.0.3" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="10.0.3" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="10.0.3" />
<PackageReference Include="SVappsLAB.iRacingTelemetrySDK" Version="1.1.0" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.14.0" PrivateAssets="all" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="5.0.0" PrivateAssets="all" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 2 additions & 0 deletions Sdk/SVappsLAB.iRacingTelemetrySDK/Models/WeekendInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,8 @@ public class WeekendOptions
public int HardcoreLevel { get; set; } // 1
public int NumJokerLaps { get; set; } // 0
public string IncidentLimit { get; set; } // unlimited
public string IncidentWarningInitialLimit { get; set; } // unlimited
public object IncidentWarningSubsequentLimit { get; set; } // unlimited
public string FastRepairsLimit { get; set; } // unlimited
public int GreenWhiteCheckeredLimit { get; set; } // 0

Expand Down
Original file line number Diff line number Diff line change
@@ -1,45 +1,46 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<LangVersion>Latest</LangVersion>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
</PropertyGroup>
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<LangVersion>Latest</LangVersion>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
</PropertyGroup>

<PropertyGroup>
<NoWarn>$(NoWarn);CA1416;CS1591;CS1587</NoWarn>
</PropertyGroup>
<PropertyGroup>
<NoWarn>$(NoWarn);CA1416;CS1591;CS1587</NoWarn>
</PropertyGroup>

<ItemGroup>
<AssemblyAttribute Include="System.Runtime.CompilerServices.InternalsVisibleTo">
<_Parameter1>UnitTests</_Parameter1>
</AssemblyAttribute>
<AssemblyAttribute Include="System.Runtime.CompilerServices.InternalsVisibleTo">
<_Parameter1>SmokeTests</_Parameter1>
</AssemblyAttribute>
</ItemGroup>
<ItemGroup>
<AssemblyAttribute Include="System.Runtime.CompilerServices.InternalsVisibleTo">
<_Parameter1>UnitTests</_Parameter1>
</AssemblyAttribute>
<AssemblyAttribute Include="System.Runtime.CompilerServices.InternalsVisibleTo">
<_Parameter1>SmokeTests</_Parameter1>
</AssemblyAttribute>
</ItemGroup>

<ItemGroup>
<None Include="..\..\NUGET.md" Pack="true" PackagePath="" />
<None Include="..\..\LICENSE" Pack="true" PackagePath="" />
<Content Include="contents\docs\AI_USAGE.md" Pack="true" PackagePath="contentFiles\any\any\docs\SVappsLAB.iRacingTelemetrySDK/AI_USAGE.md" CopyToOutputDirectory="PreserveNewest" />
<None Include="build\SVappsLAB.iRacingTelemetrySDK.props" Pack="true" PackagePath="build\" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Diagnostics.Abstractions" Version="10.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="10.0.0" />
<PackageReference Include="YamlDotNet" Version="16.3.0" />
<ProjectReference Include="..\SVappsLAB.iRacingTelemetrySDK.CodeGen\SVappsLAB.iRacingTelemetrySDK.CodeGen.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false" />
<ProjectReference Include="..\SVappsLAB.iRacingTelemetrySDK.EnumsAndFlags\SVappsLAB.iRacingTelemetrySDK.EnumsAndFlags.csproj" PrivateAssets="all" />
<ItemGroup>
<None Include="..\..\NUGET.md" Pack="true" PackagePath="" />
<None Include="..\..\LICENSE" Pack="true" PackagePath="" />
<Content Include="contents\.ai\AGENTS.md" Pack="true" PackagePath="contentFiles\any\any\.ai\SVappsLAB.iRacingTelemetrySDK/AGENTS.md" CopyToOutputDirectory="PreserveNewest" />
<None Include="build\SVappsLAB.iRacingTelemetrySDK.props" Pack="true" PackagePath="build\" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Diagnostics.Abstractions" Version="10.0.3" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="10.0.3" />
<PackageReference Include="YamlDotNet" Version="16.3.0" />
<ProjectReference Include="..\SVappsLAB.iRacingTelemetrySDK.CodeGen\SVappsLAB.iRacingTelemetrySDK.CodeGen.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false" />
<ProjectReference Include="..\SVappsLAB.iRacingTelemetrySDK.EnumsAndFlags\SVappsLAB.iRacingTelemetrySDK.EnumsAndFlags.csproj" PrivateAssets="all" />

<!-- nuget package - analyzers/dotnet/cs -->
<None Include="..\SVappsLAB.iRacingTelemetrySDK.CodeGen\bin\$(Configuration)\netstandard2.0\SVappsLAB.iRacingTelemetrySDK.CodeGen.dll" Pack="true" PackagePath="analyzers/dotnet/cs" Visible="false" />
<None Include="bin\$(Configuration)\net8.0\SVappsLAB.iRacingTelemetrySDK.EnumsAndFlags.dll" Pack="true" PackagePath="analyzers/dotnet/cs" Visible="false" PrivateAssets="all" />
<!-- nuget package - include enum types with SDK -->
<None Include="bin\$(Configuration)\net8.0\SVappsLAB.iRacingTelemetrySDK.EnumsAndFlags.dll" Pack="true" PackagePath="lib/net8.0" Visible="false" PrivateAssets="all" />
</ItemGroup>
<!-- nuget package - analyzers/dotnet/cs -->
<None Include="..\SVappsLAB.iRacingTelemetrySDK.CodeGen\bin\$(Configuration)\netstandard2.0\SVappsLAB.iRacingTelemetrySDK.CodeGen.dll" Pack="true" PackagePath="analyzers/dotnet/cs" Visible="false" />
<None Include="bin\$(Configuration)\net8.0\SVappsLAB.iRacingTelemetrySDK.EnumsAndFlags.dll" Pack="true" PackagePath="analyzers/dotnet/cs" Visible="false" PrivateAssets="all" />
<!-- nuget package - include enum types with SDK -->
<None Include="bin\$(Configuration)\net8.0\SVappsLAB.iRacingTelemetrySDK.EnumsAndFlags.dll" Pack="true" PackagePath="lib/net8.0" Visible="false" PrivateAssets="all" />
</ItemGroup>

<PropertyGroup>
<PackageId>SVappsLAB.iRacingTelemetrySDK</PackageId>
Expand All @@ -48,7 +49,7 @@
<PackageTags>iRacing iRacingSDK irsdk IBT Telemetry SDK API</PackageTags>
<PackageReadmeFile>NUGET.md</PackageReadmeFile>
<PackageLicenseFile>LICENSE</PackageLicenseFile>
<Version>1.0.0</Version>
<Version>1.1.0</Version>
<Authors>Scott Velez</Authors>
<Company>SVappsLAB</Company>
<Copyright>Copyright (c) 2025 SVappsLAB</Copyright>
Expand Down
Loading
Loading