IsoTp.CANBus.Net 1.0.7

dotnet add package IsoTp.CANBus.Net --version 1.0.7
                    
NuGet\Install-Package IsoTp.CANBus.Net -Version 1.0.7
                    
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="IsoTp.CANBus.Net" Version="1.0.7" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="IsoTp.CANBus.Net" Version="1.0.7" />
                    
Directory.Packages.props
<PackageReference Include="IsoTp.CANBus.Net" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add IsoTp.CANBus.Net --version 1.0.7
                    
#r "nuget: IsoTp.CANBus.Net, 1.0.7"
                    
#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.
#:package IsoTp.CANBus.Net@1.0.7
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=IsoTp.CANBus.Net&version=1.0.7
                    
Install as a Cake Addin
#tool nuget:?package=IsoTp.CANBus.Net&version=1.0.7
                    
Install as a Cake Tool

IsoTp.CANBus.Net

A professional .NET implementation of the ISO 15765-2 (ISO-TP) protocol. This library provides a robust transport layer for automotive diagnostic standards like UDS (ISO 14229) over CAN Bus.

Features

  • Segmentation: Automatically breaks down large messages into multiple CAN frames.
  • Flow Control: Manages transmission pace using SEPARATION_TIME_MIN and BLOCK_SIZE.
  • Reassembly: Reconstructs multiple incoming CAN frames back into a single diagnostic message.
  • Flexible Driver: Easily integrates with any CAN hardware (Vector, PEAK-System, USB-CAN, etc.) via a simple callback mechanism.

Installation

dotnet add package IsoTp.CANBus.Net

Quick Start

1. Initialize CAN Driver

The ICanDriver acts as a bridge between this library and your hardware.

using IsoTp.CANBus.Net;

var canDriver = new ICanDriver();

// Link your hardware-specific send method here
canDriver.SendCanMessage = (id, data, length) => {
    // Call your CAN hardware API (e.g., PCAN, Vector, socketcan, etc.)
    // YourHardware.Write(id, data);
};

To receive messages, you must invoke the hardware bridge.

// Inside your hardware receive loop
public void OnCanFrameArrived(uint id, byte[] data)
{
    // Important: This triggers the ISO-TP reassembly logic
    canDriver.InvokeReceive(id, data);
}

2. Configure ISO-TP Parameters

Define the addressing scheme. Flow control settings (STmin, BS) have sensible defaults.

// Example for a different ECU (e.g., Transmission Control Module)
// These IDs are just examples; use the ones specific to your project.
uint myRequestID  = 0x712; // Example: Physical Request ID
uint myResponseID = 0x71A; // Example: Physical Response ID
uint myFunctionID = 0x7DF; // Example: Functional Broadcast ID (Optional)

// Initialize with your custom IDs
var tpParams = new IsoTpParams(myRequestID, myResponseID, myFunctionID);

// Optional: Override defaults if needed
// tpParams.SEPARATION_TIME_MIN = 10; // 10 ms
// tpParams.BLOCK_SIZE = 8;           // 8 frames per block

3. Setup Processor and Listen for Messages

The IsoTpProcessor handles all the complex logic of the protocol.

var processor = new IsoTpProcessor(tpParams, canDriver);

// Subscribe to reassembled messages
processor.OnMessageReceived += (id, data) => {
    Console.WriteLine($"Received full message from ID {id:X}: {BitConverter.ToString(data)}");
};

4. Sending Data

To send a large diagnostic request, the processor will handle the segmentation automatically.

byte[] requestData = new byte[] { 0x22, 0xF1, 0x90 }; 
processor.SendData(requestData);

// When hardware receives a frame, push it into the driver
// canDriver.InvokeReceive(0x7E8, new byte[] { ... });

Key Parameters Explained

Parameter ISO-TP Term Unit Description
SEPARATION_TIME_MIN STmin Milliseconds The minimum time wait between two Consecutive Frames (CF). Helps prevent overloading the receiver.
BLOCK_SIZE BS Frames The number of Consecutive Frames (CF) allowed to be sent in a single block before waiting for a Flow Control confirm.

Note: Setting BLOCK_SIZE = 0 means the sender can transmit all remaining frames without waiting for further Flow Control.


License

Licensed under the MIT License.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  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.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETStandard 2.0

    • No dependencies.

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.0.7 40 10/8/2026
1.0.6 65 10/7/2026
1.0.5 98 9/22/2026
1.0.4 107 8/25/2026
1.0.3 119 8/24/2026
1.0.2 161 5/9/2026
1.0.1 126 5/8/2026
1.0.0 131 5/8/2026