Skip to main content

dpdu_api_types/
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 enums;
21mod functions;
22mod structures;
23
24/// Utilities for working with bit flags.
25#[cfg(feature = "bitflags")]
26pub mod bitflags;
27
28use std::ffi::c_void;
29
30pub use enums::*;
31pub use functions::*;
32pub use structures::*;
33
34/// Undefined ID value
35pub const PDU_ID_UNDEF: u32 = 0xFFFFFFFE;
36
37/// Undefined handle value
38pub const PDU_HANDLE_UNDEF: u32 = 0xFFFFFFFF;
39
40/// PDU Event callback function type
41pub type EventCallbackFn = unsafe extern "system-unwind" fn(
42    event_type: PduEvtData,
43    h_mod: u32,
44    h_cll: u32,
45    p_cll_tag: *mut c_void,
46    p_api_tag: *mut c_void,
47);