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
canghaiwuhen
OpenXG-RAN
Commits
f86fb5df
Commit
f86fb5df
authored
Sep 28, 2020
by
zhanghuiqin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add RRCSetupRequest(ue→gnb)
parent
b46abe7b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
86 additions
and
0 deletions
+86
-0
openair2/RRC/NR/MESSAGES/asn1_msg.c
openair2/RRC/NR/MESSAGES/asn1_msg.c
+50
-0
openair2/RRC/NR_UE/rrc_UE.c
openair2/RRC/NR_UE/rrc_UE.c
+36
-0
No files found.
openair2/RRC/NR/MESSAGES/asn1_msg.c
View file @
f86fb5df
...
@@ -43,6 +43,7 @@
...
@@ -43,6 +43,7 @@
#include "asn1_msg.h"
#include "asn1_msg.h"
#include "RRC/NR/nr_rrc_extern.h"
#include "RRC/NR/nr_rrc_extern.h"
#include "NR_DL-CCCH-Message.h"
#include "NR_DL-CCCH-Message.h"
#include "NR_UL-CCCH-Message.h"
#include "NR_DL-DCCH-Message.h"
#include "NR_DL-DCCH-Message.h"
#include "NR_RRCReject.h"
#include "NR_RRCReject.h"
#include "NR_RejectWaitTime.h"
#include "NR_RejectWaitTime.h"
...
@@ -1064,3 +1065,52 @@ uint16_t do_RRCReconfiguration(
...
@@ -1064,3 +1065,52 @@ uint16_t do_RRCReconfiguration(
return
((
enc_rval
.
encoded
+
7
)
/
8
);
return
((
enc_rval
.
encoded
+
7
)
/
8
);
}
}
uint8_t
do_RRCSetupRequest
(
uint8_t
Mod_id
,
uint8_t
*
buffer
,
uint8_t
*
rv
)
{
asn_enc_rval_t
enc_rval
;
uint8_t
buf
[
5
],
buf2
=
0
;
NR_UL_CCCH_Message_t
ul_ccch_msg
;
NR_RRCSetupRequest_t
*
rrcSetupRequest
;
memset
((
void
*
)
&
ul_ccch_msg
,
0
,
sizeof
(
NR_UL_CCCH_Message_t
));
ul_ccch_msg
.
message
.
present
=
NR_UL_CCCH_MessageType_PR_c1
;
ul_ccch_msg
.
message
.
choice
.
c1
->
present
=
NR_UL_CCCH_MessageType__c1_PR_rrcSetupRequest
;
rrcSetupRequest
=
&
ul_ccch_msg
.
message
.
choice
.
c1
->
choice
.
rrcSetupRequest
;
if
(
1
)
{
rrcSetupRequest
->
rrcSetupRequest
.
ue_Identity
.
present
=
NR_InitialUE_Identity_PR_randomValue
;
rrcSetupRequest
->
rrcSetupRequest
.
ue_Identity
.
choice
.
randomValue
.
size
=
5
;
rrcSetupRequest
->
rrcSetupRequest
.
ue_Identity
.
choice
.
randomValue
.
bits_unused
=
0
;
rrcSetupRequest
->
rrcSetupRequest
.
ue_Identity
.
choice
.
randomValue
.
buf
=
buf
;
rrcSetupRequest
->
rrcSetupRequest
.
ue_Identity
.
choice
.
randomValue
.
buf
[
0
]
=
rv
[
0
];
rrcSetupRequest
->
rrcSetupRequest
.
ue_Identity
.
choice
.
randomValue
.
buf
[
1
]
=
rv
[
1
];
rrcSetupRequest
->
rrcSetupRequest
.
ue_Identity
.
choice
.
randomValue
.
buf
[
2
]
=
rv
[
2
];
rrcSetupRequest
->
rrcSetupRequest
.
ue_Identity
.
choice
.
randomValue
.
buf
[
3
]
=
rv
[
3
];
rrcSetupRequest
->
rrcSetupRequest
.
ue_Identity
.
choice
.
randomValue
.
buf
[
4
]
=
rv
[
4
];
}
else
{
rrcSetupRequest
->
rrcSetupRequest
.
ue_Identity
.
present
=
NR_InitialUE_Identity_PR_ng_5G_S_TMSI_Part1
;
rrcSetupRequest
->
rrcSetupRequest
.
ue_Identity
.
choice
.
ng_5G_S_TMSI_Part1
.
size
=
1
;
rrcSetupRequest
->
rrcSetupRequest
.
ue_Identity
.
choice
.
ng_5G_S_TMSI_Part1
.
bits_unused
=
0
;
rrcSetupRequest
->
rrcSetupRequest
.
ue_Identity
.
choice
.
ng_5G_S_TMSI_Part1
.
buf
=
buf
;
rrcSetupRequest
->
rrcSetupRequest
.
ue_Identity
.
choice
.
ng_5G_S_TMSI_Part1
.
buf
[
0
]
=
0x12
;
}
rrcSetupRequest
->
rrcSetupRequest
.
establishmentCause
=
NR_EstablishmentCause_mo_Signalling
;
//EstablishmentCause_mo_Data;
rrcSetupRequest
->
rrcSetupRequest
.
spare
.
buf
=
&
buf2
;
rrcSetupRequest
->
rrcSetupRequest
.
spare
.
size
=
1
;
rrcSetupRequest
->
rrcSetupRequest
.
spare
.
bits_unused
=
7
;
if
(
LOG_DEBUGFLAG
(
DEBUG_ASN1
)
)
{
xer_fprint
(
stdout
,
&
asn_DEF_NR_UL_CCCH_Message
,
(
void
*
)
&
ul_ccch_msg
);
}
enc_rval
=
uper_encode_to_buffer
(
&
asn_DEF_NR_UL_CCCH_Message
,
NULL
,
(
void
*
)
&
ul_ccch_msg
,
buffer
,
100
);
AssertFatal
(
enc_rval
.
encoded
>
0
,
"ASN1 message encoding failed (%s, %lu)!
\n
"
,
enc_rval
.
failed_type
->
name
,
enc_rval
.
encoded
);
LOG_D
(
RRC
,
"[UE] RRCSetupRequest Encoded %zd bits (%zd bytes)
\n
"
,
enc_rval
.
encoded
,
(
enc_rval
.
encoded
+
7
)
/
8
);
return
((
enc_rval
.
encoded
+
7
)
/
8
);
}
openair2/RRC/NR_UE/rrc_UE.c
View file @
f86fb5df
...
@@ -667,3 +667,39 @@ memset((void *)&ul_dcch_msg,0,sizeof(LTE_UL_DCCH_Message_t));
...
@@ -667,3 +667,39 @@ memset((void *)&ul_dcch_msg,0,sizeof(LTE_UL_DCCH_Message_t));
securityModeCommand
->
criticalExtensions
.
present
);
securityModeCommand
->
criticalExtensions
.
present
);
}
}
//-----------------------------------------------------------------------------
void
rrc_ue_generate_RRCSetupRequest
(
const
protocol_ctxt_t
*
const
ctxt_pP
,
const
uint8_t
gNB_index
)
{
uint8_t
i
=
0
,
rv
[
6
];
if
(
UE_rrc_inst
[
ctxt_pP
->
module_id
].
Srb0
[
gNB_index
].
Tx_buffer
.
payload_size
==
0
)
{
// Get RRCConnectionRequest, fill random for now
// Generate random byte stream for contention resolution
for
(
i
=
0
;
i
<
6
;
i
++
)
{
#ifdef SMBV
// if SMBV is configured the contention resolution needs to be fix for the connection procedure to succeed
rv
[
i
]
=
i
;
#else
rv
[
i
]
=
taus
()
&
0xff
;
#endif
LOG_T
(
RRC
,
"%x."
,
rv
[
i
]);
}
LOG_T
(
RRC
,
"
\n
"
);
UE_rrc_inst
[
ctxt_pP
->
module_id
].
Srb0
[
gNB_index
].
Tx_buffer
.
payload_size
=
do_RRCSetupRequest
(
ctxt_pP
->
module_id
,
(
uint8_t
*
)
UE_rrc_inst
[
ctxt_pP
->
module_id
].
Srb0
[
gNB_index
].
Tx_buffer
.
Payload
,
rv
);
LOG_I
(
RRC
,
"[UE %d] : Frame %d, Logical Channel UL-CCCH (SRB0), Generating RRCSetupRequest (bytes %d, eNB %d)
\n
"
,
ctxt_pP
->
module_id
,
ctxt_pP
->
frame
,
UE_rrc_inst
[
ctxt_pP
->
module_id
].
Srb0
[
gNB_index
].
Tx_buffer
.
payload_size
,
gNB_index
);
for
(
i
=
0
;
i
<
UE_rrc_inst
[
ctxt_pP
->
module_id
].
Srb0
[
gNB_index
].
Tx_buffer
.
payload_size
;
i
++
)
{
LOG_T
(
RRC
,
"%x."
,
UE_rrc_inst
[
ctxt_pP
->
module_id
].
Srb0
[
gNB_index
].
Tx_buffer
.
Payload
[
i
]);
}
LOG_T
(
RRC
,
"
\n
"
);
/*UE_rrc_inst[ue_mod_idP].Srb0[Idx].Tx_buffer.Payload[i] = taus()&0xff;
UE_rrc_inst[ue_mod_idP].Srb0[Idx].Tx_buffer.payload_size =i; */
}
}
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