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
28/// Utilities for debugging and inspecting FFI data structures.
29///
30/// This module provides helper types and implementations for safely
31/// formatting raw pointers, C-compatible structures, and other data
32/// used during FFI interactions.
33#[cfg(feature = "debug")]
34pub mod debug;
35
36pub use enums::*;
37pub use functions::*;
38use std::ffi::c_void;
39pub use structures::*;
40
41/// Undefined ID value
42pub const PDU_ID_UNDEF: u32 = 0xFFFFFFFE;
43
44/// Undefined handle value
45pub const PDU_HANDLE_UNDEF: u32 = 0xFFFFFFFF;
46
47/// PDU Event callback function type
48pub type EventCallbackFn = unsafe extern "system" fn(
49 event_type: PduEvtData,
50 h_mod: u32,
51 h_cll: u32,
52 p_cll_tag: *mut c_void,
53 p_api_tag: *mut c_void,
54);