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

Commit af2b1761 authored by Jakub Pawłowski's avatar Jakub Pawłowski Committed by Automerger Merge Worker
Browse files

Merge "le_audio: Split AudioStreamDataPath to Data Path and CIS state" into main am: 3fc63129

parents 4bd71361 3fc63129
Loading
Loading
Loading
Loading
+2 −3
Original line number Original line Diff line number Diff line
@@ -90,8 +90,8 @@ using le_audio::types::ase;
using le_audio::types::AseState;
using le_audio::types::AseState;
using le_audio::types::AudioContexts;
using le_audio::types::AudioContexts;
using le_audio::types::AudioLocations;
using le_audio::types::AudioLocations;
using le_audio::types::AudioStreamDataPathState;
using le_audio::types::BidirectionalPair;
using le_audio::types::BidirectionalPair;
using le_audio::types::DataPathState;
using le_audio::types::hdl_pair;
using le_audio::types::hdl_pair;
using le_audio::types::kDefaultScanDurationS;
using le_audio::types::kDefaultScanDurationS;
using le_audio::types::kLeAudioContextAllBidir;
using le_audio::types::kLeAudioContextAllBidir;
@@ -3035,8 +3035,7 @@ class LeAudioClientImpl : public LeAudioClient {
  bool IsAseAcceptingAudioData(struct ase* ase) {
  bool IsAseAcceptingAudioData(struct ase* ase) {
    if (ase == nullptr) return false;
    if (ase == nullptr) return false;
    if (ase->state != AseState::BTA_LE_AUDIO_ASE_STATE_STREAMING) return false;
    if (ase->state != AseState::BTA_LE_AUDIO_ASE_STATE_STREAMING) return false;
    if (ase->data_path_state != AudioStreamDataPathState::DATA_PATH_ESTABLISHED)
    if (ase->data_path_state != DataPathState::CONFIGURED) return false;
      return false;


    return true;
    return true;
  }
  }
+64 −54
Original line number Original line Diff line number Diff line
@@ -51,9 +51,10 @@ using le_audio::types::ase;
using le_audio::types::AseState;
using le_audio::types::AseState;
using le_audio::types::AudioContexts;
using le_audio::types::AudioContexts;
using le_audio::types::AudioLocations;
using le_audio::types::AudioLocations;
using le_audio::types::AudioStreamDataPathState;
using le_audio::types::BidirectionalPair;
using le_audio::types::BidirectionalPair;
using le_audio::types::CisState;
using le_audio::types::CisType;
using le_audio::types::CisType;
using le_audio::types::DataPathState;
using le_audio::types::LeAudioCodecId;
using le_audio::types::LeAudioCodecId;
using le_audio::types::LeAudioContextType;
using le_audio::types::LeAudioContextType;
using le_audio::types::LeAudioLc3Config;
using le_audio::types::LeAudioLc3Config;
@@ -467,17 +468,18 @@ LeAudioDevice* LeAudioDeviceGroup::GetNextActiveDevice(
  return (iter == leAudioDevices_.end()) ? nullptr : (iter->lock()).get();
  return (iter == leAudioDevices_.end()) ? nullptr : (iter->lock()).get();
}
}


