Skip to main content

parse_packet/
parse_packet.rs

1use libaprs_engine::{parse_packet, AprsData};
2
3fn main() -> Result<(), libaprs_engine::ParseError> {
4    let packet = parse_packet(b"N0CALL>APRS:>hello")?;
5
6    println!("source={}", String::from_utf8_lossy(packet.source()));
7    println!(
8        "destination={}",
9        String::from_utf8_lossy(packet.destination())
10    );
11
12    if let AprsData::Status { text } = packet.aprs_data() {
13        println!("status={}", String::from_utf8_lossy(text));
14    }
15
16    Ok(())
17}