Loading system/bta/gatt/bta_gattc_act.cc +12 −0 Original line number Diff line number Diff line Loading @@ -630,6 +630,18 @@ void bta_gattc_close(tBTA_GATTC_CLCB* p_clcb, const tBTA_GATTC_DATA* p_data) { } } if (p_data->hdr.event == BTA_GATTC_INT_DISCONN_EVT) { /* Since link has been disconnected by and it is possible that here are * already some new p_clcb created for the background connect, the number of * p_srcb->num_clcb is NOT 0. This will prevent p_srcb to be cleared inside * the bta_gattc_clcb_dealloc. * * In this point of time, we know that link does not exist, so let's make * sure the connection state, mtu and database is cleared. */ bta_gattc_server_disconnected(p_clcb->p_srcb); } bta_gattc_clcb_dealloc(p_clcb); if (p_data->hdr.event == BTA_GATTC_API_CLOSE_EVT) { Loading system/bta/gatt/bta_gattc_int.h +1 −0 Original line number Diff line number Diff line Loading @@ -423,6 +423,7 @@ extern tBTA_GATTC_CLCB* bta_gattc_clcb_alloc(tGATT_IF client_if, const RawAddress& remote_bda, tBT_TRANSPORT transport); extern void bta_gattc_clcb_dealloc(tBTA_GATTC_CLCB* p_clcb); extern void bta_gattc_server_disconnected(tBTA_GATTC_SERV* p_srcb); extern tBTA_GATTC_CLCB* bta_gattc_find_alloc_clcb(tGATT_IF client_if, const RawAddress& remote_bda, tBT_TRANSPORT transport); Loading system/bta/gatt/bta_gattc_utils.cc +20 −0 Original line number Diff line number Diff line Loading @@ -189,6 +189,26 @@ tBTA_GATTC_CLCB* bta_gattc_find_alloc_clcb(tGATT_IF client_if, return p_clcb; } /******************************************************************************* * * Function bta_gattc_server_disconnected * * Description Set server cache disconnected * * Returns pointer to the srcb * ******************************************************************************/ void bta_gattc_server_disconnected(tBTA_GATTC_SERV* p_srcb) { if (p_srcb && p_srcb->connected) { p_srcb->connected = false; p_srcb->state = BTA_GATTC_SERV_IDLE; p_srcb->mtu = 0; // clear reallocating p_srcb->gatt_database.Clear(); } } /******************************************************************************* * * Function bta_gattc_clcb_dealloc Loading Loading
system/bta/gatt/bta_gattc_act.cc +12 −0 Original line number Diff line number Diff line Loading @@ -630,6 +630,18 @@ void bta_gattc_close(tBTA_GATTC_CLCB* p_clcb, const tBTA_GATTC_DATA* p_data) { } } if (p_data->hdr.event == BTA_GATTC_INT_DISCONN_EVT) { /* Since link has been disconnected by and it is possible that here are * already some new p_clcb created for the background connect, the number of * p_srcb->num_clcb is NOT 0. This will prevent p_srcb to be cleared inside * the bta_gattc_clcb_dealloc. * * In this point of time, we know that link does not exist, so let's make * sure the connection state, mtu and database is cleared. */ bta_gattc_server_disconnected(p_clcb->p_srcb); } bta_gattc_clcb_dealloc(p_clcb); if (p_data->hdr.event == BTA_GATTC_API_CLOSE_EVT) { Loading
system/bta/gatt/bta_gattc_int.h +1 −0 Original line number Diff line number Diff line Loading @@ -423,6 +423,7 @@ extern tBTA_GATTC_CLCB* bta_gattc_clcb_alloc(tGATT_IF client_if, const RawAddress& remote_bda, tBT_TRANSPORT transport); extern void bta_gattc_clcb_dealloc(tBTA_GATTC_CLCB* p_clcb); extern void bta_gattc_server_disconnected(tBTA_GATTC_SERV* p_srcb); extern tBTA_GATTC_CLCB* bta_gattc_find_alloc_clcb(tGATT_IF client_if, const RawAddress& remote_bda, tBT_TRANSPORT transport); Loading
system/bta/gatt/bta_gattc_utils.cc +20 −0 Original line number Diff line number Diff line Loading @@ -189,6 +189,26 @@ tBTA_GATTC_CLCB* bta_gattc_find_alloc_clcb(tGATT_IF client_if, return p_clcb; } /******************************************************************************* * * Function bta_gattc_server_disconnected * * Description Set server cache disconnected * * Returns pointer to the srcb * ******************************************************************************/ void bta_gattc_server_disconnected(tBTA_GATTC_SERV* p_srcb) { if (p_srcb && p_srcb->connected) { p_srcb->connected = false; p_srcb->state = BTA_GATTC_SERV_IDLE; p_srcb->mtu = 0; // clear reallocating p_srcb->gatt_database.Clear(); } } /******************************************************************************* * * Function bta_gattc_clcb_dealloc Loading