pub trait BluetoothDeviceTrait {
// Required methods
fn get_uuids(&mut self) -> Result<Vec<BluetoothUuid>, Error>;
fn get_name(&self) -> Result<String, Error>;
fn get_address(&mut self) -> Result<String, Error>;
fn get_pair_state(&self) -> Result<PairingStatus, Error>;
fn get_rfcomm_socket(
&mut self,
uuid: BluetoothUuid,
is_secure: bool,
) -> Result<BluetoothSocket<'_>, String>;
fn get_l2cap_socket(
&mut self,
uuid: BluetoothUuid,
is_secure: bool,
) -> Result<BluetoothSocket<'_>, String>;
fn run_sdp(&mut self);
}Expand description
The trait that all bluetooth devices must implement
Required Methods§
Sourcefn get_uuids(&mut self) -> Result<Vec<BluetoothUuid>, Error>
fn get_uuids(&mut self) -> Result<Vec<BluetoothUuid>, Error>
Get all known uuids for this device
Sourcefn get_address(&mut self) -> Result<String, Error>
fn get_address(&mut self) -> Result<String, Error>
Retrieve the device address
Sourcefn get_pair_state(&self) -> Result<PairingStatus, Error>
fn get_pair_state(&self) -> Result<PairingStatus, Error>
Retrieve the device pairing status
Sourcefn get_rfcomm_socket(
&mut self,
uuid: BluetoothUuid,
is_secure: bool,
) -> Result<BluetoothSocket<'_>, String>
fn get_rfcomm_socket( &mut self, uuid: BluetoothUuid, is_secure: bool, ) -> Result<BluetoothSocket<'_>, String>
Attempt to get an rfcomm socket for the given uuid and security setting
Sourcefn get_l2cap_socket(
&mut self,
uuid: BluetoothUuid,
is_secure: bool,
) -> Result<BluetoothSocket<'_>, String>
fn get_l2cap_socket( &mut self, uuid: BluetoothUuid, is_secure: bool, ) -> Result<BluetoothSocket<'_>, String>
Attempt to get an l2cap socket for the given uuid and security setting