Commit 31f77086 authored by aligungr's avatar aligungr

L3 RRC/NAS developments

parent 250f5738
...@@ -22,28 +22,42 @@ void UeRrcTask::performCellSelection() ...@@ -22,28 +22,42 @@ void UeRrcTask::performCellSelection()
if (m_state == ERrcState::RRC_CONNECTED) if (m_state == ERrcState::RRC_CONNECTED)
return; return;
if (utils::CurrentTimeMillis() - m_startedTime <= 1000LL && m_cellDesc.empty())
return;
int lastCell = m_base->shCtx.currentCell.get<int>([](auto &value) { return value.cellId; }); int lastCell = m_base->shCtx.currentCell.get<int>([](auto &value) { return value.cellId; });
CurrentCellInfo cellInfo; CurrentCellInfo cellInfo;
CellSelectionReport report; CellSelectionReport report;
if (!lookForSuitableCell(cellInfo, report)) bool cellFound = false;
if (m_base->shCtx.selectedPlmn.get().hasValue())
{ {
if (!m_cellDesc.empty()) cellFound = lookForSuitableCell(cellInfo, report);
{ if (!cellFound)
m_logger->warn("Suitable cell selection failed in [%d] cells. [%d] out of PLMN, [%d] no SI, [%d] reserved, "
"[%d] barred, ftai [%d]",
static_cast<int>(m_cellDesc.size()), report.outOfPlmnCells, report.sib1MissingCells,
report.reservedCells, report.barredCells, report.forbiddenTaiCells);
}
else
{ {
m_logger->warn("Suitable cell selection failed, no cell is in coverage"); if (!m_cellDesc.empty())
{
m_logger->warn(
"Suitable cell selection failed in [%d] cells. [%d] out of PLMN, [%d] no SI, [%d] reserved, "
"[%d] barred, ftai [%d]",
static_cast<int>(m_cellDesc.size()), report.outOfPlmnCells, report.sib1MissingCells,
report.reservedCells, report.barredCells, report.forbiddenTaiCells);
}
else
{
m_logger->warn("Suitable cell selection failed, no cell is in coverage");
}
} }
}
if (!cellFound)
{
report = {}; report = {};
if (!lookForAcceptableCell(cellInfo, report)) cellFound = lookForAcceptableCell(cellInfo, report);
if (!cellFound)
{ {
if (!m_cellDesc.empty()) if (!m_cellDesc.empty())
{ {
......
...@@ -27,6 +27,8 @@ UeRrcTask::UeRrcTask(TaskBase *base) : m_base{base} ...@@ -27,6 +27,8 @@ UeRrcTask::UeRrcTask(TaskBase *base) : m_base{base}
{ {
m_logger = base->logBase->makeUniqueLogger(base->config->getLoggerPrefix() + "rrc"); m_logger = base->logBase->makeUniqueLogger(base->config->getLoggerPrefix() + "rrc");
m_startedTime = utils::CurrentTimeMillis();
m_state = ERrcState::RRC_IDLE; m_state = ERrcState::RRC_IDLE;
} }
......
...@@ -50,14 +50,15 @@ class UeRrcTask : public NtsTask ...@@ -50,14 +50,15 @@ class UeRrcTask : public NtsTask
private: private:
TaskBase *m_base; TaskBase *m_base;
std::unique_ptr<Logger> m_logger; std::unique_ptr<Logger> m_logger;
int64_t m_startedTime;
ERrcState m_state; ERrcState m_state;
std::unordered_map<int, UeCellDesc> m_cellDesc{};
ERrcLastSetupRequest m_lastSetupReq{}; ERrcLastSetupRequest m_lastSetupReq{};
ASN_RRC_InitialUE_Identity_t m_initialId{}; ASN_RRC_InitialUE_Identity_t m_initialId{};
OctetString m_initialNasPdu{}; OctetString m_initialNasPdu{};
std::unordered_map<int, UeCellDesc> m_cellDesc{};
friend class UeCmdHandler; friend class UeCmdHandler;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment