20 lines
595 B
Rust
20 lines
595 B
Rust
mod adsb;
|
|
mod location;
|
|
mod aircrafts;
|
|
|
|
#[tokio::main]
|
|
async fn main() -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
|
|
let aircrafts = aircrafts::Aircrafts::load("aircraftDatabase.csv");
|
|
let locations = location::Locations::load("locations.json");
|
|
let mut events = adsb::run("https://adsb.hq.c3d2.de/data.json", locations).await;
|
|
|
|
while let Some(event) = events.recv().await {
|
|
println!("event: {:?}", event);
|
|
if let Some(aircraft) = aircrafts.find(&event.info.get_hex()) {
|
|
println!("aircraft: {:?}", aircraft);
|
|
}
|
|
}
|
|
|
|
Ok(())
|
|
}
|