From b71dab87f10699bba34668a754d091f51034b886 Mon Sep 17 00:00:00 2001 From: Andre Puschmann Date: Fri, 2 Nov 2018 21:46:03 +0100 Subject: [PATCH] add function to query if RLC bearer exists (the implementation) --- lib/include/srslte/upper/rlc.h | 1 + lib/src/upper/rlc.cc | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/lib/include/srslte/upper/rlc.h b/lib/include/srslte/upper/rlc.h index f211edf72..d269ef0de 100644 --- a/lib/include/srslte/upper/rlc.h +++ b/lib/include/srslte/upper/rlc.h @@ -90,6 +90,7 @@ public: void del_bearer(uint32_t lcid); void del_bearer_mrb(uint32_t lcid); void change_lcid(uint32_t old_lcid, uint32_t new_lcid); + bool has_bearer(uint32_t lcid); private: void reset_metrics(); diff --git a/lib/src/upper/rlc.cc b/lib/src/upper/rlc.cc index 886de474a..ef2624791 100644 --- a/lib/src/upper/rlc.cc +++ b/lib/src/upper/rlc.cc @@ -571,6 +571,15 @@ exit: } +bool rlc::has_bearer(uint32_t lcid) +{ + pthread_rwlock_rdlock(&rwlock); + bool ret = valid_lcid(lcid); + pthread_rwlock_unlock(&rwlock); + return ret; +} + + /******************************************************************************* Helpers (Lock must be hold when calling those) *******************************************************************************/