DiagCom.DoipCommunication 1.0.0

dotnet add package DiagCom.DoipCommunication --version 1.0.0
NuGet\Install-Package DiagCom.DoipCommunication -Version 1.0.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="DiagCom.DoipCommunication" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add DiagCom.DoipCommunication --version 1.0.0
#r "nuget: DiagCom.DoipCommunication, 1.0.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 DiagCom.DoipCommunication as a Cake Addin
#addin nuget:?package=DiagCom.DoipCommunication&version=1.0.0

// Install DiagCom.DoipCommunication as a Cake Tool
#tool nuget:?package=DiagCom.DoipCommunication&version=1.0.0

Introduction

DiagCom represents a package for vehicle communication based on Doip(IS013400)/UDS(ISO14229). It identifies on the local network vehicles that have Doip support and gives the possibility to run diagnostic services on detected vehicles. Identification is done by reading UDP Vehicle Identification Messages, that provide information about vehicle IP and VIN. Besides vehicle detection and running Diagnostic services, the package has few predefined vehicle commands, such as Clear and Read DTC and Read Battery Voltage. As well as a few logg-related endpoints as start/stop logging and extract logging for a specific vehicle.

Diagnostic Communication Api

In order to run diagnostic commands a vehicle monitor process and a running context need to be created. It can be done by using dependency injection or by an instance of identification monitor and context api(DiagComApi). Vehicle identification monitor(DoipEntityMonitor) is an async method that can be run in a separate process.

var loggerFactory = new LoggerFactory();
var entityLockupLogger = loggerFactory. CreateLogger<EthernetDoipEntityLookup>();

var doipEntityLookup = new EthernetDoipEntityLookup(entityLockupLogger);
var monitor = new DoipEntityMonitor(_doipEntityLookup);
var cancelationToken = new CancellationTokenSource();

await monitor.StartMonitoringAsync(cancelationToken.Token);

DiagComApi needs DoipEntityMonitor, logs and local parse to be instantiated. It contains ExecuteAsync method that runs predefined commands on the specified vehicle.

Get Connected Vehicles

This command returns VINs received and extracted from brodcasted as UDP Vehicle Identification Messages. The result is a list of strings.

var command = new GetVinsCommand();
var result = await diagComApi.ExecuteAsync(command);

Read and Clear DTCs

Read vehicle's DTCs and runs functional before reading clear operation if erase flag is true. If any ECU does not respond a physical request read dtc is sent. Result is merged with input ECUs and not responding ECUs are detected.

var readDtcsCommand = new ReadDtcCommand(ecus:new ushort[3] { 312, 232, 323 }, erase:true);
var dtcsResult = await diagComApi.ExecuteAsync(vin, readDtcsCommand);

Get Dtc Status

Retrieve DTC extended data associated with defined DTC. Extended data consist of status and indicator.

var getDtcsStatus = new GetDtcStatusCommand(ecuAddress:"1001", dtcId:"32F321");
var dtcsStatusResult = await diagComApi.ExecuteAsync(vin, getDtcsStatus);

RawDiagnosticSequence

Executes a sequence of diagnostic services.

var rawDiagSequence = new SingleDiagnosticServiceCommand(targetAddress:321, request: new byte[] { 0x19, 0x02});
var rawDiagSequenceResult = await diagComApi.ExecuteAsync(vin, rawDiagSequence);

Run Diagnostic Sequence

Creates a sequence of diagnostic services and runs them synchronous on specified vehicle.

var diagSequence = new DiagnosticSequence()
{
    Identifier = "id",
    Sequence = new List<DiagnosticService>()
    {
        new DiagnosticService
        {
            EcuAddress = 321,
            Description = "Service to run description",
            Service = "22",
            Payload = "DD01"
        }
    }
};

var diagSequenceCommand = new DiagnosticSequenceCommand(sequence: diagSequence);
var diagSequenceResult = await diagComApi.ExecuteAsync(vin, diagSequenceCommand);
Product Compatible and additional computed target framework versions.
.NET net7.0 is compatible.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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.0 71 5/15/2024

Release of version 1.0.0.0