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

Commit 23cfabb7 authored by Łukasz Rymanowski's avatar Łukasz Rymanowski Committed by Jakub Pawlowski
Browse files

btm_iso: Allow to start ISO by many clients

It turns out we might need btm_iso to be stated from more than one place
e.g. broadcast and unicast scenario.

Therefore, allow for that.

Bug: 150670922
Tag: #feature
Test: atest --host net_test_btm_iso
Sponsor: jpawlowski@

Change-Id: I8111a55707a00b5622a260f938e0da08fc37ae65
parent cbd7a703
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -128,9 +128,15 @@ void IsoManager::HandleHciEvent(uint8_t sub_code, uint8_t* params,
    pimpl_->iso_impl_->on_iso_event(sub_code, params, length);
}

void IsoManager::Start() { pimpl_->Start(); }
void IsoManager::Start() {
  if (!pimpl_->IsRunning())
    pimpl_->Start();
}

void IsoManager::Stop() { pimpl_->Stop(); }
void IsoManager::Stop() {
  if (pimpl_->IsRunning())
    pimpl_->Stop();
}

IsoManager::~IsoManager() = default;

+0 −18
Original line number Diff line number Diff line
@@ -518,24 +518,6 @@ TEST_F(IsoManagerDeathTestNoInit, RegisterNullCigCallbacks) {
  IsoManager::GetInstance()->Stop();
}

TEST_F(IsoManagerDeathTestNoInit, DoubleStart) {
  IsoManager::GetInstance()->Start();

  ASSERT_EXIT(IsoManager::GetInstance()->Start(),
              ::testing::KilledBySignal(SIGABRT), "");

  // Manual cleanup as IsoManagerDeathTest has no 'generic' cleanup
  IsoManager::GetInstance()->Stop();
}

TEST_F(IsoManagerDeathTestNoInit, DoubleStop) {
  IsoManager::GetInstance()->Start();
  IsoManager::GetInstance()->Stop();

  ASSERT_EXIT(IsoManager::GetInstance()->Stop(),
              ::testing::KilledBySignal(SIGABRT), "");
}

// Verify hci layer being called by the Iso Manager
TEST_F(IsoManagerTest, CreateCigHciCall) {
  for (uint8_t i = 220; i != 60; ++i) {