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

Commit 726bf43c authored by Hansong Zhang's avatar Hansong Zhang Committed by Automerger Merge Worker
Browse files

SCO: Route should be a compile time constant am: 0af3a968 am: faea9c49 am:...

SCO: Route should be a compile time constant am: 0af3a968 am: faea9c49 am: 729daa85 am: 739f0b77 am: bf8ecec9

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1820912

Change-Id: I4b875f3b87ea7e251d875fb99b0295f5c58ff61c
parents bf386a3f bf8ecec9
Loading
Loading
Loading
Loading
+11 −6
Original line number Diff line number Diff line
@@ -40,6 +40,14 @@
#include "types/class_of_device.h"
#include "types/raw_address.h"

#ifndef ESCO_DATA_PATH
#ifdef OS_ANDROID
#define ESCO_DATA_PATH ESCO_DATA_PATH_PCM
#else
#define ESCO_DATA_PATH ESCO_DATA_PATH_HCI
#endif
#endif

extern tBTM_CB btm_cb;

namespace {
@@ -137,8 +145,7 @@ static void btm_esco_conn_rsp(uint16_t sco_inx, uint8_t hci_status,
    if (controller_get_interface()
            ->supports_enhanced_setup_synchronous_connection()) {
      /* Use the saved SCO routing */
      p_setup->input_data_path = p_setup->output_data_path =
          btm_cb.sco_cb.sco_route;
      p_setup->input_data_path = p_setup->output_data_path = ESCO_DATA_PATH;

      BTM_TRACE_DEBUG(
          "%s: txbw 0x%x, rxbw 0x%x, lat 0x%x, retrans 0x%02x, "
@@ -307,8 +314,7 @@ static tBTM_STATUS btm_send_connect_request(uint16_t acl_handle,
      LOG_INFO("Sending enhanced SCO connect request over handle:0x%04x",
               acl_handle);
      /* Use the saved SCO routing */
      p_setup->input_data_path = p_setup->output_data_path =
          btm_cb.sco_cb.sco_route;
      p_setup->input_data_path = p_setup->output_data_path = ESCO_DATA_PATH;
      LOG(INFO) << __func__ << std::hex << ": enhanced parameter list"
                << " txbw=0x" << unsigned(p_setup->transmit_bandwidth)
                << ", rxbw=0x" << unsigned(p_setup->receive_bandwidth)
@@ -1120,8 +1126,7 @@ static tBTM_STATUS BTM_ChangeEScoLinkParms(uint16_t sco_inx,
    if (controller_get_interface()
            ->supports_enhanced_setup_synchronous_connection()) {
      /* Use the saved SCO routing */
      p_setup->input_data_path = p_setup->output_data_path =
          btm_cb.sco_cb.sco_route;
      p_setup->input_data_path = p_setup->output_data_path = ESCO_DATA_PATH;

      btsnd_hcic_enhanced_set_up_synchronous_connection(p_sco->hci_handle,
                                                        p_setup);
+0 −2
Original line number Diff line number Diff line
@@ -95,7 +95,6 @@ typedef struct {
  tSCO_CONN sco_db[BTM_MAX_SCO_LINKS];
  enh_esco_params_t def_esco_parms;
  bool esco_supported;        /* true if 1.2 cntlr AND supports eSCO links */
  esco_data_path_t sco_route; /* HCI, PCM, or TEST */

  tSCO_CONN* get_sco_connection_from_index(uint16_t index) {
    return (index < kMaxScoLinks) ? (&sco_db[index]) : nullptr;
@@ -113,7 +112,6 @@ typedef struct {

  void Init() {
    def_esco_parms = esco_parameters_for_codec(ESCO_CODEC_CVSD_S3);
    sco_route = ESCO_DATA_PATH_PCM;
  }

  uint16_t get_index(const tSCO_CONN* p_sco) const {