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

Commit 06d318a5 authored by Chris Manton's avatar Chris Manton
Browse files

Move connection_manager access into stack/acl/btm_acl

Add acl layer between l2cap and connection_manager

From: stack/l2cap/l2c_ble

Bug: 166280067
Tag: #refactor
Test: act.py -tc BleCocTest

Change-Id: I7680892626b81a90907a0071a016160fae3cb506
parent 06ef5e2f
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -50,6 +50,7 @@
#include "stack/btm/btm_dev.h"
#include "stack/btm/btm_int_types.h"
#include "stack/btm/btm_sec.h"
#include "stack/gatt/connection_manager.h"
#include "stack/include/acl_api.h"
#include "stack/include/acl_hci_link_interface.h"
#include "stack/include/btm_api.h"
@@ -2900,3 +2901,10 @@ void acl_write_automatic_flush_timeout(const RawAddress& bd_addr,
  btsnd_hcic_write_auto_flush_tout(p_acl->hci_handle, flush_timeout_in_ticks);
}

bool acl_create_le_connection(const RawAddress& bd_addr) {
  return connection_manager::direct_connect_add(CONN_MGR_ID_L2CAP, bd_addr);
}

void acl_cancel_le_connection(const RawAddress& bd_addr) {
  connection_manager::direct_connect_remove(CONN_MGR_ID_L2CAP, bd_addr);
}
+2 −0
Original line number Diff line number Diff line
@@ -26,6 +26,8 @@ void acl_accept_connection_request(const RawAddress& bd_addr, uint8_t role);
void acl_create_classic_connection(const RawAddress& bd_addr,
                                   bool there_are_high_priority_channels,
                                   bool is_bonding);
bool acl_create_le_connection(const RawAddress& bd_addr);
void acl_cancel_le_connection(const RawAddress& bd_addr);
void acl_reject_connection_request(const RawAddress& bd_addr, uint8_t reason);
void acl_send_data_packet_br_edr(const RawAddress& bd_addr, BT_HDR* p_buf);
void acl_send_data_packet_ble(const RawAddress& bd_addr, BT_HDR* p_buf);
+4 −5
Original line number Diff line number Diff line
@@ -36,7 +36,6 @@
#include "osi/include/osi.h"
#include "stack/btm/btm_dev.h"
#include "stack/btm/btm_sec.h"
#include "stack/gatt/connection_manager.h"
#include "stack/include/acl_api.h"
#include "stack_config.h"

@@ -71,7 +70,7 @@ bool L2CA_CancelBleConnectReq(const RawAddress& rem_bda) {
    }
  }

  connection_manager::direct_connect_remove(CONN_MGR_ID_L2CAP, rem_bda);
  acl_cancel_le_connection(rem_bda);

  /* Do not remove lcb if an LE link is already up as a peripheral */
  if (p_lcb != NULL && !(p_lcb->IsLinkRoleSlave() &&
@@ -773,9 +772,9 @@ void l2cble_process_sig_cmd(tL2C_LCB* p_lcb, uint8_t* p, uint16_t pkt_len) {
/** This function is to initate a direct connection. Returns true if connection
 * initiated, false otherwise. */
bool l2cble_create_conn(tL2C_LCB* p_lcb) {
  bool ret = connection_manager::direct_connect_add(CONN_MGR_ID_L2CAP,
                                                    p_lcb->remote_bd_addr);
  if (!ret) return ret;
  if (!acl_create_le_connection(p_lcb->remote_bd_addr)) {
    return false;
  }

  p_lcb->link_state = LST_CONNECTING;