Trait BluetoothAdapterTrait

Source
pub trait BluetoothAdapterTrait {
    // Required methods
    async fn register_rfcomm_profile(
        &self,
        settings: BluetoothRfcommProfileSettings,
    ) -> Result<BluetoothRfcommProfile, String>;
    fn get_paired_devices(&self) -> Option<Vec<BluetoothDevice>>;
    fn start_discovery(&self) -> BluetoothDiscovery<'_>;
    async fn addresses(&self) -> Vec<[u8; 6]>;
    async fn set_discoverable(&self, d: bool) -> Result<(), ()>;
}
Expand description

Common functionality for the bluetooth adapter

Required Methods§

Source

async fn register_rfcomm_profile( &self, settings: BluetoothRfcommProfileSettings, ) -> Result<BluetoothRfcommProfile, String>

Attempt to register a new rfcomm profile

Source

fn get_paired_devices(&self) -> Option<Vec<BluetoothDevice>>

Get a list of paired bluetooth devices

Source

fn start_discovery(&self) -> BluetoothDiscovery<'_>

Start discovery of bluetooth devices. Run this and drop the result to cancel discovery

Source

async fn addresses(&self) -> Vec<[u8; 6]>

Get the mac addresses of all bluetooth adapters for the system

Source

async fn set_discoverable(&self, d: bool) -> Result<(), ()>

Set the discoverable property

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§