1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
// (C) 2009-2026, Kees Verruijt, Harlingen, The Netherlands.
//! Build-time version + commit info, and the analyzer JSON version
//! banner that consumers (n2kd) key off.
//!
//! The git SHA is captured by `build.rs` (vergen) into `VERGEN_GIT_SHA` /
//! `VERGEN_GIT_DIRTY`. They are read with `option_env!` because a build
//! outside a git worktree — a crates.io tarball, or `cargo package`'s
//! verification build — has neither.
/// The canboat-rs release version (the human version).
pub const VERSION: &str = env!;
/// Short git SHA of the build, `"-dirty"`-suffixed when the working
/// tree had uncommitted tracked changes. `"unknown"` for a build with
/// no `.git` to ask (a crates.io or source tarball).
/// The one-line analyzer version banner, e.g.
/// `{"version":"0.5.0","commit":"08f08eb","units":"std","protocol":"nmea2000","showLookupValues":true}`.
///
/// Superset of canboat C's banner (`analyzer.c:395`): it carries the
/// extra `commit` and `protocol` fields, but keeps `version` + `units` +
/// `showLookupValues` byte-compatible so C's n2kd — which requires
/// `"version":` and `"showLookupValues":true` in the first line — still
/// accepts a Rust-produced stream, and vice versa.
///
/// `protocol` names the table the records were decoded against
/// (`nmea2000` or `j1939`): the same PGN number means different things
/// on the two, so a consumer has to know. A banner without it (canboat
/// C, Rust before 8.4) is NMEA 2000.