diff options
author | Jacob Erlbeck <jerlbeck@sysmocom.de> | 2015-06-29 14:18:46 +0200 |
---|---|---|
committer | Jacob Erlbeck <jerlbeck@sysmocom.de> | 2015-07-03 13:17:22 +0200 |
commit | ac89a555fa73b24a77bb861811774a5af885bc84 (patch) | |
tree | d0edad2d9003d7355f5637e61aa4f8f2f73879f8 /src/tbf.h | |
parent | 699b8dca49df30b7bf6db7090eb416d1ad4fd46d (diff) |
ms: Add tbf() method to get the TBF based on the direction
To avoid the need for a switch or conditional statement when needing
a TBF from an MS object in direction independant code, this method
contains that case distinction. For additional flexibility, a
reverse() function is added to get the opposite direction.
Sponsored-by: On-Waves ehf
Diffstat (limited to 'src/tbf.h')
-rw-r--r-- | src/tbf.h | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -395,6 +395,11 @@ protected: void maybe_schedule_uplink_acknack(const rlc_ul_header *rh); }; +inline enum gprs_rlcmac_tbf_direction reverse(enum gprs_rlcmac_tbf_direction dir) +{ + return (enum gprs_rlcmac_tbf_direction) + ((int)GPRS_RLCMAC_UL_TBF - (int)dir + (int)GPRS_RLCMAC_DL_TBF); +} #endif #ifdef __cplusplus |