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

Commit 0e3f9467 authored by Chris Manton's avatar Chris Manton
Browse files

Add stack/btm/btm_sco::get_index

Towards encapsulated code

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

Change-Id: I7c78eefd86b16d501e629df6e8b61689eff864ce
parent cfcc8ec0
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -119,6 +119,18 @@ typedef struct {
    def_esco_parms.max_latency_ms = 12;
    sco_route = ESCO_DATA_PATH_PCM;
  }

  uint16_t get_index(const tSCO_CONN* p_sco) const {
    CHECK(p_sco != nullptr);
    const tSCO_CONN* p = sco_db;
    for (uint16_t xx = 0; xx < kMaxScoLinks; xx++, p++) {
      if (p_sco == p) {
        return xx;
      }
    }
    return 0xffff;
  }

} tSCO_CB;

extern void btm_sco_chk_pend_rolechange(uint16_t hci_handle);