Struct can_type_rs::j1939::NameField
source · pub struct NameField(/* private fields */);Expand description
Represents a Name in the SAE J1939 protocol.
The Name structure is used in the SAE J1939 protocol to represent the identity of a device or component within a vehicle’s network.
§Repr: u64
| Field | Size (bits) |
|---|---|
| Arbitrary address bits | 1 |
| Industry group bits | 3 |
| Vehicle system instance bits | 4 |
| Vehicle system bits | 7 |
| Reserved bits | 1 |
| Function bits | 8 |
| Function instance bits | 5 |
| ECU instance bits | 3 |
| Manufacturer code bits | 11 |
| Identity number bits | 21 |
Implementations§
source§impl NameField
impl NameField
sourcepub const fn arbitrary_address(&self) -> bool
pub const fn arbitrary_address(&self) -> bool
Indicates whether 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.
Trait Implementations§
source§impl Conversion for NameField
impl Conversion for NameField
source§fn from_hex(hex_str: &str) -> Self
fn from_hex(hex_str: &str) -> Self
Creates a new NameField bitfield from a base-16 (hex) string slice.
source§fn try_from_bits(bits: u64) -> Option<Self>
fn try_from_bits(bits: u64) -> Option<Self>
Creates a new NameField bitfield from a 64-bit integer.
source§fn try_from_hex(hex_str: &str) -> Option<Self>
fn try_from_hex(hex_str: &str) -> Option<Self>
Creates a new NameField bitfield from a base-16 (hex) string slice.
type Type = u64
source§impl Ord for NameField
impl Ord for NameField
source§impl PartialOrd for NameField
impl PartialOrd for NameField
impl Copy for NameField
impl Eq for NameField
impl StructuralPartialEq for NameField
Auto Trait Implementations§
impl Freeze for NameField
impl RefUnwindSafe for NameField
impl Send for NameField
impl Sync for NameField
impl Unpin for NameField
impl UnwindSafe for NameField
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit)source§impl<T> CloneToUninit for Twhere
T: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit)