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

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

Merge changes I05ccdb3e,I00065f65,I2310c69c,I8832601e,I55ec884b, ...

* changes:
  enum-ify stack/btm/btm_ble_int_types::tBTM_BLE_SEC_REQ_ACT
  enumify tL2C_CB::tL2C_LCB::conn_update_mask
  Remove unnecesary warning on expected parsing failure
  Only read power mode on non-le links
  Add helpers tL2C_CB::tL2C_LCB::tBT_TRANSPORT
  Streamline stack/l2cap/l2c_link::l2c_link_check_power_mode
  Internally link stack/l2cap/l2c_link::l2c_link_check_power_mode
  Remove def stack/l2cap/l2c_link::L2C_LINK_CHECK_POWER_MODE
  Slight cleanup stack/acl/btm_pm::BTM_SetSsrParams
  Specialize data structures tBTM_PM_STATUS tBTM_PM_MODE
parents 7ff32367 c30f634b
Loading
Loading
Loading
Loading
+3 −4
Original line number Diff line number Diff line
@@ -623,12 +623,11 @@ std::vector<RawAddress> btif_config_get_paired_devices() {
  result.reserve(names.size());
  for (const auto& name : names) {
    RawAddress addr = {};
    if (!RawAddress::FromString(name, addr)) {
      LOG(WARNING) << __func__ << ": " << name << " is not a valid address";
      continue;
    }
    // Gather up known devices from configuration section names
    if (RawAddress::FromString(name, addr)) {
      result.emplace_back(addr);
    }
  }
  return result;
}

