| Crates.io | efb |
| lib.rs | efb |
| version | 0.3.3 |
| created_at | 2025-03-16 14:16:30.50354+00 |
| updated_at | 2025-08-13 07:45:25.214452+00 |
| description | Electronic Flight Bag library to plan and conduct a flight. |
| homepage | https://github.com/pearjo/libefb |
| repository | https://github.com/pearjo/libefb |
| max_upload_size | |
| id | 1594444 |
| size | 265,331 |
This library provides utilities to support the flight planning and air
navigation. The lib is written in Rust and intended to be integrated
into EFB applications via one of its language binding (see
bindings/).
[!NOTE] This library is still in the early stage of development with the first milestone to allow a full pre-flight planning. For more, checkout the roadmap.
The efb crate provides the core library. The center piece of this
library is the Flight Management System (FMS). It integrates and
interfaces with all sub-systems that are used for flight planning and
execution. The following example just shows the very basics that we
can enter into the FMS to get started:
use std::path::Path;
use efb::error::Error;
use efb::fms::FMS;
use efb::nd::InputFormat;
fn main() -> Result<(), Error> {
let mut fms = FMS::new();
// Read a ARINC 424 file into the navigation data (ND). You can get
// a dataset at e.g.: https://www.openflightmaps.org
fms.nd()
.read_file(Path::new("arinc_ed.pc"), InputFormat::Arinc424)?;
// Decode a route from EDDH to EDHF with winds at 20 kt from 290° and
// cruising speed of 107 kt and an altitude of 2500 ft.
fms.decode("29020KT N0107 A0250 EDDH DHN2 DHN1 EDHF")?;
// Now we could define an aircraft and continue with our planning
// but for now we'll just print the route
println!("{}", fms.print(40)); // the line length is set to 40 character
Ok(())
}
Running this example with a proper ARINC 424 file, we get the following output:
----------------------------------------
-- ROUTE
----------------------------------------
TO HDG DIST ETE
DHN2 354°M 3.2 NM 00:02
TO HDG DIST ETE
DHN1 354°M 7.5 NM 00:04
TO HDG DIST ETE
EDHF 298°M 19.6 NM 00:13
DIST 30.3 NM
ETE 00:20
Following we have the same example using the C binding that can be used to write other language bindings using their foreign function interface (FFI):
#include "efb.h"
int main(int argc, char *argv[]) {
EfbFMS *fms = efb_fms_new();
efb_fms_nd_read_file(fms, "arinc_ed.pc", Arinc424);
efb_fms_decode(fms, "29020KT N0107 A0250 EDDH DHN2 DHN1 EDHF");
char *printout = efb_fms_print(fms, 40);
printf("%s", printout);
efb_string_free(printout);
efb_fms_free(fms);
return 0;
}
For more on a specific binding and its usage, refer to the READMEs of the bindings.
In a first stage, the library should be extended to allow proper flight planning by adding the following feature:
Once those feature are available and flight planning can be conducted with this library, the goal is to move on to add feature that will be needed in flight: