From 28b1e9d3c986aa8c10ec3098e03246f67d2b5b90 Mon Sep 17 00:00:00 2001 From: Angelo Athanassopoulos Date: Fri, 19 Aug 2022 13:54:12 +0200 Subject: [PATCH] NR RRC - Created function to check if DRB is active for a UE --- openair2/RRC/NR/rrc_gNB_drbs.c | 6 ++++++ openair2/RRC/NR/rrc_gNB_drbs.h | 1 + 2 files changed, 7 insertions(+) diff --git a/openair2/RRC/NR/rrc_gNB_drbs.c b/openair2/RRC/NR/rrc_gNB_drbs.c index 7f94c487b1..85800b8522 100644 --- a/openair2/RRC/NR/rrc_gNB_drbs.c +++ b/openair2/RRC/NR/rrc_gNB_drbs.c @@ -113,4 +113,10 @@ uint8_t next_available_drb(gNB_RRC_UE_t *ue, uint8_t pdusession_id) { /* From this point, we handle the case that all DRBs are already used by the UE. */ LOG_E(RRC, "Error - All the DRBs are used - Handle this\n"); return DRB_INACTIVE; +} + +bool drb_is_active(gNB_RRC_UE_t *ue, uint8_t drb_id) { + if(ue->DRB_active[drb_id-1] == DRB_ACTIVE) + return true; + return false; } \ No newline at end of file diff --git a/openair2/RRC/NR/rrc_gNB_drbs.h b/openair2/RRC/NR/rrc_gNB_drbs.h index ed3e2dd92f..07a659bae3 100644 --- a/openair2/RRC/NR/rrc_gNB_drbs.h +++ b/openair2/RRC/NR/rrc_gNB_drbs.h @@ -39,5 +39,6 @@ NR_DRB_ToAddMod_t *generateDRB(gNB_RRC_UE_t *rrc_ue, int do_drb_ciphering); uint8_t next_available_drb(gNB_RRC_UE_t *ue, uint8_t pdusession_id); +bool drb_is_active(gNB_RRC_UE_t *ue, uint8_t drb_id); #endif \ No newline at end of file