[][src]Struct j2534::Channel

pub struct Channel<'a> { /* fields omitted */ }

Represents a J2534 channel

Methods

impl<'a> Channel<'a>[src]

pub fn read_msgs<'b>(
    &self,
    msgs: &'b mut [PassThruMsg],
    timeout: u32
) -> Result<&'b [PassThruMsg]>
[src]

Fills msgs with messages until timing out or until msgs is filled. Returns the slice of messages read.

Arguments

  • msgs - The array of messages to fill.
  • timeout - The amount of time in milliseconds to wait. If set to zero, reads buffered messages and returns immediately

pub fn read_msg(&self, timeout: u32) -> Result<PassThruMsg>[src]

Reads a single message

pub fn write_msgs(
    &self,
    msgs: &mut [PassThruMsg],
    timeout: u32
) -> Result<usize>
[src]

Writes msgs to the device until all messages have been written or until the timeout has been reached. Returns the amount of message written.

Arguments

  • msgs - The array of messages to send.
  • timeout - The amount of time in milliseconds to wait. If set to zero, queues as many messages as possible and returns immediately.

pub fn start_msg_filter(
    &self,
    filter_type: FilterType,
    mask_msg: Option<&PassThruMsg>,
    pattern_msg: Option<&PassThruMsg>,
    flow_control_msg: Option<&PassThruMsg>
) -> Result<FilterId>
[src]

Sets up a network protocol filter to filter messages received by the PassThru device. There is a limit of ten filters per network layer protocol. The device blocks all receive frames by default when no filters are defined.

Returns filter ID http://www.drewtech.com/support/passthru/startmsgfilter.html

pub fn stop_msg_filter(&self, filter_id: FilterId) -> Result<()>[src]

Removes a message filter started with Channel::start_msg_filter

Arguments

  • msg_id - The id of the message returned from Channel::start_msg_filter

pub fn start_periodic_msg(
    &self,
    msg: &PassThruMsg,
    time_interval: u32
) -> Result<MessageId>
[src]

Repetitively transmit network protocol messages at the specified time interval over an existing logical communication channel. There is a limit of ten periodic messages per network layer protocol. Returns a handle for the periodic message used in Channel::stop_periodic_msg

Arguments

  • msg - The message to send
  • time_interval - The time in milliseconds to wait between sending messages. The acceptable range is between 5 and 65,535 milliseconds.

pub fn stop_periodic_msg(&self, msg_id: MessageId) -> Result<()>[src]

Stops a periodic mesage started with Channel::start_periodic_msg

Arguments

  • msg_id = the id of the periodic message returned from Channel::start_periodiC_msg

pub fn clear_transmit_buffer(&self) -> Result<()>[src]

Clear transmit message queue

pub fn clear_periodic_messages(&self) -> Result<()>[src]

Halt continuous messages

pub fn clear_receive_buffer(&self) -> Result<()>[src]

Clear receive message queue

pub fn clear_message_filters(&self) -> Result<()>[src]

Removes all message filters

pub fn get_config(&self, id: ConfigId) -> Result<u32>[src]

Gets a single configuration parameter.

pub fn set_config(&self, id: ConfigId, value: u32) -> Result<()>[src]

Sets a single configuration parameter.

Trait Implementations

impl<'a> Drop for Channel<'a>[src]

Auto Trait Implementations

impl<'a> RefUnwindSafe for Channel<'a>

impl<'a> Send for Channel<'a>

impl<'a> Sync for Channel<'a>

impl<'a> Unpin for Channel<'a>

impl<'a> UnwindSafe for Channel<'a>

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, 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.