1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
//! Common types used throughout the automotive protocol stack.
//!
//! This module provides fundamental types and traits that are used across different
//! layers of the protocol stack. It includes basic types for CAN communication,
//! addressing, and frame structures, as well as traits for configuration and
//! hardware port interactions.
/// CAN identifier type, supporting both standard (11-bit) and extended (29-bit) identifiers.
pub type CanId = u32;
/// Frame data type representing the payload of a CAN frame.
///
/// The maximum length depends on the protocol:
/// - Classic CAN: 8 bytes
/// - CAN-FD: up to 64 bytes
pub type FrameData = ;
/// Timestamp type representing milliseconds since an arbitrary epoch.
///
/// Used for timing and synchronization purposes across the protocol stack.
pub type Timestamp = u64;
/// Protocol-specific addressing information, primarily used in higher layer protocols
/// like J1939.
/// Generic frame structure used across different protocol layers.
///
/// This structure provides a unified representation of CAN frames,
/// supporting both classic CAN and CAN-FD formats.
/// Configuration trait that must be implemented by all protocol configurations.
///
/// This trait ensures that protocol configurations can be validated before use
/// and can be safely shared between threads.
/// Hardware abstraction trait for CAN interfaces.
///
/// This trait must be implemented by platform-specific code to provide
/// the actual hardware communication capabilities.