OBD.NET
1.3.0
.NET 5.0
This package targets .NET 5.0. The package is compatible with this framework or higher.
.NET Framework 4.8
This package targets .NET Framework 4.8. The package is compatible with this framework or higher.
dotnet add package OBD.NET --version 1.3.0
NuGet\Install-Package OBD.NET -Version 1.3.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="OBD.NET" Version="1.3.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add OBD.NET --version 1.3.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: OBD.NET, 1.3.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install OBD.NET as a Cake Addin #addin nuget:?package=OBD.NET&version=1.3.0 // Install OBD.NET as a Cake Tool #tool nuget:?package=OBD.NET&version=1.3.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
OBD.NET
C#-Library to read/write data from/to a car through an ELM327-/STN1170-Adapter
Projects
- OBD.NET - OBD-II implementation in .NET 6/5 and .NET Framework 4.8
- ConsoleClient - Example client application using SerialConnection, running with .NET 6
Usage
- Add the
OBD.NET
package to project
public class Program
{
public static void Main(string[] args)
{
if (args.Length < 1)
{
Console.WriteLine("Parameter ComPort needed.");
IEnumerable<string> availablePorts = SerialConnection.GetAvailablePorts();
Console.WriteLine("\nAvailable ports:");
foreach (string port in availablePorts)
{
Console.WriteLine(port);
}
return;
}
string comPort = args[0];
using SerialConnection connection = new SerialConnection(comPort);
using ELM327 dev = new ELM327(connection, new OBDConsoleLogger(OBDLogLevel.Debug));
dev.SubscribeDataReceived<EngineRPM>((sender, data) => Console.WriteLine("EngineRPM: " + data.Data.Rpm));
dev.SubscribeDataReceived<VehicleSpeed>((sender, data) => Console.WriteLine("VehicleSpeed: " + data.Data));
dev.SubscribeDataReceived<IOBDData>((sender, data) => Console.WriteLine($"PID {data.Data.PID.ToHexString()}: {data.Data}"));
dev.Initialize();
dev.RequestData<FuelType>();
for (int i = 0; i < 5; i++)
{
dev.RequestData<EngineRPM>();
dev.RequestData<VehicleSpeed>();
Thread.Sleep(1000);
}
Console.ReadLine();
//Async example
// MainAsync(comPort).Wait();
//Console.ReadLine();
}
/// <summary>
/// Async example using new RequestDataAsync
/// </summary>
/// <param name="comPort">The COM port.</param>
/// <returns></returns>
public static async Task MainAsync(string comPort)
{
using SerialConnection connection = new SerialConnection(comPort);
using ELM327 dev = new ELM327(connection, new OBDConsoleLogger(OBDLogLevel.Debug));
dev.Initialize();
EngineRPM engineRpm = await dev.RequestDataAsync<EngineRPM>();
Console.WriteLine("Data: " + engineRpm.Rpm);
engineRpm = await dev.RequestDataAsync<EngineRPM>();
Console.WriteLine("Data: " + engineRpm.Rpm);
VehicleSpeed vehicleSpeed = await dev.RequestDataAsync<VehicleSpeed>();
Console.WriteLine("Data: " + vehicleSpeed.Speed);
engineRpm = await dev.RequestDataAsync<EngineRPM>();
Console.WriteLine("Data: " + engineRpm.Rpm);
}
}
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 is compatible. net5.0-windows was computed. net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Framework | net48 is compatible. net481 was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
.NETFramework 4.8
- No dependencies.
-
net5.0
- System.IO.Ports (>= 5.0.1)
-
net6.0
- System.IO.Ports (>= 6.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
1.3.0 | 1,177 | 6/6/2022 |