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

Commit 1faef345 authored by Aritra Sen's avatar Aritra Sen
Browse files

Add L2CAP conn result on error and propagate it upwards to GAP callback...

Add L2CAP conn result on error and propagate it upwards to GAP callback handler as a part of event data.

Bug: 263522407
Test: mma -j $(nproc)
Change-Id: I5c9a000b6f36309d7a98b8b32b258d8c99427d50
parent eb5348ef
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -691,9 +691,13 @@ static void gap_on_l2cap_error(uint16_t l2cap_cid, uint16_t result) {
  tGAP_CCB* p_ccb = gap_find_ccb_by_cid(l2cap_cid);
  if (p_ccb == nullptr) return;

  /* Propagate the l2cap result upward */
  tGAP_CB_DATA cb_data;
  cb_data.l2cap_result = result;

  /* Tell the user if there is a callback */
  if (p_ccb->p_callback)
    (*p_ccb->p_callback)(p_ccb->gap_handle, GAP_EVT_CONN_CLOSED, nullptr);
    (*p_ccb->p_callback)(p_ccb->gap_handle, GAP_EVT_CONN_CLOSED, &cb_data);

  gap_release_ccb(p_ccb);
}
+2 −0
Original line number Diff line number Diff line
@@ -23,6 +23,7 @@

#include "btm_api.h"
#include "l2c_api.h"
#include "l2cdefs.h"
#include "profiles_api.h"
#include "stack/include/bt_hdr.h"
#include "types/bt_transport.h"
@@ -74,6 +75,7 @@ struct tGAP_COC_CREDITS {

union tGAP_CB_DATA {
  tGAP_COC_CREDITS coc_credits;
  uint16_t l2cap_result;
};

/*****************************************************************************