Skip to content

Commit

Permalink
wip vector code
Browse files Browse the repository at this point in the history
  • Loading branch information
pd0wm committed Jul 15, 2024
1 parent 5010f8d commit 8d115f4
Show file tree
Hide file tree
Showing 10 changed files with 1,352 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
/target
.vscode/
.DS_Store

# TODO: Remove
windows/
bindings.rs
201 changes: 201 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ tokio = { version = "1.36.0", features = ["full"] }
tokio-stream = "0.1.14"
tracing = "0.1"

[build-dependencies]
bindgen = "0.69.4"

[target.'cfg(target_os = "linux")'.dependencies]
socket2 = "0.5.7"
libc = "0.2.154"
Expand Down
18 changes: 18 additions & 0 deletions build.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
use std::env;
use std::path::PathBuf;

fn main() {
println!("cargo:rustc-link-search=windows/");
println!("cargo:rustc-link-lib=vxlapi");

let bindings = bindgen::Builder::default()
.header("windows/wrapper.h")
.parse_callbacks(Box::new(bindgen::CargoCallbacks::new()))
.generate()
.expect("Unable to generate bindings");

let out_path = PathBuf::from(env::var("OUT_DIR").unwrap());
bindings
.write_to_file(out_path.join("bindings.rs"))
.expect("Couldn't write bindings!");
}
1 change: 1 addition & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ mod error;
pub mod isotp;
pub mod panda;
pub mod uds;
pub mod vector;

/// Re-export of relevant stream traits from `tokio_stream`.
pub use tokio_stream::{Stream, StreamExt, Timeout};
Expand Down
Loading

0 comments on commit 8d115f4

Please sign in to comment.