LeAudioDevice* LeAudioDeviceGroup::GetFirstActiveDeviceByDataPathState(
LeAudioDevice* LeAudioDeviceGroup::GetFirstActiveDeviceByCisAndDataPathState(
    AudioStreamDataPathState data_path_state) const {
    CisState cis_state, DataPathState data_path_state) const {
  auto iter = std::find_if(leAudioDevices_.begin(), leAudioDevices_.end(),
  auto iter =
                           [&data_path_state](auto& d) {
      std::find_if(leAudioDevices_.begin(), leAudioDevices_.end(),
                   [&data_path_state, &cis_state](auto& d) {
                     if (d.expired()) {
                     if (d.expired()) {
                       return false;
                       return false;
                     }
                     }


                     return (((d.lock()).get())
                     return (((d.lock()).get())
                                         ->GetFirstActiveAseByDataPathState(
                                 ->GetFirstActiveAseByCisAndDataPathState(
                                             data_path_state) != nullptr);
                                     cis_state, data_path_state) != nullptr);
                   });
                   });


  if (iter == leAudioDevices_.end()) {
  if (iter == leAudioDevices_.end()) {
@@ -487,9 +489,9 @@ LeAudioDevice* LeAudioDeviceGroup::GetFirstActiveDeviceByDataPathState(
  return iter->lock().get();
  return iter->lock().get();
}
}


LeAudioDevice* LeAudioDeviceGroup::GetNextActiveDeviceByDataPathState(
LeAudioDevice* LeAudioDeviceGroup::GetNextActiveDeviceByCisAndDataPathState(
    LeAudioDevice* leAudioDevice,
    LeAudioDevice* leAudioDevice, CisState cis_state,
    AudioStreamDataPathState data_path_state) const {
    DataPathState data_path_state) const {
  auto iter = std::find_if(leAudioDevices_.begin(), leAudioDevices_.end(),
  auto iter = std::find_if(leAudioDevices_.begin(), leAudioDevices_.end(),
                           [&leAudioDevice](auto& d) {
                           [&leAudioDevice](auto& d) {
                             if (d.expired()) {
                             if (d.expired()) {
@@ -503,15 +505,15 @@ LeAudioDevice* LeAudioDeviceGroup::GetNextActiveDeviceByDataPathState(
    return nullptr;
    return nullptr;
  }
  }


  iter = std::find_if(
  iter = std::find_if(std::next(iter, 1), leAudioDevices_.end(),
      std::next(iter, 1), leAudioDevices_.end(), [&data_path_state](auto& d) {
                      [&cis_state, &data_path_state](auto& d) {
                        if (d.expired()) {
                        if (d.expired()) {
                          return false;
                          return false;
                        }
                        }


                        return (((d.lock()).get())
                        return (((d.lock()).get())
                    ->GetFirstActiveAseByDataPathState(data_path_state) !=
                                    ->GetFirstActiveAseByCisAndDataPathState(
                nullptr);
                                        cis_state, data_path_state) != nullptr);
                      });
                      });


  if (iter == leAudioDevices_.end()) {
  if (iter == leAudioDevices_.end()) {
@@ -1208,25 +1210,25 @@ void LeAudioDeviceGroup::CigAssignCisConnHandlesToAses(


  /* Assign all CIS connection handles to ases */
  /* Assign all CIS connection handles to ases */
  struct le_audio::types::ase* ase =
  struct le_audio::types::ase* ase =
      leAudioDevice->GetFirstActiveAseByDataPathState(
      leAudioDevice->GetFirstActiveAseByCisAndDataPathState(
          AudioStreamDataPathState::IDLE);
          CisState::IDLE, DataPathState::IDLE);
  if (!ase) {
  if (!ase) {
    LOG_WARN("No active ASE with AudioStreamDataPathState IDLE");
    LOG_WARN("No active ASE with Cis and Data path state set to IDLE");
    return;
    return;
  }
  }


  for (; ase != nullptr; ase = leAudioDevice->GetFirstActiveAseByDataPathState(
  for (; ase != nullptr;
                             AudioStreamDataPathState::IDLE)) {
       ase = leAudioDevice->GetFirstActiveAseByCisAndDataPathState(
           CisState::IDLE, DataPathState::IDLE)) {
    auto ases_pair = leAudioDevice->GetAsesByCisId(ase->cis_id);
    auto ases_pair = leAudioDevice->GetAsesByCisId(ase->cis_id);


    if (ases_pair.sink && ases_pair.sink->active) {
    if (ases_pair.sink && ases_pair.sink->active) {
      ases_pair.sink->cis_conn_hdl = cises_[ase->cis_id].conn_handle;
      ases_pair.sink->cis_conn_hdl = cises_[ase->cis_id].conn_handle;
      ases_pair.sink->data_path_state = AudioStreamDataPathState::CIS_ASSIGNED;
      ases_pair.sink->cis_state = CisState::ASSIGNED;
    }
    }
    if (ases_pair.source && ases_pair.source->active) {
    if (ases_pair.source && ases_pair.source->active) {
      ases_pair.source->cis_conn_hdl = cises_[ase->cis_id].conn_handle;
      ases_pair.source->cis_conn_hdl = cises_[ase->cis_id].conn_handle;
      ases_pair.source->data_path_state =
      ases_pair.source->cis_state = CisState::ASSIGNED;
          AudioStreamDataPathState::CIS_ASSIGNED;
    }
    }
  }
  }
}
}
@@ -2470,11 +2472,13 @@ struct ase* LeAudioDevice::GetNextActiveAseWithDifferentDirection(
  return &(*iter);
  return &(*iter);
}
}


struct ase* LeAudioDevice::GetFirstActiveAseByDataPathState(
struct ase* LeAudioDevice::GetFirstActiveAseByCisAndDataPathState(
    types::AudioStreamDataPathState state) {
    types::CisState cis_state, types::DataPathState data_path_state) {
  auto iter =
  auto iter = std::find_if(ases_.begin(), ases_.end(),
      std::find_if(ases_.begin(), ases_.end(), [state](const auto& ase) {
                           [cis_state, data_path_state](const auto& ase) {
        return (ase.active && (ase.data_path_state == state));
                             return (ase.active &&
                                     (ase.data_path_state == data_path_state) &&
                                     (ase.cis_state == cis_state));
                           });
                           });


  return (iter == ases_.end()) ? nullptr : &(*iter);
  return (iter == ases_.end()) ? nullptr : &(*iter);
@@ -2589,9 +2593,12 @@ bool LeAudioDevice::HaveAnyUnconfiguredAses(void) {
}
}


bool LeAudioDevice::HaveAllActiveAsesSameState(AseState state) {
bool LeAudioDevice::HaveAllActiveAsesSameState(AseState state) {
  auto iter = std::find_if(
  auto iter =
      ases_.begin(), ases_.end(),
      std::find_if(ases_.begin(), ases_.end(), [&state](const auto& ase) {
      [&state](const auto& ase) { return ase.active && (ase.state != state); });
        LOG_INFO("id: %d, active: %d, state: %d", ase.id, ase.active,
                 (int)ase.state);
        return ase.active && (ase.state != state);
      });


  return iter == ases_.end();
  return iter == ases_.end();
}
}
@@ -2643,8 +2650,7 @@ bool LeAudioDevice::HaveAllActiveAsesCisEst(void) {
  }
  }


  auto iter = std::find_if(ases_.begin(), ases_.end(), [](const auto& ase) {
  auto iter = std::find_if(ases_.begin(), ases_.end(), [](const auto& ase) {
    return ase.active &&
    return ase.active && (ase.cis_state != CisState::CONNECTED);
           (ase.data_path_state != AudioStreamDataPathState::CIS_ESTABLISHED);
  });
  });


  return iter == ases_.end();
  return iter == ases_.end();
@@ -2653,8 +2659,8 @@ bool LeAudioDevice::HaveAllActiveAsesCisEst(void) {
bool LeAudioDevice::HaveAnyCisConnected(void) {
bool LeAudioDevice::HaveAnyCisConnected(void) {
  /* Pending and Disconnecting is considered as connected in this function */
  /* Pending and Disconnecting is considered as connected in this function */
  for (auto const ase : ases_) {
  for (auto const ase : ases_) {
    if (ase.data_path_state != AudioStreamDataPathState::CIS_ASSIGNED &&
    if (ase.cis_state != CisState::ASSIGNED &&
        ase.data_path_state != AudioStreamDataPathState::IDLE) {
        ase.cis_state != CisState::IDLE) {
      return true;
      return true;
    }
    }
  }
  }
@@ -2788,7 +2794,9 @@ void LeAudioDevice::PrintDebugState(void) {
                << (ase.direction == types::kLeAudioDirectionSink ? "sink"
                << (ase.direction == types::kLeAudioDirectionSink ? "sink"
                                                                  : "source")
                                                                  : "source")
                << ", cis_id: " << +ase.cis_id
                << ", cis_id: " << +ase.cis_id
                << ", cis_handle: " << +ase.cis_conn_hdl << ", state: "
                << ", cis_handle: " << +ase.cis_conn_hdl
                << ", state: " << bluetooth::common::ToString(ase.cis_state)
                << ", data_path_state: "
                << bluetooth::common::ToString(ase.data_path_state)
                << bluetooth::common::ToString(ase.data_path_state)
                << "\n ase max_latency: " << +ase.max_transport_latency
                << "\n ase max_latency: " << +ase.max_transport_latency
                << ", rtn: " << +ase.retrans_nb
                << ", rtn: " << +ase.retrans_nb
@@ -2863,8 +2871,8 @@ void LeAudioDevice::Dump(int fd) {


  if (ases_.size() > 0) {
  if (ases_.size() > 0) {
    stream << "\n\t== ASEs == \n\t";
    stream << "\n\t== ASEs == \n\t";
    stream
    stream << "id  active dir     cis_id  cis_handle  sdu  latency rtn  "
        << "id  active dir     cis_id  cis_handle  sdu  latency rtn  state";
              "cis_state data_path_state";
    for (auto& ase : ases_) {
    for (auto& ase : ases_) {
      stream << std::setfill('\x20') << "\n\t" << std::left << std::setw(4)
      stream << std::setfill('\x20') << "\n\t" << std::left << std::setw(4)
             << static_cast<int>(ase.id) << std::left << std::setw(7)
             << static_cast<int>(ase.id) << std::left << std::setw(7)
@@ -2875,7 +2883,8 @@ void LeAudioDevice::Dump(int fd) {
             << std::left << std::setw(12) << ase.cis_conn_hdl << std::left
             << std::left << std::setw(12) << ase.cis_conn_hdl << std::left
             << std::setw(5) << ase.max_sdu_size << std::left << std::setw(8)
             << std::setw(5) << ase.max_sdu_size << std::left << std::setw(8)
             << ase.max_transport_latency << std::left << std::setw(5)
             << ase.max_transport_latency << std::left << std::setw(5)
             << static_cast<int>(ase.retrans_nb) << std::left << std::setw(12)
             << static_cast<int>(ase.retrans_nb) << std::left << std::setw(10)
             << bluetooth::common::ToString(ase.cis_state) << std::setw(12)
             << bluetooth::common::ToString(ase.data_path_state);
             << bluetooth::common::ToString(ase.data_path_state);
    }
    }
  }
  }
@@ -2936,17 +2945,18 @@ bool LeAudioDevice::ActivateConfiguredAses(LeAudioContextType context_type) {


void LeAudioDevice::DeactivateAllAses(void) {
void LeAudioDevice::DeactivateAllAses(void) {
  for (auto& ase : ases_) {
  for (auto& ase : ases_) {
    if (ase.active == false &&
    if (ase.active == false && ase.cis_state != CisState::IDLE &&
        ase.data_path_state != AudioStreamDataPathState::IDLE) {
        ase.data_path_state != DataPathState::IDLE) {
      LOG_WARN(
      LOG_WARN(
          " %s, ase_id: %d, ase.cis_id: %d, cis_handle: 0x%02x, "
          " %s, ase_id: %d, ase.cis_id: %d, cis_handle: 0x%02x, "
          "ase.data_path=%s",
          "ase.cis_state=%s, ase.data_path_state=%s",
          ADDRESS_TO_LOGGABLE_CSTR(address_), ase.id, ase.cis_id,
          ADDRESS_TO_LOGGABLE_CSTR(address_), ase.id, ase.cis_id,
          ase.cis_conn_hdl,
          ase.cis_conn_hdl, bluetooth::common::ToString(ase.cis_state).c_str(),
          bluetooth::common::ToString(ase.data_path_state).c_str());
          bluetooth::common::ToString(ase.data_path_state).c_str());
    }
    }
    ase.state = AseState::BTA_LE_AUDIO_ASE_STATE_IDLE;
    ase.state = AseState::BTA_LE_AUDIO_ASE_STATE_IDLE;
    ase.data_path_state = AudioStreamDataPathState::IDLE;
    ase.cis_state = CisState::IDLE;
    ase.data_path_state = DataPathState::IDLE;
    ase.active = false;
    ase.active = false;
    ase.cis_id = le_audio::kInvalidCisId;
    ase.cis_id = le_audio::kInvalidCisId;
    ase.cis_conn_hdl = 0;
    ase.cis_conn_hdl = 0;
+7 −7
Original line number Original line Diff line number Diff line
@@ -151,8 +151,8 @@ class LeAudioDevice {
      struct types::ase* base_ase);
      struct types::ase* base_ase);
  struct types::ase* GetNextActiveAseWithDifferentDirection(
  struct types::ase* GetNextActiveAseWithDifferentDirection(
      struct types::ase* base_ase);
      struct types::ase* base_ase);
  struct types::ase* GetFirstActiveAseByDataPathState(
  struct types::ase* GetFirstActiveAseByCisAndDataPathState(
      types::AudioStreamDataPathState state);
      types::CisState cis_state, types::DataPathState data_path_state);
  struct types::ase* GetFirstInactiveAse(uint8_t direction,
  struct types::ase* GetFirstInactiveAse(uint8_t direction,
                                         bool reconnect = false);
                                         bool reconnect = false);
  struct types::ase* GetFirstAseWithState(uint8_t direction,
  struct types::ase* GetFirstAseWithState(uint8_t direction,
@@ -349,11 +349,11 @@ class LeAudioDeviceGroup {
      types::LeAudioContextType context_type) const;
      types::LeAudioContextType context_type) const;
  LeAudioDevice* GetFirstActiveDevice(void) const;
  LeAudioDevice* GetFirstActiveDevice(void) const;
  LeAudioDevice* GetNextActiveDevice(LeAudioDevice* leAudioDevice) const;
  LeAudioDevice* GetNextActiveDevice(LeAudioDevice* leAudioDevice) const;
  LeAudioDevice* GetFirstActiveDeviceByDataPathState(
  LeAudioDevice* GetFirstActiveDeviceByCisAndDataPathState(
      types::AudioStreamDataPathState data_path_state) const;
      types::CisState cis_state, types::DataPathState data_path_state) const;
  LeAudioDevice* GetNextActiveDeviceByDataPathState(
  LeAudioDevice* GetNextActiveDeviceByCisAndDataPathState(
      LeAudioDevice* leAudioDevice,
      LeAudioDevice* leAudioDevice, types::CisState cis_state,
      types::AudioStreamDataPathState data_path_state) const;
      types::DataPathState data_path_state) const;
  bool IsDeviceInTheGroup(LeAudioDevice* leAudioDevice) const;
  bool IsDeviceInTheGroup(LeAudioDevice* leAudioDevice) const;
  bool HaveAllActiveDevicesAsesTheSameState(types::AseState state) const;
  bool HaveAllActiveDevicesAsesTheSameState(types::AseState state) const;
  bool HaveAnyActiveDeviceInUnconfiguredState() const;
  bool HaveAnyActiveDeviceInUnconfiguredState() const;
+13 −13
Original line number Original line Diff line number Diff line
@@ -758,7 +758,8 @@ class UnicastTestNoInit : public Test {
              for (LeAudioDevice* device = group->GetFirstDevice();
              for (LeAudioDevice* device = group->GetFirstDevice();
                   device != nullptr; device = group->GetNextDevice(device)) {
                   device != nullptr; device = group->GetNextDevice(device)) {
                for (auto& ase : device->ases_) {
                for (auto& ase : device->ases_) {
                  ase.data_path_state = types::AudioStreamDataPathState::IDLE;
                  ase.cis_state = types::CisState::IDLE;
                  ase.data_path_state = types::DataPathState::IDLE;
                  ase.active = false;
                  ase.active = false;
                  ase.state =
                  ase.state =
                      types::AseState::BTA_LE_AUDIO_ASE_STATE_CODEC_CONFIGURED;
                      types::AseState::BTA_LE_AUDIO_ASE_STATE_CODEC_CONFIGURED;
@@ -806,8 +807,8 @@ class UnicastTestNoInit : public Test {


            // And also skip the ase establishment procedure which should
            // And also skip the ase establishment procedure which should
            // be tested as part of the state machine unit tests
            // be tested as part of the state machine unit tests
            ase.data_path_state =
            ase.cis_state = types::CisState::CONNECTED;
                types::AudioStreamDataPathState::DATA_PATH_ESTABLISHED;
            ase.data_path_state = types::DataPathState::CONFIGURED;
            ase.state = types::AseState::BTA_LE_AUDIO_ASE_STATE_STREAMING;
            ase.state = types::AseState::BTA_LE_AUDIO_ASE_STATE_STREAMING;


            uint16_t cis_conn_hdl = ase.cis_conn_hdl;
            uint16_t cis_conn_hdl = ase.cis_conn_hdl;
@@ -936,8 +937,8 @@ class UnicastTestNoInit : public Test {


              // And also skip the ase establishment procedure which should
              // And also skip the ase establishment procedure which should
              // be tested as part of the state machine unit tests
              // be tested as part of the state machine unit tests
              ase.data_path_state =
              ase.cis_state = types::CisState::CONNECTED;
                  types::AudioStreamDataPathState::DATA_PATH_ESTABLISHED;
              ase.data_path_state = types::DataPathState::CONFIGURED;
              ase.state = types::AseState::BTA_LE_AUDIO_ASE_STATE_STREAMING;
              ase.state = types::AseState::BTA_LE_AUDIO_ASE_STATE_STREAMING;
              ase.pres_delay_min = 2500;
              ase.pres_delay_min = 2500;
              ase.pres_delay_max = 2500;
              ase.pres_delay_max = 2500;
@@ -1132,8 +1133,7 @@ class UnicastTestNoInit : public Test {
          for (LeAudioDevice* device = group->GetFirstDevice();
          for (LeAudioDevice* device = group->GetFirstDevice();
               device != nullptr; device = group->GetNextDevice(device)) {
               device != nullptr; device = group->GetNextDevice(device)) {
            for (auto& ase : device->ases_) {
            for (auto& ase : device->ases_) {
              ase.data_path_state =
              ase.cis_state = types::CisState::CONNECTED;
                  types::AudioStreamDataPathState::CIS_ESTABLISHED;
              ase.active = false;
              ase.active = false;
              ase.state =
              ase.state =
                  types::AseState::BTA_LE_AUDIO_ASE_STATE_QOS_CONFIGURED;
                  types::AseState::BTA_LE_AUDIO_ASE_STATE_QOS_CONFIGURED;
@@ -1216,14 +1216,12 @@ class UnicastTestNoInit : public Test {
              auto ases_pair =
              auto ases_pair =
                  leAudioDevice->GetAsesByCisConnHdl(event->cis_conn_hdl);
                  leAudioDevice->GetAsesByCisConnHdl(event->cis_conn_hdl);
              if (ases_pair.sink) {
              if (ases_pair.sink) {
                ases_pair.sink->data_path_state =
                ases_pair.sink->cis_state = types::CisState::ASSIGNED;
                    types::AudioStreamDataPathState::CIS_ASSIGNED;
                ases_pair.sink->active = false;
                ases_pair.sink->active = false;
              }
              }
              if (ases_pair.source) {
              if (ases_pair.source) {
                ases_pair.source->active = false;
                ases_pair.source->active = false;
                ases_pair.source->data_path_state =
                ases_pair.source->cis_state = types::CisState::ASSIGNED;
                    types::AudioStreamDataPathState::CIS_ASSIGNED;
              }
              }
              /* Invalidate stream configuration if needed */
              /* Invalidate stream configuration if needed */
              auto* stream_conf = &group->stream_conf;
              auto* stream_conf = &group->stream_conf;
@@ -1359,7 +1357,8 @@ class UnicastTestNoInit : public Test {
            group->CigUnassignCis(device);
            group->CigUnassignCis(device);


            for (auto& ase : device->ases_) {
            for (auto& ase : device->ases_) {
              ase.data_path_state = types::AudioStreamDataPathState::IDLE;
              ase.cis_state = types::CisState::IDLE;
              ase.data_path_state = types::DataPathState::IDLE;
              ase.active = false;
              ase.active = false;
              ase.state = types::AseState::BTA_LE_AUDIO_ASE_STATE_IDLE;
              ase.state = types::AseState::BTA_LE_AUDIO_ASE_STATE_IDLE;
              ase.cis_id = 0;
              ase.cis_id = 0;
@@ -4764,7 +4763,8 @@ TEST_F(UnicastTest, SpeakerStreamingAutonomousRelease) {
  for (LeAudioDevice* device = group->GetFirstDevice(); device != nullptr;
  for (LeAudioDevice* device = group->GetFirstDevice(); device != nullptr;
       device = group->GetNextDevice(device)) {
       device = group->GetNextDevice(device)) {
    for (auto& ase : device->ases_) {
    for (auto& ase : device->ases_) {
      ase.data_path_state = types::AudioStreamDataPathState::IDLE;
      ase.cis_state = types::CisState::IDLE;
      ase.data_path_state = types::DataPathState::IDLE;
      ase.state = types::AseState::BTA_LE_AUDIO_ASE_STATE_IDLE;
      ase.state = types::AseState::BTA_LE_AUDIO_ASE_STATE_IDLE;
      InjectCisDisconnected(group_id, ase.cis_conn_hdl);
      InjectCisDisconnected(group_id, ase.cis_conn_hdl);
    }
    }
+12 −9
Original line number Original line Diff line number Diff line
@@ -771,15 +771,18 @@ uint8_t GetMaxCodecFramesPerSduFromPac(const acs_ac_record* pac) {
}
}


namespace types {
namespace types {
std::ostream& operator<<(std::ostream& os,
std::ostream& operator<<(std::ostream& os, const CisState& state) {
                         const AudioStreamDataPathState& state) {
  static const char* char_value_[5] = {"IDLE", "ASSIGNED", "CONNECTING",
  static const char* char_value_[7] = {"IDLE",
                                       "CONNECTED", "DISCONNECTING"};
                                       "CIS_DISCONNECTING",

                                       "CIS_ASSIGNED",
  os << char_value_[static_cast<uint8_t>(state)] << " ("
                                       "CIS_PENDING",
     << "0x" << std::setfill('0') << std::setw(2) << static_cast<int>(state)
                                       "CIS_ESTABLISHED",
     << ")";
                                       "DATA_PATH_ESTABLISHED",
  return os;
                                       "DATA_PATH_REMOVING"};
}
std::ostream& operator<<(std::ostream& os, const DataPathState& state) {
  static const char* char_value_[4] = {"IDLE", "CONFIGURING", "CONFIGURED",
                                       "REMOVING"};


  os << char_value_[static_cast<uint8_t>(state)] << " ("
  os << char_value_[static_cast<uint8_t>(state)] << " ("
     << "0x" << std::setfill('0') << std::setw(2) << static_cast<int>(state)
     << "0x" << std::setfill('0') << std::setw(2) << static_cast<int>(state)
Loading