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

Commit 4b0d69f7 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge changes I5bc0330c,I7d68ca08,I3f5bba04

* changes:
  enum-ify bta/include/bta_api::SSR_
  btm_history: Add acl power mode state
  Properly retrieve acl_conn stack/acl/btm_acl::BTM_IsBleConnection
parents 287702bb 2bf7b1c7
Loading
Loading
Loading
Loading
+9 −9
Original line number Diff line number Diff line
@@ -482,15 +482,15 @@ typedef void(tBTA_BLE_ENERGY_INFO_CBACK)(tBTM_BLE_TX_TIME_MS tx_time,
typedef uint8_t tBTA_DM_PM_ACTION;

/* index to bta_dm_ssr_spec */
#define BTA_DM_PM_SSR0 0
#define BTA_DM_PM_SSR1                      \
  1 /* BTA_DM_PM_SSR1 will be dedicated for \
enum {
  BTA_DM_PM_SSR0 = 0,
  /* BTA_DM_PM_SSR1 will be dedicated for \
     HH SSR setting entry, no other profile can use it */
#define BTA_DM_PM_SSR2 2
#define BTA_DM_PM_SSR3 3
#define BTA_DM_PM_SSR4 4
#define BTA_DM_PM_SSR5 5
#define BTA_DM_PM_SSR6 6
  BTA_DM_PM_SSR1 = 1,
  BTA_DM_PM_SSR2 = 2,
  BTA_DM_PM_SSR3 = 3,
  BTA_DM_PM_SSR4 = 4,
};

#define BTA_DM_PM_NUM_EVTS 9

+3 −5
Original line number Diff line number Diff line
@@ -2450,11 +2450,9 @@ bool BTM_IsBleConnection(uint16_t hci_handle) {
    ASSERT_LOG(false, "This should not be invoked from code path");
  }

  uint8_t index = btm_handle_to_acl_index(hci_handle);
  if (index >= MAX_L2CAP_LINKS) return false;

  tACL_CONN* p = &btm_cb.acl_cb_.acl_db[index];
  return (p->transport == BT_TRANSPORT_LE);
  const tACL_CONN* p_acl = internal_.acl_get_connection_from_handle(hci_handle);
  if (p_acl == nullptr) return false;
  return p_acl->is_transport_ble();
}

const RawAddress acl_address_from_handle(uint16_t hci_handle) {
+5 −0
Original line number Diff line number Diff line
@@ -522,6 +522,11 @@ tBTM_STATUS StackAclBtmPm::btm_pm_snd_md_req(uint8_t pm_id, int link_ind,
  LOG_INFO("switching from %s(0x%x) to %s(0x%x), link_ind: %d",
           power_mode_state_text(p_cb->state).c_str(), p_cb->state,
           power_mode_state_text(md_res.mode).c_str(), md_res.mode, link_ind);
  btm_cb.history_->Push(
      "%-32s: %s  %s(0x%02x) ==> %s(0x%02x)", "Power mode change",
      PRIVATE_ADDRESS(btm_cb.acl_cb_.acl_db[link_ind].remote_addr),
      power_mode_state_text(p_cb->state).c_str(), p_cb->state,
      power_mode_state_text(md_res.mode).c_str(), md_res.mode);

  switch (md_res.mode) {
    case BTM_PM_MD_ACTIVE: