dpdu_rust/
lib.rs

1#![deny(
2    missing_docs,
3    missing_debug_implementations,
4    missing_copy_implementations,
5    trivial_casts,
6    trivial_numeric_casts,
7    unstable_features,
8    unused_imports,
9    unused_import_braces,
10    unused_qualifications
11)]
12
13//! A core implementation of the D-PDU API (ISO 22900-2).
14//! 
15//! This crate just provides the type definitions in order to use the API with Rust code.
16//! 
17//! For a crate that actually uses this API, you can check the [ecu_diagnostics crate](https://docs.rs/ecu_diagnostics/latest/ecu_diagnostics/)
18//!
19//! NOTE: To match the rust naming convention, enums and structure names have been slightly renamed.
20mod structures;
21mod enums;
22mod functions;
23
24use std::ffi::c_void;
25
26pub use functions::*;
27pub use enums::*;
28pub use structures::*;
29
30/// Undefined ID value
31pub const PDU_ID_UNDEF: u32 = 0xFFFFFFFE;
32
33/// Undefined handle value
34pub const PDU_HANDLE_UNDEF: u32 = 0xFFFFFFFF;
35
36
37/// PDU Event callback function type
38pub type EventCallbackFn = unsafe extern "C" fn(
39    event_type: PduEvtData, 
40    h_mod: u32, 
41    h_cll: u32,
42    p_cll_tag: *mut c_void, 
43    p_api_tag: *mut c_void
44);