Oakrey.Applications.DecodingServices.LIN 1.0.2

dotnet add package Oakrey.Applications.DecodingServices.LIN --version 1.0.2
                    
NuGet\Install-Package Oakrey.Applications.DecodingServices.LIN -Version 1.0.2
                    
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="Oakrey.Applications.DecodingServices.LIN" Version="1.0.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Oakrey.Applications.DecodingServices.LIN" Version="1.0.2" />
                    
Directory.Packages.props
<PackageReference Include="Oakrey.Applications.DecodingServices.LIN" />
                    
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 Oakrey.Applications.DecodingServices.LIN --version 1.0.2
                    
#r "nuget: Oakrey.Applications.DecodingServices.LIN, 1.0.2"
                    
#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 Oakrey.Applications.DecodingServices.LIN@1.0.2
                    
#: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=Oakrey.Applications.DecodingServices.LIN&version=1.0.2
                    
Install as a Cake Addin
#tool nuget:?package=Oakrey.Applications.DecodingServices.LIN&version=1.0.2
                    
Install as a Cake Tool

Oakrey.Applications.DecodingServices.LIN

A .NET 10 Windows library that decodes received LIN frames using the frames and signals defined in a loaded LDF file. It connects Oakrey.Applications.Ohm.LIN reception with Oakrey.Applications.FileParsing.LDF and exposes decoded frames, frame history, compatible definitions, reactive updates, and live decoder statistics.

Main features

  • Automatically tracks frame definitions from the currently loaded LDF matrix.
  • Decodes frames received through ILinDeviceService into LDF-backed LdfTaskFrame instances.
  • Keeps one live ReceivedFrame per device, channel, and LIN frame ID.
  • Publishes reactive streams when frames are created or updated and periodically publishes decoder statistics.
  • Exposes the receiving channel and device, latest timestamp, receive period, and calculated frame rate.
  • Retains the latest 200 raw-value history entries for each received frame.
  • Reports decoded and unknown frame totals, unique counts, unknown IDs, and per-second rates.
  • Supports explicit frame processing through ProcessFrame in addition to the subscribed device stream.

Architecture

flowchart LR
    LDF[ILdfService] -->|LDF matrix| Decoder[LINDecodingService]
    LIN[ILinDeviceService] -->|received LIN frames| Decoder
    Decoder --> Frames[ReceivedFrames]
    Decoder --> Events[Reactive frame streams]
    Decoder --> Statistics[Decoder statistics]

Key types

Type Description
ILINDecodingService / LINDecodingService Main decoding service and consumer-facing contract.
ReceivedFrame A decoded LDF frame associated with its source device and channel, including receive rate and bounded raw-value history.
CompatibleFrame A frame definition from the currently loaded LDF matrix.
ILinFrame Common contract implemented by compatible and received LIN frames.
StatisticRecord<T> Snapshot of decoder totals, unique counts, unknown IDs, and per-second rates.

Requirements

  • .NET 10 for Windows
  • A configured ILdfService from Oakrey.Applications.FileParsing.LDF
  • A configured ILinDeviceService from Oakrey.Applications.Ohm.LIN

Installation

.NET CLI

dotnet add package Oakrey.Applications.DecodingServices.LIN

Package Manager Console

Install-Package Oakrey.Applications.DecodingServices.LIN

NuGet Package Manager

Search for Oakrey.Applications.DecodingServices.LIN in Tools > NuGet Package Manager > Manage NuGet Packages for Solution.

Registration

Register the service after configuring its LDF and LIN device dependencies:

services.AddSingleton<ILINDecodingService, LINDecodingService>();

The service subscribes to LDF-file and LIN-frame streams when it is created. Loading a new LDF matrix refreshes CompatibleFrames and clears frames decoded from the previous matrix. Duplicate frame identifiers are ignored and reported in one summary log entry.

Example usage

Observe newly discovered frames and subsequent updates:

IDisposable createdSubscription = decodingService.FrameCreated.Subscribe(received =>
{
    Console.WriteLine($"New LIN frame: {received.Frame.Id}");
});

IDisposable updatedSubscription = decodingService.FrameUpdated.Subscribe(received =>
{
    Console.WriteLine($"{received.Frame.Id}: {received.FramesPerSecond:F1} frame/s");
});

Inspect the bounded raw-value history of a received frame:

IDisposable historySubscription = receivedFrame.FrameHistory.Subscribe(entry =>
{
    Console.WriteLine(entry);
});

Read the periodically published statistics, including unknown frame IDs:

IDisposable statisticsSubscription = decodingService.Statistic.Subscribe(statistics =>
{
    Console.WriteLine(
        $"Received: {statistics.TotalReceivedItems}, " +
        $"decoded: {statistics.ItemDecodedCount}, " +
        $"unknown: {statistics.UnknownItemsReceived}");
});

ProcessFrame may also be called explicitly. Frame processing validates and resolves the source channel, updates the keyed frame in constant time, and records unknown identifiers in the statistics. An unknown ID is logged only on its first occurrence.

Dispose subscriptions when they are no longer needed. The decoding service itself is disposable and should normally have the same lifetime as its LDF and LIN device services.

Reliability

  • Frame processing, definition replacement, clearing, and disposal are synchronized.
  • Source observables include explicit error handlers.
  • Received-frame history is bounded and protected against concurrent update and disposal.
  • Notifications are not published after the service has been disposed.
  • ClearReceivedFrames, ClearReceivedItems, and ClearStatistics are safe to call repeatedly.

Project information

Field Value
Author Oakrey
License MIT
Target framework net10.0-windows
NuGet package Oakrey.Applications.DecodingServices.LIN
Repository https://dev.azure.com/oakrey/OpenPackages/_git/ApplicationServices

License

This project is licensed under the MIT License. See the repository's LICENSE file for details.

Product Compatible and additional computed target framework versions.
.NET net10.0-windows7.0 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Oakrey.Applications.DecodingServices.LIN:

Package Downloads
Oakrey.Applications.Dashboards.LIN

Reactive WPF dashboard services and models for displaying signals decoded from LIN frames using LDF definitions.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.2 35 9/4/2026
1.0.1 39 9/4/2026
1.0.0 47 9/4/2026