use uuid::Uuid;
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct DeviceId(pub(crate) String);
impl DeviceId {
#[must_use]
pub fn as_str(&self) -> &str {
&self.0
}
}
impl std::fmt::Display for DeviceId {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str(&self.0)
}
}
impl From<String> for DeviceId {
fn from(s: String) -> Self {
Self(s)
}
}
impl From<&str> for DeviceId {
fn from(s: &str) -> Self {
Self(s.to_owned())
}
}
#[derive(Debug, Clone)]
pub struct BleDevice {
pub id: DeviceId,
pub name: Option<String>,
pub rssi: Option<i16>,
pub services: Vec<Uuid>,
}