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

Commit 09d047ae authored by Chris Manton's avatar Chris Manton Committed by Automerger Merge Worker
Browse files

Re-log stack/gap/gap_ble::client_connect_cback am: 1d3ad100

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1467026

Change-Id: I24b490b9bab1d022b7d212a45c57b59315229095
parents 3d32fdd3 1d3ad100
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -24,6 +24,7 @@
#include <queue>
#include "gap_api.h"
#include "gatt_api.h"
#include "osi/include/log.h"
#include "types/bt_transport.h"

using base::StringPrintf;
@@ -289,14 +290,19 @@ void client_connect_cback(tGATT_IF, const RawAddress& bda, uint16_t conn_id,
                          bool connected, tGATT_DISCONN_REASON reason,
                          tBT_TRANSPORT) {
  tGAP_CLCB* p_clcb = find_clcb_by_bd_addr(bda);
  if (p_clcb == NULL) return;
  if (p_clcb == NULL) {
    LOG_WARN("Unable to find device after connection");
    return;
  }

  if (connected) {
    LOG_DEBUG("Connected GAP to remote device");
    p_clcb->conn_id = conn_id;
    p_clcb->connected = true;
    /* start operation is pending */
    send_cl_read_request(*p_clcb);
  } else {
    LOG_WARN("Disconnected GAP from remote device");
    p_clcb->connected = false;
    cl_op_cmpl(*p_clcb, false, 0, NULL);
    /* clean up clcb */