Compare commits
1 Commits
e68cc8bcbc
...
259fdeb7b0
Author | SHA1 | Date | |
---|---|---|---|
|
259fdeb7b0 |
@ -1,14 +0,0 @@
|
|||||||
mod device;
|
|
||||||
mod helios;
|
|
||||||
|
|
||||||
use crate::conf::{Conf, DacFamily, EtherDreamConf, HeliosConf};
|
|
||||||
use crate::device::device::Device;
|
|
||||||
use crate::device::helios::HeliosDevice;
|
|
||||||
|
|
||||||
pub fn device_factory(config: Conf) -> Box<dyn Device> {
|
|
||||||
let device = match config.dac {
|
|
||||||
DacFamily::Helios(conf) => Box::new(HeliosDevice { conf }),
|
|
||||||
DacFamily::Etherdream(conf) => todo!(),
|
|
||||||
};
|
|
||||||
device
|
|
||||||
}
|
|
@ -21,12 +21,6 @@ pub struct HeliosDevice {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl HeliosDevice {
|
impl HeliosDevice {
|
||||||
|
|
||||||
/// This is fabulous doc !
|
|
||||||
/// # Woot
|
|
||||||
///
|
|
||||||
/// ` some example `
|
|
||||||
///
|
|
||||||
pub fn new(conf: &HeliosConf) -> LJResult<Self> {
|
pub fn new(conf: &HeliosConf) -> LJResult<Self> {
|
||||||
let id = conf.id;
|
let id = conf.id;
|
||||||
let controller = NativeHeliosDacController::new()?;
|
let controller = NativeHeliosDacController::new()?;
|
||||||
@ -36,21 +30,10 @@ impl HeliosDevice {
|
|||||||
};
|
};
|
||||||
let dac = device.open()?;
|
let dac = device.open()?;
|
||||||
Ok(Self {
|
Ok(Self {
|
||||||
conf: (*conf).clone(),
|
conf: (*conf).clone(), dac,
|
||||||
dac,
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//
|
|
||||||
// fn get_helios_device() -> LJResult<NativeHeliosDac> {
|
|
||||||
// let controller = NativeHeliosDacController::new()?;
|
|
||||||
// let devices = controller.list_devices()?;
|
|
||||||
// let Some(device) = devices.into_iter().next() else {
|
|
||||||
// return Err(Box::new(LJError::HeliosDeviceMissing));
|
|
||||||
// };
|
|
||||||
// let device = device.open()?;
|
|
||||||
// Ok(device)
|
|
||||||
// }
|
|
||||||
|
|
||||||
impl Device for HeliosDevice {
|
impl Device for HeliosDevice {
|
||||||
fn status(&self) -> Status {
|
fn status(&self) -> Status {
|
||||||
|
Loading…
Reference in New Issue
Block a user