[−][src]Struct j2534::Channel
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]
&self,
msgs: &'b mut [PassThruMsg],
timeout: u32
) -> Result<&'b [PassThruMsg]>
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]
&self,
msgs: &mut [PassThruMsg],
timeout: u32
) -> Result<usize>
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]
&self,
filter_type: FilterType,
mask_msg: Option<&PassThruMsg>,
pattern_msg: Option<&PassThruMsg>,
flow_control_msg: Option<&PassThruMsg>
) -> Result<FilterId>
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 fromChannel::start_msg_filter
pub fn start_periodic_msg(
&self,
msg: &PassThruMsg,
time_interval: u32
) -> Result<MessageId>
[src]
&self,
msg: &PassThruMsg,
time_interval: u32
) -> Result<MessageId>
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 sendtime_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
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,