Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2b4d18c0 authored by Chienyuan's avatar Chienyuan
Browse files

gd: Find and fill TX Power with the correct value

Tag: #gd-refactor
Bug: 185962046
Test: gd/cert/run
Test: manual
Change-Id: If49961fc02d0cdebc28f0d8d247a98ed35bcd6b4
parent 3e2d2b79
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -429,6 +429,7 @@ struct LeAdvertisingManager::impl : public bluetooth::hci::LeAddressManagerCallb

  void set_parameters(AdvertiserId advertiser_id, ExtendedAdvertisingConfig config) {
    advertising_sets_[advertiser_id].connectable = config.connectable;
    advertising_sets_[advertiser_id].tx_power = config.tx_power;

    switch (advertising_api_type_) {
      case (AdvertisingApiType::LEGACY): {
@@ -547,6 +548,14 @@ struct LeAdvertisingManager::impl : public bluetooth::hci::LeAddressManagerCallb
      data.insert(data.begin(), gap_data);
    }

    // Find and fill TX Power with the correct value.
    for (auto& gap_data : data) {
      if (gap_data.data_type_ == GapDataType::TX_POWER_LEVEL) {
        gap_data.data_[0] = advertising_sets_[advertiser_id].tx_power;
        break;
      }
    }

    switch (advertising_api_type_) {
      case (AdvertisingApiType::LEGACY): {
        if (set_scan_rsp) {