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

Commit e29cea15 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "RootCanal: Fix LE advertising with legacy HCI commands"

parents 08fad3aa 59768f81
Loading
Loading
Loading
Loading
+8 −4
Original line number Diff line number Diff line
@@ -20,14 +20,16 @@ using namespace bluetooth::hci;
using namespace std::literals;

namespace rootcanal {
void LeAdvertiser::Initialize(AddressWithType address,
void LeAdvertiser::Initialize(OwnAddressType address_type,
                              AddressWithType public_address,
                              AddressWithType peer_address,
                              LeScanningFilterPolicy filter_policy,
                              model::packets::AdvertisementType type,
                              const std::vector<uint8_t>& advertisement,
                              const std::vector<uint8_t>& scan_response,
                              std::chrono::steady_clock::duration interval) {
  address_ = address;
  own_address_type_ = address_type;
  public_address_ = public_address;
  peer_address_ = peer_address;
  filter_policy_ = filter_policy;
  type_ = type;
@@ -35,6 +37,8 @@ void LeAdvertiser::Initialize(AddressWithType address,
  scan_response_ = scan_response;
  interval_ = interval;
  tx_power_ = kTxPowerUnavailable;
  LOG_INFO("%s -> %s", public_address_.ToString().c_str(),
           peer_address.ToString().c_str());
}

void LeAdvertiser::InitializeExtended(
@@ -54,8 +58,8 @@ void LeAdvertiser::InitializeExtended(
  interval_ = interval;
  tx_power_ = tx_power;
  LOG_INFO("%s -> %s type = %hhx interval = %d ms tx_power = 0x%hhx",
           address_.ToString().c_str(), peer_address.ToString().c_str(), type_,
           static_cast<int>(interval_.count()), tx_power);
           public_address_.ToString().c_str(), peer_address.ToString().c_str(),
           type_, static_cast<int>(interval_.count()), tx_power);
}

void LeAdvertiser::Clear() {
+2 −1
Original line number Diff line number Diff line
@@ -32,7 +32,8 @@ class LeAdvertiser {
  LeAdvertiser() = default;
  virtual ~LeAdvertiser() = default;

  void Initialize(bluetooth::hci::AddressWithType address,
  void Initialize(bluetooth::hci::OwnAddressType address_type,
                  bluetooth::hci::AddressWithType public_address,
                  bluetooth::hci::AddressWithType peer_address,
                  bluetooth::hci::LeScanningFilterPolicy filter_policy,
                  model::packets::AdvertisementType type,
+5 −1
Original line number Diff line number Diff line
@@ -3734,7 +3734,11 @@ ErrorCode LinkLayerController::SetLeAdvertisingEnable(
    return ErrorCode::INVALID_HCI_COMMAND_PARAMETERS;
  }
  advertisers_[0].Initialize(
      own_address_with_type,
      static_cast<bluetooth::hci::OwnAddressType>(
          properties_.GetLeAdvertisingOwnAddressType()),
      bluetooth::hci::AddressWithType(
          properties_.GetAddress(),
          bluetooth::hci::AddressType::PUBLIC_DEVICE_ADDRESS),
      bluetooth::hci::AddressWithType(
          properties_.GetLeAdvertisingPeerAddress(),
          static_cast<bluetooth::hci::AddressType>(