Skip to content

Commit 5bec694

Browse files
Adapt Namespaces for low level Systems
1 parent 6ce49fa commit 5bec694

File tree

8 files changed

+30
-26
lines changed

8 files changed

+30
-26
lines changed

executables/referenceApp/application/include/systems/EthernetSystem.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#include <async/IRunnable.h>
1111
#include <async/util/Call.h>
1212
#include <lifecycle/AsyncLifecycleComponent.h>
13-
#include <systems/IEthernetDriverSystem.h>
13+
#include <systems/IEthernetSystem.h>
1414

1515
namespace systems
1616
{
@@ -45,7 +45,7 @@ class EthernetSystem
4545
{
4646
public:
4747
explicit EthernetSystem(
48-
::async::ContextType context, ::ethernet::IEthernetDriverSystem& ethernetSystem);
48+
::async::ContextType context, ::ethernet::IEthernetSystem& ethernetSystem);
4949

5050
EthernetSystem(EthernetSystem const&) = delete;
5151
EthernetSystem& operator=(EthernetSystem const&) = delete;
@@ -56,7 +56,7 @@ class EthernetSystem
5656

5757
void execute() override;
5858

59-
::ethernet::IEthernetDriverSystem& ethernetDriverSystem;
59+
::ethernet::IEthernetSystem& ethernetDriverSystem;
6060
Netifs<::ethX::NUM_NETIFS> netifs;
6161

6262
private:

executables/referenceApp/application/src/app/app.cpp

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,19 +45,25 @@
4545
#ifdef PLATFORM_SUPPORT_CAN
4646
#include <systems/ICanSystem.h>
4747

48+
namespace platform
49+
{
4850
namespace systems
4951
{
5052
extern ::can::ICanSystem& getCanSystem();
5153
} // namespace systems
54+
} // namespace platform
5255
#endif
5356

5457
#ifdef PLATFORM_SUPPORT_ETHERNET
55-
#include <systems/IEthernetDriverSystem.h>
58+
#include <systems/IEthernetSystem.h>
5659

60+
namespace platform
61+
{
5762
namespace systems
5863
{
59-
extern ::ethernet::IEthernetDriverSystem& getEthernetSystem();
64+
extern ::ethernet::IEthernetSystem& getEthernetSystem();
6065
} // namespace systems
66+
} // namespace platform
6167
#endif
6268

6369
#include <platform/estdint.h>
@@ -212,12 +218,12 @@ void startApp()
212218
/* runlevel 5 */
213219
#ifdef PLATFORM_SUPPORT_CAN
214220
lifecycleManager.addComponent(
215-
"docan", doCanSystem.create(*transportSystem, ::systems::getCanSystem(), TASK_CAN), 5U);
221+
"docan", doCanSystem.create(*transportSystem, ::platform::systems::getCanSystem(), TASK_CAN), 5U);
216222
#endif
217223

218224
#ifdef PLATFORM_SUPPORT_ETHERNET
219225
lifecycleManager.addComponent(
220-
"ethernet", ethernetSystem.create(TASK_ETHERNET, ::systems::getEthernetSystem()), 5U);
226+
"ethernet", ethernetSystem.create(TASK_ETHERNET, ::platform::systems::getEthernetSystem()), 5U);
221227
#endif
222228

223229
#ifdef PLATFORM_SUPPORT_STORAGE
@@ -246,7 +252,7 @@ void startApp()
246252
TASK_DEMO,
247253
lifecycleManager
248254
#ifdef PLATFORM_SUPPORT_CAN
249-
, ::systems::getCanSystem()
255+
, ::platform::systems::getCanSystem()
250256
#endif
251257
#ifdef PLATFORM_SUPPORT_STORAGE
252258
, (*storageSystem).getStorage()

