Crates.io | adsb |
lib.rs | adsb |
version | 0.3.0 |
source | src |
created_at | 2019-03-10 08:44:44.096765 |
updated_at | 2021-02-20 07:46:59.061487 |
description | ADS-B/Mode-S parser |
homepage | |
repository | https://github.com/asmarques/adsb |
max_upload_size | |
id | 119844 |
size | 75,114 |
A Rust parser for ADS-B/Mode-S messages.
Messages with the following Downlink Formats (DF) are supported:
let avr = "*8D4840D6202CC371C32CE0576098;";
let (message, _) = parse_avr(&avr).unwrap();
if let Message {
kind:
MessageKind::ADSBMessage {
kind: ADSBMessageKind::AircraftIdentification { callsign, .. },
..
},
..
} = message
{
println!("callsign: {}", callsign);
}
let bin = b"\x8D\x40\x62\x1D\x58\xC3\x82\xD6\x90\xC8\xAC\x28\x63\xA7";
let (message, _) = parse_binary(bin).unwrap();
if let Message {
kind:
MessageKind::ADSBMessage {
kind: ADSBMessageKind::AirbornePosition { altitude, .. },
..
},
..
} = message
{
println!("altitude: {}", altitude);
}