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

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

Merge changes Ie0f33c90,I683d6803,I908ff98f,I0a6c26c9,I392dac8b, ...

* changes:
  Re-log stack/btm/btm_ble_gap::btm_ble_read_remote_features_complete
  Move btm_ble_increment_link_topology_mask l2c=>btm
  Streamline conditional stack/btm/btm_ble::btm_ble_connected
  enum-ify tL2CAP_LE_RESULT_
  Add api around select fields tL2C_CB::tL2C_LCB::
  enum-ify stack/include/l2c_api::L2CAP_PRIORITY_
parents 4b55f4d3 8a281f43
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -164,7 +164,7 @@ bool bluetooth::shim::L2CA_SetIdleTimeoutByBdAddr(const RawAddress& bd_addr,
}

bool bluetooth::shim::L2CA_SetAclPriority(const RawAddress& bd_addr,
                                          uint8_t priority) {
                                          tL2CAP_PRIORITY priority) {
  LOG_INFO("UNIMPLEMENTED %s", __func__);
  return false;
}
+1 −1
Original line number Diff line number Diff line
@@ -266,7 +266,7 @@ uint16_t L2CA_FlushChannel(uint16_t lcid, uint16_t num_to_flush);
 * Returns          true if a valid channel, else false
 *
 ******************************************************************************/
bool L2CA_SetAclPriority(const RawAddress& bd_addr, uint8_t priority);
bool L2CA_SetAclPriority(const RawAddress& bd_addr, tL2CAP_PRIORITY priority);

/*******************************************************************************
 *
+5 −0
Original line number Diff line number Diff line
@@ -25,6 +25,7 @@

void btm_ble_advertiser_notify_terminated_legacy(uint8_t status,
                                                 uint16_t connection_handle);
void btm_ble_increment_link_topology_mask(uint8_t link_role);

void acl_ble_connection_complete(const tBLE_BD_ADDR& address_with_type,
                                 uint16_t handle, uint8_t role, bool match,
@@ -34,6 +35,8 @@ void acl_ble_connection_complete(const tBLE_BD_ADDR& address_with_type,
  btm_ble_connected(address_with_type.bda, handle, HCI_ENCRYPT_MODE_DISABLED,
                    role, address_with_type.type, match);

  btm_ble_increment_link_topology_mask(role);

  l2cble_conn_comp(handle, role, address_with_type.bda, address_with_type.type,
                   conn_interval, conn_latency, conn_timeout);

@@ -52,6 +55,8 @@ void acl_ble_enhanced_connection_complete(
  btm_ble_connected(address_with_type.bda, handle, HCI_ENCRYPT_MODE_DISABLED,
                    role, address_with_type.type, match);

  btm_ble_increment_link_topology_mask(role);

  l2cble_conn_comp(handle, role, address_with_type.bda, address_with_type.type,
                   conn_interval, conn_latency, conn_timeout);

+3 −3
Original line number Diff line number Diff line
@@ -1747,10 +1747,10 @@ void btm_ble_connected(const RawAddress& bda, uint16_t handle, uint8_t enc_mode,

  if (!addr_matched) {
    p_dev_rec->ble.active_addr_type = tBTM_SEC_BLE::BTM_BLE_ADDR_PSEUDO;
  }
  if (!addr_matched && p_dev_rec->ble.ble_addr_type == BLE_ADDR_RANDOM) {
    if (p_dev_rec->ble.ble_addr_type == BLE_ADDR_RANDOM) {
      p_dev_rec->ble.cur_rand_addr = bda;
    }
  }
  btm_cb.ble_ctr_cb.inq_var.directed_conn = BTM_BLE_ADV_IND_EVT;
}

+8 −7
Original line number Diff line number Diff line
@@ -2181,8 +2181,6 @@ static void btm_ble_observer_timer_timeout(UNUSED_ATTR void* data) {
 *
 ******************************************************************************/
void btm_ble_read_remote_features_complete(uint8_t* p) {
  BTM_TRACE_EVENT("%s", __func__);

  uint16_t handle;
  uint8_t status;
  STREAM_TO_UINT8(status, p);
@@ -2190,15 +2188,18 @@ void btm_ble_read_remote_features_complete(uint8_t* p) {
  handle = handle & 0x0FFF;  // only 12 bits meaningful

  if (status != HCI_SUCCESS) {
    BTM_TRACE_ERROR("%s: failed for handle: 0x%04d, status 0x%02x", __func__,
                    handle, status);
    if (status != HCI_ERR_UNSUPPORTED_REM_FEATURE) return;
    if (status != HCI_ERR_UNSUPPORTED_REM_FEATURE) {
      LOG_ERROR("Failed to read remote features status:%s",
                hci_error_code_text(status).c_str());
      return;
    }
    LOG_WARN("Remote does not support reading remote feature");
  }

  if (status == HCI_SUCCESS) {
    if (!acl_set_peer_le_features_from_handle(handle, p)) {
      BTM_TRACE_ERROR("%s: can't find acl for handle: 0x%04d", __func__,
                      handle);
      LOG_ERROR(
          "Unable to find existing connection after read remote features");
      return;
    }
  }
Loading