pub struct Pdu<U: IsDataUnit>(/* private fields */);
Expand description
Represents a Protocol Data Unit (PDU) in the context of Controller Area Network (CAN).
Implementations§
Source§impl Pdu<Data>
impl Pdu<Data>
Sourcepub const fn to_le_bytes(&self) -> [u8; 8]
pub const fn to_le_bytes(&self) -> [u8; 8]
Return the 64-bit Data
bitfield as little-endian bytes.
Sourcepub const fn to_be_bytes(&self) -> [u8; 8]
pub const fn to_be_bytes(&self) -> [u8; 8]
Return the 64-bit Data
bitfield as big-endian bytes.
Sourcepub const fn to_ne_bytes(&self) -> [u8; 8]
pub const fn to_ne_bytes(&self) -> [u8; 8]
Return the 64-bit Data
bitfield as native-endian bytes.
Source§impl Pdu<Name>
impl Pdu<Name>
Sourcepub const fn arbitrary_address(&self) -> bool
pub const fn arbitrary_address(&self) -> bool
Indicates whether or not the ECU/CA can negotiate an address (true = yes; false = no).
Sourcepub const fn industry_group(&self) -> u8
pub const fn industry_group(&self) -> u8
These codes are associated with particular industries such as on-highway equipment, agricultural equipment, and more.
Sourcepub const fn vehicle_system_instance(&self) -> u8
pub const fn vehicle_system_instance(&self) -> u8
Assigns a number to each instance on the Vehicle System (in case you connect several networks – e.g. connecting cars on a train).
Sourcepub const fn vehicle_system(&self) -> u8
pub const fn vehicle_system(&self) -> u8
Vehicle systems are associated with the Industry Group and they can be, for instance, “tractor” in the “Common” industry or “trailer” in the “On-Highway” industry group.
Sourcepub const fn function(&self) -> u8
pub const fn function(&self) -> u8
This code, in a range between 128 and 255, is assigned according to the Industry Group. A value between 0 and 127 is not associated with any other parameter.
Sourcepub const fn function_instance(&self) -> u8
pub const fn function_instance(&self) -> u8
Returns the function instance.
Sourcepub const fn ecu_instance(&self) -> u8
pub const fn ecu_instance(&self) -> u8
A J1939 network may accommodate several ECUs of the same kind (i.e. same functionality). The Instance code separates them.
Sourcepub const fn manufacturer_code(&self) -> u16
pub const fn manufacturer_code(&self) -> u16
The 11-Bit Manufacturer Code is assigned by the SAE.
Sourcepub const fn identity_number(&self) -> u32
pub const fn identity_number(&self) -> u32
This field is assigned by the manufacturer, similar to a serial number, i.e. the code must be uniquely assigned to the unit.