+2 −5
Original line number Diff line number Diff line
@@ -304,10 +304,7 @@ tBTM_STATUS btm_read_power_mode_state(const RawAddress& remote_bda,
 ******************************************************************************/
tBTM_STATUS BTM_SetSsrParams(const RawAddress& remote_bda, uint16_t max_lat,
                             uint16_t min_rmt_to, uint16_t min_loc_to) {
  int acl_ind;
  tBTM_PM_MCB* p_cb;

  acl_ind = btm_pm_find_acl_ind(remote_bda);
  int acl_ind = btm_pm_find_acl_ind(remote_bda);
  if (acl_ind == MAX_L2CAP_LINKS) return (BTM_UNKNOWN_ADDR);

  if (BTM_PM_STS_ACTIVE == btm_cb.acl_cb_.pm_mode_db[acl_ind].state ||
@@ -317,7 +314,7 @@ tBTM_STATUS BTM_SetSsrParams(const RawAddress& remote_bda, uint16_t max_lat,
    return BTM_SUCCESS;
  }
  LOG_DEBUG("pm_mode_db state: %d", btm_cb.acl_cb_.pm_mode_db[acl_ind].state);
  p_cb = &btm_cb.acl_cb_.pm_mode_db[acl_ind];
  tBTM_PM_MCB* p_cb = &btm_cb.acl_cb_.pm_mode_db[acl_ind];
  p_cb->max_lat = max_lat;
  p_cb->min_rmt_to = min_rmt_to;
  p_cb->min_loc_to = min_loc_to;
+8 −7
Original line number Diff line number Diff line
@@ -70,13 +70,14 @@

#define BTM_BLE_GAP_FAST_ADV_TIMEOUT_MS (30 * 1000)

#define BTM_BLE_SEC_REQ_ACT_NONE 0
typedef enum : uint8_t {
  BTM_BLE_SEC_REQ_ACT_NONE = 0,
  /* encrypt the link using current key or key refresh */
#define BTM_BLE_SEC_REQ_ACT_ENCRYPT 1
#define BTM_BLE_SEC_REQ_ACT_PAIR 2
  BTM_BLE_SEC_REQ_ACT_ENCRYPT = 1,
  BTM_BLE_SEC_REQ_ACT_PAIR = 2,
  /* discard the sec request while encryption is started but not completed */
#define BTM_BLE_SEC_REQ_ACT_DISCARD 3
typedef uint8_t tBTM_BLE_SEC_REQ_ACT;
  BTM_BLE_SEC_REQ_ACT_DISCARD = 3,
} tBTM_BLE_SEC_REQ_ACT;

/* LE scan activity bit mask, continue with LE inquiry bits */
/* observe is in progress */
+1 −1
Original line number Diff line number Diff line
@@ -272,7 +272,7 @@ tGATT_SEC_ACTION gatt_determine_sec_act(tGATT_CLCB* p_clcb) {
  bool is_link_key_known = false;
  bool is_key_mitm = false;
  uint8_t key_type;
  tBTM_BLE_SEC_REQ_ACT sec_act = BTM_LE_SEC_NONE;
  tBTM_BLE_SEC_REQ_ACT sec_act = BTM_BLE_SEC_REQ_ACT_NONE;

  if (auth_req == GATT_AUTH_REQ_NONE) return act;

+18 −16
Original line number Diff line number Diff line
@@ -986,11 +986,11 @@ typedef void(tBTM_LSTO_CBACK)(const RawAddress& remote_bda, uint16_t timeout);
 *  Power Manager Constants
 ****************************/
/* BTM Power manager status codes */
enum {
  BTM_PM_STS_ACTIVE = HCI_MODE_ACTIVE,
  BTM_PM_STS_HOLD = HCI_MODE_HOLD,
  BTM_PM_STS_SNIFF = HCI_MODE_SNIFF,
  BTM_PM_STS_PARK = HCI_MODE_PARK,
enum : uint8_t {
  BTM_PM_STS_ACTIVE = HCI_MODE_ACTIVE,  // 0x00
  BTM_PM_STS_HOLD = HCI_MODE_HOLD,      // 0x01
  BTM_PM_STS_SNIFF = HCI_MODE_SNIFF,    // 0x02
  BTM_PM_STS_PARK = HCI_MODE_PARK,      // 0x03
  BTM_PM_STS_SSR,     /* report the SSR parameters in HCI_SNIFF_SUB_RATE_EVT */
  BTM_PM_STS_PENDING, /* when waiting for status from controller */
  BTM_PM_STS_ERROR    /* when HCI command status returns error */
@@ -998,11 +998,11 @@ enum {
typedef uint8_t tBTM_PM_STATUS;

/* BTM Power manager modes */
enum {
  BTM_PM_MD_ACTIVE = BTM_PM_STS_ACTIVE,
  BTM_PM_MD_HOLD = BTM_PM_STS_HOLD,
  BTM_PM_MD_SNIFF = BTM_PM_STS_SNIFF,
  BTM_PM_MD_PARK = BTM_PM_STS_PARK,
enum : uint8_t {
  BTM_PM_MD_ACTIVE = HCI_MODE_ACTIVE,  // 0x00
  BTM_PM_MD_HOLD = HCI_MODE_HOLD,      // 0x01
  BTM_PM_MD_SNIFF = HCI_MODE_SNIFF,    // 0x02
  BTM_PM_MD_PARK = HCI_MODE_PARK,      // 0x03
  BTM_PM_MD_FORCE = 0x10 /* OR this to force ACL link to a certain mode */
};
typedef uint8_t tBTM_PM_MODE;
@@ -1010,12 +1010,14 @@ typedef uint8_t tBTM_PM_MODE;
#define BTM_PM_SET_ONLY_ID 0x80

/* Operation codes */
typedef enum : uint8_t {
  /* The module wants to set the desired power mode */
#define BTM_PM_REG_SET 1
  BTM_PM_REG_SET = (1u << 0),
  /* The module wants to receive mode change event */
#define BTM_PM_REG_NOTIF 2
  BTM_PM_REG_NOTIF = (1u << 1),
  /* The module does not want to involve with PM anymore */
#define BTM_PM_DEREG 4
  BTM_PM_DEREG = (1u << 2),
} tBTM_PM_REGISTER;

/************************
 *  Power Manager Types
Loading