Represents a GATT client that interacts with services on a GATT server. More...
#include <client2.h>
Classes | |
struct | RemoteServiceInfo |
Represents a remote GATT service. More... | |
Public Member Functions | |
virtual async2::Poll< RemoteServiceInfo > | PendServiceUpdate (async2::Context &cx) |
virtual async2::Poll< ServiceHandle > | PendServiceRemoved (async2::Context &cx) |
virtual pw::expected< RemoteService2::Ptr, Error > | ConnectToService (ServiceHandle handle)=0 |
Represents a GATT client that interacts with services on a GATT server.
|
pure virtual |
Connects to a RemoteService2
. Only 1 connection per service is allowed.
handle | The handle of the service to connect to. |
handle
does not correspond to a known service.
|
virtual |
Returns the handles of services that have been removed. Note that handles may be reused, so it is recommended to check for removed services before calling PendServiceUpdate
. This should be called repeatedly until Pending
is returned.
cx | Awoken when a service is removed after Pending is returned. |
|
virtual |
Enumerates existing services found on the peer that this object represents and notifies of modifications to services or new services thereafter. If service discovery hasn't happened yet, it may be started. To further interact with services, clients must obtain a RemoteService2
protocol by calling ConnectToService
.
Ready
with RemoteServiceInfo
when there are services that are updated/modified. This can can be called repeatedly until Pending
is returned to get all previously discovered services.