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

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

Merge changes I624cd740,I68dabd23

* changes:
  RootCanal: Reinitialise connection state on HCI_Reset
  RootCanal: Remove unused members in LinkLayerController
parents 5b667504 09ca4702
Loading
Loading
Loading
Loading
+10 −3
Original line number Original line Diff line number Diff line
@@ -3641,14 +3641,21 @@ bool LinkLayerController::LeResolvingListFull() {
}
}


void LinkLayerController::Reset() {
void LinkLayerController::Reset() {
  connections_ = AclConnectionHandler();
  le_connect_list_.clear();
  le_resolving_list_.clear();
  le_resolving_list_enabled_ = false;
  le_connecting_rpa_ = Address();
  LeDisableAdvertisingSets();
  le_scan_enable_ = bluetooth::hci::OpCode::NONE;
  le_connect_ = false;
  if (inquiry_timer_task_id_ != kInvalidTaskId) {
  if (inquiry_timer_task_id_ != kInvalidTaskId) {
    CancelScheduledTask(inquiry_timer_task_id_);
    CancelScheduledTask(inquiry_timer_task_id_);
    inquiry_timer_task_id_ = kInvalidTaskId;
    inquiry_timer_task_id_ = kInvalidTaskId;
  }
  }
  last_inquiry_ = steady_clock::now();
  last_inquiry_ = steady_clock::now();
  le_scan_enable_ = bluetooth::hci::OpCode::NONE;
  page_scans_enabled_ = false;
  LeDisableAdvertisingSets();
  inquiry_scans_enabled_ = false;
  le_connect_ = 0;
}
}


void LinkLayerController::StartInquiry(milliseconds timeout) {
void LinkLayerController::StartInquiry(milliseconds timeout) {
+0 −9
Original line number Original line Diff line number Diff line
@@ -455,13 +455,6 @@ class LinkLayerController {
 private:
 private:
  const DeviceProperties& properties_;
  const DeviceProperties& properties_;
  AclConnectionHandler connections_;
  AclConnectionHandler connections_;
  // Add timestamps?
  std::vector<std::shared_ptr<model::packets::LinkLayerPacketBuilder>>
      commands_awaiting_responses_;

  // Timing related state
  std::vector<AsyncTaskId> controller_events_;
  std::chrono::milliseconds timer_period_ = std::chrono::milliseconds(100);


  // Callbacks to schedule tasks.
  // Callbacks to schedule tasks.
  std::function<AsyncTaskId(std::chrono::milliseconds, const TaskCallback&)>
  std::function<AsyncTaskId(std::chrono::milliseconds, const TaskCallback&)>
@@ -487,8 +480,6 @@ class LinkLayerController {
  uint32_t key_id_ = 1;
  uint32_t key_id_ = 1;


  // LE state
  // LE state
  std::vector<uint8_t> le_event_mask_;

  std::vector<std::tuple<Address, uint8_t>> le_connect_list_;
  std::vector<std::tuple<Address, uint8_t>> le_connect_list_;
  struct ResolvingListEntry {
  struct ResolvingListEntry {
    Address address;
    Address address;