Skip to main content

AsyncBluetoothAdapterTrait

Trait AsyncBluetoothAdapterTrait 

Source
pub trait AsyncBluetoothAdapterTrait {
    // Required methods
    fn register_rfcomm_profile<'life0, 'async_trait>(
        &'life0 self,
        settings: BluetoothRfcommProfileSettings,
    ) -> Pin<Box<dyn Future<Output = Result<BluetoothRfcommProfileAsync, String>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn register_l2cap_profile<'life0, 'async_trait>(
        &'life0 self,
        settings: BluetoothL2capProfileSettings,
    ) -> Pin<Box<dyn Future<Output = Result<BluetoothL2capProfileAsync, String>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_paired_devices(&self) -> Option<Vec<BluetoothDevice>>;
    fn start_discovery(&self) -> BluetoothDiscovery;
    fn addresses<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Vec<BluetoothAdapterAddress>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn set_discoverable<'life0, 'async_trait>(
        &'life0 self,
        d: bool,
    ) -> Pin<Box<dyn Future<Output = Result<(), ()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Common async functionality for the bluetooth adapter

Required Methods§

Source

fn register_rfcomm_profile<'life0, 'async_trait>( &'life0 self, settings: BluetoothRfcommProfileSettings, ) -> Pin<Box<dyn Future<Output = Result<BluetoothRfcommProfileAsync, String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Attempt to register a new rfcomm profile

Source

fn register_l2cap_profile<'life0, 'async_trait>( &'life0 self, settings: BluetoothL2capProfileSettings, ) -> Pin<Box<dyn Future<Output = Result<BluetoothL2capProfileAsync, String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Attempt to register a new l2cap 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

fn addresses<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Vec<BluetoothAdapterAddress>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get the mac addresses of all bluetooth adapters for the system

Source

fn set_discoverable<'life0, 'async_trait>( &'life0 self, d: bool, ) -> Pin<Box<dyn Future<Output = Result<(), ()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Set the discoverable property

Implementors§