Hsu.Formats.Trace 2026.7.13

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

Hsu.Formats.Trace

NuGet .NET Standard 2.0 .NET 8.0+ AOT Compatible CAN CAN FD Vector ASC Vector BLF PCAN TRC PCAP PCAPNG

Trace-log and Ethernet-capture support for the Hsu.Formats library.

Supported Formats

Format Extension Description
Vector ASC .asc Vector CANoe/CANalyzer ASCII log — CAN/CAN FD plus official Vector Ethernet packet lines
Vector BLF .blf Vector Binary Logging Format — CAN/CAN FD plus official Ethernet objects
PCAN TRC .trc PEAK PCAN TRC log — versions 1.1, 1.3, 2.0, and 2.1
ASAM MDF .mf4 .dat .mdf ASAM Measurement Data Format — versions 3.00–4.30
Kvaser KME .kme30 .kme40 .kme50 .kme60 Kvaser binary log — Classic CAN and CAN FD
PCAP .pcap libpcap packet capture — single-interface file model
PCAPNG .pcapng PCAP Next Generation capture — multiple interfaces, SHB/IDB/EPB/SPB blocks

Features

  • AOT-compatible (IsAotCompatible=true on net8.0+)
  • AscModel, BlfModel, TrcModel, MdfModel, KmeModel, PcapModel, and PcapngModel implement IFormatModel
  • All parsers implement IAsyncFormatParser
  • Mixed ordered event support through:
    • ITraceEvent
    • ITraceEventLog
    • ITraceEthernetFrame
    • TraceEventKind
  • Streaming parser surfaces:
    • IAsyncStreamingTraceParser / TraceParseSession for frame-oriented readers
    • IAsyncStreamingEventParser / EventParseSession for mixed CAN + Ethernet event streams
    • IAsyncStreamingEthernetParser / EthernetParseSession for capture-style packet streams
  • Official-format ASC Ethernet output via AscWriter
  • BLF Ethernet support for official object types such as ETHERNET_FRAME_EX and ETHERNET_FRAME_FORWARDED
  • PCAP/PCAPNG parsing with little/big-endian and microsecond/nanosecond timestamp handling
  • Incremental file writers:
    • AscFileWriter
    • BlfFileWriter
    • TrcFileWriter

Mixed Event Model

ASC and BLF are not treated as CAN-only containers anymore.

They can preserve ordered mixed-event streams containing:

  • CAN / CAN FD frames
  • Ethernet packet events
  • selected status / statistics / meta events

This is what powers:

  • mixed CAN + Ethernet desktop viewers
  • official-format ASC/BLF Ethernet exports
  • replay planning over trace logs that contain both CAN and Ethernet data

Quick Start

Parse a Vector ASC log

using Hsu.Formats.Asc;

using var stream = File.OpenRead("log.asc");
var model = (AscModel)new AscParser().Parse(stream);

Console.WriteLine($"Frames: {model.Frames.Count}");
Console.WriteLine($"Ethernet events: {model.EthernetFrames.Count}");

Parse a PCAP capture

using Hsu.Formats.Pcap;

using var stream = File.OpenRead("capture.pcap");
var model = (PcapModel)new PcapParser().Parse(stream);

Console.WriteLine($"LinkType: {model.FileInfo.Network}");
Console.WriteLine($"Packets: {model.Packets.Count}");

Stream mixed events from ASC or BLF

using Hsu.Formats.Asc;
using Hsu.Formats.Trace;

var parser = new AscParser();
using var stream = File.OpenRead("log.asc");

EventParseSession session = parser.ParseEventsAsync(stream);
var model = (ITraceEventLog)session.Model;

await foreach (var traceEvent in session.Events)
    Console.WriteLine($"{traceEvent.EventKind} @ {traceEvent.Timestamp}");

Stream Ethernet packets from PCAP

using Hsu.Formats.Ethernet;
using Hsu.Formats.Pcap;

var parser = new PcapParser();
using var stream = File.OpenRead("capture.pcap");

EthernetParseSession session = parser.ParsePacketsAsync(stream);
var model = (PcapModel)session.Model;

await foreach (var packet in session.Packets)
    Console.WriteLine($"{packet.Timestamp.TotalSeconds:F6}s  {packet.Data.Length} bytes");

Conversion Notes

Trace/capture conversions live in Hsu.Formats.Converters.Trace, but a few behavior boundaries are important:

  • ASC/BLF -> PCAP/PCAPNG export Ethernet event subsets as capture packets
  • PCAP/PCAPNG -> ASC/BLF restore packets as Ethernet events in the official target-format syntax
  • PCAP/PCAPNG -> ASC/BLF are Ethernet-oriented conversions, not CAN decoding
  • Some capture-specific metadata may be normalized when converting into trace-log formats that do not have direct fields for every source concept
  • PCAPNG -> PCAP necessarily flattens a richer multi-interface model into PCAP’s single-interface file model

Writer Notes

  • AscWriter emits official Vector Ethernet packet lines only
  • PcapWriter always emits little-endian output
  • PcapngWriter always emits little-endian SHB/IDB/EPB blocks
  • PcapngWriter preserves RawTimestamp when present and reconstructs it from Timestamp only when needed

Documentation

  • Standard format specifications, when present, are documented in the project repository.
  • Project-level architecture and feature design notes are documented in the project repository.
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  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 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. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on Hsu.Formats.Trace:

Package Downloads
Hsu.Formats.Converters.Trace

CAN bus trace log and Ethernet capture format converters for Hsu.Formats (ASC↔BLF↔TRC, PCAP↔PCAPNG, ASC/BLF↔PCAP/PCAPNG).

Hsu.Formats.Replay

Replay engine for Hsu.Formats: schedules recorded CAN and Ethernet logs and emits them over an Ethernet (UDP) transport, preserving the original inter-frame timing.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2026.7.13 272 7/13/2026
2026.5.11-preview.100100 82 5/11/2026
2026.5.7 164 5/7/2026
2026.4.20 212 4/20/2026