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

Commit 0be606aa authored by Alice Kuo's avatar Alice Kuo
Browse files

Correct the data path direction setting in HCI_LE_Remove_ISO_data_path

The data path direction is bit field in LE Remove ISO Data Path command.
Bit 0: remove input data path
Bit 1: remove output data path

Bug: 226438214
Test: make build
Change-Id: I5ee340fc36c119fecd614115f779b9cb1bb5be38
parent d9bd7a80
Loading
Loading
Loading
Loading
+2 −1
Original line number Original line Diff line number Diff line
@@ -488,7 +488,8 @@ class BroadcastStateMachineImpl : public BroadcastStateMachine {


    SetMuted(true);
    SetMuted(true);
    IsoManager::GetInstance()->RemoveIsoDataPath(
    IsoManager::GetInstance()->RemoveIsoDataPath(
        conn_handle, bluetooth::hci::iso_manager::kIsoDataPathDirectionIn);
        conn_handle,
        bluetooth::hci::iso_manager::kRemoveIsoDataPathDirectionInput);
  }
  }


  void HandleHciEvent(uint16_t event, void* data) override {
  void HandleHciEvent(uint16_t event, void* data) override {
+14 −13
Original line number Original line Diff line number Diff line
@@ -779,10 +779,10 @@ class LeAudioGroupStateMachineImpl : public LeAudioGroupStateMachine {
      IsoManager::GetInstance()->RemoveIsoDataPath(
      IsoManager::GetInstance()->RemoveIsoDataPath(
          ase->cis_conn_hdl,
          ase->cis_conn_hdl,
          (ases_pair.sink
          (ases_pair.sink
               ? bluetooth::hci::iso_manager::kIsoDataPathDirectionOut
               ? bluetooth::hci::iso_manager::kRemoveIsoDataPathDirectionOutput
               : 0x00) |
               : 0x00) |
              (ases_pair.source
              (ases_pair.source ? bluetooth::hci::iso_manager::
                   ? bluetooth::hci::iso_manager::kIsoDataPathDirectionIn
                                      kRemoveIsoDataPathDirectionInput
                                : 0x00));
                                : 0x00));
    }
    }
  }
  }
@@ -1015,10 +1015,11 @@ class LeAudioGroupStateMachineImpl : public LeAudioGroupStateMachine {


    IsoManager::GetInstance()->RemoveIsoDataPath(
    IsoManager::GetInstance()->RemoveIsoDataPath(
        ase->cis_conn_hdl,
        ase->cis_conn_hdl,
        (ases_pair.sink ? bluetooth::hci::iso_manager::kIsoDataPathDirectionOut
        (ases_pair.sink
             ? bluetooth::hci::iso_manager::kRemoveIsoDataPathDirectionOutput
             : 0x00) |
             : 0x00) |
            (ases_pair.source
            (ases_pair.source
                 ? bluetooth::hci::iso_manager::kIsoDataPathDirectionIn
                 ? bluetooth::hci::iso_manager::kRemoveIsoDataPathDirectionInput
                 : 0x00));
                 : 0x00));
  }
  }


@@ -1816,11 +1817,11 @@ class LeAudioGroupStateMachineImpl : public LeAudioGroupStateMachine {
              leAudioDevice->GetAsesByCisConnHdl(ase->cis_conn_hdl);
              leAudioDevice->GetAsesByCisConnHdl(ase->cis_conn_hdl);
          IsoManager::GetInstance()->RemoveIsoDataPath(
          IsoManager::GetInstance()->RemoveIsoDataPath(
              ase->cis_conn_hdl,
              ase->cis_conn_hdl,
              (ases_pair.sink
              (ases_pair.sink ? bluetooth::hci::iso_manager::
                   ? bluetooth::hci::iso_manager::kIsoDataPathDirectionOut
                                    kRemoveIsoDataPathDirectionOutput
                              : 0x00) |
                              : 0x00) |
                  (ases_pair.source
                  (ases_pair.source ? bluetooth::hci::iso_manager::
                       ? bluetooth::hci::iso_manager::kIsoDataPathDirectionIn
                                          kRemoveIsoDataPathDirectionInput
                                    : 0x00));
                                    : 0x00));
        } else if (ase->data_path_state ==
        } else if (ase->data_path_state ==
                       AudioStreamDataPathState::CIS_ESTABLISHED ||
                       AudioStreamDataPathState::CIS_ESTABLISHED ||
+7 −1
Original line number Original line Diff line number Diff line
@@ -4370,10 +4370,16 @@ packet LeSetupIsoDataPathComplete : CommandComplete (command_op_code = LE_SETUP_
  _reserved_ : 4,
  _reserved_ : 4,
}
}


enum RemoveDataPathDirection : 8 {
  INPUT = 1,
  OUTPUT = 2,
  INPUT_AND_OUTPUT = 3,
}

packet LeRemoveIsoDataPath : LeIsoCommand (op_code = LE_REMOVE_ISO_DATA_PATH) {
packet LeRemoveIsoDataPath : LeIsoCommand (op_code = LE_REMOVE_ISO_DATA_PATH) {
  connection_handle : 12,
  connection_handle : 12,
  _reserved_ : 4,
  _reserved_ : 4,
  data_path_direction : DataPathDirection,
  remove_data_path_direction : RemoveDataPathDirection,
}
}


packet LeRemoveIsoDataPathComplete : CommandComplete (command_op_code = LE_REMOVE_ISO_DATA_PATH) {
packet LeRemoveIsoDataPathComplete : CommandComplete (command_op_code = LE_REMOVE_ISO_DATA_PATH) {
+3 −0
Original line number Original line Diff line number Diff line
@@ -44,6 +44,9 @@ namespace iso_manager {
constexpr uint8_t kIsoDataPathDirectionIn = 0x00;
constexpr uint8_t kIsoDataPathDirectionIn = 0x00;
constexpr uint8_t kIsoDataPathDirectionOut = 0x01;
constexpr uint8_t kIsoDataPathDirectionOut = 0x01;


constexpr uint8_t kRemoveIsoDataPathDirectionInput = 0x01;
constexpr uint8_t kRemoveIsoDataPathDirectionOutput = 0x02;

constexpr uint8_t kIsoDataPathHci = 0x00;
constexpr uint8_t kIsoDataPathHci = 0x00;
constexpr uint8_t kIsoDataPathPlatformDefault = 0x01;
constexpr uint8_t kIsoDataPathPlatformDefault = 0x01;
constexpr uint8_t kIsoDataPathDisabled = 0xFF;
constexpr uint8_t kIsoDataPathDisabled = 0xFF;
+1 −1
Original line number Original line Diff line number Diff line
@@ -1674,7 +1674,7 @@ TEST_F(IsoManagerTest, RemoveIsoDataPathValid) {


  // Setup and remove data paths for all CISes
  // Setup and remove data paths for all CISes
  path_params.data_path_dir =
  path_params.data_path_dir =
      bluetooth::hci::iso_manager::kIsoDataPathDirectionIn;
      bluetooth::hci::iso_manager::kRemoveIsoDataPathDirectionInput;
  for (auto& handle : volatile_test_cig_create_cmpl_evt_.conn_handles) {
  for (auto& handle : volatile_test_cig_create_cmpl_evt_.conn_handles) {
    IsoManager::GetInstance()->SetupIsoDataPath(handle, path_params);
    IsoManager::GetInstance()->SetupIsoDataPath(handle, path_params);


Loading