Struct btleplug::platform::Peripheral [−][src]
pub struct Peripheral { /* fields omitted */ }
Expand description
Implementation of api::Peripheral.
Trait Implementations
fn properties<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<Option<PeripheralProperties>>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
fn properties<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<Option<PeripheralProperties>>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
Returns the set of properties associated with the peripheral. These may be updated over time as additional advertising reports are received. Read more
The set of characteristics we’ve discovered for this device. This will be empty until
discover_characteristics
is called. Read more
Returns true iff we are currently connected to the device.
Creates a connection to the device. If this method returns Ok there has been successful connection. Note that peripherals allow only one connection at a time. Operations that attempt to communicate with a device will fail until it is connected. Read more
Terminates a connection to the device.
fn discover_characteristics<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<Vec<Characteristic>>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
fn discover_characteristics<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<Vec<Characteristic>>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
Discovers all characteristics for the device.
fn write<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
characteristic: &'life1 Characteristic,
data: &'life2 [u8],
write_type: WriteType
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
fn write<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
characteristic: &'life1 Characteristic,
data: &'life2 [u8],
write_type: WriteType
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
Write some data to the characteristic. Returns an error if the write couldn’t be sent or (in the case of a write-with-response) if the device returns an error. Read more
Sends a read request to the device. Returns either an error if the request was not accepted or the response from the device. Read more
Enables either notify or indicate (depending on support) for the specified characteristic.
fn unsubscribe<'life0, 'life1, 'async_trait>(
&'life0 self,
characteristic: &'life1 Characteristic
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn unsubscribe<'life0, 'life1, 'async_trait>(
&'life0 self,
characteristic: &'life1 Characteristic
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Disables either notify or indicate (depending on support) for the specified characteristic.
Returns a stream of notifications for characteristic value updates. The stream will receive a notification when a value notification or indication is received from the device. This method should only be used after a connection has been established. Read more
Auto Trait Implementations
impl !RefUnwindSafe for Peripheral
impl Send for Peripheral
impl Sync for Peripheral
impl Unpin for Peripheral
impl !UnwindSafe for Peripheral
Blanket Implementations
Mutably borrows from an owned value. Read more