Oakrey.Applications.DecodingServices.LIN
1.0.1
See the version list below for details.
dotnet add package Oakrey.Applications.DecodingServices.LIN --version 1.0.1
NuGet\Install-Package Oakrey.Applications.DecodingServices.LIN -Version 1.0.1
<PackageReference Include="Oakrey.Applications.DecodingServices.LIN" Version="1.0.1" />
<PackageVersion Include="Oakrey.Applications.DecodingServices.LIN" Version="1.0.1" />
<PackageReference Include="Oakrey.Applications.DecodingServices.LIN" />
paket add Oakrey.Applications.DecodingServices.LIN --version 1.0.1
#r "nuget: Oakrey.Applications.DecodingServices.LIN, 1.0.1"
#:package Oakrey.Applications.DecodingServices.LIN@1.0.1
#addin nuget:?package=Oakrey.Applications.DecodingServices.LIN&version=1.0.1
#tool nuget:?package=Oakrey.Applications.DecodingServices.LIN&version=1.0.1
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
ILinDeviceServiceinto LDF-backedLdfTaskFrameinstances. - Keeps one live
ReceivedFrameper 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
ProcessFramein 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
ILdfServicefromOakrey.Applications.FileParsing.LDF - A configured
ILinDeviceServicefromOakrey.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, andClearStatisticsare 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 | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0-windows7.0 is compatible. |
-
net10.0-windows7.0
- Oakrey.Applications.DecodingServices.Abstractions (>= 1.0.0)
- Oakrey.Applications.FileParsing.LDF (>= 8.0.0)
- Oakrey.Applications.Ohm.LIN (>= 2.0.0)
- Oakrey.LDF.Values (>= 4.0.0)
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.