Commit 325f3d65 authored by aligungr's avatar aligungr

gNB CLI improvement

parent 6b09b474
...@@ -30,15 +30,40 @@ void GnbAppTask::onLoop() ...@@ -30,15 +30,40 @@ void GnbAppTask::onLoop()
switch (msg->msgType) switch (msg->msgType)
{ {
case NtsMessageType::GNB_STATUS_UPDATE: { case NtsMessageType::GNB_STATUS_UPDATE: {
auto *m = dynamic_cast<NwGnbStatusUpdate *>(msg); auto *w = dynamic_cast<NwGnbStatusUpdate *>(msg);
switch (m->what) switch (w->what)
{ {
case NwGnbStatusUpdate::NGAP_IS_UP: case NwGnbStatusUpdate::NGAP_IS_UP:
m_statusInfo.isNgapUp = m->isNgapUp; m_statusInfo.isNgapUp = w->isNgapUp;
break; break;
} }
break; break;
} }
case NtsMessageType::GNB_CLI_COMMAND: {
auto *w = dynamic_cast<NwGnbCliCommand *>(msg);
if (w->cmd == nullptr)
break;
switch (w->cmd->present)
{
case app::GnbCliCommand::STATUS: {
w->sendError("status command not implemented yet");
break;
}
case app::GnbCliCommand::INFO: {
w->sendError("info command not implemented yet");
break;
}
case app::GnbCliCommand::AMF_LIST: {
w->sendError("amf-list command not implemented yet");
break;
}
case app::GnbCliCommand::AMF_STATUS: {
w->sendError("amf-status command not implemented yet");
break;
}
}
break;
}
default: default:
m_logger->unhandledNts(msg); m_logger->unhandledNts(msg);
delete msg; delete msg;
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
#pragma once #pragma once
#include <app/cli_base.hpp>
#include <app/cli_cmd.hpp> #include <app/cli_cmd.hpp>
#include <rrc/rrc.hpp> #include <rrc/rrc.hpp>
#include <sctp/sctp.hpp> #include <sctp/sctp.hpp>
...@@ -251,6 +252,16 @@ struct NwGnbCliCommand : NtsMessage ...@@ -251,6 +252,16 @@ struct NwGnbCliCommand : NtsMessage
: NtsMessage(NtsMessageType::GNB_CLI_COMMAND), cmd(std::move(cmd)), address(address), callbackTask(callbackTask) : NtsMessage(NtsMessageType::GNB_CLI_COMMAND), cmd(std::move(cmd)), address(address), callbackTask(callbackTask)
{ {
} }
void sendResult(const std::string &output) const
{
callbackTask->push(new app::NwCliSendResponse(address, output, false));
}
void sendError(const std::string &output) const
{
callbackTask->push(new app::NwCliSendResponse(address, output, true));
}
}; };
} // namespace nr::gnb } // namespace nr::gnb
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