Chdef 0.0.4

There is a newer version of this package available.
See the version list below for details.
dotnet add package Chdef --version 0.0.4
                    
NuGet\Install-Package Chdef -Version 0.0.4
                    
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="Chdef" Version="0.0.4" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Chdef" Version="0.0.4" />
                    
Directory.Packages.props
<PackageReference Include="Chdef" />
                    
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 Chdef --version 0.0.4
                    
#r "nuget: Chdef, 0.0.4"
                    
#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 Chdef@0.0.4
                    
#: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=Chdef&version=0.0.4
                    
Install as a Cake Addin
#tool nuget:?package=Chdef&version=0.0.4
                    
Install as a Cake Tool

chdef

🌐 English | 日本語

CI License: MIT OR Apache-2.0

Channel definitions (CH) and bit-field definitions (BF) for binary frames: parse the CSVs, compute the layout, convert raw ↔ physical.

⚠ Pre-alpha (0.0.x). The API and the CSV rules are still moving; until 0.1.0 lands, patch releases may break either.


What it is

A CH definition (channel definition CSV) gives every field of a binary frame a meaning; a BF definition (bit-field definition CSV) gives every bit of a BF-typed channel a name. chdef is the one Rust implementation of both, so that every consumer reads the same file the same way.

  • Parse a CH CSV / BF CSV — columns are found by header name, spelled in English (number,bytes,…) or Japanese (番号,バイト数,…); a leading BOM is ignored and rows without an integer number are skipped
  • Compute the frame layout (each channel sits at the cumulative bytes, plus the total byte count)
  • Convert raw ↔ physical: value = raw × lsb + offset and back (lsb 0 / empty is 1, SI is signed, endianness selectable, rounding half away from zero, clamped to the channel width)

The columns of both CSVs, with their aliases and how each cell is read, are specified in docs/spec/format.md.

let channels = chdef::parse_ch_csv(ch_csv_text)?;
let bitfields = chdef::parse_bf_csv(bf_csv_text)?;
let layout = chdef::build_layout(channels, bitfields);
let value = layout.channels[0].raw_to_value(&frame[..4]);
let bytes = layout.channels[0].value_to_bytes(value);

The specification lives in docs/spec/; design decisions in docs/decisions/.

Origin

The CH / BF concept was extracted from chbridge-core of chbridge, an internal telemetry bridge. Definition files themselves (real-device channel tables) belong to each consumer; this repository holds synthetic data only.

License

Licensed under either of

at your option.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net8.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
0.0.16 136 8/28/2026
0.0.15 119 8/26/2026
0.0.14 125 8/25/2026
0.0.13 123 8/25/2026
0.0.12 113 8/25/2026
0.0.11 117 8/25/2026
0.0.10 112 8/25/2026
0.0.9 121 8/25/2026
0.0.8 122 8/25/2026
0.0.7 126 8/24/2026
0.0.5 112 8/24/2026
0.0.4 110 8/24/2026
0.0.3 125 8/24/2026