[][src]Struct j2534::Channel

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

A communication channel

Implementations

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

pub fn read(
    &self,
    buf: &mut [PassThruMsg],
    timeout: u32
) -> Result<usize, Error>
[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

Returns the amount of messages read.

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

Reads a single message

pub fn write(
    &self,
    msgs: &mut [PassThruMsg],
    timeout: u32
) -> Result<usize, Error>
[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_message_filter(
    &self,
    filter_type: FilterType,
    mask_msg: Option<&PassThruMsg>,
    pattern_msg: Option<&PassThruMsg>,
    flow_control_msg: Option<&PassThruMsg>
) -> Result<FilterId, Error>
[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_message_filter(&self, filter_id: FilterId) -> Result<(), Error>[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_message(
    &self,
    msg: &PassThruMsg,
    time_interval: u32
) -> Result<MessageId, Error>
[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_message(&self, msg_id: MessageId) -> Result<(), Error>[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<(), Error>[src]

Clear transmit message queue

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

Halt continuous messages

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

Clear receive message queue

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

Removes all message filters

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

Gets a single configuration parameter.

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

Sets a single configuration parameter.

Trait Implementations

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

Auto Trait Implementations

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

impl<'a> !Send for Channel<'a>[src]

impl<'a> !Sync for Channel<'a>[src]

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

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

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.