Struct rustable::Adapter [−][src]
pub struct Adapter { /* fields omitted */ }This struct represents a local Bluetooth adapter.
It can be used to query and configure the local adapter, get remote Devices, and host local GATT services.
Implementations
impl Adapter[src]
impl Adapter[src]pub async fn from_conn(conn: Arc<RpcConn>, idx: u8) -> Result<Adapter, Error>[src]
Create an Adapter to interface with a specific Bluetooth adapter
using an existing async_rustbus::RpcConn
pub async fn new(idx: u8) -> Result<Adapter, Error>[src]
Create an Adapter to interface with a specific Bluetooth adapter.
pub async fn addr(&self) -> Result<MAC, Error>[src]
Get the MAC of the local adapter.
pub async fn set_powered(&self, powered: bool) -> Result<(), Error>[src]
Turn the Bluetooth adapter on (true) or off.
pub async fn get_powered(&self) -> Result<bool, Error>[src]
Check if the device is powered on (true) or off.
pub fn path(&self) -> &ObjectPath[src]
Get the DBus ObjectPath of this remote device.
pub async fn get_devices(&self) -> Result<Vec<MAC>, Error>[src]
Get the MACs of remote devices that the adapter knows of.
This will included connected devices, paired devices, and visible devices (if discovery is enabled).
pub async fn get_device(&self, mac: MAC) -> Result<Device, Error>[src]
Get Device for the given MAC.
pub fn conn(&self) -> &Arc<RpcConn>[src]
Get a reference to Arc<async_rustbus::RpcConn> used to communicate with the Bluez daemon.