Skip to content

Commit

Permalink
Quick solution for mnc values bug
Browse files Browse the repository at this point in the history
  • Loading branch information
DendoD96 committed Jun 25, 2021
1 parent 34cc91e commit 4f2b880
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/gnb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include <utils/options.hpp>
#include <utils/yaml_utils.hpp>
#include <yaml-cpp/yaml.h>
#include <string>

static app::CliServer *g_cliServer = nullptr;
static nr::gnb::GnbConfig *g_refConfig = nullptr;
Expand All @@ -41,8 +42,10 @@ static nr::gnb::GnbConfig *ReadConfigYaml()

result->plmn.mcc = yaml::GetInt32(config, "mcc", 1, 999);
yaml::GetString(config, "mcc", 3, 3);
result->plmn.mnc = yaml::GetInt32(config, "mnc", 0, 999);
result->plmn.isLongMnc = yaml::GetString(config, "mnc", 2, 3).size() == 3;
auto mncValue = config["mnc"].Scalar();
config["mnc"] = mncValue.erase(0, std::min(mncValue.find_first_not_of('0'), mncValue.size()-1));
result->plmn.mnc = yaml::GetInt32(config, "mnc", 0, 999);

result->nci = yaml::GetInt64(config, "nci", 0, 0xFFFFFFFFFll);
result->gnbIdLength = yaml::GetInt32(config, "idLength", 22, 32);
Expand Down

0 comments on commit 4f2b880

Please sign in to comment.