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
b41ecee9
Commit
b41ecee9
authored
Feb 20, 2021
by
aligungr
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
UE/gNB executable refactor
parent
f0d63a86
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
37 additions
and
8 deletions
+37
-8
src/app/ue_ctl.hpp
src/app/ue_ctl.hpp
+6
-1
src/ue.cpp
src/ue.cpp
+14
-6
src/ue/app/task.cpp
src/ue/app/task.cpp
+1
-1
src/ue/types.hpp
src/ue/types.hpp
+2
-0
src/ue/ue.cpp
src/ue/ue.cpp
+1
-0
src/utils/concurrent_map.hpp
src/utils/concurrent_map.hpp
+13
-0
No files found.
src/app/ue_ctl.hpp
View file @
b41ecee9
...
@@ -8,13 +8,18 @@
...
@@ -8,13 +8,18 @@
#pragma once
#pragma once
namespace
nr
::
ue
{
class
UserEquipment
;
}
namespace
app
namespace
app
{
{
class
IUeController
class
IUeController
{
{
public:
public:
virtual
void
performSwitchOff
()
=
0
;
virtual
void
performSwitchOff
(
nr
::
ue
::
UserEquipment
*
ue
)
=
0
;
};
};
}
// namespace app
}
// namespace app
src/ue.cpp
View file @
b41ecee9
...
@@ -329,16 +329,24 @@ static void Loop()
...
@@ -329,16 +329,24 @@ static void Loop()
class
UeController
:
public
app
::
IUeController
class
UeController
:
public
app
::
IUeController
{
{
public:
public:
void
performSwitchOff
()
override
void
performSwitchOff
(
nr
::
ue
::
UserEquipment
*
ue
)
override
{
{
// WARNING: This method is executed in UE AppTask's thread.
// WARNING: This method is executed in UE AppTask's thread.
// Therefore be careful about thread safety.
// Therefore be careful about thread safety.
// todo ue' için ptr çek
std
::
string
key
{};
// o ptru delete et
g_ueMap
.
invokeForeach
([
&
key
,
ue
](
auto
&
item
)
{
// mapten sil
if
(
item
.
second
==
ue
)
// map boşaldıysa exit yap
key
=
item
.
first
;
// tabi bunları switc off olan appin kendi threadin yapıyoz o yüzden burası atomic değil dikkat!!
});
if
(
key
.
empty
())
return
;
if
(
g_ueMap
.
removeAndGetSize
(
key
)
==
0
)
exit
(
0
);
delete
ue
;
}
}
}
g_ueController
;
}
g_ueController
;
...
...
src/ue/app/task.cpp
View file @
b41ecee9
...
@@ -112,7 +112,7 @@ void UeAppTask::onLoop()
...
@@ -112,7 +112,7 @@ void UeAppTask::onLoop()
if
(
w
->
timerId
==
SWITCH_OFF_TIMER_ID
)
if
(
w
->
timerId
==
SWITCH_OFF_TIMER_ID
)
{
{
m_logger
->
info
(
"UE device is switching off"
);
m_logger
->
info
(
"UE device is switching off"
);
m_base
->
ueController
->
performSwitchOff
();
m_base
->
ueController
->
performSwitchOff
(
m_base
->
ue
);
}
}
break
;
break
;
}
}
...
...
src/ue/types.hpp
View file @
b41ecee9
...
@@ -25,6 +25,7 @@ class UeAppTask;
...
@@ -25,6 +25,7 @@ class UeAppTask;
class
UeMrTask
;
class
UeMrTask
;
class
NasTask
;
class
NasTask
;
class
UeRrcTask
;
class
UeRrcTask
;
class
UserEquipment
;
struct
SupportedAlgs
struct
SupportedAlgs
{
{
...
@@ -97,6 +98,7 @@ struct UeConfig
...
@@ -97,6 +98,7 @@ struct UeConfig
struct
TaskBase
struct
TaskBase
{
{
UserEquipment
*
ue
{};
UeConfig
*
config
{};
UeConfig
*
config
{};
LogBase
*
logBase
{};
LogBase
*
logBase
{};
app
::
IUeController
*
ueController
{};
app
::
IUeController
*
ueController
{};
...
...
src/ue/ue.cpp
View file @
b41ecee9
...
@@ -20,6 +20,7 @@ UserEquipment::UserEquipment(UeConfig *config, app::IUeController *ueController,
...
@@ -20,6 +20,7 @@ UserEquipment::UserEquipment(UeConfig *config, app::IUeController *ueController,
NtsTask
*
cliCallbackTask
)
NtsTask
*
cliCallbackTask
)
{
{
auto
*
base
=
new
TaskBase
();
auto
*
base
=
new
TaskBase
();
base
->
ue
=
this
;
base
->
config
=
config
;
base
->
config
=
config
;
base
->
logBase
=
new
LogBase
(
"logs/ue-"
+
config
->
getNodeName
()
+
".log"
);
base
->
logBase
=
new
LogBase
(
"logs/ue-"
+
config
->
getNodeName
()
+
".log"
);
base
->
ueController
=
ueController
;
base
->
ueController
=
ueController
;
...
...
src/utils/concurrent_map.hpp
View file @
b41ecee9
...
@@ -43,4 +43,17 @@ class ConcurrentMap
...
@@ -43,4 +43,17 @@ class ConcurrentMap
for
(
auto
i
:
m_map
)
for
(
auto
i
:
m_map
)
fun
(
i
);
fun
(
i
);
}
}
void
remove
(
const
TKey
&
key
)
{
std
::
lock_guard
lk
(
m_mutex
);
m_map
.
erase
(
key
);
}
size_t
removeAndGetSize
(
const
TKey
&
key
)
{
std
::
lock_guard
lk
(
m_mutex
);
m_map
.
erase
(
key
);
return
m_map
.
size
();
}
};
};
\ 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