libaprs-engine 2.6.0

Protocol-first APRS engine core primitives
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#![cfg(feature = "serde")]

use libaprs_engine::{parse_packet, serde_support::PacketDiagnostic};

#[test]
fn serde_diagnostic_preserves_non_utf8_bytes() {
    let packet = parse_packet(b"N0CALL>APRS:>\xff").expect("packet should parse");
    let diagnostic = PacketDiagnostic::from_packet(&packet);
    let explicit_diagnostic = packet.to_diagnostic();

    assert_eq!(diagnostic.schema_version, 1);
    assert_eq!(diagnostic.raw, b"N0CALL>APRS:>\xff");
    assert_eq!(explicit_diagnostic, diagnostic);
    assert_eq!(diagnostic.semantic, "status");
}