Device can now be downcasted to a specific type of device (and upcasted back)
This commit is contained in:
parent
2acdb272fb
commit
e40c3e7787
7 changed files with 106 additions and 6 deletions
|
|
@ -182,7 +182,7 @@ pub trait Device {
|
|||
|
||||
/// Path property
|
||||
#[dbus_proxy(property)]
|
||||
fn path(&self) -> zbus::Result<String>;
|
||||
fn path_(&self) -> zbus::Result<String>;
|
||||
|
||||
/// PhysicalPortId property
|
||||
#[dbus_proxy(property)]
|
||||
|
|
|
|||
|
|
@ -51,6 +51,7 @@ pub enum DeviceType {
|
|||
Ethernet,
|
||||
Wifi,
|
||||
Bluetooth,
|
||||
Generic,
|
||||
Other,
|
||||
Unknown,
|
||||
}
|
||||
|
|
@ -61,7 +62,8 @@ impl From<u32> for DeviceType {
|
|||
1 => DeviceType::Ethernet,
|
||||
2 => DeviceType::Wifi,
|
||||
5 => DeviceType::Bluetooth,
|
||||
3..=4 | 6..=32 => DeviceType::Other,
|
||||
14 => DeviceType::Generic,
|
||||
3..=32 => DeviceType::Other,
|
||||
_ => DeviceType::Unknown,
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@
|
|||
//! * [`zbus::fdo::PeerProxy`]
|
||||
//!
|
||||
//! …consequently `zbus-xmlgen` did not generate code for the above interfaces.
|
||||
#![allow(clippy::type_complexity)]
|
||||
|
||||
pub mod access_point;
|
||||
pub mod config;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue