Oakrey.DBC.Values
2.1.3
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package Oakrey.DBC.Values --version 2.1.3
NuGet\Install-Package Oakrey.DBC.Values -Version 2.1.3
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.DBC.Values" Version="2.1.3" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Oakrey.DBC.Values" Version="2.1.3" />
<PackageReference Include="Oakrey.DBC.Values" />
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.DBC.Values --version 2.1.3
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Oakrey.DBC.Values, 2.1.3"
#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.DBC.Values@2.1.3
#: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.DBC.Values&version=2.1.3
#tool nuget:?package=Oakrey.DBC.Values&version=2.1.3
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Oakrey.DBC.Values
Overview
Oakrey.DBC.Values is a .NET 10 class library that adds live signal value handling on top of Oakrey.DBC.
It wraps parsed DBC signal and message templates with mutable, data-binding-ready value containers backed by NumericBitArray.
The library is designed for automotive, industrial, and IoT applications that need to read, compose, and validate CAN message payloads at runtime.
Main Features
SignalValue
- Wraps a
Signaltemplate fromOakrey.DBCtogether with aNumericBitArraypayload. - Exposes a scaled
doubleValueproperty (appliesScaleandOffsetfrom the DBC template). - Exposes raw
byte[]/NumericBitArrayaccess viaRawValueandSignalContent. - Implements
INotifyPropertyChangedso it integrates directly with WPF or MAUI bindings. - Computes
DecimalPlacesautomatically from the signal scale. - Provides
MaxBinValuederived from signal size, scale, and offset.
TaskMessage
- Composes a full CAN message payload from all its
SignalValueinstances. - Accepts a
Messagetemplate and builds the signal list automatically. - Supports multiplexed signals (MUX indicator
M/mN):SetValues(byte[])dispatches incoming bytes to the correct mux group.UpdateGetMessage()packs only the active mux group into the outgoing payload.IncreaseMUXCount()andSetMUXPosition(byte)control the active mux index.
ValidateValues(bool zerosCheck)checks all signal values against DBC min/max and scale.- Maintains a rolling receive history (
FixedSizedQueue<string>, last 50 entries). - Copy constructor enables deep-cloning of a live
TaskMessage.
Architecture
graph TD
DBC["Oakrey.DBC<br>(Signal, Message)"]
BitArray["Oakrey.BitArray<br>(NumericBitArray)"]
Collections["Oakrey.Collections<br>(FixedSizedQueue, ForEach)"]
Values["Oakrey.DBC.Values<br>(SignalValue, TaskMessage)"]
DBC --> Values
BitArray --> Values
Collections --> Values
| Type | Responsibility |
|---|---|
SignalValue |
Single signal with scaled value, raw bits, and change notification |
TaskMessage |
Full CAN message with signal set, mux dispatch, and payload encoding |
Requirements
- .NET 10 or higher
Oakrey.DBC(project reference or matching NuGet package)Oakrey.BitArray>= 3.0.0Oakrey.Collections>= 2.0.0
Installation
.NET CLI
dotnet add package Oakrey.DBC.Values
Package Manager Console
Install-Package Oakrey.DBC.Values
NuGet Package Manager
- Open Visual Studio.
- Go to Tools > NuGet Package Manager > Manage NuGet Packages for Solution.
- Search for
Oakrey.DBC.Valuesand click Install.
Example Usage
Create a SignalValue from a DBC Signal template
// Parse a DBC file using Oakrey.DBC
DbcMatrix matrix = DbcReader.Read("vehicle.dbc");
Signal template = matrix.Messages[0].Signals[0];
// Wrap it with a live value container
SignalValue signalValue = new SignalValue(template, initialValue: 12.5);
// Read the scaled value
double current = signalValue.Value;
// Write a new value (fires INotifyPropertyChanged)
signalValue.Value = 13.0;
// Access raw bytes
byte[] raw = signalValue.RawValue;
Build and encode a CAN message
Message messageTemplate = matrix.Messages[0];
TaskMessage taskMessage = new TaskMessage(messageTemplate);
// Set individual signal values
taskMessage.Signals.First(s => s.Name == "EngineSpeed").Value = 3000.0;
// Encode all signals into a CAN payload
byte[] payload = taskMessage.UpdateGetMessage();
Decode a received CAN frame
byte[] receivedBytes = /* bytes from CAN bus */;
taskMessage.SetValues(receivedBytes);
// MUX signals are dispatched automatically
double decoded = taskMessage.Signals.First(s => s.Name == "EngineSpeed").Value;
Validate signal values
bool valid = taskMessage.ValidateValues(zerosCheck: true);
Development Notes
SignalValue.ValueSourceis typed asobject?and reserved for a futureIValueSourceabstraction.UpdateGetMessageusesTrace.TraceErrorfor encoding exceptions; consider wiring up structured logging in production hosts.- MUX part count is inferred from the
mNmultiplex identifiers in the DBC template. - Payload length mismatches in
SetValuesare handled gracefully: excess bytes are trimmed and short arrays are zero-padded.
Project Information
- Author: Oakrey
- License: MIT
- Repository: Azure DevOps
- Package URL: nuget.org/packages/Oakrey.DBC.Values
License
This project is licensed under the MIT License. See the LICENSE file for details.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. 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. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net10.0
- Oakrey.BitArray (>= 3.0.0)
- Oakrey.Collections (>= 2.0.0)
- Oakrey.DBC (>= 3.0.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.