This change allows for an operation complete of the client
configuration registeration process.
In the current code, the successful completion of the
process where host writes the client configuration
descriptor of the service changed characteristic of the
remote device, the connection id (1) is never disconnected.
Hence, for those remote devices with the service changed
characteristic that allows Indications, there will always
be a remaining connection which will prevent disconnection
of the remote device.
This change fixes that issue and also the issue related
to early notifications/registerations causing disconnects
of HOGP devices
CRs-Fixed:
1014919
Change-Id: I04273f6a1ab5e2d74f49687c9a70670e40db9d39
**
*******************************************************************************/
static void gatt_cl_op_cmpl_cback (UINT16 conn_id, tGATTC_OPTYPE op,
- tGATT_STATUS status, tGATT_CL_COMPLETE *p_data)
+ tGATT_STATUS status, tGATT_CL_COMPLETE *p_data)
{
- UNUSED(conn_id);
- UNUSED(op);
- UNUSED(status);
- UNUSED(p_data);
+ tGATT_PROFILE_CLCB *p_clcb = gatt_profile_find_clcb_by_conn_id(conn_id);
+
+ if (p_clcb == NULL)
+ return;
+
+ if (op == GATTC_OPTYPE_WRITE)
+ {
+ GATT_TRACE_DEBUG("%s() - ccc write status : %d", __FUNCTION__, status);
+ }
+
+ /* Do not disconnect in case of notification or Indication (Unexpected events)*/
+ if (op == GATTC_OPTYPE_NOTIFICATION || op == GATTC_OPTYPE_INDICATION)
+ {
+ GATT_TRACE_DEBUG("%s: Unexpected event received. Ignore", __func__);
+ return;
+ }
+
+ /* free the connection */
+ gatt_config_ccc_complete (p_clcb);
}
/*******************************************************************************