use crate::registry::Device;
#[derive(Clone, Copy, PartialEq, Eq, Debug)]
pub enum Category {
SmartSpeaker,
MediaStreamer,
SmartLight,
Camera,
Thermostat,
Printer,
Phone,
Computer,
SingleBoardComputer,
Router,
Nas,
IoTSensor,
Unknown,
}
impl Category {
pub fn as_str(self) -> &'static str {
match self {
Category::SmartSpeaker => "smart-speaker",
Category::MediaStreamer => "media-streamer",
Category::SmartLight => "smart-light",
Category::Camera => "camera",
Category::Thermostat => "thermostat",
Category::Printer => "printer",
Category::Phone => "phone",
Category::Computer => "computer",
Category::SingleBoardComputer => "sbc",
Category::Router => "router",
Category::Nas => "nas",
Category::IoTSensor => "iot-sensor",
Category::Unknown => "unknown",
}
}
}
#[derive(Clone, Debug, PartialEq)]
pub struct Classification {
pub device_type: String,
pub category: Category,
pub confidence: f32,
pub rationale: String,
}
pub trait Fingerprinter: Send + Sync {
fn classify(&self, device: &Device) -> Option<Classification>;
}