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

Commit 2945ced2 authored by Chris Manton's avatar Chris Manton
Browse files

Add tSCO_CONN::get_sco_connection_from_index

Towards encapsulated code

Bug: 163134718
Tag: #refactor
Test: gd/cert/run

Change-Id: I39a87cb83e6e0572b407f1fccc5a11b11e96ee0e
parent 99a383ce
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -22,6 +22,8 @@
#include "device/include/esco_parameters.h"
#include "stack/include/btm_api_types.h"

constexpr uint16_t kMaxScoLinks = static_cast<uint16_t>(BTM_MAX_SCO_LINKS);

/* Define the structures needed by sco
 */

@@ -92,6 +94,10 @@ typedef struct {
  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;
  }

  void Init() {
    sco_disc_reason = BTM_INVALID_SCO_DISC_REASON;
    def_esco_parms = esco_parameters_for_codec(ESCO_CODEC_CVSD);