Use Adapter's SupportedSecondaryChannels to check if EA is supported

This commit is contained in:
Vibhav Pant
2023-09-26 17:25:00 +05:30
parent e754f3bee4
commit 300155257f
2 changed files with 11 additions and 1 deletions
@@ -222,6 +222,16 @@ std::unique_ptr<api::ble_v2::GattClient> BleV2Medium::ConnectToGattServer(
std::move(callback.disconnected_cb));
}
bool BleV2Medium::IsExtendedAdvertisementsAvailable() {
try {
auto supported_channels = adv_manager_->SupportedSecondaryChannels();
return !supported_channels.empty();
} catch (const sdbus::Error &e) {
DBUS_LOG_PROPERTY_GET_ERROR(adv_manager_, "SupportedSecondaryChannels", e);
return false;
}
}
bool BleV2Medium::StartLEDiscovery() {
std::map<std::string, sdbus::Variant> filter;
filter["Transport"] = "auto";
@@ -84,7 +84,7 @@ class BleV2Medium final : public api::ble_v2::BleMedium {
CancellationFlag *cancellation_flag) override {
return nullptr;
}
bool IsExtendedAdvertisementsAvailable() override { return false; }
bool IsExtendedAdvertisementsAvailable() override;
bool GetRemotePeripheral(const std::string &mac_address,
GetRemotePeripheralCallback callback) override;
bool GetRemotePeripheral(api::ble_v2::BlePeripheral::UniqueId id,