libaprs-engine 0.1.2

Protocol-first APRS engine core primitives
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use libaprs_engine::{parse_packet, AprsData};

fn main() -> Result<(), libaprs_engine::ParseError> {
    let packet = parse_packet(b"N0CALL>APRS:>hello")?;

    println!("source={}", String::from_utf8_lossy(packet.source()));
    println!(
        "destination={}",
        String::from_utf8_lossy(packet.destination())
    );

    if let AprsData::Status { text } = packet.aprs_data() {
        println!("status={}", String::from_utf8_lossy(text));
    }

    Ok(())
}