pub struct BluetoothDevice { /* private fields */ }
Expand description
Corresponds to android.bluetooth.BluetoothDevice
.
Implementations§
Source§impl BluetoothDevice
impl BluetoothDevice
Sourcepub fn get_address(&self) -> Result<String, Error>
pub fn get_address(&self) -> Result<String, Error>
Returns the hardware address of this BluetoothDevice.
TODO: return some MAC address type instead of String
.
Sourcepub fn get_name(&self) -> Result<String, Error>
pub fn get_name(&self) -> Result<String, Error>
Gets the friendly Bluetooth name of the remote device.
Sourcepub fn build_rfcomm_socket(
&self,
uuid: &str,
is_secure: bool,
) -> Result<BluetoothSocket, Error>
pub fn build_rfcomm_socket( &self, uuid: &str, is_secure: bool, ) -> Result<BluetoothSocket, Error>
Creates the Android Bluetooth API socket object for RFCOMM communication.
SPP_UUID
can be used. Note that connect
is not called automatically.
Trait Implementations§
Source§impl Clone for BluetoothDevice
impl Clone for BluetoothDevice
Source§fn clone(&self) -> BluetoothDevice
fn clone(&self) -> BluetoothDevice
Returns a duplicate of the value. Read more
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl Freeze for BluetoothDevice
impl RefUnwindSafe for BluetoothDevice
impl Send for BluetoothDevice
impl Sync for BluetoothDevice
impl Unpin for BluetoothDevice
impl UnwindSafe for BluetoothDevice
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more