Struct aaronia_rtsa::Device
source · pub struct Device { /* private fields */ }
Expand description
A device, created through the ApiHandle.
The typical life-cycle of a device is:
- Create with
ApiHandle
Device::open()
- Configure with
Device::set()
,Device::set_int()
, andDevice::set_float()
Device::connect()
Device::start()
Device::stop()
Device::disconnect()
Device::close()
Implementations§
source§impl Device
impl Device
sourcepub fn open(&mut self) -> Result
pub fn open(&mut self) -> Result
Open the Device
for exclusive use.
This allocates the required data structures and prepares the configuration settings, but will not access the hardware.
sourcepub fn disconnect(&mut self) -> Result
pub fn disconnect(&mut self) -> Result
Disconnect from the Device
.
sourcepub fn start(&mut self) -> Result
pub fn start(&mut self) -> Result
Start data acqusition from the Device] / data transmission to the [
Device`.
sourcepub fn state(&mut self) -> Result<DeviceState, Error>
pub fn state(&mut self) -> Result<DeviceState, Error>
Get DeviceState
from the Device
.
sourcepub fn get<S: AsRef<str>>(&mut self, path: S) -> Result<ConfigItem, Error>
pub fn get<S: AsRef<str>>(&mut self, path: S) -> Result<ConfigItem, Error>
Get Device
configuration parameter.
sourcepub fn set<S1: AsRef<str>, S2: AsRef<str>>(
&mut self,
path: S1,
value: S2
) -> Result
pub fn set<S1: AsRef<str>, S2: AsRef<str>>(
&mut self,
path: S1,
value: S2
) -> Result
Set Device
configuration parameter as string.
sourcepub fn set_float<S1: AsRef<str>, F: Into<f64>>(
&mut self,
path: S1,
value: F
) -> Result
pub fn set_float<S1: AsRef<str>, F: Into<f64>>(
&mut self,
path: S1,
value: F
) -> Result
Set Device
configuration parameter as float.
sourcepub fn set_int<S1: AsRef<str>, F: Into<i64>>(
&mut self,
path: S1,
value: F
) -> Result
pub fn set_int<S1: AsRef<str>, F: Into<i64>>(
&mut self,
path: S1,
value: F
) -> Result
Set Device
configuration parameter as integer.
sourcepub fn send_packet(&mut self, chan: i32, packet: &Packet) -> Result
pub fn send_packet(&mut self, chan: i32, packet: &Packet) -> Result
sourcepub fn print_config(&mut self) -> Result
pub fn print_config(&mut self) -> Result
Print the Device
configuration parameter tree.
sourcepub fn print_health(&mut self) -> Result
pub fn print_health(&mut self) -> Result
Print the Device
health parameter tree.