pub mod serialport;
use serialport::{BaudRate, ComPort};
use crate::error::AvrResult;
pub(crate) trait DeviceInterface {
fn send(&mut self, command: Vec<u8>) -> AvrResult<()>;
fn receive(&mut self) -> AvrResult<Vec<u8>>;
fn reset(&mut self) -> AvrResult<()>;
}
#[derive(Debug, Clone)]
pub struct SerialportParams {
pub port: Option<ComPort>,
pub baud: Option<BaudRate>,
}
#[derive(Debug, Clone)]
pub enum DeviceInterfaceType {
Serial(SerialportParams),
}