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
spbro
OpenXG-RAN
Commits
d4102b55
Commit
d4102b55
authored
Jan 22, 2018
by
William Johnson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Resolved issues with PC5-D implementation.
parent
7fb0902d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
19 deletions
+35
-19
openair2/LAYER2/MAC/ue_procedures.c
openair2/LAYER2/MAC/ue_procedures.c
+7
-1
openair2/RRC/LITE/defs.h
openair2/RRC/LITE/defs.h
+7
-3
openair2/RRC/LITE/rrc_UE.c
openair2/RRC/LITE/rrc_UE.c
+21
-15
No files found.
openair2/LAYER2/MAC/ue_procedures.c
View file @
d4102b55
...
...
@@ -797,18 +797,24 @@ void ue_send_sl_sdu(module_id_t module_idP,
NULL
);
}
else
{
//SL_DISCOVERY
<<<<<<<
7
fb0902dbc37c2a91252b7b956d2c0158d3b2ff5
//call mac_rrc_data_ind
uint16_t
len
=
sdu_len
;
printf
(
"SL DISCOVERY: "
);
for
(
int
i
=
0
;
i
<
len
;
i
++
)
printf
(
"%x "
,((
uint8_t
*
)
sdu
)[
i
]);
printf
(
"
\n
"
);
=======
LOG_I
(
MAC
,
"SL DISCOVERY
\n
"
);
//call mac_rrc_data_ind
//uint16_t len;
>>>>>>>
Resolved
issues
with
PC5
-
D
implementation
.
mac_rrc_data_ind
(
module_idP
,
CC_id
,
frameP
,
subframeP
,
UE_mac_inst
[
module_idP
].
crnti
,
SL_DISCOVERY
,
sdu
,
//(uint8_t*)&UE_mac_inst[Mod_id].SL_Discovery[0].Rx_buffer.Payload[0],
len
,
sdu_
len
,
ENB_FLAG_NO
,
eNB_index
,
0
);
...
...
openair2/RRC/LITE/defs.h
View file @
d4102b55
...
...
@@ -87,7 +87,10 @@
#define GROUP_COMMUNICATION_RELEASE_RSP 8
#define PC5S_ESTABLISH_REQ 9
#define PC5S_ESTABLISH_RSP 10
#define PC5_DISCOVERY_MESSAGE 11
#define PC5_DISCOVERY_MESSAGE 11
#define PC5_DISCOVERY_PAYLOAD_SIZE 29
typedef
enum
{
...
...
@@ -132,9 +135,10 @@ struct PC5SEstablishRsp{
uint8_t
status
;
};
//
example of PC5_DSICOVERY MESSAGE (for testing only)
//
PC5_DISCOVERY MESSAGE
typedef
struct
{
unsigned
char
bytes
[
29
];
unsigned
char
payload
[
PC5_DISCOVERY_PAYLOAD_SIZE
];
uint32_t
measuredPower
;
}
__attribute__
((
__packed__
))
PC5DiscoveryMessage
;
...
...
openair2/RRC/LITE/rrc_UE.c
View file @
d4102b55
...
...
@@ -5806,15 +5806,13 @@ void *rrc_control_socket_thread_fct(void *arg)
#ifdef DEBUG_CTRL_SOCKET
LOG_I
(
RRC
,
"[PC5DiscoveryMessage] Received on socket from ProSe App (msg type: %d)
\n
"
,
sl_ctrl_msg_recv
->
type
);
// LOG_I(RRC,"[PC5DiscoveryMessage] type: %d\n",sl_ctrl_msg_recv->sidelinkPrimitive.pc5_discovery_message.msg_type);
// LOG_D(RRC,"[PC5DiscoveryMessage] discoveryGroupId: 0x%08x\n",sl_ctrl_msg_recv->sidelinkPrimitive.pc5_discovery_message.discoveryGroupId);
// LOG_D(RRC,"[PC5DiscoveryMessage] proSeUEId: 0x%08x\n",sl_ctrl_msg_recv->sidelinkPrimitive.pc5_discovery_message.proSeUEId);
#endif
//prepare SL_Discovery buffer
if
(
UE_rrc_inst
)
{
memcpy
((
void
*
)
&
UE_rrc_inst
[
module_id
].
SL_Discovery
[
0
].
Tx_buffer
.
Payload
[
0
],
(
void
*
)
receive_buf
,
n
);
UE_rrc_inst
[
module_id
].
SL_Discovery
[
0
].
Tx_buffer
.
payload_size
=
n
;
LOG_I
(
RRC
,
"[PC5DiscoveryMessage] Copied %d bytes
\n
"
,
n
);
memcpy
((
void
*
)
&
UE_rrc_inst
[
module_id
].
SL_Discovery
[
0
].
Tx_buffer
.
Payload
[
0
],
(
void
*
)
&
sl_ctrl_msg_recv
->
sidelinkPrimitive
.
pc5_discovery_message
.
payload
[
0
],
PC5_DISCOVERY_PAYLOAD_SIZE
);
//memcpy((void*)&UE_rrc_inst[module_id].SL_Discovery[0].Tx_buffer.Payload[0], (void*)receive_buf, n);
UE_rrc_inst
[
module_id
].
SL_Discovery
[
0
].
Tx_buffer
.
payload_size
=
PC5_DISCOVERY_PAYLOAD_SIZE
;
LOG_I
(
RRC
,
"[PC5DiscoveryMessage] Copied %d bytes
\n
"
,
PC5_DISCOVERY_PAYLOAD_SIZE
);
}
break
;
default:
...
...
@@ -5837,9 +5835,8 @@ int decode_SL_Discovery_Message(
int
prose_addr_len
;
char
send_buf
[
BUFSIZE
];
int
n
;
struct
sidelink_ctrl_element
*
sl_ctrl_msg_
recv
=
NULL
;
struct
sidelink_ctrl_element
*
sl_ctrl_msg_
send
=
NULL
;
LOG_I
(
RRC
,
"[decode_SL_Discovery_Message] received %d bytes (sizeof(struct sidelink_ctrl_element) %d)
\n
"
,
Sdu_len
,
sizeof
(
struct
sidelink_ctrl_element
));
//from the main program, listen for the incoming messages from control socket (ProSe App)
prose_addr_len
=
sizeof
(
prose_app_addr
);
...
...
@@ -5847,21 +5844,30 @@ int decode_SL_Discovery_Message(
memcpy
((
void
*
)
&
UE_rrc_inst
[
ctxt_pP
->
module_id
].
SL_Discovery
[
0
].
Rx_buffer
.
Payload
[
0
],
(
void
*
)
Sdu
,
Sdu_len
);
UE_rrc_inst
[
ctxt_pP
->
module_id
].
SL_Discovery
[
0
].
Rx_buffer
.
payload_size
=
Sdu_len
;
sl_ctrl_msg_recv
=
calloc
(
1
,
sizeof
(
struct
sidelink_ctrl_element
));
memcpy
((
void
*
)
sl_ctrl_msg_recv
,
(
void
*
)
Sdu
,
sizeof
(
struct
sidelink_ctrl_element
));
LOG_I
(
RRC
,
"[decode_SL_Discovery_Message] Message type %d
\n
"
,
sl_ctrl_msg_recv
->
type
);
memset
(
send_buf
,
0
,
BUFSIZE
);
//send to ProSeApp
memcpy
((
void
*
)
send_buf
,
(
void
*
)
Sdu
,
Sdu_len
);
prose_addr_len
=
sizeof
(
prose_app_addr
);
n
=
sendto
(
ctrl_sock_fd
,
(
char
*
)
send_buf
,
Sdu_len
,
0
,
(
struct
sockaddr
*
)
&
prose_app_addr
,
prose_addr_len
);
sl_ctrl_msg_send
=
calloc
(
1
,
sizeof
(
struct
sidelink_ctrl_element
));
sl_ctrl_msg_send
->
type
=
PC5_DISCOVERY_MESSAGE
;
int
num_bytes
=
29
;
// TODO: Add a check for the SDU size.
memcpy
((
void
*
)
&
sl_ctrl_msg_send
->
sidelinkPrimitive
.
pc5_discovery_message
.
payload
[
0
],
(
void
*
)
Sdu
,
num_bytes
);
memcpy
((
void
*
)
send_buf
,
(
void
*
)
sl_ctrl_msg_send
,
sizeof
(
struct
sidelink_ctrl_element
));
free
(
sl_ctrl_msg_send
);
prose_addr_len
=
sizeof
(
prose_app_addr
);
n
=
sendto
(
ctrl_sock_fd
,
(
char
*
)
send_buf
,
sizeof
(
struct
sidelink_ctrl_element
),
0
,
(
struct
sockaddr
*
)
&
prose_app_addr
,
prose_addr_len
);
if
(
n
<
0
){
LOG_E
(
RRC
,
"ERROR: Failed to send to ProSe App
\n
"
);
// TODO: We should not just exit if the Prose App has not yet attached. It creates a race condition.
LOG_I
(
RRC
,
"ERROR: Failed to send to ProSe App
\n
"
);
//exit(EXIT_FAILURE);
}
free
(
sl_ctrl_msg_recv
);
return
(
0
);
}
...
...
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