diff options
author | Jacob Erlbeck <jerlbeck@sysmocom.de> | 2016-01-05 15:33:03 +0100 |
---|---|---|
committer | Jacob Erlbeck <jerlbeck@sysmocom.de> | 2016-02-01 13:58:14 +0100 |
commit | cb7289094a40f179f6c538780f3117f7ad9688bd (patch) | |
tree | dc25962feb9c18814fe944fe9d39adedcf859dc6 /src/encoding.cpp | |
parent | 96ccea8436f9a5bbd9f459c6c1bdb9a24dd2bed9 (diff) |
edge: Replace integer cs by GprsCodingScheme
Currently the TBF and MS object use a plain integer value
(current_cs) to manage the coding scheme. This makes it difficult to
support the MCS schemes. GprsCodingScheme supports a partial ordering
of these values (CS and MCS) and provides safe increment and
decrement methods.
Use the GprsCodingScheme type instead of integer for cs fields and
variables. Add a 'mode' to GprsMs which can be set to either GPRS,
EGPRS, or EGPRS_GMSK which also set the initial values of
current_cs_ul/dl. Select the mode based on max_mcs_ul and max_mcs_dl.
Sponsored-by: On-Waves ehf
Diffstat (limited to 'src/encoding.cpp')
-rw-r--r-- | src/encoding.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/encoding.cpp b/src/encoding.cpp index 158625e6..acd8f43d 100644 --- a/src/encoding.cpp +++ b/src/encoding.cpp @@ -193,7 +193,7 @@ void Encoding::write_packet_uplink_assignment( if (!use_egprs) { bitvec_write_field(dest, wp,0x0,1); // Message escape - bitvec_write_field(dest, wp,tbf->current_cs()-1, 2); // CHANNEL_CODING_COMMAND + bitvec_write_field(dest, wp,tbf->current_cs().to_num()-1, 2); // CHANNEL_CODING_COMMAND bitvec_write_field(dest, wp,0x1,1); // TLLI_BLOCK_CHANNEL_CODING bitvec_write_field(dest, wp,0x1,1); // switch TIMING_ADVANCE_VALUE = on bitvec_write_field(dest, wp,tbf->ta(),6); // TIMING_ADVANCE_VALUE @@ -209,7 +209,7 @@ void Encoding::write_packet_uplink_assignment( bitvec_write_field(dest, wp,0x0,2); // EGPRS message contents bitvec_write_field(dest, wp,0x0,1); // No CONTENTION_RESOLUTION_TLLI bitvec_write_field(dest, wp,0x0,1); // No COMPACT reduced MA - bitvec_write_field(dest, wp,tbf->current_cs()-1, 4); // EGPRS Modulation and Coding IE + bitvec_write_field(dest, wp,tbf->current_cs().to_num()-1, 4); // EGPRS Modulation and Coding IE bitvec_write_field(dest, wp,0x0,1); // No RESEGMENT bitvec_write_field(dest, wp,0x0,5); // EGPRS Window Size = 64 bitvec_write_field(dest, wp,0x0,1); // No Access Technologies Request @@ -426,7 +426,7 @@ static void write_packet_uplink_ack_gprs( struct gprs_rlcmac_ul_tbf *tbf, bool is_final) { - bitvec_write_field(dest, wp, tbf->current_cs() - 1, 2); // CHANNEL_CODING_COMMAND + bitvec_write_field(dest, wp, tbf->current_cs().to_num() - 1, 2); // CHANNEL_CODING_COMMAND write_packet_ack_nack_desc_gprs(bts, dest, wp, &tbf->m_window, is_final); bitvec_write_field(dest, wp, 1, 1); // 1: have CONTENTION_RESOLUTION_TLLI |