Work on bindings some more
This commit is contained in:
parent
da5c6ed172
commit
2acdb272fb
11 changed files with 290 additions and 2 deletions
|
|
@ -12,3 +12,9 @@ impl<'a> Deref for BluetoothDevice<'a> {
|
|||
&self.0
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> From<BluetoothDeviceProxy<'a>> for BluetoothDevice<'a> {
|
||||
fn from(device: BluetoothDeviceProxy<'a>) -> Self {
|
||||
BluetoothDevice(device)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,3 +12,9 @@ impl<'a> Deref for WiredDevice<'a> {
|
|||
&self.0
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> From<WiredDeviceProxy<'a>> for WiredDevice<'a> {
|
||||
fn from(device: WiredDeviceProxy<'a>) -> Self {
|
||||
WiredDevice(device)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,10 +1,20 @@
|
|||
// SPDX-License-Identifier: MPL-2.0
|
||||
|
||||
use crate::interface::device::wireless::WirelessDeviceProxy;
|
||||
use crate::interface::{device::wireless::WirelessDeviceProxy, enums::WifiCapabilities};
|
||||
use std::ops::Deref;
|
||||
use zbus::Result;
|
||||
|
||||
pub struct WirelessDevice<'a>(WirelessDeviceProxy<'a>);
|
||||
|
||||
impl<'a> WirelessDevice<'a> {
|
||||
pub async fn wireless_capabilities(&self) -> Result<WifiCapabilities> {
|
||||
self.0
|
||||
.wireless_capabilities()
|
||||
.await
|
||||
.map(WifiCapabilities::from_bits_truncate)
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> Deref for WirelessDevice<'a> {
|
||||
type Target = WirelessDeviceProxy<'a>;
|
||||
|
||||
|
|
@ -12,3 +22,9 @@ impl<'a> Deref for WirelessDevice<'a> {
|
|||
&self.0
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> From<WirelessDeviceProxy<'a>> for WirelessDevice<'a> {
|
||||
fn from(device: WirelessDeviceProxy<'a>) -> Self {
|
||||
WirelessDevice(device)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue