[][src]Struct j2534::PassThruMsg

#[repr(C, packed(1))]pub struct PassThruMsg {
    pub protocol_id: u32,
    pub rx_status: u32,
    pub tx_flags: u32,
    pub timestamp: u32,
    pub data_size: u32,
    pub extra_data_index: u32,
    pub data: [u8; 4128],
}

A message sent a received from the device

Fields

protocol_id: u32rx_status: u32tx_flags: u32timestamp: u32data_size: u32extra_data_index: u32data: [u8; 4128]

Implementations

impl PassThruMsg[src]

pub fn new_raw(
    protocol: Protocol,
    rx_status: RxStatus,
    tx_flags: TxFlags,
    timestamp: u32,
    data_size: u32,
    extra_data_index: u32,
    data: [u8; 4128]
) -> PassThruMsg
[src]

pub fn new(protocol: Protocol) -> PassThruMsg[src]

pub fn new_can(id: u32, data: &[u8]) -> PassThruMsg[src]

Creates a new CAN message. The data size must be less than or equal to 8 bytes.

pub fn new_isotp(id: u32, data: &[u8]) -> PassThruMsg[src]

Creates a new ISO 15765-2 (ISO-TP) message. ISO-TP is a transport-layer protocol that uses multiple CAN messages to transmit up to 4095 bytes per packet. The data size must be less than or equal to 4095.

pub fn can_message(&self) -> Option<(u32, &[u8])>[src]

Returns the CAN ID and payload. Also use this method for reading ISO-TP messages. Returns None if the protocol is not CAN or ISO15765 or if the message is too short.

pub fn isotp_message(&self) -> Option<(u32, &[u8])>[src]

pub fn rx_status(self, rx_status: RxStatus) -> Self[src]

Sets the rx status of the message

pub fn tx_flags(self, tx_flags: TxFlags) -> Self[src]

Sets the transmit flags of the message

pub fn transmitted(&self) -> bool[src]

Returns true if this is an echo of a message transmitted by the PassThru device.

pub fn first_frame(&self) -> bool[src]

Returns true if this message indicates the first frame of a ISO15765 packet has been received.

Trait Implementations

impl Clone for PassThruMsg[src]

impl Copy for PassThruMsg[src]

impl Debug for PassThruMsg[src]

impl Default for PassThruMsg[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.