ProtocolPacketHandler

Struct ProtocolPacketHandler 

Source
pub struct ProtocolPacketHandler<'a> { /* private fields */ }

Implementations§

Source§

impl<'a> ProtocolPacketHandler<'a>

Source

pub fn new(port_handler: &'a mut PortHandler) -> Self

Source

pub fn sts_makeword(&self, a: u8, b: u8) -> u16

Source

pub fn sts_makedword(&self, a: u16, b: u16) -> u32

Source

pub fn sts_lobyte(&self, w: u16) -> u8

Source

pub fn sts_hibyte(&self, w: u16) -> u8

Source

pub fn sts_loword(&self, l: u32) -> u16

Source

pub fn sts_hiword(&self, h: u32) -> u16

Source

pub fn sts_tohost(&self, a: u16, b: u8) -> i16

Source

pub fn tx_packet(&mut self, txpacket: &mut Vec<u8>) -> CommResult

Source

pub fn rx_packet(&mut self) -> (Vec<u8>, CommResult)

Source

pub fn tx_rx_packet( &mut self, txpacket: &mut Vec<u8>, ) -> (Option<Vec<u8>>, CommResult, u8)

Source

pub fn ping(&mut self, sts_id: u8) -> (u16, CommResult, u8)

Source

pub fn read_tx_rx( &mut self, sts_id: u8, address: u8, length: u8, ) -> (Vec<u8>, CommResult, u8)

Source

pub fn read_1byte_tx_rx( &mut self, sts_id: u8, address: u8, ) -> (u8, CommResult, u8)

Source

pub fn read_2byte_tx_rx( &mut self, sts_id: u8, address: u8, ) -> (u16, CommResult, u8)

Source

pub fn write_tx_rx( &mut self, sts_id: u8, address: u8, data: &[u8], ) -> (CommResult, u8)

Source

pub fn write_tx_only( &mut self, sts_id: u8, address: u8, data: &[u8], ) -> CommResult

Source

pub fn write_1byte_tx_only( &mut self, sts_id: u8, address: u8, data: u8, ) -> CommResult

Source

pub fn write_1byte_tx_rx( &mut self, sts_id: u8, address: u8, data: u8, ) -> (CommResult, u8)

Source

pub fn write_2byte_tx_only( &mut self, sts_id: u8, address: u8, data: u16, ) -> CommResult

Source

pub fn write_2byte_tx_rx( &mut self, sts_id: u8, address: u8, data: u16, ) -> (CommResult, u8)

Source

pub fn sync_write_tx_only( &mut self, start_address: u8, data_length: u8, param: &[u8], ) -> CommResult

Source

pub fn sync_read_tx( &mut self, start_address: u8, data_length: u8, param: &[u8], ) -> CommResult

Source

pub fn sync_read_rx( &mut self, data_length: usize, param_length: usize, ) -> (CommResult, Vec<u8>)

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.