aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJacob Erlbeck <jerlbeck@sysmocom.de>2016-01-18 17:23:09 +0100
committerJacob Erlbeck <jerlbeck@sysmocom.de>2016-02-08 00:45:35 +0100
commit53bc1861c4b6197bfc6715f8d4c08add473f7c6f (patch)
tree6e72ccc6e4fce76923444d12da178bb04a8e470b
parentb4beb545f7751f598e520707a6358bd515282869 (diff)
edge: Fix initial coding scheme selection
Currently the coding scheme gets reset when GprsMs::set_mode() is called even if the mode did not change. Make sure, that the CS is only reset, if it is not compliant to the new mode. Sponsored-by: On-Waves ehf
-rw-r--r--src/gprs_ms.cpp29
1 files changed, 17 insertions, 12 deletions
diff --git a/src/gprs_ms.cpp b/src/gprs_ms.cpp
index 187132f5..9126543e 100644
--- a/src/gprs_ms.cpp
+++ b/src/gprs_ms.cpp
@@ -212,34 +212,39 @@ void GprsMs::set_mode(GprsCodingScheme::Mode mode)
{
m_mode = mode;
+ if (!m_bts)
+ return;
+
switch (m_mode) {
case GprsCodingScheme::GPRS:
- if (m_bts) {
+ if (!m_current_cs_ul.isGprs()) {
m_current_cs_ul = GprsCodingScheme::getGprsByNum(
m_bts->bts_data()->initial_cs_ul);
+ if (!m_current_cs_ul.isValid())
+ m_current_cs_ul = GprsCodingScheme::CS1;
+ }
+ if (!m_current_cs_dl.isGprs()) {
m_current_cs_dl = GprsCodingScheme::getGprsByNum(
m_bts->bts_data()->initial_cs_dl);
+ if (!m_current_cs_dl.isValid())
+ m_current_cs_dl = GprsCodingScheme::CS1;
}
- if (!m_current_cs_ul.isGprs())
- m_current_cs_ul = GprsCodingScheme::CS1;
- if (!m_current_cs_dl.isGprs())
- m_current_cs_dl = GprsCodingScheme::CS1;
-
break;
case GprsCodingScheme::EGPRS_GMSK:
case GprsCodingScheme::EGPRS:
- if (m_bts) {
+ if (!m_current_cs_ul.isEgprs()) {
m_current_cs_ul = GprsCodingScheme::getEgprsByNum(
m_bts->bts_data()->initial_mcs_ul);
+ if (!m_current_cs_dl.isValid())
+ m_current_cs_ul = GprsCodingScheme::MCS1;
+ }
+ if (!m_current_cs_dl.isEgprs()) {
m_current_cs_dl = GprsCodingScheme::getEgprsByNum(
m_bts->bts_data()->initial_mcs_dl);
+ if (!m_current_cs_dl.isValid())
+ m_current_cs_dl = GprsCodingScheme::MCS1;
}
- if (!m_current_cs_ul.isEgprs())
- m_current_cs_ul = GprsCodingScheme::MCS1;
- if (!m_current_cs_dl.isEgprs())
- m_current_cs_dl = GprsCodingScheme::MCS1;
-
break;
}
}