roundtrip

command
v1.12.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 21, 2026 License: MIT Imports: 13 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Command roundtrip replays a candump log (candump -L / -l format) through the n2k decode pipeline and verifies that every decoded message re-encodes back to the bytes that were on the wire.

Usage:

go run ./cmd/roundtrip capture.log
candump -L vcan0 | go run ./cmd/roundtrip -

Each CAN frame is fed through the same adapter the live pipeline uses (including fast-packet assembly), then every assembled payload is decoded with pgn.DecodeMessage and re-encoded with pgn.EncodeMessage, which returns a decoded message's original wire payload verbatim rather than reconstructing it field by field. By default every message is printed as a wire / re-encode byte pair (with a marker line under any differing bytes) followed by a summary; -quiet suppresses the per-message output. The result is classified per message:

exact       re-encoded bytes match the wire bytes exactly
padded      bytes match except for trailing 0xFF padding on one side
value-equal bytes differ, but decoding the re-encoded payload yields an
            identical struct (usually reserved-bit or padding conventions)
MISMATCH    re-encoded payload decodes to different field values

The whole log is always processed and the exit status is always 0 (2 for usage or I/O errors). Pass -report <file> to additionally collect every imperfect message (anything not exact/padded) plus the closing summary into a file for later review.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL