summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSerhii Kostiuk <serhii.o.kostiuk@globallogic.com>2021-05-18 17:55:03 +0300
committerSerhii Kostiuk <serhii.o.kostiuk@globallogic.com>2021-05-18 18:12:52 +0300
commitd562fa43d6f61c0a6ad4fb79e91c90cf571884f3 (patch)
tree2c544187ae4ea04d730b772091520fe44eb44640 /src
parentbcd5443bcfff3e17ee120c305bbfd0ce2c812b21 (diff)
downloadlibmts-io-d562fa43d6f61c0a6ad4fb79e91c90cf571884f3.tar.gz
libmts-io-d562fa43d6f61c0a6ad4fb79e91c90cf571884f3.tar.bz2
libmts-io-d562fa43d6f61c0a6ad4fb79e91c90cf571884f3.zip
[GP-1111] mPower R. Apr 2021: +CEMODE shall be set to CEMODE=2
Fixed carrier MCC/MNC table lookup for networks with two-digit conuntry codes. The original MCC/MNC population script used the following encoding for MCC/MNC values: - MCC - interpret the original value as hex; - 2-digit MNC - append "f" and interpret the resulting value as hex; - 3-digit MNC - interpret the original value as hex. So during lookup the system shall also use this conversion logic before querying the information from the table.
Diffstat (limited to 'src')
-rw-r--r--src/MTS_IO_MccMncTable.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/MTS_IO_MccMncTable.cpp b/src/MTS_IO_MccMncTable.cpp
index e375213..b187b86 100644
--- a/src/MTS_IO_MccMncTable.cpp
+++ b/src/MTS_IO_MccMncTable.cpp
@@ -53,9 +53,13 @@ MccMncTable::MccMncTable() {
Json::Value MccMncTable::lookup(const std::string& sMcc, const std::string& sMnc) {
uint32_t iMcc, iMnc;
+ std::string sNormalizedMnc = sMnc;
printTrace("[MCCMNC] MCCx[%s] MNCx[%s]", sMcc.c_str(), sMnc.c_str());
- if(!MTS::Text::parseHex(iMcc, sMcc)) { return Json::Value::null; }
- if(!MTS::Text::parseHex(iMnc, sMnc)) { return Json::Value::null; }
+ if (sMnc.length() == 2) {
+ sNormalizedMnc += 'f';
+ }
+ if (!MTS::Text::parseHex(iMcc, sMcc)) { return Json::Value::null; }
+ if (!MTS::Text::parseHex(iMnc, sNormalizedMnc)) { return Json::Value::null; }
printTrace("[MCCMNC] MCC0X[%d] MNC0X[%d]", iMcc, iMnc);
if (m_mTable.count(iMcc)) {
if(m_mTable[iMcc].count(iMnc)) {