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
e8985cac
Commit
e8985cac
authored
May 11, 2021
by
aligungr
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
RLS improvements
parent
e796709d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
86 additions
and
1 deletion
+86
-1
src/ue/rls/ctl_task.cpp
src/ue/rls/ctl_task.cpp
+86
-1
No files found.
src/ue/rls/ctl_task.cpp
View file @
e8985cac
...
@@ -8,10 +8,14 @@
...
@@ -8,10 +8,14 @@
#include "ctl_task.hpp"
#include "ctl_task.hpp"
#include <utils/common.hpp>
static
constexpr
const
size_t
MAX_PDU_COUNT
=
128
;
namespace
nr
::
ue
namespace
nr
::
ue
{
{
RlsControlTask
::
RlsControlTask
(
TaskBase
*
base
)
:
m_udpTask
{
}
RlsControlTask
::
RlsControlTask
(
TaskBase
*
base
,
uint64_t
sti
)
:
m_udpTask
{},
m_pduMap
{},
m_sti
{
sti
}
{
{
m_logger
=
base
->
logBase
->
makeUniqueLogger
(
base
->
config
->
getLoggerPrefix
()
+
"rls-ctl"
);
m_logger
=
base
->
logBase
->
makeUniqueLogger
(
base
->
config
->
getLoggerPrefix
()
+
"rls-ctl"
);
}
}
...
@@ -69,10 +73,91 @@ void RlsControlTask::onQuit()
...
@@ -69,10 +73,91 @@ void RlsControlTask::onQuit()
void
RlsControlTask
::
handleRlsMessage
(
int
cellId
,
rls
::
RlsMessage
&
msg
)
void
RlsControlTask
::
handleRlsMessage
(
int
cellId
,
rls
::
RlsMessage
&
msg
)
{
{
if
(
msg
.
msgType
==
rls
::
EMessageType
::
PDU_TRANSMISSION_ACK
)
{
auto
&
m
=
(
rls
::
RlsPduTransmissionAck
&
)
msg
;
for
(
auto
pduId
:
m
.
pduIds
)
m_pduMap
.
erase
(
pduId
);
}
else
if
(
msg
.
msgType
==
rls
::
EMessageType
::
PDU_TRANSMISSION
)
{
auto
&
m
=
(
rls
::
RlsPduTransmission
&
)
msg
;
if
(
m
.
pduId
!=
0
)
{
// TODO: Send ACK
}
if
(
m
.
pduType
==
rls
::
EPduType
::
DATA
)
{
// NOTE: Data packet may be received from a cell other than serving cell
// (This is not a problem for RRC, but for DATA), normally we should avoid this, no need for now.
(
void
)
cellId
;
int
psi
=
static_cast
<
int
>
(
m
.
payload
);
// TODO: send to upper layer [PSI, DATA]
}
else
if
(
m
.
pduType
==
rls
::
EPduType
::
RRC
)
{
auto
rrcChannel
=
static_cast
<
rrc
::
RrcChannel
>
(
m
.
payload
);
// TODO: send to upper layer [rrcChannel, DATA]
}
else
{
// TODO: log
}
}
else
{
// TODO: log
}
}
}
void
RlsControlTask
::
handleSignalChange
(
int
cellId
,
int
dbm
)
void
RlsControlTask
::
handleSignalChange
(
int
cellId
,
int
dbm
)
{
{
// TODO transparently send to the RRC
}
void
RlsControlTask
::
handleUplinkRrcDelivery
(
int
cellId
,
uint32_t
pduId
,
rrc
::
RrcChannel
channel
,
OctetString
&&
data
)
{
if
(
pduId
!=
0
)
{
if
(
m_pduMap
.
count
(
pduId
))
{
// TODO: issue RLF
return
;
}
if
(
m_pduMap
.
size
()
>
MAX_PDU_COUNT
)
{
// TODO: issue RLF
return
;
}
m_pduMap
[
pduId
].
pdu
=
data
.
copy
();
m_pduMap
[
pduId
].
rrcChannel
=
channel
;
m_pduMap
[
pduId
].
sentTime
=
utils
::
CurrentTimeMillis
();
}
rls
::
RlsPduTransmission
msg
{
m_sti
};
msg
.
pduType
=
rls
::
EPduType
::
RRC
;
msg
.
pdu
=
std
::
move
(
data
);
msg
.
payload
=
static_cast
<
uint32_t
>
(
channel
);
msg
.
pduId
=
pduId
;
m_udpTask
->
send
(
cellId
,
msg
);
}
void
RlsControlTask
::
handleUplinkDataDelivery
(
int
cellId
,
int
psi
,
OctetString
&&
data
)
{
rls
::
RlsPduTransmission
msg
{
m_sti
};
msg
.
pduType
=
rls
::
EPduType
::
DATA
;
msg
.
pdu
=
std
::
move
(
data
);
msg
.
payload
=
static_cast
<
uint32_t
>
(
psi
);
msg
.
pduId
=
0
;
m_udpTask
->
send
(
cellId
,
msg
);
}
}
}
// namespace nr::ue
}
// namespace nr::ue
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