Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
U
UERANSIM
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
Libraries
UERANSIM
Commits
fd300697
Commit
fd300697
authored
May 17, 2021
by
aligungr
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
RRC developments
parent
bda839bc
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
77 additions
and
24 deletions
+77
-24
src/ue/nts.hpp
src/ue/nts.hpp
+6
-3
src/ue/rls/ctl_task.cpp
src/ue/rls/ctl_task.cpp
+1
-1
src/ue/rls/task.cpp
src/ue/rls/task.cpp
+17
-0
src/ue/rrc/idle.cpp
src/ue/rrc/idle.cpp
+31
-16
src/ue/rrc/task.hpp
src/ue/rrc/task.hpp
+2
-2
src/utils/common_types.cpp
src/utils/common_types.cpp
+17
-0
src/utils/common_types.hpp
src/utils/common_types.hpp
+1
-0
src/utils/locked.hpp
src/utils/locked.hpp
+2
-2
No files found.
src/ue/nts.hpp
View file @
fd300697
...
...
@@ -113,10 +113,13 @@ struct NwUeRrcToRls : NtsMessage
{
enum
PR
{
ASSIGN_CURRENT_CELL
,
RRC_PDU_DELIVERY
,
RESET_STI
,
}
present
;
// ASSIGN_CURRENT_CELL
int
cellId
{};
// RRC_PDU_DELIVERY
rrc
::
RrcChannel
channel
{};
OctetString
pdu
{};
...
...
@@ -251,14 +254,14 @@ struct NwUeRlsToRls : NtsMessage
DOWNLINK_RRC
,
RADIO_LINK_FAILURE
,
TRANSMISSION_FAILURE
,
ASSIGN_
SERVING
_CELL
,
ASSIGN_
CURRENT
_CELL
,
}
present
;
// RECEIVE_RLS_MESSAGE
// UPLINK_RRC
// DOWNLINK_RRC
// SIGNAL_CHANGED
// ASSIGN_
SERVING
_CELL
// ASSIGN_
CURRENT
_CELL
int
cellId
{};
// RECEIVE_RLS_MESSAGE
...
...
src/ue/rls/ctl_task.cpp
View file @
fd300697
...
...
@@ -64,7 +64,7 @@ void RlsControlTask::onLoop()
case
NwUeRlsToRls
:
:
UPLINK_RRC
:
handleUplinkRrcDelivery
(
w
->
cellId
,
w
->
pduId
,
w
->
rrcChannel
,
std
::
move
(
w
->
data
));
break
;
case
NwUeRlsToRls
:
:
ASSIGN_
SERVING
_CELL
:
case
NwUeRlsToRls
:
:
ASSIGN_
CURRENT
_CELL
:
m_servingCell
=
w
->
cellId
;
break
;
default:
...
...
src/ue/rls/task.cpp
View file @
fd300697
...
...
@@ -80,6 +80,23 @@ void UeRlsTask::onLoop()
}
break
;
}
case
NtsMessageType
:
:
UE_RRC_TO_RLS
:
{
auto
*
w
=
dynamic_cast
<
NwUeRrcToRls
*>
(
msg
);
switch
(
w
->
present
)
{
case
NwUeRrcToRls
:
:
ASSIGN_CURRENT_CELL
:
{
auto
*
m
=
new
NwUeRlsToRls
(
NwUeRlsToRls
::
ASSIGN_CURRENT_CELL
);
m
->
cellId
=
w
->
cellId
;
m_ctlTask
->
push
(
m
);
break
;
}
case
NwUeRrcToRls
:
:
RRC_PDU_DELIVERY
:
{
break
;
}
}
break
;
}
default:
m_logger
->
unhandledNts
(
msg
);
break
;
...
...
src/ue/rrc/idle.cpp
View file @
fd300697
...
...
@@ -12,6 +12,7 @@
#include <lib/rrc/encode.hpp>
#include <ue/nas/task.hpp>
#include <ue/rls/task.hpp>
namespace
nr
::
ue
{
...
...
@@ -21,18 +22,40 @@ void UeRrcTask::performCellSelection()
if
(
m_state
==
ERrcState
::
RRC_CONNECTED
)
return
;
if
(
!
lookForSuitableCell
())
lookForAcceptableCell
();
int
lastCell
=
m_base
->
shCtx
.
currentCell
.
get
<
int
>
([](
auto
&
value
)
{
return
value
.
cellId
;
});
CurrentCellInfo
cellInfo
;
if
(
!
lookForSuitableCell
(
cellInfo
))
{
lookForAcceptableCell
(
cellInfo
);
}
int
selectedCell
=
cellInfo
.
cellId
;
m_base
->
shCtx
.
currentCell
.
set
(
cellInfo
);
if
(
selectedCell
!=
0
&&
selectedCell
!=
lastCell
)
{
m_logger
->
info
(
"Selected cell id[%d] category[%s]"
,
selectedCell
,
ToJson
(
cellInfo
.
category
).
str
().
c_str
());
}
if
(
selectedCell
!=
lastCell
)
{
auto
*
w
=
new
NwUeRrcToRls
(
NwUeRrcToRls
::
ASSIGN_CURRENT_CELL
);
w
->
cellId
=
selectedCell
;
m_base
->
rlsTask
->
push
(
w
);
m_base
->
nasTask
->
push
(
new
NwUeRrcToNas
(
NwUeRrcToNas
::
NAS_NOTIFY
));
}
}
bool
UeRrcTask
::
lookForSuitableCell
()
bool
UeRrcTask
::
lookForSuitableCell
(
CurrentCellInfo
&
cellInfo
)
{
Plmn
selectedPlmn
=
m_base
->
shCtx
.
selectedPlmn
.
get
();
if
(
!
selectedPlmn
.
hasValue
())
return
false
;
int
lastCell
=
m_base
->
shCtx
.
currentCell
.
get
<
int
>
([](
auto
&
value
)
{
return
value
.
cellId
;
});
int
outOfPlmnCells
=
0
;
int
sib1MissingCells
=
0
;
int
barredCells
=
0
;
...
...
@@ -72,7 +95,7 @@ bool UeRrcTask::lookForSuitableCell()
}
// TODO: Check TAI if forbidden by service area or forbidden list
// TODO: Do we need to check by access identity
// TODO: Do we need to check by access identity
?
// It seems suitable
candidates
.
push_back
(
item
.
first
);
...
...
@@ -96,24 +119,16 @@ bool UeRrcTask::lookForSuitableCell()
auto
&
selectedId
=
candidates
[
0
];
auto
&
selectedCell
=
m_cellDesc
[
selectedId
];
CurrentCellInfo
cellInfo
;
cellInfo
=
{}
;
cellInfo
.
cellId
=
selectedId
;
cellInfo
.
plmn
=
selectedCell
.
sib1
.
plmn
;
cellInfo
.
tac
=
selectedCell
.
sib1
.
tac
;
cellInfo
.
category
=
ECellCategory
::
SUITABLE_CELL
;
m_base
->
shCtx
.
currentCell
.
set
(
cellInfo
);
if
(
lastCell
!=
selectedId
)
{
m_logger
->
info
(
"Selected cell id[%d] category[SUITABLE]"
,
selectedId
);
// TODO: Notify RLS
m_base
->
nasTask
->
push
(
new
NwUeRrcToNas
(
NwUeRrcToNas
::
NAS_NOTIFY
));
}
return
true
;
}
bool
UeRrcTask
::
lookForAcceptableCell
()
bool
UeRrcTask
::
lookForAcceptableCell
(
CurrentCellInfo
&
cellInfo
)
{
// TODO
return
false
;
...
...
src/ue/rrc/task.hpp
View file @
fd300697
...
...
@@ -104,8 +104,8 @@ class UeRrcTask : public NtsTask
/* Idle Mode Operations */
void
performCellSelection
();
bool
lookForSuitableCell
();
bool
lookForAcceptableCell
();
bool
lookForSuitableCell
(
CurrentCellInfo
&
cellInfo
);
bool
lookForAcceptableCell
(
CurrentCellInfo
&
cellInfo
);
/* Cell Management */
void
handleCellSignalChange
(
int
cellId
,
int
dbm
);
...
...
src/utils/common_types.cpp
View file @
fd300697
...
...
@@ -76,6 +76,23 @@ Json ToJson(const EDeregCause &v)
}
}
Json
ToJson
(
const
ECellCategory
&
v
)
{
switch
(
v
)
{
case
ECellCategory
:
:
BARRED_CELL
:
return
"BARRED"
;
case
ECellCategory
:
:
RESERVED_CELL
:
return
"RESERVED"
;
case
ECellCategory
:
:
ACCEPTABLE_CELL
:
return
"ACCEPTABLE"
;
case
ECellCategory
:
:
SUITABLE_CELL
:
return
"SUITABLE"
;
default:
return
"?"
;
}
}
bool
operator
==
(
const
SingleSlice
&
lhs
,
const
SingleSlice
&
rhs
)
{
if
((
int
)
lhs
.
sst
!=
(
int
)
rhs
.
sst
)
...
...
src/utils/common_types.hpp
View file @
fd300697
...
...
@@ -207,6 +207,7 @@ Json ToJson(const SingleSlice &v);
Json
ToJson
(
const
NetworkSlice
&
v
);
Json
ToJson
(
const
PlmnSupport
&
v
);
Json
ToJson
(
const
EDeregCause
&
v
);
Json
ToJson
(
const
ECellCategory
&
v
);
namespace
std
{
...
...
src/utils/locked.hpp
View file @
fd300697
...
...
@@ -49,7 +49,7 @@ class Locked
inline
T
get
()
{
T
copy
{};
access
([
&
copy
](
auto
&
value
)
{
copy
=
value
;
});
access
([
&
copy
](
const
auto
&
value
)
{
copy
=
value
;
});
return
copy
;
}
...
...
@@ -57,7 +57,7 @@ class Locked
inline
U
get
(
Func
&&
fun
)
{
U
copy
{};
access
([
&
copy
,
&
fun
](
auto
&
value
)
{
copy
=
fun
(
value
);
});
access
([
&
copy
,
&
fun
](
const
auto
&
value
)
{
copy
=
fun
(
value
);
});
return
copy
;
}
...
...
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