Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG UE
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
Michael Black
OpenXG UE
Commits
37cb2aca
Commit
37cb2aca
authored
May 30, 2020
by
Andrew Burger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
OAI UE receive dl_config_request and call memcpy additions
parent
d6780786
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
76 additions
and
25 deletions
+76
-25
openair2/PHY_INTERFACE/phy_stub_UE.c
openair2/PHY_INTERFACE/phy_stub_UE.c
+62
-7
openair2/PHY_INTERFACE/phy_stub_UE.h
openair2/PHY_INTERFACE/phy_stub_UE.h
+3
-0
targets/RT/USER/lte-softmodem.h
targets/RT/USER/lte-softmodem.h
+1
-0
targets/RT/USER/lte-ue.c
targets/RT/USER/lte-ue.c
+7
-0
targets/RT/USER/lte-uesoftmodem.c
targets/RT/USER/lte-uesoftmodem.c
+3
-18
No files found.
openair2/PHY_INTERFACE/phy_stub_UE.c
View file @
37cb2aca
...
...
@@ -1056,25 +1056,80 @@ int ue_init_standalone_socket(const char *addr, int port)
int
sd
=
socket
(
server_address
.
sin_family
,
SOCK_STREAM
,
IPPROTO_SCTP
);
if
(
sd
<
0
)
{
LOG_E
(
MAC
,
"Socket creation error standalone PNF"
);
LOG_E
(
MAC
,
"Socket creation error standalone PNF
\n
"
);
return
-
1
;
}
if
(
inet_pton
(
server_address
.
sin_family
,
addr
,
&
server_address
.
sin_addr
)
<=
0
)
{
LOG_E
(
MAC
,
"Invalid standalone PNF Address"
);
LOG_E
(
MAC
,
"Invalid standalone PNF Address
\n
"
);
close
(
sd
);
return
-
1
;
}
if
(
connect
(
sd
,
(
struct
sockaddr
*
)
&
server_address
,
addr_len
)
<
0
)
{
LOG_E
(
MAC
,
"Connection to standalone PNF failed"
);
close
(
sd
);
return
-
1
;
while
(
connect
(
sd
,
(
struct
sockaddr
*
)
&
server_address
,
addr_len
)
<
0
)
{
LOG_E
(
MAC
,
"Connection to standalone PNF failed: %s
\n
"
,
strerror
(
errno
));
sleep
(
1
);
}
LOG_I
(
MAC
,
"Succeeded Now
\n
"
);
return
sd
;
}
void
*
ue_standalone_pnf_task
(
void
*
context
)
{
const
char
*
standalone_addr
=
"127.0.0.1"
;
int
standalone_port
=
3289
;
char
buffer
[
1024
];
int
sd
=
ue_init_standalone_socket
(
standalone_addr
,
standalone_port
);
while
(
true
)
{
ssize_t
len
=
read
(
sd
,
buffer
,
sizeof
(
buffer
));
if
(
len
==
-
1
)
{
LOG_E
(
MAC
,
"reading from standalone pnf sctp socket failed
\n
"
);
continue
;
}
nfapi_p7_message_header_t
header
;
if
(
nfapi_p7_message_header_unpack
((
void
*
)
buffer
,
len
,
&
header
,
sizeof
(
header
),
NULL
)
<
0
)
{
LOG_E
(
MAC
,
"Header unpack failed for standalone pnf
\n
"
);
continue
;
}
LOG_I
(
MAC
,
"Bruins header_t.message_id: %u
\n
"
,
header
.
message_id
);
switch
(
header
.
message_id
)
{
case
NFAPI_DL_CONFIG_REQUEST
:
{
nfapi_dl_config_request_t
dl_config_req
;
if
(
nfapi_p7_message_unpack
((
void
*
)
buffer
,
len
,
&
dl_config_req
,
sizeof
(
dl_config_req
),
NULL
)
<
0
)
{
LOG_E
(
MAC
,
"Message dl_config_req failed to unpack
\n
"
);
}
else
{
LOG_I
(
MAC
,
"Sending dl_config_req to memcpy function
\n
"
);
memcpy_dl_config_req
(
NULL
,
NULL
,
&
dl_config_req
);
}
break
;
}
case
NFAPI_TX_REQUEST
:
break
;
case
NFAPI_HI_DCI0_REQUEST
:
break
;
default:
LOG_E
(
MAC
,
"Case Statement has no corresponding nfapi message
\n
"
);
break
;
}
}
}
/* Dummy functions*/
void
handle_nfapi_hi_dci0_dci_pdu
(
...
...
openair2/PHY_INTERFACE/phy_stub_UE.h
View file @
37cb2aca
...
...
@@ -134,6 +134,9 @@ void UE_config_stub_pnf(void);
// This function is used to open an SCTP socket with a standalone PNF module
int
ue_init_standalone_socket
(
const
char
*
addr
,
int
port
);
// This function is used to read from standalone pnf socket call corresponding memcpy functions
void
*
ue_standalone_pnf_task
(
void
*
context
);
#endif
/* PHY_STUB_UE_H_ */
targets/RT/USER/lte-softmodem.h
View file @
37cb2aca
...
...
@@ -206,6 +206,7 @@ extern int stop_L1L2(module_id_t enb_id);
extern
int
restart_L1L2
(
module_id_t
enb_id
);
extern
void
init_UE_stub_single_thread
(
int
nb_inst
,
int
eMBMS_active
,
int
uecap_xer_in
,
char
*
emul_iface
);
extern
void
init_UE_standalone_thread
(
void
);
extern
PHY_VARS_UE
*
init_ue_vars
(
LTE_DL_FRAME_PARMS
*
frame_parms
,
uint8_t
UE_id
,
uint8_t
abstraction_flag
);
...
...
targets/RT/USER/lte-ue.c
View file @
37cb2aca
...
...
@@ -422,6 +422,13 @@ void init_UE_stub_single_thread(int nb_inst,
multicast_link_start
(
ue_stub_rx_handler
,
0
,
emul_iface
);
}
void
init_UE_standalone_thread
()
{
pthread_t
thread
;
if
(
pthread_create
(
&
thread
,
NULL
,
ue_standalone_pnf_task
,
NULL
)
!=
0
)
{
LOG_E
(
MAC
,
"pthread_create failed for calling ue_standalone_pnf_task"
);
}
}
void
init_UE_stub
(
int
nb_inst
,
int
eMBMS_active
,
...
...
targets/RT/USER/lte-uesoftmodem.c
View file @
37cb2aca
...
...
@@ -711,26 +711,11 @@ int main( int argc, char **argv ) {
}
// hard-coding address and port for now fix later
int
sd
=
-
1
;
// beggining of test
if
(
NFAPI_MODE
==
NFAPI_MODE_STANDALONE_PNF
)
{
const
char
*
standalone_addr
=
"127.0.0.1"
;
int
standalone_port
=
3289
;
char
buffy
[
1024
];
sd
=
ue_init_standalone_socket
(
standalone_addr
,
standalone_port
);
ssize_t
len
=
read
(
sd
,
buffy
,
sizeof
(
buffy
));
if
(
len
==
-
1
)
{
printf
(
"reading from standalone pnf sctp socket failed
\n
"
);
return
EXIT_FAILURE
;
}
nfapi_p7_message_header_t
header_t
;
if
(
nfapi_p7_message_header_unpack
((
void
*
)
buffy
,
len
,
&
header_t
,
sizeof
(
header_t
),
NULL
)
!=
0
)
{
printf
(
"unpacking p7 message failed from standalone pnf
\n
"
);
printf
(
"Bruins header_t.message_id: %u"
,
header_t
.
message_id
);
}
init_UE_standalone_thread
();
}
// end of test
printf
(
"ITTI tasks created
\n
"
);
mlockall
(
MCL_CURRENT
|
MCL_FUTURE
);
rt_sleep_ns
(
10
*
100000000ULL
);
...
...
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