more libs

This commit is contained in:
Bel LaPointe
2023-03-17 08:18:04 -06:00
parent 7889816a0b
commit 2374375803
4 changed files with 41 additions and 2 deletions

View File

@@ -1,4 +1,5 @@
use crate::config::Engine;
use rusb::UsbContext;
pub trait InputEngine {
fn get(&mut self) -> Vec<char>;
@@ -17,7 +18,18 @@ struct InputEngineDevice {
}
pub fn build_input_engine_device(cfg: &Engine) -> Result<Box<dyn InputEngine>, String> {
let device_cfg = cfg.device.as_ref().unwrap();
let _device_cfg = cfg.device.as_ref().unwrap();
assert!(rusb::has_capability());
let ctx = rusb::Context::new().unwrap();
for device in ctx.devices().unwrap().iter() {
let device_desc = device.device_descriptor().unwrap();
println!("Bus {:03} Device {:03} ID {:04x}:{:04x}",
device.bus_number(),
device.address(),
device_desc.vendor_id(),
device_desc.product_id());
}
return Err("do what".to_string());
}
@@ -31,7 +43,7 @@ struct InputEngineKafka {
}
pub fn build_input_engine_kafka(cfg: &Engine) -> Result<Box<dyn InputEngine>, String> {
let kafka_cfg = cfg.kafka.as_ref().unwrap();
let _kafka_cfg = cfg.kafka.as_ref().unwrap();
return Err("do what".to_string());
}