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
<PackageReference Include="Hsu.Formats.Trace" Version="2026.7.13" />
<PackageVersion Include="Hsu.Formats.Trace" Version="2026.7.13" />
<PackageReference Include="Hsu.Formats.Trace" />
paket add Hsu.Formats.Trace --version 2026.7.13
#r "nuget: Hsu.Formats.Trace, 2026.7.13"
#:package Hsu.Formats.Trace@2026.7.13
#addin nuget:?package=Hsu.Formats.Trace&version=2026.7.13
#tool nuget:?package=Hsu.Formats.Trace&version=2026.7.13
Hsu.Formats.Trace
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=trueon net8.0+) AscModel,BlfModel,TrcModel,MdfModel,KmeModel,PcapModel, andPcapngModelimplementIFormatModel- All parsers implement
IAsyncFormatParser - Mixed ordered event support through:
ITraceEventITraceEventLogITraceEthernetFrameTraceEventKind
- Streaming parser surfaces:
IAsyncStreamingTraceParser/TraceParseSessionfor frame-oriented readersIAsyncStreamingEventParser/EventParseSessionfor mixed CAN + Ethernet event streamsIAsyncStreamingEthernetParser/EthernetParseSessionfor capture-style packet streams
- Official-format ASC Ethernet output via
AscWriter - BLF Ethernet support for official object types such as
ETHERNET_FRAME_EXandETHERNET_FRAME_FORWARDED - PCAP/PCAPNG parsing with little/big-endian and microsecond/nanosecond timestamp handling
- Incremental file writers:
AscFileWriterBlfFileWriterTrcFileWriter
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/PCAPNGexport Ethernet event subsets as capture packetsPCAP/PCAPNG -> ASC/BLFrestore packets as Ethernet events in the official target-format syntaxPCAP/PCAPNG -> ASC/BLFare 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 -> PCAPnecessarily flattens a richer multi-interface model into PCAP’s single-interface file model
Writer Notes
AscWriteremits official Vector Ethernet packet lines onlyPcapWriteralways emits little-endian outputPcapngWriteralways emits little-endian SHB/IDB/EPB blocksPcapngWriterpreservesRawTimestampwhen present and reconstructs it fromTimestamponly 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 | Versions 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. |
-
.NETStandard 2.0
- Hsu.Formats.Abstractions (>= 2026.7.13)
- Microsoft.Bcl.AsyncInterfaces (>= 8.0.0)
-
net8.0
- Hsu.Formats.Abstractions (>= 2026.7.13)
- Microsoft.Bcl.AsyncInterfaces (>= 8.0.0)
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 |