Pigweed
 
Loading...
Searching...
No Matches
pw::bluetooth::gatt::Client2 Class Referenceabstract

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< RemoteServiceInfoPendServiceUpdate (async2::Context &cx)
 
virtual async2::Poll< ServiceHandle > PendServiceRemoved (async2::Context &cx)
 
virtual pw::expected< RemoteService2::Ptr, Error > ConnectToService (ServiceHandle handle)=0
 

Detailed Description

Represents a GATT client that interacts with services on a GATT server.

Member Function Documentation

◆ ConnectToService()

virtual pw::expected< RemoteService2::Ptr, Error > pw::bluetooth::gatt::Client2::ConnectToService ( ServiceHandle  handle)
pure virtual

Connects to a RemoteService2. Only 1 connection per service is allowed.

Parameters
handleThe handle of the service to connect to.
Returns
kInvalidParameters handle does not correspond to a known service.

◆ PendServiceRemoved()

virtual async2::Poll< ServiceHandle > pw::bluetooth::gatt::Client2::PendServiceRemoved ( async2::Context cx)
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.

Parameters
cxAwoken when a service is removed after Pending is returned.

◆ PendServiceUpdate()

virtual async2::Poll< RemoteServiceInfo > pw::bluetooth::gatt::Client2::PendServiceUpdate ( async2::Context cx)
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.

Returns
Will return 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.

The documentation for this class was generated from the following file: