Loading system/bta/gatt/bta_gattc_act.cc +28 −0 Original line number Diff line number Diff line Loading @@ -385,6 +385,16 @@ void bta_gattc_open(tBTA_GATTC_CLCB* p_clcb, const tBTA_GATTC_DATA* p_data) { return; } tBTA_GATTC_RCB* p_clreg = p_clcb->p_rcb; /* Re-enable notification registration for closed connection */ for (int i = 0; i < BTA_GATTC_NOTIF_REG_MAX; i++) { if (p_clreg->notif_reg[i].in_use && p_clreg->notif_reg[i].remote_bda == p_clcb->bda && p_clreg->notif_reg[i].app_disconnected) { p_clreg->notif_reg[i].app_disconnected = false; } } /* a connected remote device */ if (GATT_GetConnIdIfConnected( p_clcb->p_rcb->client_if, p_data->api_conn.remote_bda, Loading Loading @@ -511,6 +521,16 @@ void bta_gattc_conn(tBTA_GATTC_CLCB* p_clcb, const tBTA_GATTC_DATA* p_data) { if (p_clcb->p_srcb->mtu == 0) p_clcb->p_srcb->mtu = GATT_DEF_BLE_MTU_SIZE; tBTA_GATTC_RCB* p_clreg = p_clcb->p_rcb; /* Re-enable notification registration for closed connection */ for (int i = 0; i < BTA_GATTC_NOTIF_REG_MAX; i++) { if (p_clreg->notif_reg[i].in_use && p_clreg->notif_reg[i].remote_bda == p_clcb->bda && p_clreg->notif_reg[i].app_disconnected) { p_clreg->notif_reg[i].app_disconnected = false; } } /* start database cache if needed */ if (p_clcb->p_srcb->gatt_database.IsEmpty() || p_clcb->p_srcb->state != BTA_GATTC_SERV_IDLE) { Loading Loading @@ -604,6 +624,14 @@ void bta_gattc_close(tBTA_GATTC_CLCB* p_clcb, const tBTA_GATTC_DATA* p_data) { bta_sys_conn_close(BTA_ID_GATTC, BTA_ALL_APP_ID, p_clcb->bda); } /* Disable notification registration for closed connection */ for (int i = 0; i < BTA_GATTC_NOTIF_REG_MAX; i++) { if (p_clreg->notif_reg[i].in_use && p_clreg->notif_reg[i].remote_bda == p_clcb->bda) { p_clreg->notif_reg[i].app_disconnected = true; } } 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 @@ -230,6 +230,7 @@ typedef struct { typedef struct { bool in_use; bool app_disconnected; RawAddress remote_bda; uint16_t handle; } tBTA_GATTC_NOTIF_REG; Loading system/bta/gatt/bta_gattc_utils.cc +2 −1 Original line number Diff line number Diff line Loading @@ -352,7 +352,8 @@ bool bta_gattc_check_notif_registry(tBTA_GATTC_RCB* p_clreg, for (i = 0; i < BTA_GATTC_NOTIF_REG_MAX; i++) { if (p_clreg->notif_reg[i].in_use && p_clreg->notif_reg[i].remote_bda == p_srcb->server_bda && p_clreg->notif_reg[i].handle == p_notify->handle) { p_clreg->notif_reg[i].handle == p_notify->handle && !p_clreg->notif_reg[i].app_disconnected) { VLOG(1) << "Notification registered!"; return true; } Loading Loading
system/bta/gatt/bta_gattc_act.cc +28 −0 Original line number Diff line number Diff line Loading @@ -385,6 +385,16 @@ void bta_gattc_open(tBTA_GATTC_CLCB* p_clcb, const tBTA_GATTC_DATA* p_data) { return; } tBTA_GATTC_RCB* p_clreg = p_clcb->p_rcb; /* Re-enable notification registration for closed connection */ for (int i = 0; i < BTA_GATTC_NOTIF_REG_MAX; i++) { if (p_clreg->notif_reg[i].in_use && p_clreg->notif_reg[i].remote_bda == p_clcb->bda && p_clreg->notif_reg[i].app_disconnected) { p_clreg->notif_reg[i].app_disconnected = false; } } /* a connected remote device */ if (GATT_GetConnIdIfConnected( p_clcb->p_rcb->client_if, p_data->api_conn.remote_bda, Loading Loading @@ -511,6 +521,16 @@ void bta_gattc_conn(tBTA_GATTC_CLCB* p_clcb, const tBTA_GATTC_DATA* p_data) { if (p_clcb->p_srcb->mtu == 0) p_clcb->p_srcb->mtu = GATT_DEF_BLE_MTU_SIZE; tBTA_GATTC_RCB* p_clreg = p_clcb->p_rcb; /* Re-enable notification registration for closed connection */ for (int i = 0; i < BTA_GATTC_NOTIF_REG_MAX; i++) { if (p_clreg->notif_reg[i].in_use && p_clreg->notif_reg[i].remote_bda == p_clcb->bda && p_clreg->notif_reg[i].app_disconnected) { p_clreg->notif_reg[i].app_disconnected = false; } } /* start database cache if needed */ if (p_clcb->p_srcb->gatt_database.IsEmpty() || p_clcb->p_srcb->state != BTA_GATTC_SERV_IDLE) { Loading Loading @@ -604,6 +624,14 @@ void bta_gattc_close(tBTA_GATTC_CLCB* p_clcb, const tBTA_GATTC_DATA* p_data) { bta_sys_conn_close(BTA_ID_GATTC, BTA_ALL_APP_ID, p_clcb->bda); } /* Disable notification registration for closed connection */ for (int i = 0; i < BTA_GATTC_NOTIF_REG_MAX; i++) { if (p_clreg->notif_reg[i].in_use && p_clreg->notif_reg[i].remote_bda == p_clcb->bda) { p_clreg->notif_reg[i].app_disconnected = true; } } 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 @@ -230,6 +230,7 @@ typedef struct { typedef struct { bool in_use; bool app_disconnected; RawAddress remote_bda; uint16_t handle; } tBTA_GATTC_NOTIF_REG; Loading
system/bta/gatt/bta_gattc_utils.cc +2 −1 Original line number Diff line number Diff line Loading @@ -352,7 +352,8 @@ bool bta_gattc_check_notif_registry(tBTA_GATTC_RCB* p_clreg, for (i = 0; i < BTA_GATTC_NOTIF_REG_MAX; i++) { if (p_clreg->notif_reg[i].in_use && p_clreg->notif_reg[i].remote_bda == p_srcb->server_bda && p_clreg->notif_reg[i].handle == p_notify->handle) { p_clreg->notif_reg[i].handle == p_notify->handle && !p_clreg->notif_reg[i].app_disconnected) { VLOG(1) << "Notification registered!"; return true; } Loading