Commit c4c9ea6a authored by aligungr's avatar aligungr

L3 RRC/NAS developments

parent cc3c83e7
......@@ -13,6 +13,7 @@
#include <vector>
#include <utils/common.hpp>
#include <utils/json.hpp>
namespace nas
{
......@@ -207,6 +208,11 @@ class NasSlot
return m_value;
}
const T &getPure() const
{
return m_value;
}
void clear()
{
set(T{});
......@@ -267,3 +273,9 @@ class NasSlot
};
} // namespace nas
template <typename T>
inline Json ToJson(const nas::NasSlot<T> &v)
{
return ToJson(v.getPure());
}
......@@ -128,7 +128,7 @@ void UeCmdHandler::handleCmdImpl(NmUeCliCommand &msg)
{"current-plmn", ::ToJson(currentPlmn)},
{"current-tac", ::ToJson(currentTac)},
{"tai-list", ""},
{"last-tai", ""},
{"last-tai", ToJson(m_base->nasTask->mm->m_storage->lastVisitedRegisteredTai)},
{"stored-suci", ToJson(m_base->nasTask->mm->m_storage->storedSuci->get())},
{"stored-guti", ToJson(m_base->nasTask->mm->m_storage->storedGuti->get())},
{"has-emergency", ::ToJson(m_base->nasTask->mm->hasEmergency())},
......
......@@ -175,6 +175,13 @@ Json ToJson(const EInitialRegCause &v)
}
}
Json ToJson(const Tai &v)
{
if (!v.hasValue())
return nullptr;
return "PLMN[" + ToJson(v.plmn).str() + "] TAC[" + std::to_string(v.tac) + "]";
}
void NetworkSlice::addIfNotExists(const SingleSlice &slice)
{
if (!std::any_of(slices.begin(), slices.end(), [&slice](auto &s) { return s == slice; }))
......
......@@ -206,6 +206,7 @@ bool operator!=(const GlobalNci &lhs, const GlobalNci &rhs);
Json ToJson(const Supi &v);
Json ToJson(const Plmn &v);
Json ToJson(const Tai &v);
Json ToJson(const SingleSlice &v);
Json ToJson(const NetworkSlice &v);
Json ToJson(const PlmnSupport &v);
......
......@@ -161,7 +161,7 @@ Json::Json() : m_type{Type::NULL_TYPE}
{
}
Json::Json(nullptr_t) : m_type{Type::NULL_TYPE}
Json::Json(std::nullptr_t) : m_type{Type::NULL_TYPE}
{
}
......@@ -362,7 +362,7 @@ void Json::put(std::string key, Json value)
m_children.emplace_back(std::move(key), std::move(value));
}
Json ToJson(nullptr_t)
Json ToJson(std::nullptr_t)
{
return nullptr;
}
......
......@@ -47,7 +47,7 @@ class Json
public:
Json();
/* no-explicit */ Json(nullptr_t v);
/* no-explicit */ Json(std::nullptr_t v);
/* no-explicit */ Json(std::string str);
/* no-explicit */ Json(bool v);
/* no-explicit */ Json(uint8_t v);
......@@ -105,7 +105,7 @@ class Json
[[nodiscard]] std::string dumpYaml() const;
};
Json ToJson(nullptr_t);
Json ToJson(std::nullptr_t);
Json ToJson(bool v);
Json ToJson(const std::string &v);
Json ToJson(uint8_t v);
......
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