pub struct Device { /* private fields */ }
Implementations§
Source§impl Device
impl Device
pub fn address(&self) -> BDAddr
Sourcepub fn on_disconnected<F>(&mut self, f: F)
pub fn on_disconnected<F>(&mut self, f: F)
add device disconnected callback
Sourcepub async fn properties(&self) -> Option<PeripheralProperties>
pub async fn properties(&self) -> Option<PeripheralProperties>
Get the peripheral properties from device.
Sourcepub async fn local_name(&self) -> Option<String>
pub async fn local_name(&self) -> Option<String>
Local name of the device
Sourcepub async fn manufacturer_data(&self, val: &u16) -> Option<Vec<u8>>
pub async fn manufacturer_data(&self, val: &u16) -> Option<Vec<u8>>
Get the manufacturer data from device.
Sourcepub async fn service_data(&self, uuid: &Uuid) -> Option<Vec<u8>>
pub async fn service_data(&self, uuid: &Uuid) -> Option<Vec<u8>>
Get the service data from device.
Sourcepub async fn disconnect(&self) -> Result<()>
pub async fn disconnect(&self) -> Result<()>
Disconnect from the device
Sourcepub async fn is_connected(&self) -> Result<bool>
pub async fn is_connected(&self) -> Result<bool>
Get the connected state
Sourcepub async fn service_count(&self) -> Result<usize>
pub async fn service_count(&self) -> Result<usize>
Number of services advertised by the device
Sourcepub async fn characteristics(&self) -> Result<Vec<Characteristic>>
pub async fn characteristics(&self) -> Result<Vec<Characteristic>>
Characteristics advertised by the device
Sourcepub async fn characteristic(&self, uuid: Uuid) -> Result<Option<Characteristic>>
pub async fn characteristic(&self, uuid: Uuid) -> Result<Option<Characteristic>>
Get characteristic by UUID
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Device
impl !RefUnwindSafe for Device
impl Send for Device
impl Sync for Device
impl Unpin for Device
impl !UnwindSafe for Device
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