Skip to main content

SyncBluetoothAdapterTrait

Trait SyncBluetoothAdapterTrait 

Source
pub trait SyncBluetoothAdapterTrait {
    // Required methods
    fn register_rfcomm_profile(
        &self,
        settings: BluetoothRfcommProfileSettings,
    ) -> Result<BluetoothRfcommProfileSync, String>;
    fn register_l2cap_profile(
        &self,
        settings: BluetoothL2capProfileSettings,
    ) -> Result<BluetoothL2capProfileAsync, String>;
    fn get_paired_devices(&self) -> Option<Vec<BluetoothDevice>>;
    fn start_discovery(&self) -> BluetoothDiscovery;
    fn addresses(&self) -> Vec<BluetoothAdapterAddress>;
    fn set_discoverable(&self, d: bool) -> Result<(), ()>;
}
Expand description

Common sync functionality for the bluetooth adapter

Required Methods§

Source

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

Attempt to register a new rfcomm profile

Source

fn register_l2cap_profile( &self, settings: BluetoothL2capProfileSettings, ) -> Result<BluetoothL2capProfileAsync, String>

Attempt to register a new lc2ap 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(&self) -> Vec<BluetoothAdapterAddress>

Get the mac addresses of all bluetooth adapters for the system

Source

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

Set the discoverable property

Implementors§