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§
Sourcefn register_rfcomm_profile(
&self,
settings: BluetoothRfcommProfileSettings,
) -> Result<BluetoothRfcommProfileSync, String>
fn register_rfcomm_profile( &self, settings: BluetoothRfcommProfileSettings, ) -> Result<BluetoothRfcommProfileSync, String>
Attempt to register a new rfcomm profile
Sourcefn register_l2cap_profile(
&self,
settings: BluetoothL2capProfileSettings,
) -> Result<BluetoothL2capProfileAsync, String>
fn register_l2cap_profile( &self, settings: BluetoothL2capProfileSettings, ) -> Result<BluetoothL2capProfileAsync, String>
Attempt to register a new lc2ap profile
Sourcefn get_paired_devices(&self) -> Option<Vec<BluetoothDevice>>
fn get_paired_devices(&self) -> Option<Vec<BluetoothDevice>>
Get a list of paired bluetooth devices
Sourcefn start_discovery(&self) -> BluetoothDiscovery
fn start_discovery(&self) -> BluetoothDiscovery
Start discovery of bluetooth devices. Run this and drop the result to cancel discovery
Sourcefn addresses(&self) -> Vec<BluetoothAdapterAddress>
fn addresses(&self) -> Vec<BluetoothAdapterAddress>
Get the mac addresses of all bluetooth adapters for the system