aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <holger@moiji-mobile.com>2014-06-08 11:27:05 +0200
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2014-06-08 11:27:05 +0200
commit53e6a185812abe384ddc821779d593508b703a17 (patch)
treec12a61f4d13b54ddc630f902eb42f92c0ab2cc0b
parentf758b152bac5127edee8a7eadd4a1e40600c721f (diff)
clean-up: The ta_idx parameter was always -1, remove it
The amount of parameters is so difficult to understand and the goal of Encoding is to support our application and not be able to provide all possible combinations for these messages.
-rw-r--r--src/bts.cpp6
-rw-r--r--src/encoding.cpp19
-rw-r--r--src/encoding.h3
3 files changed, 10 insertions, 18 deletions
diff --git a/src/bts.cpp b/src/bts.cpp
index c07b8f4..166354a 100644
--- a/src/bts.cpp
+++ b/src/bts.cpp
@@ -408,7 +408,7 @@ bool BTS::rcv_rach_sba(uint8_t ra, uint32_t Fn, int16_t qta, bitvec *immediate_a
*plen = Encoding::write_immediate_assignment(&m_bts, immediate_assignment, 0, ra,
Fn, qta >> 2, &m_bts.trx[trx_no].pdch[ts_no], 0, 0, 0, 0, sb_fn, 1,
- m_bts.alpha, m_bts.gamma, -1);
+ m_bts.alpha, m_bts.gamma);
return true;
}
@@ -447,7 +447,7 @@ bool BTS::rcv_rach_tbf(uint8_t ra, uint32_t Fn, int16_t qta, bitvec *immediate_a
*plen = Encoding::write_immediate_assignment(&m_bts, immediate_assignment, 0, ra,
Fn, tbf->ta, tbf->first_pdch(),
tbf->tfi(), tbf->dir.ul.usf[tbf->first_ts], 0, 0, 0, 0,
- m_bts.alpha, m_bts.gamma, -1);
+ m_bts.alpha, m_bts.gamma);
return true;
}
@@ -543,7 +543,7 @@ void BTS::snd_dl_ass(gprs_rlcmac_tbf *tbf, uint8_t poll, const char *imsi)
plen = Encoding::write_immediate_assignment(&m_bts, immediate_assignment, 1, 125,
(tbf->pdch[tbf->first_ts]->last_rts_fn + 21216) % 2715648, tbf->ta,
tbf->first_pdch(), tbf->tfi(), 0, tbf->tlli(), poll,
- tbf->poll_fn, 0, m_bts.alpha, m_bts.gamma, -1);
+ tbf->poll_fn, 0, m_bts.alpha, m_bts.gamma);
pcu_l1if_tx_pch(immediate_assignment, plen, imsi);
bitvec_free(immediate_assignment);
}
diff --git a/src/encoding.cpp b/src/encoding.cpp
index 644f32a..1e31853 100644
--- a/src/encoding.cpp
+++ b/src/encoding.cpp
@@ -32,7 +32,7 @@ int Encoding::write_immediate_assignment(
uint32_t ref_fn, uint8_t ta, gprs_rlcmac_pdch *pdch,
uint8_t tfi, uint8_t usf, uint32_t tlli,
uint8_t polling, uint32_t fn, uint8_t single_block, uint8_t alpha,
- uint8_t gamma, int8_t ta_idx)
+ uint8_t gamma)
{
unsigned wp = 0;
uint8_t plen;
@@ -95,12 +95,9 @@ int Encoding::write_immediate_assignment(
bitvec_write_field(dest, wp,gamma,5); // GAMMA power control parameter
bitvec_write_field(dest, wp,polling,1); // Polling Bit
bitvec_write_field(dest, wp,!polling,1); // TA_VALID ???
- if (ta_idx < 0) {
- bitvec_write_field(dest, wp,0x0,1); // switch TIMING_ADVANCE_INDEX = off
- } else {
- bitvec_write_field(dest, wp,0x1,1); // switch TIMING_ADVANCE_INDEX = on
- bitvec_write_field(dest, wp,ta_idx,4); // TIMING_ADVANCE_INDEX
- }
+
+ bitvec_write_field(dest, wp,0x0,1); // switch TIMING_ADVANCE_INDEX = off
+
if (polling) {
bitvec_write_field(dest, wp,0x1,1); // TBF Starting TIME present
bitvec_write_field(dest, wp,(fn / (26 * 51)) % 32,5); // T1'
@@ -126,12 +123,8 @@ int Encoding::write_immediate_assignment(
} else
bitvec_write_field(dest, wp,0x0,1); // ALPHA = not present
bitvec_write_field(dest, wp,gamma,5); // GAMMA power control parameter
- if (ta_idx < 0) {
- bitvec_write_field(dest, wp,0x0,1); // switch TIMING_ADVANCE_INDEX = off
- } else {
- bitvec_write_field(dest, wp,0x1,1); // switch TIMING_ADVANCE_INDEX = on
- bitvec_write_field(dest, wp,ta_idx,4); // TIMING_ADVANCE_INDEX
- }
+
+ bitvec_write_field(dest, wp,0x0,1); // switch TIMING_ADVANCE_INDEX = off
bitvec_write_field(dest, wp, 1, 1); // TBF_STARTING_TIME_FLAG
bitvec_write_field(dest, wp,(fn / (26 * 51)) % 32,5); // T1'
bitvec_write_field(dest, wp,fn % 51,6); // T3
diff --git a/src/encoding.h b/src/encoding.h
index dc4b95e..89d4cc9 100644
--- a/src/encoding.h
+++ b/src/encoding.h
@@ -41,8 +41,7 @@ public:
bitvec * dest, uint8_t downlink, uint8_t ra,
uint32_t ref_fn, uint8_t ta, gprs_rlcmac_pdch *pdch,
uint8_t tfi, uint8_t usf, uint32_t tlli, uint8_t polling,
- uint32_t fn, uint8_t single_block, uint8_t alpha, uint8_t gamma,
- int8_t ta_idx);
+ uint32_t fn, uint8_t single_block, uint8_t alpha, uint8_t gamma);
static void write_packet_uplink_assignment(
struct gprs_rlcmac_bts *bts,