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

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

Merge "RootCanal: Send LE Disconnections to remote"

parents 1ec653b3 e4534862
Loading
Loading
Loading
Loading
+8 −3
Original line number Diff line number Diff line
@@ -2339,9 +2339,14 @@ ErrorCode LinkLayerController::Disconnect(uint16_t handle, uint8_t reason) {
  }

  const AddressWithType remote = connections_.GetAddress(handle);
  auto packet = model::packets::DisconnectBuilder::Create(
      properties_.GetAddress(), remote.GetAddress(), reason);
  SendLinkLayerPacket(std::move(packet));
  if (connections_.GetPhyType(handle) == Phy::Type::BR_EDR) {
    SendLinkLayerPacket(model::packets::DisconnectBuilder::Create(
        properties_.GetAddress(), remote.GetAddress(), reason));
  } else {
    SendLeLinkLayerPacket(model::packets::DisconnectBuilder::Create(
        connections_.GetOwnAddress(handle).GetAddress(), remote.GetAddress(),
        reason));
  }
  ASSERT_LOG(connections_.Disconnect(handle), "Disconnecting %hx", handle);

  ScheduleTask(milliseconds(20), [this, handle]() {