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

Commit f5718a49 authored by Partha Sarathi Saha's avatar Partha Sarathi Saha Committed by Chris Manton
Browse files

Fix local disconnect reason code

For local disconnect of device, BTA_GATTC_CLOSE_EVT was sent
with reason code 0 rather than GATT_CONN_TERMINATE_LOCAL_HOST.

Fixed the issue by sending reason code
GATT_CONN_TERMINATE_LOCAL_HOST for local disconnect case.

Test: Verified local disconnect reason code is sent as
      GATT_CONN_TERMINATE_LOCAL_HOST and not 0
Change-Id: I964dc7480dae4a0840450652992eaf48ca439e2f
parent 456916cd
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -580,6 +580,7 @@ void bta_gattc_close(tBTA_GATTC_CLCB* p_clcb, const tBTA_GATTC_DATA* p_data) {

  if (p_data->hdr.event == BTA_GATTC_API_CLOSE_EVT) {
    GATT_Disconnect(p_data->hdr.layer_specific);
    cb_data.close.reason = GATT_CONN_TERMINATE_LOCAL_HOST;
    LOG_DEBUG("Local close event client_if:%hu conn_id:%hu reason:%s",
              cb_data.close.client_if, cb_data.close.conn_id,
              gatt_disconnection_reason_text(