pub struct FakeTypes {}
Trait Implementations§
Source§impl Central<FakeTypes> for FakeCentral
impl Central<FakeTypes> for FakeCentral
Source§fn scan(&self, _filters: &[ScanFilter]) -> ScannedResultStream
fn scan(&self, _filters: &[ScanFilter]) -> ScannedResultStream
Scan for peers.
If any of the filters match, the results will be returned in the Stream.
Source§fn connect(&self, peer_id: PeerId) -> <FakeTypes as GattTypes>::ConnectFuture
fn connect(&self, peer_id: PeerId) -> <FakeTypes as GattTypes>::ConnectFuture
Connect to a specific peer.
Source§fn periodic_advertising(
&self,
) -> Result<<FakeTypes as GattTypes>::PeriodicAdvertising>
fn periodic_advertising( &self, ) -> Result<<FakeTypes as GattTypes>::PeriodicAdvertising>
Get API for periodic advertising.
Source§impl Client<FakeTypes> for FakeClient
impl Client<FakeTypes> for FakeClient
Source§fn find_service(&self, uuid: Uuid) -> <FakeTypes as GattTypes>::FindServicesFut
fn find_service(&self, uuid: Uuid) -> <FakeTypes as GattTypes>::FindServicesFut
Find services by UUID on the peer.
This may cause as much as a full discovery of all services on the peer
if the stack deems it appropriate.
Service information should be up to date at the time returned.
Source§impl GattTypes for FakeTypes
impl GattTypes for FakeTypes
type Central = FakeCentral
type ScanResultStream = ScannedResultStream
type Client = FakeClient
type ConnectFuture = Ready<Result<FakeClient, Error>>
type PeerServiceHandle = FakeServiceHandle
type FindServicesFut = Ready<Result<Vec<FakeServiceHandle>, Error>>
type PeerService = FakePeerService
type ServiceConnectFut = Ready<Result<FakePeerService, Error>>
Source§type CharacteristicDiscoveryFut = Ready<Result<Vec<Characteristic>, Error>>
type CharacteristicDiscoveryFut = Ready<Result<Vec<Characteristic>, Error>>
Future returned by PeerService::discover_characteristics,
delivering the set of characteristics discovered within a service
Source§type NotificationStream = UnboundedReceiver<Result<CharacteristicNotification, Error>>
type NotificationStream = UnboundedReceiver<Result<CharacteristicNotification, Error>>
A stream of notifications, delivering updates to a characteristic value
that has been subscribed to. See
client::PeerService::subscribe
Source§type ReadFut<'a> = Ready<Result<(usize, bool), Error>>
type ReadFut<'a> = Ready<Result<(usize, bool), Error>>
Future resolving when a characteristic or descriptor has been read.
Resolves to a number of bytes read along with a boolean indicating if
the value was possibly truncated, or an Error if the value could not
be read.
Source§type WriteFut<'a> = Ready<Result<(), Error>>
type WriteFut<'a> = Ready<Result<(), Error>>
Future resolving when a characteristic or descriptor has been written.
Returns an error if the value could not be written.
Source§type PeriodicAdvertising = FakePeriodicAdvertising
type PeriodicAdvertising = FakePeriodicAdvertising
The implementation of periodic advertising for this GATT implementation.
Source§impl LocalService<FakeTypes> for FakeLocalService
impl LocalService<FakeTypes> for FakeLocalService
Source§fn publish(&self) -> <FakeTypes as ServerTypes>::ServiceEventStream
fn publish(&self) -> <FakeTypes as ServerTypes>::ServiceEventStream
Publish the service.
Returns an EventStream providing Events to be processed by the local
service implementation.
Events will only be delivered to one ServiceEventStream at a time.
Calling publish while a previous ServiceEventStream is still active
will return a stream with only Err(AlreadyPublished).
Source§fn notify(&self, characteristic: &Handle, data: &[u8], peers: &[PeerId])
fn notify(&self, characteristic: &Handle, data: &[u8], peers: &[PeerId])
Notify a characteristic.
Leave
peers
empty to notify all peers who have configured
notifications. Peers that have not configured for notifications will
not be notified.Source§fn indicate(
&self,
characteristic: &Handle,
data: &[u8],
peers: &[PeerId],
) -> <FakeTypes as ServerTypes>::IndicateConfirmationStream
fn indicate( &self, characteristic: &Handle, data: &[u8], peers: &[PeerId], ) -> <FakeTypes as ServerTypes>::IndicateConfirmationStream
Indicate on a characteristic.
Leave
peers
empty to notify all peers who have configured
indications. Peers that have not configured for indications will
be skipped. Returns a stream which has items for each peer that
confirms the notification, and terminates when all peers have either
timed out or confirmed.Source§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.
Source§impl Server<FakeTypes> for FakeServer
impl Server<FakeTypes> for FakeServer
Source§fn prepare(
&self,
service: ServiceDefinition,
) -> <FakeTypes as ServerTypes>::LocalServiceFut
fn prepare( &self, service: ServiceDefinition, ) -> <FakeTypes as ServerTypes>::LocalServiceFut
Prepare to publish a service.
This service is not immediately visible in the local GATT server.
It will be published when the LocalService::publish is called.
If the returned LocalService is dropped, the service will be removed
from the Server.
Source§impl ServerTypes for FakeTypes
impl ServerTypes for FakeTypes
type Server = FakeServer
type LocalService = FakeLocalService
type LocalServiceFut = Ready<Result<FakeLocalService, Error>>
type ServiceEventStream = UnboundedReceiver<Result<ServiceEvent<FakeTypes>, Error>>
type ServiceWriteType = Vec<u8>
type ReadResponder = FakeResponder
type WriteResponder = FakeResponder
type IndicateConfirmationStream = UnboundedReceiver<Result<ConfirmationEvent, Error>>
Auto Trait Implementations§
impl Freeze for FakeTypes
impl RefUnwindSafe for FakeTypes
impl Send for FakeTypes
impl Sync for FakeTypes
impl Unpin for FakeTypes
impl UnwindSafe for FakeTypes
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