mirror of
https://github.com/kidfromjupiter/nearby.git
synced 2026-09-16 15:36:12 -04:00
Use Adapter's SupportedSecondaryChannels to check if EA is supported
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user