Commit 325f3d65 authored by aligungr's avatar aligungr

gNB CLI improvement

parent 6b09b474
......@@ -30,15 +30,40 @@ void GnbAppTask::onLoop()
switch (msg->msgType)
{
case NtsMessageType::GNB_STATUS_UPDATE: {
auto *m = dynamic_cast<NwGnbStatusUpdate *>(msg);
switch (m->what)
auto *w = dynamic_cast<NwGnbStatusUpdate *>(msg);
switch (w->what)
{
case NwGnbStatusUpdate::NGAP_IS_UP:
m_statusInfo.isNgapUp = m->isNgapUp;
m_statusInfo.isNgapUp = w->isNgapUp;
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:
m_logger->unhandledNts(msg);
delete msg;
......
......@@ -8,6 +8,7 @@
#pragma once
#include <app/cli_base.hpp>
#include <app/cli_cmd.hpp>
#include <rrc/rrc.hpp>
#include <sctp/sctp.hpp>
......@@ -251,6 +252,16 @@ struct NwGnbCliCommand : NtsMessage
: 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
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