Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
U
UERANSIM
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
UERANSIM
Commits
6759f50a
Commit
6759f50a
authored
Feb 14, 2021
by
aligungr
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CLI improvements
parent
2900d17e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
0 deletions
+35
-0
src/ue/app/cmd_handler.cpp
src/ue/app/cmd_handler.cpp
+13
-0
src/utils/json.cpp
src/utils/json.cpp
+20
-0
src/utils/json.hpp
src/utils/json.hpp
+2
-0
No files found.
src/ue/app/cmd_handler.cpp
View file @
6759f50a
...
...
@@ -83,6 +83,18 @@ void UeCmdHandler::HandleCmdImpl(TaskBase &base, NwUeCliCommand &msg)
switch
(
msg
.
cmd
->
present
)
{
case
app
:
:
UeCliCommand
::
STATUS
:
{
std
::
vector
<
Json
>
pduSessions
{};
int
index
=
0
;
for
(
auto
&
pduSession
:
base
.
appTask
->
m_statusInfo
.
pduSessions
)
{
if
(
pduSession
.
has_value
())
{
pduSessions
.
push_back
(
Json
::
Obj
({{
"id"
,
index
},
{
"type"
,
pduSession
->
type
},
{
"address"
,
pduSession
->
address
}}));
}
index
++
;
}
Json
json
=
Json
::
Obj
({
{
"cm-state"
,
ToJson
(
base
.
nasTask
->
mm
->
m_cmState
)},
{
"rm-state"
,
ToJson
(
base
.
nasTask
->
mm
->
m_rmState
)},
...
...
@@ -90,6 +102,7 @@ void UeCmdHandler::HandleCmdImpl(TaskBase &base, NwUeCliCommand &msg)
{
"sim-inserted"
,
base
.
nasTask
->
mm
->
m_validSim
},
{
"stored-suci"
,
ToJson
(
base
.
nasTask
->
mm
->
m_storedSuci
)},
{
"stored-guti"
,
ToJson
(
base
.
nasTask
->
mm
->
m_storedGuti
)},
{
"pdu-sessions"
,
Json
::
Arr
(
std
::
move
(
pduSessions
))},
});
msg
.
sendResult
(
json
.
dumpYaml
());
break
;
...
...
src/utils/json.cpp
View file @
6759f50a
...
...
@@ -349,6 +349,26 @@ Json Json::Arr(std::initializer_list<Json> &&elements)
return
json
;
}
Json
Json
::
Arr
(
const
std
::
vector
<
Json
>
&
elements
)
{
Json
json
{};
json
.
m_type
=
Type
::
ARRAY
;
int
index
=
0
;
for
(
auto
&
item
:
elements
)
json
.
m_children
[
std
::
to_string
(
index
++
)]
=
item
;
return
json
;
}
Json
Json
::
Arr
(
std
::
vector
<
Json
>
&&
elements
)
{
Json
json
{};
json
.
m_type
=
Type
::
ARRAY
;
int
index
=
0
;
for
(
auto
&
item
:
elements
)
json
.
m_children
[
std
::
to_string
(
index
++
)]
=
std
::
move
(
item
);
return
json
;
}
Json
Json
::
Obj
(
std
::
initializer_list
<
std
::
pair
<
std
::
string
,
Json
>>
&&
elements
)
{
Json
json
{};
...
...
src/utils/json.hpp
View file @
6759f50a
...
...
@@ -65,6 +65,8 @@ class Json
public:
static
Json
Arr
(
std
::
initializer_list
<
Json
>
&&
elements
);
static
Json
Arr
(
const
std
::
vector
<
Json
>
&
elements
);
static
Json
Arr
(
std
::
vector
<
Json
>
&&
elements
);
static
Json
Obj
(
std
::
initializer_list
<
std
::
pair
<
std
::
string
,
Json
>>
&&
elements
);
public:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment