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<BluetoothRfcommSocket<'_>, String>;
}
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<BluetoothRfcommSocket<'_>, String>
fn get_rfcomm_socket( &mut self, uuid: BluetoothUuid, is_secure: bool, ) -> Result<BluetoothRfcommSocket<'_>, String>
Attempt to get an rfcomm socket for the given uuid and seciruty setting
Implementations on Foreign Types§
Source§impl BluetoothDeviceTrait for Device
impl BluetoothDeviceTrait for Device
Source§fn get_uuids(&mut self) -> Result<Vec<BluetoothUuid>, Error>
fn get_uuids(&mut self) -> Result<Vec<BluetoothUuid>, Error>
Get all known uuids for this device
Source§fn get_pair_state(&self) -> Result<PairingStatus, Error>
fn get_pair_state(&self) -> Result<PairingStatus, Error>
Retrieve the device pairing (bonding) status
Source§fn get_rfcomm_socket(
&mut self,
uuid: BluetoothUuid,
is_secure: bool,
) -> Result<BluetoothRfcommSocket<'_>, String>
fn get_rfcomm_socket( &mut self, uuid: BluetoothUuid, is_secure: bool, ) -> Result<BluetoothRfcommSocket<'_>, String>
Attempt to get an rfcomm socket for the given uuid and seciruty setting