executables/referenceApp/application/src/systems/EthernetSystem.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ namespace systems
8080
{
8181

8282
EthernetSystem::EthernetSystem(
83-
::async::ContextType const context, ::ethernet::IEthernetDriverSystem& ethernetSystem)
83+
::async::ContextType const context, ::ethernet::IEthernetSystem& ethernetSystem)
8484
: ethernetDriverSystem(ethernetSystem), _context(context), _executeCounter(0)
8585
{
8686
#if LWIP_NETIF_SPECIFIC_TTL

executables/referenceApp/configuration/include/systems/IEthernetDriverSystem.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@
88
namespace ethernet
99
{
1010

11-
class IEthernetDriverSystem
11+
class IEthernetSystem
1212
{
1313
protected:
14-
~IEthernetDriverSystem() = default;
14+
~IEthernetSystem() = default;
1515

1616
public:
1717
virtual void setGroupcastAddressRecognition(::etl::array<uint8_t, 6> const mac) const = 0;

executables/referenceApp/platforms/posix/main/include/systems/TapEthernetSystem.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@
66

77
#include <ethernet/EthernetLogger.h>
88
#include <lifecycle/AsyncLifecycleComponent.h>
9-
#include <systems/IEthernetDriverSystem.h>
9+
#include <systems/IEthernetSystem.h>
1010

1111
namespace systems
1212
{
1313

1414
class TapEthernetSystem final
15-
: public ::ethernet::IEthernetDriverSystem
15+
: public ::ethernet::IEthernetSystem
1616
, public ::lifecycle::AsyncLifecycleComponent
1717
, public ::async::IRunnable
1818
{

executables/referenceApp/platforms/posix/main/src/main.cpp

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -49,22 +49,20 @@ void platformLifecycleAdd(::lifecycle::LifecycleManager& lifecycleManager, uint8
4949
}
5050
}
5151

52-
} // namespace platform
53-
54-
#ifdef PLATFORM_SUPPORT_CAN
5552
namespace systems
5653
{
54+
55+
#ifdef PLATFORM_SUPPORT_CAN
5756
::can::ICanSystem& getCanSystem() { return *::platform::canSystem; }
58-
} // namespace systems
5957
#endif // PLATFORM_SUPPORT_CAN
60-
6158
#ifdef PLATFORM_SUPPORT_ETHERNET
62-
namespace systems
63-
{
64-
::ethernet::IEthernetDriverSystem& getEthernetSystem() { return *::platform::tapEthernetSystem; }
65-
} // namespace systems
59+
::ethernet::IEthernetSystem& getEthernetSystem() { return *::platform::tapEthernetSystem; }
6660
#endif // PLATFORM_SUPPORT_ETHERNET
6761

62+
} // namespace systems
63+
64+
} // namespace platform
65+
6866
extern "C"
6967
{
7068
void putchar_(char character) { putchar(character); }

executables/referenceApp/platforms/s32k148evb/main/include/systems/S32K148EvbEthernetSystem.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@
1111
#include "lifecycle/ILifecycleManager.h"
1212
#include "phy/Tja1101.h"
1313
#include "phy/Tja1101Tester.h"
14-
#include "systems/IEthernetDriverSystem.h"
14+
#include "systems/IEthernetSystem.h"
1515

1616
namespace systems
1717
{
1818

1919
class S32K148EvbEthernetSystem final
20-
: public ::ethernet::IEthernetDriverSystem
20+
: public ::ethernet::IEthernetSystem
2121
, private ::async::IRunnable
2222
, public ::lifecycle::AsyncLifecycleComponent
2323
{

executables/referenceApp/platforms/s32k148evb/main/src/main.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
#include "commonDebug.h"
1717
#include "interrupt_manager.h"
1818
#include "lifecycle/StaticBsp.h"
19-
#include "systems/IEthernetDriverSystem.h"
19+
#include "systems/IEthernetSystem.h"
2020
#include "watchdog/Watchdog.h"
2121

2222
#include <lifecycle/LifecycleManager.h>
@@ -121,7 +121,7 @@ ::can::ICanSystem& getCanSystem() { return *::platform::canSystem; }
121121
#ifdef PLATFORM_SUPPORT_ETHERNET
122122
namespace systems
123123
{
124-
::ethernet::IEthernetDriverSystem& getEthernetSystem() { return *::platform::s32kEthernetSystem; }
124+
::ethernet::IEthernetSystem& getEthernetSystem() { return *::platform::s32kEthernetSystem; }
125125
} // namespace systems
126126
#endif // PLATFORM_SUPPORT_ETHERNET
127127

0 commit comments

Comments
 (0)