else
{
sec_event.auth_cmpl.success = true;
- /* We also register for Service Changed right after connect. */
if (!p_data->complt.smp_over_br)
GATT_ConfigServiceChangeCCC(bda, true, BT_TRANSPORT_LE);
}
{
UNUSED(gatt_if);
- GATT_TRACE_EVENT("%s: from %08x%04x connected:%d conn_id=%d reason = 0x%04x", __func__,
- (bda[0]<<24)+(bda[1]<<16)+(bda[2]<<8)+bda[3],
- (bda[4]<<8)+bda[5], connected, conn_id, reason);
+ GATT_TRACE_EVENT ("%s: from %08x%04x connected:%d conn_id=%d reason = 0x%04x", __FUNCTION__,
+ (bda[0]<<24)+(bda[1]<<16)+(bda[2]<<8)+bda[3],
+ (bda[4]<<8)+bda[5], connected, conn_id, reason);
tGATT_PROFILE_CLCB *p_clcb = gatt_profile_find_clcb_by_bd_addr(bda, transport);
- if (connected) {
- if (p_clcb == NULL)
- p_clcb = gatt_profile_clcb_alloc(conn_id, bda, transport);
-
- if (p_clcb == NULL)
- return;
+ if (p_clcb == NULL)
+ return;
+ if (connected)
+ {
+ p_clcb->conn_id = conn_id;
p_clcb->connected = true;
- p_clcb->ccc_stage = GATT_SVC_CHANGED_SERVICE;
- gatt_cl_start_config_ccc(p_clcb);
+
+ if (p_clcb->ccc_stage == GATT_SVC_CHANGED_CONNECTING)
+ {
+ p_clcb->ccc_stage ++;
+ gatt_cl_start_config_ccc(p_clcb);
+ }
} else {
- if (p_clcb != NULL)
- gatt_profile_clcb_dealloc(p_clcb);
+ gatt_profile_clcb_dealloc(p_clcb);
}
}