18#include "pw_async2/once_sender.h"
19#include "pw_bluetooth/internal/raii_ptr.h"
20#include "pw_bluetooth/low_energy/connection2.h"
21#include "pw_bluetooth/low_energy/phy.h"
22#include "pw_bluetooth/types.h"
23#include "pw_chrono/system_clock.h"
24#include "pw_result/expected.h"
26namespace pw::bluetooth::low_energy {
57 std::optional<std::string_view>
name;
139 std::optional<InlineString<22>>
name;
174 using Ptr = internal::RaiiPtr<ScanHandle, &ScanHandle::Release>;
Definition: dispatcher_base.h:52
Definition: once_sender.h:41
Represents an ongoing LE scan.
Definition: central2.h:146
virtual async2::Poll< pw::Result< ScanResult > > PendResult(async2::Context &cx)=0
virtual ~ScanHandle()=default
Stops the scan.
internal::RaiiPtr< ScanHandle, &ScanHandle::Release > Ptr
Definition: central2.h:174
Represents the LE central role. Used to scan and connect to peripherals.
Definition: central2.h:29
virtual async2::OnceReceiver< ConnectResult > Connect(PeerId peer_id, Connection2::ConnectionOptions options)=0
ScanType
Definition: central2.h:76
@ kActiveUseRandomAddress
Send scanning PDUs with the random address.
@ kActiveUsePublicAddress
Send scanning PDUs with the public address.
@ kActiveUseResolvablePrivateAddress
Send scanning PDUs with a generated Resolvable Private Address.
ConnectError
Possible errors returned by Connect.
Definition: central2.h:178
@ kUnknownPeer
The peer ID is unknown.
@ kInvalidOptions
The ConnectionOptions were invalid.
@ kAlreadyExists
A connection to the peer already exists.
pw::expected< ScanHandle::Ptr, StartScanError > ScanStartResult
The result type returned by Scan().
Definition: central2.h:207
virtual async2::OnceReceiver< ScanStartResult > Scan(const ScanOptions &options)=0
pw::expected< Connection2::Ptr, ConnectError > ConnectResult
The result type returned by Connect().
Definition: central2.h:204
StartScanError
Definition: central2.h:194
@ kInvalidParameters
Some of the scan options are invalid.
@ kScanInProgress
A scan is already in progress. Only 1 scan may be active at a time.
@ kInternal
An internal error occurred and a scan could not be started.
Definition: multibuf.h:245
Definition: central2.h:33
std::optional< Uuid > service_data_uuid
Filter based on service data containing the given UUID.
Definition: central2.h:38
std::optional< Uuid > service_uuid
Filter based on advertised service UUID.
Definition: central2.h:35
std::optional< Uuid > solicitation_uuid
Require that a peer solicits support for a service UUID.
Definition: central2.h:73
std::optional< uint16_t > manufacturer_id
Definition: central2.h:46
std::optional< bool > connectable
Definition: central2.h:52
std::optional< int8_t > max_path_loss
Definition: central2.h:70
std::optional< std::string_view > name
Definition: central2.h:57
Parameters used during a scan.
Definition: central2.h:87
pw::span< const ScanFilter > filters
Definition: central2.h:93
uint16_t window
Definition: central2.h:104
uint16_t interval
Definition: central2.h:98
ScanType scan_type
Definition: central2.h:108
Phy phys
Definition: central2.h:112
Definition: central2.h:115
PeerId peer_id
Uniquely identifies this peer on the current system.
Definition: central2.h:117
bool connectable
Definition: central2.h:121
chrono::SystemClock::time_point last_updated
Timestamp of when the information in this ScanResult was last updated.
Definition: central2.h:142
pw::multibuf::MultiBuf data
This contains the advertising data last received from the peer.
Definition: central2.h:132
std::optional< InlineString< 22 > > name
Definition: central2.h:139
std::optional< uint8_t > rssi
Definition: central2.h:129
Represents parameters that are set on a per-connection basis.
Definition: connection2.h:109