#include "device/bluetooth/floss/floss_advertiser_client.h"
#include "components/device_event_log/device_event_log.h"
#include "device/bluetooth/floss/floss_gatt_manager_client.h"
namespace floss {
namespace {
constexpr char kDiscoverable[] = …;
constexpr char kConnectable[] = …;
constexpr char kScannable[] = …;
constexpr char kIsLegacy[] = …;
constexpr char kIsAnonymous[] = …;
constexpr char kIncludeTxPower[] = …;
constexpr char kPrimaryPhy[] = …;
constexpr char kSecondaryPhy[] = …;
constexpr char kInterval[] = …;
constexpr char kTxPowerLevel[] = …;
constexpr char kOwnAddressType[] = …;
constexpr char kServiceUuids[] = …;
constexpr char kSolicitUuids[] = …;
constexpr char kTransportDiscoveryData[] = …;
constexpr char kManufacturerData[] = …;
constexpr char kServiceData[] = …;
constexpr char kIncludeTxPowerLevel[] = …;
constexpr char kIncludeDeviceName[] = …;
}
template <>
void FlossDBusClient::WriteDBusParam(dbus::MessageWriter* writer,
const OwnAddressType& type) { … }
template <>
void FlossDBusClient::WriteDBusParam(
dbus::MessageWriter* writer,
const AdvertisingSetParametersOld& params) { … }
template <>
void FlossDBusClient::WriteDBusParam(dbus::MessageWriter* writer,
const AdvertisingSetParameters& params) { … }
template <>
void FlossDBusClient::WriteDBusParam(dbus::MessageWriter* writer,
const AdvertiseData& data) { … }
template <>
void FlossDBusClient::WriteDBusParam(
dbus::MessageWriter* writer,
const PeriodicAdvertisingParameters& params) { … }
template <>
bool FlossDBusClient::ReadDBusParam(dbus::MessageReader* reader,
AdvertisingStatus* status) { … }
template <>
const DBusTypeInfo& GetDBusTypeInfo(const OwnAddressType*) { … }
template <>
const DBusTypeInfo& GetDBusTypeInfo(const AdvertisingSetParametersOld*) { … }
template <>
const DBusTypeInfo& GetDBusTypeInfo(const AdvertisingSetParameters*) { … }
template <>
const DBusTypeInfo& GetDBusTypeInfo(const AdvertiseData*) { … }
template <>
const DBusTypeInfo& GetDBusTypeInfo(const PeriodicAdvertisingParameters*) { … }
template <>
const DBusTypeInfo& GetDBusTypeInfo(const AdvertisingStatus*) { … }
std::unique_ptr<FlossAdvertiserClient> FlossAdvertiserClient::Create() { … }
AdvertiseData::AdvertiseData() = default;
AdvertiseData::AdvertiseData(const AdvertiseData&) = default;
AdvertiseData::~AdvertiseData() = default;
FlossAdvertiserClient::FlossAdvertiserClient() = default;
FlossAdvertiserClient::~FlossAdvertiserClient() { … }
void FlossAdvertiserClient::Init(dbus::Bus* bus,
const std::string& service_name,
const int adapter_index,
base::Version version,
base::OnceClosure on_ready) { … }
void FlossAdvertiserClient::AddObserver(
FlossAdvertiserClientObserver* observer) { … }
void FlossAdvertiserClient::RemoveObserver(
FlossAdvertiserClientObserver* observer) { … }
void FlossAdvertiserClient::StartAdvertisingSet(
const AdvertisingSetParameters& params,
const AdvertiseData& adv_data,
const std::optional<AdvertiseData> scan_rsp,
const std::optional<PeriodicAdvertisingParameters> periodic_params,
const std::optional<AdvertiseData> periodic_data,
const int32_t duration,
const int32_t max_ext_adv_events,
StartSuccessCallback success_callback,
ErrorCallback error_callback) { … }
void FlossAdvertiserClient::StopAdvertisingSet(
const AdvertiserId adv_id,
StopSuccessCallback success_callback,
ErrorCallback error_callback) { … }
void FlossAdvertiserClient::SetAdvertisingParameters(
const AdvertiserId adv_id,
const AdvertisingSetParameters& params,
SetAdvParamsSuccessCallback success_callback,
ErrorCallback error_callback) { … }
void FlossAdvertiserClient::OnMethodsExported() { … }
void FlossAdvertiserClient::CompleteRegisterCallback(
dbus::Response* response,
dbus::ErrorResponse* error_response) { … }
void FlossAdvertiserClient::CompleteUnregisterCallback(DBusResult<bool> ret) { … }
void FlossAdvertiserClient::CompleteStartAdvertisingSetCallback(
StartSuccessCallback success_callback,
ErrorCallback error_callback,
DBusResult<RegId> ret) { … }
void FlossAdvertiserClient::CompleteStopAdvertisingSetCallback(
StopSuccessCallback success_callback,
ErrorCallback error_callback,
const AdvertiserId adv_id,
DBusResult<Void> ret) { … }
void FlossAdvertiserClient::CompleteSetAdvertisingParametersCallback(
SetAdvParamsSuccessCallback success_callback,
ErrorCallback error_callback,
const AdvertiserId adv_id,
DBusResult<Void> ret) { … }
void FlossAdvertiserClient::OnAdvertisingSetStarted(RegId reg_id,
AdvertiserId adv_id,
int32_t tx_power,
AdvertisingStatus status) { … }
void FlossAdvertiserClient::OnOwnAddressRead(AdvertiserId adv_id,
int32_t address_type,
std::string address) { … }
void FlossAdvertiserClient::OnAdvertisingSetStopped(AdvertiserId adv_id) { … }
void FlossAdvertiserClient::OnAdvertisingEnabled(AdvertiserId adv_id,
bool enable,
AdvertisingStatus status) { … }
void FlossAdvertiserClient::OnAdvertisingDataSet(AdvertiserId adv_id,
AdvertisingStatus status) { … }
void FlossAdvertiserClient::OnScanResponseDataSet(AdvertiserId adv_id,
AdvertisingStatus status) { … }
void FlossAdvertiserClient::OnAdvertisingParametersUpdated(
AdvertiserId adv_id,
int32_t tx_power,
AdvertisingStatus status) { … }
void FlossAdvertiserClient::OnPeriodicAdvertisingParametersUpdated(
AdvertiserId adv_id,
AdvertisingStatus status) { … }
void FlossAdvertiserClient::OnPeriodicAdvertisingDataSet(
AdvertiserId adv_id,
AdvertisingStatus status) { … }
void FlossAdvertiserClient::OnPeriodicAdvertisingEnabled(
AdvertiserId adv_id,
bool enable,
AdvertisingStatus status) { … }
device::BluetoothAdvertisement::ErrorCode FlossAdvertiserClient::GetErrorCode(
AdvertisingStatus status) { … }
}