From d562fa43d6f61c0a6ad4fb79e91c90cf571884f3 Mon Sep 17 00:00:00 2001 From: Serhii Kostiuk Date: Tue, 18 May 2021 17:55:03 +0300 Subject: [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. --- scripts/create-mcc-mnc-table.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/create-mcc-mnc-table.py b/scripts/create-mcc-mnc-table.py index 761454c..cc30fef 100644 --- a/scripts/create-mcc-mnc-table.py +++ b/scripts/create-mcc-mnc-table.py @@ -43,9 +43,13 @@ print "}" print "" print "Json::Value MccMncTable::lookup(const std::string& sMcc, const std::string& sMnc) {" print " uint32_t iMcc, iMnc;" +print " std::string sNormalizedMnc = sMnc;" print ' printTrace("[MCCMNC] MCCx[%s] MNCx[%s]", sMcc.c_str(), sMnc.c_str());' -print " if(!MTS::Text::parseHex(iMcc, sMcc)) { return Json::Value::null; }" -print " if(!MTS::Text::parseHex(iMnc, sMnc)) { return Json::Value::null; }" +print " if (sMnc.length() == 2) {" +print " sNormalizedMnc += 'f';" +print " }" +print " if (!MTS::Text::parseHex(iMcc, sMcc)) { return Json::Value::null; }" +print " if (!MTS::Text::parseHex(iMnc, sNormalizedMnc)) { return Json::Value::null; }" print ' printTrace("[MCCMNC] MCC0X[%d] MNC0X[%d]", iMcc, iMnc);' print " if (m_mTable.count(iMcc)) {" print " if(m_mTable[iMcc].count(iMnc)) {" -- cgit v1.2.3