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

Commit 59579689 authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "IsoManager: Add state dump" am: 4dc1d338

parents 9001a01f 4dc1d338
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -3637,6 +3637,7 @@ void LeAudioClient::DebugDump(int fd) {
  LeAudioClientAudioSource::DebugDump(fd);
  LeAudioClientAudioSink::DebugDump(fd);
  le_audio::AudioSetConfigurationProvider::Get()->DebugDump(fd);
  IsoManager::GetInstance()->Dump(fd);
  dprintf(fd, "\n");
}

+2 −0
Original line number Diff line number Diff line
@@ -149,6 +149,8 @@ void IsoManager::Stop() {
  mock_pimpl_ = nullptr;
}

void IsoManager::Dump(int fd) {}

IsoManager::~IsoManager() = default;

}  // namespace hci
+8 −0
Original line number Diff line number Diff line
@@ -41,6 +41,10 @@ struct IsoManager::impl {
    iso_impl_.reset();
  }

  void Dump(int fd) {
    if (iso_impl_) iso_impl_->dump(fd);
  }

  bool IsRunning() { return iso_impl_ ? true : false; }

  const IsoManager& iso_manager_;
@@ -143,6 +147,10 @@ void IsoManager::Stop() {
    pimpl_->Stop();
}

void IsoManager::Dump(int fd) {
  if (pimpl_->IsRunning()) pimpl_->Dump(fd);
}

IsoManager::~IsoManager() = default;

}  // namespace hci
+28 −0
Original line number Diff line number Diff line
@@ -767,6 +767,34 @@ struct iso_impl {
    return (bis_it != conn_hdl_to_bis_map_.cend());
  }

  void dump(int fd) const {
    dprintf(fd, "  ----------------\n ");
    dprintf(fd, "  ISO Manager:\n");
    dprintf(fd, "    Available credits: %d\n", iso_credits_.load());
    dprintf(fd, "    Controller buffer size: %d\n", iso_buffer_size_);
    dprintf(fd, "    CISes:\n");
    for (auto const& cis_pair : conn_hdl_to_cis_map_) {
      dprintf(fd, "      CIS Connection handle: %d\n", cis_pair.first);
      dprintf(fd, "        CIG ID: %d\n", cis_pair.second->cig_id);
      dprintf(fd, "        Used Credits: %d\n",
              cis_pair.second->used_credits.load());
      dprintf(fd, "        SDU Interval: %d\n", cis_pair.second->sdu_itv);
      dprintf(fd, "        State Flags: 0x%02hx\n",
              cis_pair.second->state_flags.load());
    }
    dprintf(fd, "    BISes:\n");
    for (auto const& cis_pair : conn_hdl_to_bis_map_) {
      dprintf(fd, "      BIS Connection handle: %d\n", cis_pair.first);
      dprintf(fd, "        BIG Handle: %d\n", cis_pair.second->big_handle);
      dprintf(fd, "        Used Credits: %d\n",
              cis_pair.second->used_credits.load());
      dprintf(fd, "        SDU Interval: %d\n", cis_pair.second->sdu_itv);
      dprintf(fd, "        State Flags: 0x%02hx\n",
              cis_pair.second->state_flags.load());
    }
    dprintf(fd, "  ----------------\n ");
  }

  std::map<uint16_t, std::unique_ptr<iso_cis>> conn_hdl_to_cis_map_;
  std::map<uint16_t, std::unique_ptr<iso_bis>> conn_hdl_to_bis_map_;

+5 −0
Original line number Diff line number Diff line
@@ -233,6 +233,11 @@ class IsoManager {
   */
  void Stop();

  /**
   * Dumps the IsoManager module state
   */
  void Dump(int fd);

 private:
  struct impl;
  std::unique_ptr<impl> pimpl_;
Loading