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

Commit f1b902e8 authored by Chris Manton's avatar Chris Manton
Browse files

Break out stack/gatt::on_connection_complete

Towards readable code

Bug: 163134718
Tag: #refactor
Test: compile & verify basic functions working
Test: act.py -tc BleCocTest

Change-Id: I30da4870897ade37a671021edb7722b062150d65
parent 77ad6ca3
Loading
Loading
Loading
Loading
+9 −3
Original line number Diff line number Diff line
@@ -29,6 +29,7 @@
#include "internal_include/bt_trace.h"
#include "main/shim/shim.h"
#include "osi/include/alarm.h"
#include "osi/include/log.h"
#include "stack/btm/btm_ble_bgconn.h"
#include "stack/include/l2c_api.h"

@@ -170,10 +171,9 @@ void on_app_deregistered(uint8_t app_id) {
  }
}

void on_connection_complete(const RawAddress& address) {
  VLOG(2) << __func__;
static void remove_all_clients_with_pending_connections(
    const RawAddress& address) {
  auto it = bgconn_dev.find(address);

  while (it != bgconn_dev.end() && !it->second.doing_direct_conn.empty()) {
    uint8_t app_id = it->second.doing_direct_conn.begin()->first;
    direct_connect_remove(app_id, address);
@@ -181,6 +181,12 @@ void on_connection_complete(const RawAddress& address) {
  }
}

void on_connection_complete(const RawAddress& address) {
  LOG_DEBUG("Le connection completed to device:%s", address.ToString().c_str());

  remove_all_clients_with_pending_connections(address);
}

/** Reset bg device list. If called after controller reset, set |after_reset| to
 * true, as there is no need to wipe controller white list in this case. */
void reset(bool after_reset) {