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
2a946eb8
Commit
2a946eb8
authored
May 18, 2019
by
laurent
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix UE switch from read only to R+W
parent
290ca22d
Changes
3
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
1354 additions
and
6 deletions
+1354
-6
cmake_targets/CMakeLists.txt
cmake_targets/CMakeLists.txt
+24
-0
executables/gNBmain.c
executables/gNBmain.c
+1313
-0
targets/ARCH/rfsimulator/simulator.c
targets/ARCH/rfsimulator/simulator.c
+17
-6
No files found.
cmake_targets/CMakeLists.txt
View file @
2a946eb8
...
...
@@ -2377,6 +2377,30 @@ target_link_libraries (nr-softmodem pthread m ${CONFIG_LIBRARIES} rt crypt ${CRY
target_link_libraries
(
nr-softmodem
${
LIB_LMS_LIBRARIES
}
)
target_link_libraries
(
nr-softmodem
${
T_LIB
}
)
add_executable
(
ocpsoftmodem
${
OPENAIR_DIR
}
/executables/gNBmain.c
${
OPENAIR1_DIR
}
/SIMULATION/TOOLS/taus.c
${
OPENAIR_TARGETS
}
/ARCH/COMMON/common_lib.c
${
OPENAIR_DIR
}
/common/utils/utils.c
${
OPENAIR_DIR
}
/common/utils/system.c
${
GTPU_need_ITTI
}
${
T_SOURCE
}
${
CONFIG_SOURCES
}
${
SHLIB_LOADER_SOURCES
}
)
target_link_libraries
(
ocpsoftmodem
-Wl,--start-group
UTIL HASHTABLE SCTP_CLIENT UDP SCHED_LIB SCHED_RU_LIB SCHED_NR_LIB PHY_NR PHY PHY_COMMON PHY_RU LFDS GTPV1U SECU_CN SECU_OSA
${
ITTI_LIB
}
${
FLPT_MSG_LIB
}
${
ASYNC_IF_LIB
}
${
FLEXRAN_AGENT_LIB
}
LFDS7
${
MSC_LIB
}
${
RAL_LIB
}
${
NAS_UE_LIB
}
RRC_LIB NR_RRC_LIB S1AP_LIB S1AP_ENB L2 L2_NR MAC_NR_COMMON
NFAPI_COMMON_LIB NFAPI_LIB NFAPI_VNF_LIB NFAPI_PNF_LIB NFAPI_USER_LIB
-Wl,--end-group z dl
)
target_link_libraries
(
ocpsoftmodem
${
LIBXML2_LIBRARIES
}
)
target_link_libraries
(
ocpsoftmodem pthread m
${
CONFIG_LIBRARIES
}
rt crypt
${
CRYPTO_LIBRARIES
}
${
OPENSSL_LIBRARIES
}
${
NETTLE_LIBRARIES
}
sctp
${
PROTOBUF_LIB
}
${
CMAKE_DL_LIBS
}
${
LIBYAML_LIBRARIES
}
${
ATLAS_LIBRARIES
}
)
target_link_libraries
(
ocpsoftmodem
${
LIB_LMS_LIBRARIES
}
)
# nr-softmodem-nos1
###################################################
...
...
executables/gNBmain.c
0 → 100644
View file @
2a946eb8
This diff is collapsed.
Click to expand it.
targets/ARCH/rfsimulator/simulator.c
View file @
2a946eb8
...
...
@@ -3,6 +3,12 @@
copyleft: OpenAirInterface Software Alliance and it's licence
*/
/*
* Open issues and limitations
* The read and write should be called in the same thread, that is not new USRP UHD design
* When the opposite side switch from passive reading to active R+Write, the synchro is not fully deterministic
*/
#include <sys/socket.h>
#include <netinet/in.h>
#include <netinet/tcp.h>
...
...
@@ -111,7 +117,7 @@ void setblocking(int sock, enum blocking_t active) {
AssertFatal
(
fcntl
(
sock
,
F_SETFL
,
opts
)
>=
0
,
""
);
}
static
bool
flushInput
(
rfsimulator_state_t
*
t
);
static
bool
flushInput
(
rfsimulator_state_t
*
t
,
int
timeout
);
void
fullwrite
(
int
fd
,
void
*
_buf
,
ssize_t
count
,
rfsimulator_state_t
*
t
)
{
if
(
t
->
saveIQfile
!=
-
1
)
{
...
...
@@ -134,7 +140,9 @@ void fullwrite(int fd, void *_buf, ssize_t count, rfsimulator_state_t *t) {
continue
;
if
(
errno
==
EAGAIN
)
{
flushInput
(
t
);
// The opposite side is saturated
// we read incoming sockets meawhile waiting
flushInput
(
t
,
5
);
continue
;
}
else
return
;
...
...
@@ -229,14 +237,17 @@ int rfsimulator_write(openair0_device *device, openair0_timestamp timestamp, voi
lastW
=
timestamp
;
LOG_D
(
HW
,
"sent %d samples at time: %ld->%ld, energy in first antenna: %d
\n
"
,
nsamps
,
timestamp
,
timestamp
+
nsamps
,
signal_energy
(
samplesVoid
[
0
],
nsamps
)
);
// Let's verify we don't have incoming data
// This is mandatory when the opposite side don't transmit
flushInput
(
t
,
0
);
return
nsamps
;
}
static
bool
flushInput
(
rfsimulator_state_t
*
t
)
{
static
bool
flushInput
(
rfsimulator_state_t
*
t
,
int
timeout
)
{
// Process all incoming events on sockets
// store the data in lists
struct
epoll_event
events
[
FD_SETSIZE
]
=
{
0
};
int
nfds
=
epoll_wait
(
t
->
epollfd
,
events
,
FD_SETSIZE
,
20
);
int
nfds
=
epoll_wait
(
t
->
epollfd
,
events
,
FD_SETSIZE
,
timeout
);
if
(
nfds
==-
1
)
{
if
(
errno
==
EINTR
||
errno
==
EAGAIN
)
...
...
@@ -356,7 +367,7 @@ int rfsimulator_read(openair0_device *device, openair0_timestamp *ptimestamp, vo
if
(
first_sock
==
FD_SETSIZE
)
{
// no connected device (we are eNB, no UE is connected)
if
(
!
flushInput
(
t
))
{
if
(
!
flushInput
(
t
,
10
))
{
for
(
int
x
=
0
;
x
<
nbAnt
;
x
++
)
memset
(
samplesVoid
[
x
],
0
,
sampleToByte
(
nsamps
,
1
));
...
...
@@ -385,7 +396,7 @@ int rfsimulator_read(openair0_device *device, openair0_timestamp *ptimestamp, vo
ptr->lastReceivedTS,
t->nextTimestamp+nsamps);
*/
flushInput
(
t
);
flushInput
(
t
,
3
);
}
while
(
have_to_wait
);
}
...
...
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