16#include "pw_async2/dispatcher.h"
17#include "pw_async2/once_sender.h"
18#include "pw_bluetooth/gatt/constants.h"
19#include "pw_bluetooth/gatt/error.h"
20#include "pw_bluetooth/gatt/types.h"
21#include "pw_bluetooth/internal/raii_ptr.h"
22#include "pw_containers/vector.h"
23#include "pw_function/function.h"
24#include "pw_multibuf/multibuf.h"
25#include "pw_result/expected.h"
27namespace pw::bluetooth::gatt {
61 pw::expected<ReadValue, Error>
result;
125 characteristics_sender) = 0;
200 Handle handle, std::optional<LongReadOptions> options) = 0;
280 using Ptr = internal::RaiiPtr<RemoteService2, &RemoteService2::Disconnect>;
327 ServiceHandle handle) = 0;
Definition: dispatcher_base.h:52
Definition: once_sender.h:41
Definition: once_sender.h:268
Represents a GATT client that interacts with services on a GATT server.
Definition: client2.h:284
virtual async2::Poll< ServiceHandle > PendServiceRemoved(async2::Context &cx)
virtual async2::Poll< RemoteServiceInfo > PendServiceUpdate(async2::Context &cx)
virtual pw::expected< RemoteService2::Ptr, Error > ConnectToService(ServiceHandle handle)=0
An interface for interacting with a GATT service on a peer device.
Definition: client2.h:30
RemoteServiceError
Definition: client2.h:32
@ kPeerDisconnected
The peer serving this service has disconnected.
@ kServiceRemoved
The service has been modified or removed.
virtual async2::OnceReceiver< pw::expected< ReadValue, Error > > ReadCharacteristic(Handle handle, std::optional< LongReadOptions > options)=0
virtual void DiscoverCharacteristics(async2::OnceRefSender< Vector< Characteristic2 > > characteristics_sender)=0
virtual async2::OnceReceiver< pw::expected< void, Error > > WriteDescriptor(Handle handle, pw::multibuf::MultiBuf &&value)=0
WriteMode
Definition: client2.h:78
internal::RaiiPtr< RemoteService2, &RemoteService2::Disconnect > Ptr
Definition: client2.h:280
virtual async2::OnceReceiver< pw::expected< Vector< ReadByTypeResult, 5 >, Error > > ReadByType(Uuid uuid)=0
virtual void Disconnect()=0
virtual async2::OnceReceiver< pw::expected< ReadValue, Error > > ReadDescriptor(Handle handle, std::optional< LongReadOptions > options)=0
virtual async2::Poll< RemoteServiceError > PendError(async2::Context &cx)=0
virtual async2::Poll< ReadValue > PendNotification(Handle handle, async2::Context &cx)=0
virtual async2::OnceReceiver< pw::expected< void, Error > > StopNotifications(Handle handle)=0
virtual async2::OnceReceiver< pw::expected< void, Error > > WriteCharacteristic(Handle handle, pw::multibuf::MultiBuf &&value, WriteOptions options)=0
virtual async2::OnceReceiver< pw::expected< void, Error > > EnableNotifications(Handle handle)=0
Definition: multibuf.h:245
Represents a remote GATT service.
Definition: client2.h:287
ServiceHandle handle
Uniquely identifies this GATT service.
Definition: client2.h:289
bool primary
Indicates whether this is a primary or secondary service.
Definition: client2.h:292
Uuid type
Definition: client2.h:296
uint16_t offset
Definition: client2.h:70
uint16_t max_bytes
The maximum number of bytes to read.
Definition: client2.h:73
A result returned by ReadByType.
Definition: client2.h:55
pw::expected< ReadValue, Error > result
Definition: client2.h:61
Handle handle
Characteristic or descriptor handle.
Definition: client2.h:57
Wrapper around a possible truncated value received from the server.
Definition: client2.h:41
multibuf::MultiBuf value
The value of the characteristic or descriptor.
Definition: client2.h:46
bool maybe_truncated
Definition: client2.h:51
Handle handle
Characteristic or descriptor handle.
Definition: client2.h:43
Definition: client2.h:100
uint16_t offset
Definition: client2.h:107
WriteMode mode
Definition: client2.h:103