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

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

Merge "RootCanal: AddressResolutionEnable"

parents b4f77c79 093f8c81
Loading
Loading
Loading
Loading
+10 −6
Original line number Original line Diff line number Diff line
@@ -1611,12 +1611,16 @@ void DualModeController::LeReadBufferSizeV2(CommandView command) {
}
}


void DualModeController::LeSetAddressResolutionEnable(CommandView command) {
void DualModeController::LeSetAddressResolutionEnable(CommandView command) {
    // NOP
  auto command_view = gd_hci::LeSetAddressResolutionEnableView::Create(
    auto payload =
      gd_hci::LeSecurityCommandView::Create(
      std::make_unique<bluetooth::packet::RawBuilder>(std::vector<uint8_t>(
          gd_hci::SecurityCommandView::Create(command)));
          {static_cast<uint8_t>(bluetooth::hci::ErrorCode::SUCCESS)}));
  ASSERT(command_view.IsValid());
  send_event_(bluetooth::hci::CommandCompleteBuilder::Create(
  auto status = link_layer_controller_.LeSetAddressResolutionEnable(
      kNumCommandPackets, command.GetOpCode(), std::move(payload)));
      command_view.GetAddressResolutionEnable() ==
      bluetooth::hci::Enable::ENABLED);
  send_event_(
      bluetooth::hci::LeSetAddressResolutionEnableCompleteBuilder::Create(
          kNumCommandPackets, status));
}
}


void DualModeController::LeSetResovalablePrivateAddressTimeout(CommandView command) {
void DualModeController::LeSetResovalablePrivateAddressTimeout(CommandView command) {
+9 −0
Original line number Original line Diff line number Diff line
@@ -2876,6 +2876,15 @@ ErrorCode LinkLayerController::LeConnectListClear() {
  return ErrorCode::SUCCESS;
  return ErrorCode::SUCCESS;
}
}


ErrorCode LinkLayerController::LeSetAddressResolutionEnable(bool enable) {
  if (ResolvingListBusy()) {
    return ErrorCode::COMMAND_DISALLOWED;
  }

  le_resolving_list_enabled_ = enable;
  return ErrorCode::SUCCESS;
}

ErrorCode LinkLayerController::LeResolvingListClear() {
ErrorCode LinkLayerController::LeResolvingListClear() {
  if (ResolvingListBusy()) {
  if (ResolvingListBusy()) {
    return ErrorCode::COMMAND_DISALLOWED;
    return ErrorCode::COMMAND_DISALLOWED;
+2 −0
Original line number Original line Diff line number Diff line
@@ -181,6 +181,7 @@ class LinkLayerController {
  bool LeConnectListContainsDevice(Address addr, uint8_t addr_type);
  bool LeConnectListContainsDevice(Address addr, uint8_t addr_type);
  bool LeConnectListFull();
  bool LeConnectListFull();
  bool ResolvingListBusy();
  bool ResolvingListBusy();
  ErrorCode LeSetAddressResolutionEnable(bool enable);
  ErrorCode LeResolvingListClear();
  ErrorCode LeResolvingListClear();
  ErrorCode LeResolvingListAddDevice(Address addr, uint8_t addr_type,
  ErrorCode LeResolvingListAddDevice(Address addr, uint8_t addr_type,
                                     std::array<uint8_t, kIrkSize> peerIrk,
                                     std::array<uint8_t, kIrkSize> peerIrk,
@@ -463,6 +464,7 @@ class LinkLayerController {
    std::array<uint8_t, kIrkSize> local_irk;
    std::array<uint8_t, kIrkSize> local_irk;
  };
  };
  std::vector<ResolvingListEntry> le_resolving_list_;
  std::vector<ResolvingListEntry> le_resolving_list_;
  bool le_resolving_list_enabled_{false};


  std::array<LeAdvertiser, 7> advertisers_;
  std::array<LeAdvertiser, 7> advertisers_;