Commit 4b392a25 authored by aligungr's avatar aligungr

L3 RRC/NAS developments

parent 96073581
......@@ -1093,4 +1093,27 @@ Json ToJson(const IEPduAddress &v)
}
}
Json ToJson(const IESessionAmbr &v)
{
int downlinkValue = static_cast<int>(v.sessionAmbrForDownlink);
int uplinkValue = static_cast<int>(v.sessionAmbrForUplink);
int downlinkUnit = static_cast<int>(v.unitForSessionAmbrForDownlink);
int uplinkUnit = static_cast<int>(v.unitForSessionAmbrForUplink);
int downlinkFactor = 1 << (2 * ((downlinkUnit - 1) % 5));
int uplinkFactor = 1 << (2 * ((uplinkUnit - 1) % 5));
int downlinkMagnitude = (downlinkUnit - 1) / 5;
int uplinkMagnitude = (uplinkUnit - 1) / 5;
int downlink = downlinkValue * downlinkFactor;
int uplink = uplinkValue * uplinkFactor;
static const std::string units[5] = {"Kb/s", "Mb/s", "Gb/s", "Tb/s", "Pb/s"};
return "up[" + std::to_string(uplink) + units[uplinkMagnitude] + "] down[" + std::to_string(downlink) +
units[downlinkMagnitude] + "]";
}
} // namespace nas
\ No newline at end of file
......@@ -573,5 +573,6 @@ struct IE5gsTrackingAreaIdentityList : InformationElement4
};
Json ToJson(const IEPduAddress &v);
Json ToJson(const IESessionAmbr &v);
} // namespace nas
......@@ -160,6 +160,9 @@ void UeCmdHandler::handleCmdImpl(NmUeCliCommand &msg)
std::vector<Json> arr{};
for (auto *pduSession : m_base->nasTask->sm->m_pduSessions)
{
if (pduSession->psi == 0)
continue;
arr.push_back(Json::Obj({
{"ID", pduSession->psi},
{"state", ToJson(pduSession->psState)},
......@@ -168,7 +171,7 @@ void UeCmdHandler::handleCmdImpl(NmUeCliCommand &msg)
{"s-nssai", ToJson(pduSession->sNssai)},
{"emergency", pduSession->isEmergency},
{"address", ::ToJson(pduSession->pduAddress)},
{"ambr", ""}, // TODO
{"ambr", ::ToJson(pduSession->sessionAmbr)},
{"data-pending", pduSession->uplinkPending},
}));
}
......
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