pub struct Bluetooth { /* private fields */ }Expand description
Bluetooth from BlueZ, from cx.bluetooth(). Cloning it is cheap.
Implementations§
Source§impl Bluetooth
impl Bluetooth
Sourcepub fn adapters(&self) -> ReadSignal<Vec<BluetoothAdapter>>
pub fn adapters(&self) -> ReadSignal<Vec<BluetoothAdapter>>
Every adapter, in path order. Empty while BlueZ isn’t running.
Sourcepub fn devices(&self) -> ReadSignal<Vec<BluetoothDevice>>
pub fn devices(&self) -> ReadSignal<Vec<BluetoothDevice>>
Every device BlueZ knows, in path order. Empty while BlueZ isn’t running.
Sourcepub fn set_powered(&self, adapter: &str, powered: bool)
pub fn set_powered(&self, adapter: &str, powered: bool)
Turns the adapter at adapter, its path, on or off.
Sourcepub fn start_discovery(&self, adapter: &str)
pub fn start_discovery(&self, adapter: &str)
Starts looking for devices. Found ones join devices until BlueZ
forgets them, a while after stop_discovery.
Sourcepub fn stop_discovery(&self, adapter: &str)
pub fn stop_discovery(&self, adapter: &str)
Stops looking for devices.
Sourcepub fn disconnect(&self, device: &str)
pub fn disconnect(&self, device: &str)
Disconnects the device at device.
Sourcepub fn pair(&self, device: &str)
pub fn pair(&self, device: &str)
Pairs with the device at device. The shell answers no pairing
questions, so a device that asks for a PIN or a confirmation fails,
and that is logged, unless another program on the desktop answers
for BlueZ.
Sourcepub fn set_trusted(&self, device: &str, trusted: bool)
pub fn set_trusted(&self, device: &str, trusted: bool)
Lets the device at device connect without asking, or not.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Bluetooth
impl !Send for Bluetooth
impl !Sync for Bluetooth
impl !UnwindSafe for Bluetooth
impl Forget for Bluetooth
impl Freeze for Bluetooth
impl Move for Bluetooth
impl Unpin for Bluetooth
impl UnsafeUnpin for Bluetooth
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more