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
6c831a70
Commit
6c831a70
authored
May 16, 2021
by
aligungr
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
RRC developments
parent
26a8e3d0
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
69 additions
and
2 deletions
+69
-2
src/ue/rrc/cells.cpp
src/ue/rrc/cells.cpp
+7
-1
src/ue/rrc/sysinfo.cpp
src/ue/rrc/sysinfo.cpp
+4
-0
src/ue/types.hpp
src/ue/types.hpp
+3
-1
src/utils/locked.cpp
src/utils/locked.cpp
+9
-0
src/utils/locked.hpp
src/utils/locked.hpp
+46
-0
No files found.
src/ue/rrc/cells.cpp
View file @
6c831a70
...
@@ -7,6 +7,7 @@
...
@@ -7,6 +7,7 @@
//
//
#include "task.hpp"
#include "task.hpp"
#include <lib/rrc/encode.hpp>
#include <lib/rrc/encode.hpp>
#include <ue/nas/task.hpp>
#include <ue/nas/task.hpp>
...
@@ -64,7 +65,12 @@ bool UeRrcTask::hasSignalToCell(int cellId)
...
@@ -64,7 +65,12 @@ bool UeRrcTask::hasSignalToCell(int cellId)
void
UeRrcTask
::
updateAvailablePlmns
()
void
UeRrcTask
::
updateAvailablePlmns
()
{
{
// TODO
m_base
->
shCtx
.
availablePlmns
.
mutate
([
this
](
std
::
unordered_set
<
Plmn
>
&
value
)
{
value
.
clear
();
for
(
auto
&
cellDesc
:
m_cellDesc
)
if
(
cellDesc
.
second
.
sib1
.
hasSib1
)
value
.
insert
(
cellDesc
.
second
.
sib1
.
plmn
);
});
}
}
}
// namespace nr::ue
}
// namespace nr::ue
src/ue/rrc/sysinfo.cpp
View file @
6c831a70
...
@@ -29,6 +29,8 @@ void UeRrcTask::receiveMib(int cellId, const ASN_RRC_MIB &msg)
...
@@ -29,6 +29,8 @@ void UeRrcTask::receiveMib(int cellId, const ASN_RRC_MIB &msg)
desc
.
mib
.
isBarred
=
msg
.
cellBarred
==
ASN_RRC_MIB__cellBarred_barred
;
desc
.
mib
.
isBarred
=
msg
.
cellBarred
==
ASN_RRC_MIB__cellBarred_barred
;
desc
.
mib
.
isIntraFreqReselectAllowed
=
msg
.
intraFreqReselection
==
ASN_RRC_MIB__intraFreqReselection_allowed
;
desc
.
mib
.
isIntraFreqReselectAllowed
=
msg
.
intraFreqReselection
==
ASN_RRC_MIB__intraFreqReselection_allowed
;
desc
.
mib
.
hasMib
=
true
;
updateAvailablePlmns
();
updateAvailablePlmns
();
}
}
...
@@ -60,6 +62,8 @@ void UeRrcTask::receiveSib1(int cellId, const ASN_RRC_SIB1 &msg)
...
@@ -60,6 +62,8 @@ void UeRrcTask::receiveSib1(int cellId, const ASN_RRC_SIB1 &msg)
desc
.
sib1
.
aiBarringSet
.
ai2
=
bits
::
BitAt
<
5
>
(
barringBits
);
desc
.
sib1
.
aiBarringSet
.
ai2
=
bits
::
BitAt
<
5
>
(
barringBits
);
desc
.
sib1
.
aiBarringSet
.
ai1
=
bits
::
BitAt
<
6
>
(
barringBits
);
desc
.
sib1
.
aiBarringSet
.
ai1
=
bits
::
BitAt
<
6
>
(
barringBits
);
desc
.
sib1
.
hasSib1
=
true
;
updateAvailablePlmns
();
updateAvailablePlmns
();
}
}
...
...
src/ue/types.hpp
View file @
6c831a70
...
@@ -11,6 +11,7 @@
...
@@ -11,6 +11,7 @@
#include <array>
#include <array>
#include <atomic>
#include <atomic>
#include <memory>
#include <memory>
#include <unordered_set>
#include <lib/app/monitor.hpp>
#include <lib/app/monitor.hpp>
#include <lib/app/ue_ctl.hpp>
#include <lib/app/ue_ctl.hpp>
...
@@ -18,6 +19,7 @@
...
@@ -18,6 +19,7 @@
#include <lib/nas/timer.hpp>
#include <lib/nas/timer.hpp>
#include <utils/common_types.hpp>
#include <utils/common_types.hpp>
#include <utils/json.hpp>
#include <utils/json.hpp>
#include <utils/locked.hpp>
#include <utils/logger.hpp>
#include <utils/logger.hpp>
#include <utils/nts.hpp>
#include <utils/nts.hpp>
#include <utils/octet_string.hpp>
#include <utils/octet_string.hpp>
...
@@ -138,7 +140,7 @@ struct UeConfig
...
@@ -138,7 +140,7 @@ struct UeConfig
struct
UeSharedContext
struct
UeSharedContext
{
{
std
::
array
<
std
::
atomic
<
Plmn
>
,
16
>
availablePlmns
{};
Locked
<
std
::
unordered_set
<
Plmn
>
>
availablePlmns
{};
};
};
struct
TaskBase
struct
TaskBase
...
...
src/utils/locked.cpp
0 → 100644
View file @
6c831a70
//
// This file is a part of UERANSIM open source project.
// Copyright (c) 2021 ALİ GÜNGÖR.
//
// The software and all associated files are licensed under GPL-3.0
// and subject to the terms and conditions defined in LICENSE file.
//
#include "locked.hpp"
\ No newline at end of file
src/utils/locked.hpp
0 → 100644
View file @
6c831a70
//
// This file is a part of UERANSIM open source project.
// Copyright (c) 2021 ALİ GÜNGÖR.
//
// The software and all associated files are licensed under GPL-3.0
// and subject to the terms and conditions defined in LICENSE file.
//
#include <mutex>
template
<
typename
T
>
class
Locked
{
private:
T
m_value
;
std
::
recursive_mutex
m_mutex
;
public:
Locked
()
:
m_value
{},
m_mutex
{}
{
}
explicit
Locked
(
T
value
)
:
m_value
{
value
},
m_mutex
{}
{
}
Locked
(
const
T
&
)
=
delete
;
Locked
(
T
&&
)
=
delete
;
Locked
&
operator
=
(
const
Locked
&
)
=
delete
;
Locked
&
operator
=
(
Locked
&&
)
=
delete
;
template
<
typename
Func
>
inline
void
access
(
Func
fun
)
{
// Şimdilik access ve mutate aynı, optimizasyon adına read-write lock kullanılabilir
mutate
(
fun
);
}
template
<
typename
Func
>
inline
void
mutate
(
Func
fun
)
{
std
::
lock_guard
lk
(
m_mutex
);
fun
(
m_value
);
}
};
\ No newline at end of file
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