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
zzha zzha
OpenXG-RAN
Commits
971bacb7
Commit
971bacb7
authored
Mar 27, 2023
by
francescomani
Committed by
Robert Schmidt
Apr 14, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
clang warning fixes to compile rfsimulator
parent
5d38a999
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
19 deletions
+19
-19
radio/rfsimulator/simulator.c
radio/rfsimulator/simulator.c
+19
-19
No files found.
radio/rfsimulator/simulator.c
View file @
971bacb7
...
...
@@ -77,15 +77,15 @@
/*-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
#define simOpt PARAMFLAG_NOFREE|PARAMFLAG_CMDLINE_NOPREFIXENABLED
#define RFSIMULATOR_PARAMS_DESC { \
{"serveraddr", "<ip address to connect to>\n", simOpt,
strptr:&rfsimulator->ip, defstrval:
"127.0.0.1", TYPE_STRING, 0 },\
{"serverport", "<port to connect to>\n", simOpt,
u16ptr:&(rfsimulator->port), defuintval:
PORT, TYPE_UINT16, 0 },\
{RFSIMU_OPTIONS_PARAMNAME, RFSIM_CONFIG_HELP_OPTIONS, 0,
strlistptr:NULL, defstrlistval:
NULL, TYPE_STRINGLIST,0 },\
{"IQfile", "<file path to use when saving IQs>\n",simOpt,
strptr:&saveF, defstrval:
"/tmp/rfsimulator.iqs",TYPE_STRING, 0 },\
{"modelname", "<channel model name>\n", simOpt,
strptr:&modelname, defstrval:
"AWGN", TYPE_STRING, 0 },\
{"ploss", "<channel path loss in dB>\n", simOpt,
dblptr:&(rfsimulator->chan_pathloss), defdblval:
0, TYPE_DOUBLE, 0 },\
{"forgetfact", "<channel forget factor ((0 to 1)>\n", simOpt,
dblptr:&(rfsimulator->chan_forgetfact), defdblval:
0, TYPE_DOUBLE, 0 },\
{"offset", "<channel offset in samps>\n", simOpt,
iptr:&(rfsimulator->chan_offset), defintval:
0, TYPE_INT, 0 },\
{"wait_timeout", "<wait timeout if no UE connected>\n", simOpt,
iptr:&(rfsimulator->wait_timeout), defintval:
1, TYPE_INT, 0 },\
{"serveraddr", "<ip address to connect to>\n", simOpt,
.strptr=&rfsimulator->ip, .defstrval=
"127.0.0.1", TYPE_STRING, 0 },\
{"serverport", "<port to connect to>\n", simOpt,
.u16ptr=&(rfsimulator->port), .defuintval=
PORT, TYPE_UINT16, 0 },\
{RFSIMU_OPTIONS_PARAMNAME, RFSIM_CONFIG_HELP_OPTIONS, 0,
.strlistptr=NULL, .defstrlistval=
NULL, TYPE_STRINGLIST,0 },\
{"IQfile", "<file path to use when saving IQs>\n",simOpt,
.strptr=&saveF, .defstrval=
"/tmp/rfsimulator.iqs",TYPE_STRING, 0 },\
{"modelname", "<channel model name>\n", simOpt,
.strptr=&modelname, .defstrval=
"AWGN", TYPE_STRING, 0 },\
{"ploss", "<channel path loss in dB>\n", simOpt,
.dblptr=&(rfsimulator->chan_pathloss), .defdblval=
0, TYPE_DOUBLE, 0 },\
{"forgetfact", "<channel forget factor ((0 to 1)>\n", simOpt,
.dblptr=&(rfsimulator->chan_forgetfact),.defdblval=
0, TYPE_DOUBLE, 0 },\
{"offset", "<channel offset in samps>\n", simOpt,
.iptr=&(rfsimulator->chan_offset), .defintval=
0, TYPE_INT, 0 },\
{"wait_timeout", "<wait timeout if no UE connected>\n", simOpt,
.iptr=&(rfsimulator->wait_timeout), .defintval=
1, TYPE_INT, 0 },\
};
static
void
getset_currentchannels_type
(
char
*
buf
,
int
debug
,
webdatadef_t
*
tdata
,
telnet_printfunc_t
prnt
);
...
...
@@ -557,12 +557,12 @@ static int startServer(openair0_device *device) {
int
enable
=
1
;
AssertFatal
(
setsockopt
(
t
->
listen_sock
,
SOL_SOCKET
,
SO_REUSEADDR
,
&
enable
,
sizeof
(
int
))
==
0
,
""
);
struct
sockaddr_in
addr
=
{
sin_family:
.
sin_family
=
AF_INET
,
sin_port:
.
sin_port
=
htons
(
t
->
port
),
sin_addr:
{
s_addr
:
INADDR_ANY
}
.
sin_addr
=
{
.
s_addr
=
INADDR_ANY
}
};
int
rc
=
bind
(
t
->
listen_sock
,
(
struct
sockaddr
*
)
&
addr
,
sizeof
(
addr
));
AssertFatal
(
rc
==
0
,
"bind failed: errno %d, %s"
,
errno
,
strerror
(
errno
));
...
...
@@ -580,12 +580,12 @@ static int startClient(openair0_device *device) {
int
sock
;
AssertFatal
((
sock
=
socket
(
AF_INET
,
SOCK_STREAM
,
0
))
>=
0
,
""
);
struct
sockaddr_in
addr
=
{
sin_family:
.
sin_family
=
AF_INET
,
sin_port:
.
sin_port
=
htons
(
t
->
port
),
sin_addr:
{
s_addr
:
INADDR_ANY
}
.
sin_addr
=
{
.
s_addr
=
INADDR_ANY
}
};
addr
.
sin_addr
.
s_addr
=
inet_addr
(
t
->
ip
);
bool
connected
=
false
;
...
...
@@ -634,7 +634,7 @@ static int rfsimulator_write_internal(rfsimulator_state_t *t, openair0_timestamp
}
}
if
(
t
->
lastWroteTS
!=
0
&&
abs
((
double
)
t
->
lastWroteTS
-
timestamp
)
>
(
double
)
CirSize
)
if
(
t
->
lastWroteTS
!=
0
&&
f
abs
((
double
)
t
->
lastWroteTS
-
timestamp
)
>
(
double
)
CirSize
)
LOG_E
(
HW
,
"Discontinuous TX gap too large Tx:%lu, %lu
\n
"
,
t
->
lastWroteTS
,
timestamp
);
if
(
t
->
lastWroteTS
>
timestamp
+
nsamps
)
...
...
@@ -770,7 +770,7 @@ static bool flushInput(rfsimulator_state_t *t, int timeout, int nsamps_for_initi
pthread_mutex_lock
(
&
Sockmutex
);
if
(
t
->
lastWroteTS
!=
0
&&
(
abs
((
double
)
t
->
lastWroteTS
-
b
->
lastReceivedTS
)
>
(
double
)
CirSize
))
if
(
t
->
lastWroteTS
!=
0
&&
(
f
abs
((
double
)
t
->
lastWroteTS
-
b
->
lastReceivedTS
)
>
(
double
)
CirSize
))
LOG_E
(
HW
,
"UEsock: %d Tx/Rx shift too large Tx:%lu, Rx:%lu
\n
"
,
fd
,
t
->
lastWroteTS
,
b
->
lastReceivedTS
);
pthread_mutex_unlock
(
&
Sockmutex
);
...
...
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