device — functions and constants
Finding cameras, and what enumeration says about them.
pub fn enumerate() -> Result<Vec<DeviceInfo>>
Find every connected Optris camera.
An empty vector is a success, not an error: no cameras attached is a normal state of the world, and a test suite that runs without hardware relies on it.
Examples
# fn main() -> optris_sdk::Result<()> {
for device in optris_sdk::enumerate()? {
println!("{} ({})", device.model, device.serial);
}
# Ok(())
# }
Errors
Returns whatever the SDK reports if the enumeration pass itself fails: a USB subsystem that cannot be queried, for instance.
pub fn enumerate_with(options: &EnumerationOptions) -> Result<Vec<DeviceInfo>>
Find cameras, with filters.
Examples
use optris_sdk::{enumerate_with, EnumerationOptions};
# fn main() -> optris_sdk::Result<()> {
// A simulated device needs no hardware, which is what makes an
// integration testable on a build machine.
let options = EnumerationOptions::new().include_simulated(true);
let devices = enumerate_with(&options)?;
# Ok(())
# }
Errors
As enumerate.