pub struct FakePeerService { /* private fields */ }
Implementations§
Source§impl FakePeerService
impl FakePeerService
pub fn new() -> Self
pub fn add_characteristic(&mut self, char: Characteristic, value: Vec<u8>)
pub fn expect_characteristic_value(&mut self, handle: &Handle, value: Vec<u8>)
Sourcepub fn notify(
&self,
handle: &Handle,
notification: Result<CharacteristicNotification>,
)
pub fn notify( &self, handle: &Handle, notification: Result<CharacteristicNotification>, )
Sends a notification on the characteristic with the provided handle
.
Sourcepub fn clear_notifier(&self, handle: &Handle)
pub fn clear_notifier(&self, handle: &Handle)
Removes the notification subscription for the characteristic with the
provided handle
.
Trait Implementations§
Source§impl Clone for FakePeerService
impl Clone for FakePeerService
Source§fn clone(&self) -> FakePeerService
fn clone(&self) -> FakePeerService
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl PeerService<FakeTypes> for FakePeerService
impl PeerService<FakeTypes> for FakePeerService
Source§fn discover_characteristics(
&self,
uuid: Option<Uuid>,
) -> <FakeTypes as GattTypes>::CharacteristicDiscoveryFut
fn discover_characteristics( &self, uuid: Option<Uuid>, ) -> <FakeTypes as GattTypes>::CharacteristicDiscoveryFut
Discover characteristics on this service.
If
uuid
is provided, only the characteristics matching uuid
will be
returned. This operation may use either the Discovery All
Characteristics of a Service or Discovery Characteristic by UUID
procedures, regardless of uuid
.Source§fn read_characteristic<'a>(
&self,
handle: &Handle,
_offset: u16,
buf: &'a mut [u8],
) -> <FakeTypes as GattTypes>::ReadFut<'a>
fn read_characteristic<'a>( &self, handle: &Handle, _offset: u16, buf: &'a mut [u8], ) -> <FakeTypes as GattTypes>::ReadFut<'a>
Read a characteristic into a buffer, given the handle within the
service. On success, returns the size read and whether the value may
have been truncated. By default this will try to use a long read if
the
buf
is larger than a normal read will allow (22 bytes) or if
the offset is non-zero.fn write_characteristic<'a>( &self, handle: &Handle, _mode: WriteMode, _offset: u16, buf: &'a [u8], ) -> <FakeTypes as GattTypes>::WriteFut<'a>
fn read_descriptor<'a>( &self, _handle: &Handle, _offset: u16, _buf: &'a mut [u8], ) -> <FakeTypes as GattTypes>::ReadFut<'a>
fn write_descriptor<'a>( &self, _handle: &Handle, _offset: u16, _buf: &'a [u8], ) -> <FakeTypes as GattTypes>::WriteFut<'a>
Source§fn subscribe(
&self,
handle: &Handle,
) -> <FakeTypes as GattTypes>::NotificationStream
fn subscribe( &self, handle: &Handle, ) -> <FakeTypes as GattTypes>::NotificationStream
Subscribe to updates on a Characteristic.
Either notifications or indications will be enabled depending on the
properties available, with indications preferred if they are
supported. Fails if the Characteristic doesn’t support indications
or notifications. Errors are delivered through an Err item in the
stream. This will often write to the Client Characteristic
Configuration descriptor for the Characteristic subscribed to.
Updates sent from the peer will be delivered to the Stream returned.
Auto Trait Implementations§
impl Freeze for FakePeerService
impl !RefUnwindSafe for FakePeerService
impl Send for FakePeerService
impl Sync for FakePeerService
impl Unpin for FakePeerService
impl !UnwindSafe for FakePeerService
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