window: move encoding into functions
* move window size encoding and writing into separate functions
* introduce necessary TBF wrappers to avoid direct m_window access
This is part of preparation work to move to separate UL/DL windows.
Related: OS#1759
Change-Id: I60184d5049bc7d7b119df5a9eb82d1c4b788c840
diff --git a/src/tbf.h b/src/tbf.h
index f57dbe3..9491f2a 100644
--- a/src/tbf.h
+++ b/src/tbf.h
@@ -464,7 +464,7 @@
bool keep_open(unsigned fn) const;
int release();
int abort();
-
+ uint16_t window_size() const;
void egprs_calc_window_size();
void update_coding_scheme_counter_dl(const GprsCodingScheme cs);
@@ -562,7 +562,7 @@
uint8_t *data, const uint8_t block_idx);
void egprs_calc_ulwindow_size();
-
+ uint16_t window_size() const;
void update_coding_scheme_counter_ul(const GprsCodingScheme cs);
/* Please note that all variables here will be reset when changing
@@ -599,6 +599,16 @@
((int)GPRS_RLCMAC_UL_TBF - (int)dir + (int)GPRS_RLCMAC_DL_TBF);
}
+inline uint16_t gprs_rlcmac_ul_tbf::window_size() const
+{
+ return m_window.ws();
+}
+
+inline uint16_t gprs_rlcmac_dl_tbf::window_size() const
+{
+ return m_window.ws();
+}
+
inline void gprs_rlcmac_ul_tbf::enable_egprs()
{
m_window.set_sns(RLC_EGPRS_SNS);