Interface for a GATT server that serves many GATT services. More...
#include <server2.h>
Classes | |
struct | LocalServiceInfo |
Parameters for registering a local GATT service. More... | |
Public Types | |
enum class | PublishServiceError { kInternalError = 0 , kInvalidHandle = 1 , kInvalidUuid = 2 , kInvalidCharacteristics = 3 , kInvalidIncludes = 4 } |
using | PublishServiceResult = pw::expected< LocalService2::Ptr, PublishServiceError > |
The Result passed by PublishService. | |
Public Member Functions | |
virtual async2::OnceReceiver< PublishServiceResult > | PublishService (const LocalServiceInfo &info, LocalServiceDelegate2 &delegate)=0 |
Interface for a GATT server that serves many GATT services.
|
strong |
|
pure virtual |
Publishes the service defined by info
and implemented by delegate
so that it is available to all remote peers.
The caller must assign distinct handles to the characteristics and descriptors listed in info
per call to PublishService
(handles can be reused across calls). These identifiers will be used in requests sent to delegate
.
LocalService::Ptr
is returned via result_sender
. When the LocalService::Ptr
is destroyed or an error occurs (LocalServiceDelegate.OnError), the service will be unpublished.