Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-RAN
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
lizhongxiao
OpenXG-RAN
Commits
c7b2c19f
Commit
c7b2c19f
authored
Mar 15, 2022
by
frtabu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
go on websrv implem
parent
31755980
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
3 deletions
+12
-3
common/utils/websrv/websrv.c
common/utils/websrv/websrv.c
+12
-3
No files found.
common/utils/websrv/websrv.c
View file @
c7b2c19f
...
...
@@ -54,6 +54,12 @@
return
U_CALLBACK_CONTINUE
;
}
int
websrv_callback_get_softmodemcmd
(
const
struct
_u_request
*
request
,
struct
_u_response
*
response
,
void
*
user_data
)
{
char
*
cmd
=
(
char
*
)
user_data
;
LOG_I
(
UTIL
,
"websrv received %s command request
\n
"
,
cmd
);
return
U_CALLBACK_CONTINUE
;
}
int
websrv_callback_get_softmodeminfo
(
const
struct
_u_request
*
request
,
struct
_u_response
*
response
,
void
*
user_data
)
{
char
*
cfgfile
=
CONFIG_GETCONFFILE
;
char
*
execfunc
=
get_softmodem_function
(
NULL
);
...
...
@@ -68,8 +74,11 @@ int websrv_callback_get_softmodeminfo(const struct _u_request * request, struct
LOG_E
(
UTIL
,
"websrv cannot encode status info
\n
"
);
}
char
cmdnames
[
8192
]
=
"?"
;
json_t
*
cmdnames
=
json_array
()
;
for
(
int
i
=
0
;
telnetparams
->
CmdParsers
[
i
].
var
!=
NULL
&&
telnetparams
->
CmdParsers
[
i
].
cmd
!=
NULL
;
i
++
)
{
json_t
*
acmd
=
json_string
(
telnetparams
->
CmdParsers
[
i
].
module
);
json_array_append
(
cmdnames
,
acmd
);
ulfius_add_endpoint_by_val
(
websrvparams
.
instance
,
"GET"
,
"oaisoftmodem"
,
telnetparams
->
CmdParsers
[
i
].
module
,
0
,
&
websrv_callback_get_softmodemcmd
,
telnetparams
->
CmdParsers
[
i
].
module
);
// client_printf(" module %i = %s:\n",i,telnetparams.CmdParsers[i].module);
// for(j=0; telnetparams.CmdParsers[i].var[j].varvalptr != NULL ; j++) {
...
...
@@ -82,8 +91,8 @@ int websrv_callback_get_softmodeminfo(const struct _u_request * request, struct
// telnetparams.CmdParsers[i].module,telnetparams.CmdParsers[i].cmd[j].cmdname,
// telnetparams.CmdParsers[i].cmd[j].helpstr);
// }
}
json_t
*
cmds
=
json_pack
(
"{s
[s]
}"
,
"menu_cmds"
,
cmdnames
);
}
json_t
*
cmds
=
json_pack
(
"{s
o
}"
,
"menu_cmds"
,
cmdnames
);
if
(
cmds
==
NULL
)
{
LOG_E
(
UTIL
,
"websrv cannot encode cmds
\n
"
);
}
...
...
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