Trait cameleon::camera::DeviceControl
source · pub trait DeviceControl {
// Required methods
fn open(&mut self) -> ControlResult<()>;
fn close(&mut self) -> ControlResult<()>;
fn is_opened(&self) -> bool;
fn read(&mut self, address: u64, buf: &mut [u8]) -> ControlResult<()>;
fn write(&mut self, address: u64, data: &[u8]) -> ControlResult<()>;
fn genapi(&mut self) -> ControlResult<String>;
fn enable_streaming(&mut self) -> ControlResult<()>;
fn disable_streaming(&mut self) -> ControlResult<()>;
}
Expand description
This trait provides operations on the device’s memory.
Required Methods§
sourcefn open(&mut self) -> ControlResult<()>
fn open(&mut self) -> ControlResult<()>
Opens the handle.
sourcefn close(&mut self) -> ControlResult<()>
fn close(&mut self) -> ControlResult<()>
Closes the handle.
sourcefn read(&mut self, address: u64, buf: &mut [u8]) -> ControlResult<()>
fn read(&mut self, address: u64, buf: &mut [u8]) -> ControlResult<()>
Reads data from the device’s memory.
Reads length is same as buf.len()
.
sourcefn write(&mut self, address: u64, data: &[u8]) -> ControlResult<()>
fn write(&mut self, address: u64, data: &[u8]) -> ControlResult<()>
Writes data to the device’s memory.
sourcefn genapi(&mut self) -> ControlResult<String>
fn genapi(&mut self) -> ControlResult<String>
Returns GenICam
xml string.
sourcefn enable_streaming(&mut self) -> ControlResult<()>
fn enable_streaming(&mut self) -> ControlResult<()>
Enables streaming.
sourcefn disable_streaming(&mut self) -> ControlResult<()>
fn disable_streaming(&mut self) -> ControlResult<()>
Disables streaming.
Trait Implementations§
source§impl From<ControlHandle> for Box<dyn DeviceControl>
impl From<ControlHandle> for Box<dyn DeviceControl>
source§fn from(ctrl: ControlHandle) -> Self
fn from(ctrl: ControlHandle) -> Self
Converts to this type from the input type.
source§fn from(ctrl: SharedControlHandle) -> Self
fn from(ctrl: SharedControlHandle) -> Self
Converts to this type from the input type.