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§
Sourceasync fn register_rfcomm_profile(
&self,
settings: BluetoothRfcommProfileSettings,
) -> Result<BluetoothRfcommProfile, String>
async fn register_rfcomm_profile( &self, settings: BluetoothRfcommProfileSettings, ) -> Result<BluetoothRfcommProfile, String>
Attempt to register a new rfcomm 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
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.