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

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

gatt: Properly put gatt status in field

Bug: 172805487
Test: CtsVerifier
Tag: #stability

Change-Id: I4e730cd8b367fe9764bae3bc49a7a4ee8f00c708
parent 03f0510d
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -527,12 +527,11 @@ void bta_gattc_close(tBTA_GATTC_CLCB* p_clcb, tBTA_GATTC_DATA* p_data) {
  tBTA_GATTC_RCB* p_clreg = p_clcb->p_rcb;
  tBTA_GATTC cb_data;

  VLOG(1) << __func__ << ": conn_id=" << loghex(p_clcb->bta_conn_id);

  cb_data.close.client_if = p_clcb->p_rcb->client_if;
  cb_data.close.conn_id = p_clcb->bta_conn_id;
  cb_data.close.reason = p_clcb->reason;
  cb_data.close.remote_bda = p_clcb->bda;
  cb_data.close.status = GATT_SUCCESS;

  if (p_clcb->transport == BT_TRANSPORT_BR_EDR)
    bta_sys_conn_close(BTA_ID_GATTC, BTA_ALL_APP_ID, p_clcb->bda);
@@ -541,8 +540,14 @@ void bta_gattc_close(tBTA_GATTC_CLCB* p_clcb, tBTA_GATTC_DATA* p_data) {

  if (p_data->hdr.event == BTA_GATTC_API_CLOSE_EVT) {
    GATT_Disconnect(p_data->hdr.layer_specific);
    LOG_DEBUG("Local close event client_if:%hu conn_id:%hu reason:%hu",
              cb_data.close.client_if, cb_data.close.conn_id,
              cb_data.close.reason);
  } else if (p_data->hdr.event == BTA_GATTC_INT_DISCONN_EVT) {
    cb_data.close.reason = p_data->int_conn.reason;
    LOG_DEBUG(
        "Peer close disconnect event client_if:%hu conn_id:%hu reason:%hu",
        cb_data.close.client_if, cb_data.close.conn_id, cb_data.close.reason);
  }

  if (p_cback) (*p_cback)(BTA_GATTC_CLOSE_EVT, &cb_data);
+1 −0
Original line number Diff line number Diff line
@@ -191,6 +191,7 @@ typedef struct {

typedef struct {
  uint16_t conn_id;
  tGATT_STATUS status;
  tGATT_IF client_if;
  RawAddress remote_bda;
  tBTA_GATT_REASON reason; /* disconnect reason code, not useful when connect
+1 −1
Original line number Diff line number Diff line
@@ -149,7 +149,7 @@ void btif_gattc_upstreams_evt(uint16_t event, char* p_param) {

    case BTA_GATTC_CLOSE_EVT: {
      HAL_CBACK(bt_gatt_callbacks, client->close_cb, p_data->close.conn_id,
                p_data->status, p_data->close.client_if,
                p_data->close.status, p_data->close.client_if,
                p_data->close.remote_bda);
      break;
    }