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
24use std::ffi::c_void;
25
26pub use enums::*;
27pub use functions::*;
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/// PDU Event callback function type
37pub type EventCallbackFn = unsafe extern "system" fn(
38    event_type: PduEvtData,
39    h_mod: u32,
40    h_cll: u32,
41    p_cll_tag: *mut c_void,
42    p_api_tag: *mut c_void,
43);