Struct RevPiControl

Source
pub struct RevPiControl { /* private fields */ }
Expand description

RevPiControl is an object representing an open file handle to the piControl driver file descriptor.

Implementations§

Source§

impl RevPiControl

Source

pub fn new() -> Self

Source

pub fn new_at(path: &str) -> Self

Source

pub fn open(&mut self) -> Result<bool>

Open the Pi Control interface.

Source

pub fn close(&mut self)

Close the Pi Control interface.

Source

pub fn reset(&self) -> Result<c_int>

Reset Pi Control Interface.

Source

pub fn read(&mut self, offset: u64, length: usize) -> Result<Vec<u8>>

Source

pub fn write(&mut self, offset: u64, data: &Vec<u8>) -> Result<bool>

Writes process data at a specific position and a returns a boolean result.

Source

pub fn get_variable_info(&self, name: &str) -> Result<SPIVariable>

Get the info for a variable.

Source

pub fn get_device_info_list(&self) -> Result<Vec<SDeviceInfo>>

Gets a description of connected devices.

Source

pub fn get_bit_value(&self, pSpiValue: &mut SPIValue) -> Result<bool>

Gets the value of one bit in the process image.

Source

pub fn set_bit_value(&self, pSpiValue: &mut SPIValue) -> Result<bool>

Sets the value of one bit in the process image.

Source

pub fn dump(&mut self, fp: &str) -> Result<bool>

dumps the process image to a file.

§Arguments
  • fp - The file path

Trait Implementations§

Source§

impl Drop for RevPiControl

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more

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.