dungeonctl/core/
peripheral.rs

1pub(crate) trait PeripheralExt: btleplug::api::Peripheral {
2    async fn local_name_matches(&self, name: &str) -> btleplug::Result<bool> {
3        let properties = self.properties().await?;
4
5        Ok(properties
6            .and_then(|p| p.local_name)
7            .is_some_and(|local_name| local_name == name))
8    }
9}
10
11impl<T: btleplug::api::Peripheral> PeripheralExt for T {}