#[repr(u8)]pub enum Priority {
Exceptional = 0,
Immediate = 1,
Fast = 2,
High = 3,
Nominal = 4,
Low = 5,
Slow = 6,
Optional = 7,
}Expand description
Transfer priority [1; 4.1.1.3]
The type has explicit numeric encoding to facilitate look-up table implementation. The encoding matches the CAN ID encoding [1; 4.2.1.1], thus the ordering is reversed: Optional > Exceptional
Variants§
Exceptional = 0
The bus designer can ignore these messages when calculating bus load since they should only be sent when a total system failure has occurred. For example, a self-destruct message on a rocket would use this priority. Another analogy is an NMI on a microcontroller.
Immediate = 1
Immediate is a “high priority message” but with additional latency constraints. Since exceptional messages are not considered when designing a bus, the latency of immediate messages can be determined by considering only immediate messages.
Fast = 2
Fast and immediate are both “high priority messages” but with additional latency constraints. Since exceptional messages are not considered when designing a bus, the latency of fast messages can be determined by considering only immediate and fast messages.
High = 3
High priority messages are more important than nominal messages but have looser latency requirements than fast messages. This priority is used so that, in the presence of rogue nominal messages, important commands can be received. For example, one might envision a failure mode where a temperature sensor starts to load a vehicle bus with nominal messages. The vehicle remains operational (for a time) because the controller is exchanging fast and immediate messages with sensors and actuators. A system safety monitor is able to detect the distressed bus and command the vehicle to a safe state by sending high priority messages to the controller.
Nominal = 4
This is what all messages should use by default. Specifically, heartbeat messages should use this priority.
Low = 5
Low priority messages are expected to be sent on a bus under all conditions but cannot prevent the delivery of nominal messages. They are allowed to be delayed, but latency should be constrained by the bus designer.
Slow = 6
Slow messages are low priority messages that have no time sensitivity at all. The bus designer need only ensure that for all possible system states, these messages will eventually be sent.
Optional = 7
These messages might never be sent (theoretically) for some possible system states. The system shall tolerate never exchanging optional messages in every possible state. The bus designer can ignore these messages when calculating bus load. This should be the priority used for diagnostic or debug messages that are not required on an operational system.
Implementations§
Source§impl Priority
impl Priority
pub const MIN: Priority = Priority::Exceptional
pub const MAX: Priority = Priority::Optional
pub const fn try_from_u8(code: u8) -> Option<Priority>
pub const fn from_u8_truncating(code: u8) -> Priority
pub const fn into_u8(self) -> u8
pub const fn next(self) -> Option<Self>
pub const fn prev(self) -> Option<Self>
Trait Implementations§
Source§impl Ord for Priority
impl Ord for Priority
Source§impl PartialOrd for Priority
impl PartialOrd for Priority
impl Copy for Priority
impl Eq for Priority
impl StructuralPartialEq for Priority
Auto Trait Implementations§
impl Freeze for Priority
impl RefUnwindSafe for Priority
impl Send for Priority
impl Sync for Priority
impl Unpin for Priority
impl UnwindSafe for Priority
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
clone_to_uninit)