From f51dc495929c8f28ce1bec247b03349f54eb9037 Mon Sep 17 00:00:00 2001 From: Timur Kamaletdinov Date: Fri, 22 Nov 2024 12:45:28 +0100 Subject: [PATCH] Delete unused files from libs/bsw/bsp, libs/bsp Deleted: - bsw::bsp::background - ICanPhy from bsw::bsp::can - bsw::bsp::commandInterpreter - bsw::bsp::error - bsw::bsp::ethernet - IFlash from bsw::bsp::flash - bsw::bsp::flexray - bsw::bsp::hwInfo - bsw::bsp::i2c - bsw::bsp::lin - IAwakened, IUnderVoltageListener, AbstractPowerStateListener, IVoltageManager from bsw::bsp::power - bsw::bsp::spi - bsw::bsp::stepperMotor - ICompareTimer, IHighResolutionTimer from bsw::bsp::timer - bsw::bsp::xcp - LoggerBackgroundJob from bsw::logger - module libs::bsp::bspTestConsoleWithCommandInterpreter - module libs::bsp::bspCommandInterpreterSimple - module libs::bsp::bspInputManager - module libs::bsp::bspError Change-Id: I3d53a123a28f7f0a3fb3c6e11fbefad34ee1ed00 --- .../bspConfiguration/CMakeLists.txt | 1 - .../src/bsp/adc/AnalogInput.cpp | 2 - .../main/include/lifecycle/StaticBsp.h | 2 +- libs/bsp/CMakeLists.txt | 6 - .../CMakeLists.txt | 8 - .../bspCommandInterpreterSimple/doc/index.rst | 10 -- .../CommandInterpreter.h | 35 ---- .../commandInterpreterSimple/CommandLine.h | 66 -------- .../bspCommandInterpreterSimple/module.spec | 2 - .../CommandInterpreter.cpp | 73 -------- .../commandInterpreterSimple/CommandLine.cpp | 84 --------- .../test/gtest/CMakeLists.txt | 6 - .../test/gtest/src/IncludeTest.cpp | 12 -- libs/bsp/bspError/CMakeLists.txt | 5 - libs/bsp/bspError/doc/index.rst | 8 - libs/bsp/bspError/include/bspError/BspError.h | 38 ----- .../include/bspError/BspErrorTester.h | 40 ----- libs/bsp/bspError/module.spec | 2 - libs/bsp/bspError/src/BspError.cpp | 54 ------ libs/bsp/bspError/src/BspErrorTester.cpp | 38 ----- libs/bsp/bspError/test/gtest/CMakeLists.txt | 5 - .../bspError/test/gtest/src/IncludeTest.cpp | 15 -- libs/bsp/bspInputManager/CMakeLists.txt | 2 - .../bspInputManager/test/gtest/CMakeLists.txt | 1 - .../CMakeLists.txt | 9 - .../doc/index.rst | 11 -- .../include/console/Console.h | 55 ------ .../include/console/ConsoleMenu.h | 27 --- .../module.spec | 3 - .../src/console/Console.cpp | 103 ------------ .../src/console/ConsoleMenu.cpp | 75 --------- .../test/gtest/CMakeLists.txt | 11 -- .../test/gtest/src/IncludeTest.cpp | 15 -- .../bsp/background/AbstractBackgroundJob.h | 80 --------- .../bsp/background/IBackgroundJobHandler.h | 48 ------ libs/bsw/bsp/include/bsp/can/ICanPhy.h | 56 ------ .../include/bsp/can/canTransceiver/CanJob.h | 60 ------- .../bsp/commandInterpreter/CommandSpec.h | 15 -- .../commandInterpreter/ICommandInterpreter.h | 36 ---- .../ICommandInterpreterSimple.h | 66 -------- .../bsp/commandInterpreter/ReturnCode.h | 17 -- .../bsp/include/bsp/error/IEventListener.h | 66 -------- .../bsp/ethernet/ILinkStatusListener.h | 64 ------- libs/bsw/bsp/include/bsp/ethernet/IMdio.h | 60 ------- .../bsp/include/bsp/ethernet/IMdioClause22.h | 49 ------ .../bsp/include/bsp/ethernet/IMdioClause45.h | 53 ------ libs/bsw/bsp/include/bsp/flash/IFlash.h | 159 ------------------ .../bsw/bsp/include/bsp/flexray/IFlexrayPhy.h | 75 --------- .../bsp/hwInfo/IHardwareInfoProvider.h | 30 ---- libs/bsw/bsp/include/bsp/i2c/I2cCommon.h | 33 ---- libs/bsw/bsp/include/bsp/i2c/II2cMaster.h | 66 -------- libs/bsw/bsp/include/bsp/lin/ILinDevice.h | 80 --------- libs/bsw/bsp/include/bsp/lin/ILinPhy.h | 44 ----- .../bsw/bsp/include/bsp/lin/ILinSciReceiver.h | 34 ---- .../include/bsp/lin/linTransceiver/LinPhy.h | 46 ----- .../bsp/power/AbstractPowerStateListener.h | 55 ------ libs/bsw/bsp/include/bsp/power/IAwakened.h | 22 --- .../include/bsp/power/IUnderVoltageListener.h | 24 --- .../bsp/include/bsp/power/IVoltageManager.h | 65 ------- libs/bsw/bsp/include/bsp/spi/ISpi.h | 28 --- .../bsp/stepperMotor/IStepperMotorDevice.h | 81 --------- .../bsw/bsp/include/bsp/timer/ICompareTimer.h | 52 ------ .../include/bsp/timer/IHighResolutionTimer.h | 31 ---- .../bsp/include/bsp/xcp/IOverlayController.h | 49 ------ .../background/AbstractBackgroundJobMock.h | 21 --- .../bsp/background/BackgroundJobHandlerMock.h | 21 --- .../bsw/bsp/mock/include/bsp/can/CanPhyMock.h | 26 --- .../include/bsp/ethernet/MdioClause22Mock.h | 28 --- .../include/bsp/ethernet/MdioClause45Mock.h | 28 --- .../bsp/mock/include/bsp/ethernet/MdioMock.h | 39 ----- .../bsp/hwInfo/HardwareInfoProviderMock.h | 23 --- .../bsp/lin/linTransceiver/LinPhyMock.h | 25 --- .../power/AbstractPowerStateListenerMock.h | 20 --- .../include/bsp/power/VoltageManagerMock.h | 35 ---- .../mock/include/bsp/timer/CompareTimerMock.h | 29 ---- .../include/bsp/xcp/OverlayControllerMock.h | 23 --- libs/bsw/bsp/test/gtest/CMakeLists.txt | 6 +- .../bsp/test/gtest/src/bsp/IncludeTest.cpp | 27 --- .../IncludeTestCommandInterpreterSimple.cpp | 14 -- .../background/AbstractBackgroundJobTest.cpp | 42 ----- .../test/gtest/src/bsp/can/ICanPhyTest.cpp | 15 -- .../src/bsp/can/canTransceiver/CanPhyTest.cpp | 2 - .../src/bsp/lin/linTransceiver/LinPhyTest.cpp | 36 ---- .../power/AbstractPowerStateListenerTest.cpp | 28 --- .../bsw/bsp/test/mock/gmock/include/spi/Spi.h | 25 --- .../include/logger/LoggerBackgroundJob.h | 87 ---------- libs/bsw/logger/test/CMakeLists.txt | 1 - .../src/logger/LoggerBackgroundJobTest.cpp | 73 -------- 88 files changed, 2 insertions(+), 3140 deletions(-) delete mode 100644 libs/bsp/bspCommandInterpreterSimple/CMakeLists.txt delete mode 100644 libs/bsp/bspCommandInterpreterSimple/doc/index.rst delete mode 100644 libs/bsp/bspCommandInterpreterSimple/include/commandInterpreterSimple/CommandInterpreter.h delete mode 100644 libs/bsp/bspCommandInterpreterSimple/include/commandInterpreterSimple/CommandLine.h delete mode 100644 libs/bsp/bspCommandInterpreterSimple/module.spec delete mode 100644 libs/bsp/bspCommandInterpreterSimple/src/commandInterpreterSimple/CommandInterpreter.cpp delete mode 100644 libs/bsp/bspCommandInterpreterSimple/src/commandInterpreterSimple/CommandLine.cpp delete mode 100644 libs/bsp/bspCommandInterpreterSimple/test/gtest/CMakeLists.txt delete mode 100644 libs/bsp/bspCommandInterpreterSimple/test/gtest/src/IncludeTest.cpp delete mode 100644 libs/bsp/bspError/CMakeLists.txt delete mode 100644 libs/bsp/bspError/doc/index.rst delete mode 100644 libs/bsp/bspError/include/bspError/BspError.h delete mode 100644 libs/bsp/bspError/include/bspError/BspErrorTester.h delete mode 100644 libs/bsp/bspError/module.spec delete mode 100644 libs/bsp/bspError/src/BspError.cpp delete mode 100644 libs/bsp/bspError/src/BspErrorTester.cpp delete mode 100644 libs/bsp/bspError/test/gtest/CMakeLists.txt delete mode 100644 libs/bsp/bspError/test/gtest/src/IncludeTest.cpp delete mode 100644 libs/bsp/bspTestConsoleWithCommandInterpreter/CMakeLists.txt delete mode 100644 libs/bsp/bspTestConsoleWithCommandInterpreter/doc/index.rst delete mode 100644 libs/bsp/bspTestConsoleWithCommandInterpreter/include/console/Console.h delete mode 100644 libs/bsp/bspTestConsoleWithCommandInterpreter/include/console/ConsoleMenu.h delete mode 100644 libs/bsp/bspTestConsoleWithCommandInterpreter/module.spec delete mode 100644 libs/bsp/bspTestConsoleWithCommandInterpreter/src/console/Console.cpp delete mode 100644 libs/bsp/bspTestConsoleWithCommandInterpreter/src/console/ConsoleMenu.cpp delete mode 100644 libs/bsp/bspTestConsoleWithCommandInterpreter/test/gtest/CMakeLists.txt delete mode 100644 libs/bsp/bspTestConsoleWithCommandInterpreter/test/gtest/src/IncludeTest.cpp delete mode 100644 libs/bsw/bsp/include/bsp/background/AbstractBackgroundJob.h delete mode 100644 libs/bsw/bsp/include/bsp/background/IBackgroundJobHandler.h delete mode 100644 libs/bsw/bsp/include/bsp/can/ICanPhy.h delete mode 100644 libs/bsw/bsp/include/bsp/can/canTransceiver/CanJob.h delete mode 100644 libs/bsw/bsp/include/bsp/commandInterpreter/CommandSpec.h delete mode 100644 libs/bsw/bsp/include/bsp/commandInterpreter/ICommandInterpreter.h delete mode 100644 libs/bsw/bsp/include/bsp/commandInterpreter/ICommandInterpreterSimple.h delete mode 100644 libs/bsw/bsp/include/bsp/commandInterpreter/ReturnCode.h delete mode 100644 libs/bsw/bsp/include/bsp/error/IEventListener.h delete mode 100644 libs/bsw/bsp/include/bsp/ethernet/ILinkStatusListener.h delete mode 100644 libs/bsw/bsp/include/bsp/ethernet/IMdio.h delete mode 100644 libs/bsw/bsp/include/bsp/ethernet/IMdioClause22.h delete mode 100644 libs/bsw/bsp/include/bsp/ethernet/IMdioClause45.h delete mode 100644 libs/bsw/bsp/include/bsp/flash/IFlash.h delete mode 100644 libs/bsw/bsp/include/bsp/flexray/IFlexrayPhy.h delete mode 100644 libs/bsw/bsp/include/bsp/hwInfo/IHardwareInfoProvider.h delete mode 100644 libs/bsw/bsp/include/bsp/i2c/I2cCommon.h delete mode 100644 libs/bsw/bsp/include/bsp/i2c/II2cMaster.h delete mode 100644 libs/bsw/bsp/include/bsp/lin/ILinDevice.h delete mode 100644 libs/bsw/bsp/include/bsp/lin/ILinPhy.h delete mode 100644 libs/bsw/bsp/include/bsp/lin/ILinSciReceiver.h delete mode 100644 libs/bsw/bsp/include/bsp/lin/linTransceiver/LinPhy.h delete mode 100644 libs/bsw/bsp/include/bsp/power/AbstractPowerStateListener.h delete mode 100644 libs/bsw/bsp/include/bsp/power/IAwakened.h delete mode 100644 libs/bsw/bsp/include/bsp/power/IUnderVoltageListener.h delete mode 100644 libs/bsw/bsp/include/bsp/power/IVoltageManager.h delete mode 100644 libs/bsw/bsp/include/bsp/spi/ISpi.h delete mode 100644 libs/bsw/bsp/include/bsp/stepperMotor/IStepperMotorDevice.h delete mode 100644 libs/bsw/bsp/include/bsp/timer/ICompareTimer.h delete mode 100644 libs/bsw/bsp/include/bsp/timer/IHighResolutionTimer.h delete mode 100644 libs/bsw/bsp/include/bsp/xcp/IOverlayController.h delete mode 100644 libs/bsw/bsp/mock/include/bsp/background/AbstractBackgroundJobMock.h delete mode 100644 libs/bsw/bsp/mock/include/bsp/background/BackgroundJobHandlerMock.h delete mode 100644 libs/bsw/bsp/mock/include/bsp/can/CanPhyMock.h delete mode 100644 libs/bsw/bsp/mock/include/bsp/ethernet/MdioClause22Mock.h delete mode 100644 libs/bsw/bsp/mock/include/bsp/ethernet/MdioClause45Mock.h delete mode 100644 libs/bsw/bsp/mock/include/bsp/ethernet/MdioMock.h delete mode 100644 libs/bsw/bsp/mock/include/bsp/hwInfo/HardwareInfoProviderMock.h delete mode 100644 libs/bsw/bsp/mock/include/bsp/lin/linTransceiver/LinPhyMock.h delete mode 100644 libs/bsw/bsp/mock/include/bsp/power/AbstractPowerStateListenerMock.h delete mode 100644 libs/bsw/bsp/mock/include/bsp/power/VoltageManagerMock.h delete mode 100644 libs/bsw/bsp/mock/include/bsp/timer/CompareTimerMock.h delete mode 100644 libs/bsw/bsp/mock/include/bsp/xcp/OverlayControllerMock.h delete mode 100644 libs/bsw/bsp/test/gtest/src/bsp/IncludeTestCommandInterpreterSimple.cpp delete mode 100644 libs/bsw/bsp/test/gtest/src/bsp/background/AbstractBackgroundJobTest.cpp delete mode 100644 libs/bsw/bsp/test/gtest/src/bsp/can/ICanPhyTest.cpp delete mode 100644 libs/bsw/bsp/test/gtest/src/bsp/lin/linTransceiver/LinPhyTest.cpp delete mode 100644 libs/bsw/bsp/test/gtest/src/bsp/power/AbstractPowerStateListenerTest.cpp delete mode 100644 libs/bsw/bsp/test/mock/gmock/include/spi/Spi.h delete mode 100644 libs/bsw/logger/include/logger/LoggerBackgroundJob.h delete mode 100644 libs/bsw/logger/test/src/logger/LoggerBackgroundJobTest.cpp diff --git a/executables/referenceApp/platforms/s32k148evb/bspConfiguration/CMakeLists.txt b/executables/referenceApp/platforms/s32k148evb/bspConfiguration/CMakeLists.txt index 73bb6f97f1..1e40a8fa1e 100644 --- a/executables/referenceApp/platforms/s32k148evb/bspConfiguration/CMakeLists.txt +++ b/executables/referenceApp/platforms/s32k148evb/bspConfiguration/CMakeLists.txt @@ -9,7 +9,6 @@ target_link_libraries( bspConfiguration PUBLIC bspAdc bspCharInputOutput - bspError bspFtm bspFtmPwm bspInterrupts diff --git a/executables/referenceApp/platforms/s32k148evb/bspConfiguration/src/bsp/adc/AnalogInput.cpp b/executables/referenceApp/platforms/s32k148evb/bspConfiguration/src/bsp/adc/AnalogInput.cpp index 7675de4a7c..a8b2887001 100644 --- a/executables/referenceApp/platforms/s32k148evb/bspConfiguration/src/bsp/adc/AnalogInput.cpp +++ b/executables/referenceApp/platforms/s32k148evb/bspConfiguration/src/bsp/adc/AnalogInput.cpp @@ -10,8 +10,6 @@ #endif #define BSP_ANALOGINPUT_PIN_CONFIGURATION 1 -#include "bspError/BspError.h" - namespace bios { diff --git a/executables/referenceApp/platforms/s32k148evb/main/include/lifecycle/StaticBsp.h b/executables/referenceApp/platforms/s32k148evb/main/include/lifecycle/StaticBsp.h index dd7280a7f9..8ae788f429 100644 --- a/executables/referenceApp/platforms/s32k148evb/main/include/lifecycle/StaticBsp.h +++ b/executables/referenceApp/platforms/s32k148evb/main/include/lifecycle/StaticBsp.h @@ -20,7 +20,7 @@ namespace bios class CanPhyCommon : public CanPhy { public: - CanPhyCommon() {} + CanPhyCommon() = default; virtual void init(uint32_t id = 0U) {} diff --git a/libs/bsp/CMakeLists.txt b/libs/bsp/CMakeLists.txt index b7836219e4..50adefbf5a 100644 --- a/libs/bsp/CMakeLists.txt +++ b/libs/bsp/CMakeLists.txt @@ -1,21 +1,15 @@ add_subdirectory(bspCharInputOutput EXCLUDE_FROM_ALL) -add_subdirectory(bspCommandInterpreterSimple EXCLUDE_FROM_ALL) add_subdirectory(bspDynamicClient EXCLUDE_FROM_ALL) -add_subdirectory(bspError EXCLUDE_FROM_ALL) add_subdirectory(bspInputManager EXCLUDE_FROM_ALL) add_subdirectory(bspInterrupts EXCLUDE_FROM_ALL) add_subdirectory(bspOutputManager EXCLUDE_FROM_ALL) add_subdirectory(bspOutputPwm EXCLUDE_FROM_ALL) -add_subdirectory(bspTestConsoleWithCommandInterpreter EXCLUDE_FROM_ALL) if (BUILD_UNIT_TESTS) - add_subdirectory(bspCommandInterpreterSimple/test/gtest) add_subdirectory(bspInputManager/test/gtest) add_subdirectory(bspCharInputOutput/test/gtest) add_subdirectory(bspDynamicClient/test/gtest) add_subdirectory(bspInterrupts/test/gtest) add_subdirectory(bspOutputManager/test/gtest) add_subdirectory(bspOutputPwm/test/gtest) - add_subdirectory(bspTestConsoleWithCommandInterpreter/test/gtest) - add_subdirectory(bspError/test/gtest) endif () diff --git a/libs/bsp/bspCommandInterpreterSimple/CMakeLists.txt b/libs/bsp/bspCommandInterpreterSimple/CMakeLists.txt deleted file mode 100644 index 21ea06b15e..0000000000 --- a/libs/bsp/bspCommandInterpreterSimple/CMakeLists.txt +++ /dev/null @@ -1,8 +0,0 @@ -add_library( - bspCommandInterpreterSimple - src/commandInterpreterSimple/CommandInterpreter.cpp - src/commandInterpreterSimple/CommandLine.cpp) - -target_include_directories(bspCommandInterpreterSimple PUBLIC include) - -target_link_libraries(bspCommandInterpreterSimple PUBLIC bsp) diff --git a/libs/bsp/bspCommandInterpreterSimple/doc/index.rst b/libs/bsp/bspCommandInterpreterSimple/doc/index.rst deleted file mode 100644 index 7f94dbcde8..0000000000 --- a/libs/bsp/bspCommandInterpreterSimple/doc/index.rst +++ /dev/null @@ -1,10 +0,0 @@ -bspCommandInterpreterSimple -=========================== - -Overview --------- - -The module ``bspCommandInterpreterSimple`` provides API for commands which can be used, for -example, in a serial console. It includes methods for processing the commands. The class -``CommandLine`` divides the command into tokens and provides methods for accessing and -manipulating these tokens. diff --git a/libs/bsp/bspCommandInterpreterSimple/include/commandInterpreterSimple/CommandInterpreter.h b/libs/bsp/bspCommandInterpreterSimple/include/commandInterpreterSimple/CommandInterpreter.h deleted file mode 100644 index edc10c0990..0000000000 --- a/libs/bsp/bspCommandInterpreterSimple/include/commandInterpreterSimple/CommandInterpreter.h +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright 2024 Accenture. - -#ifndef GUARD_7DE692F5_A5F9_46A4_A7D9_536D7B62322C -#define GUARD_7DE692F5_A5F9_46A4_A7D9_536D7B62322C - -#include - -#include -#include - -namespace bios -{ -class CommandModule; -class CommandLine; - -class CommandInterpreter : public ICommandInterpreterSimple -{ - UNCOPYABLE(CommandInterpreter); - -public: - CommandInterpreter(CommandSpec const& cs, CommandFunc func); - - CommandReturnCode processCommand(CommandLine& commandLine) override; - void printHelp(char const* specific = nullptr) override; - char const* errorCodeToString(CommandReturnCode code) const; - -private: - CommandInterpreter(); - CommandFunc fCommandFunc; - CommandSpec const& fCommands; -}; - -} // namespace bios - -#endif diff --git a/libs/bsp/bspCommandInterpreterSimple/include/commandInterpreterSimple/CommandLine.h b/libs/bsp/bspCommandInterpreterSimple/include/commandInterpreterSimple/CommandLine.h deleted file mode 100644 index f1fb9ac773..0000000000 --- a/libs/bsp/bspCommandInterpreterSimple/include/commandInterpreterSimple/CommandLine.h +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright 2024 Accenture. - -#ifndef GUARD_B00C973E_6334_42B0_9508_EA3C2AEDAF17 -#define GUARD_B00C973E_6334_42B0_9508_EA3C2AEDAF17 - -#include - -#include -#include -#include - -#include - -namespace bios -{ -using CommandToken = char*; -using ConstCommandToken = char const*; - -class CommandLine -{ - UNCOPYABLE(CommandLine); - -public: - explicit CommandLine(CommandToken pCommand); - - CommandToken getToken(uint8_t const index) const - { - if ((index >= MAX_NUM_TOKENS) || (TOKEN_INVALID == fpTokenPosition[index])) - { - return nullptr; - } - return fpCommand + fpTokenPosition[index]; - } - - CommandToken operator[](uint8_t const index) const { return getToken(index); } - - uint8_t getNumberOfTokens() const { return fNumTokens; } - - uint8_t getMatchingCommandIndex(uint8_t idx, CommandSpec const& cs) const; - - bool tokenEqualsString(uint8_t tokenIdx, char const* s) const; - - void shift(); - - uint32_t getUint32(uint8_t const idx) const - { - return static_cast(strtoul(getToken(idx), nullptr, 0)); - } - - void print() const; - - void getCommand(estd::string& s) const; - -private: - static uint8_t const TOKEN_INVALID = 0xFFU; - static uint8_t const MAX_NUM_TOKENS = 16U; - static ConstCommandToken const TOKEN_SEPERATORS; - uint8_t fTokenPosition[MAX_NUM_TOKENS]; - uint8_t* fpTokenPosition; - uint8_t fNumTokens; - CommandToken fpCommand; -}; - -} // namespace bios - -#endif diff --git a/libs/bsp/bspCommandInterpreterSimple/module.spec b/libs/bsp/bspCommandInterpreterSimple/module.spec deleted file mode 100644 index 50ed87e068..0000000000 --- a/libs/bsp/bspCommandInterpreterSimple/module.spec +++ /dev/null @@ -1,2 +0,0 @@ -maturity: raw -oss: true diff --git a/libs/bsp/bspCommandInterpreterSimple/src/commandInterpreterSimple/CommandInterpreter.cpp b/libs/bsp/bspCommandInterpreterSimple/src/commandInterpreterSimple/CommandInterpreter.cpp deleted file mode 100644 index 63fa5237cf..0000000000 --- a/libs/bsp/bspCommandInterpreterSimple/src/commandInterpreterSimple/CommandInterpreter.cpp +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright 2024 Accenture. - -#include "commandInterpreterSimple/CommandInterpreter.h" - -#include "commandInterpreterSimple/CommandLine.h" - -#include - -#include - -namespace bios -{ -CommandInterpreter::CommandInterpreter(CommandSpec const& cs, CommandFunc const func) -: fCommandFunc(func), fCommands(cs) -{} - -CommandReturnCode CommandInterpreter::processCommand(CommandLine& commandLine) -{ - if (commandLine.getNumberOfTokens() < 1U) - { - return CMD_ERROR; - } - if (0 == strncmp(commandLine.getToken(0U), "help?", 4U)) - { - printHelp(commandLine.getToken(1U)); - return CMD_OK; - } - - CommandReturnCode const result = fCommandFunc(commandLine); - if (result == CMD_NOCMD) - { - if (getNext() != nullptr) - { - return getNext()->processCommand(commandLine); - } - else - { - return CMD_ERROR; - } - } - else - { - return result; - } -} - -char const* CommandInterpreter::errorCodeToString(CommandReturnCode const code) const -{ - static char const errorCode[static_cast(CMD_NUM_CODES) + 1][6] = { - "ok", - "error", - "nocmd", - "", - }; - return errorCode[code]; -} - -void CommandInterpreter::printHelp(char const* specific) -{ - CommandSpec const* c = &fCommands; - if ((specific == nullptr) || ((specific != nullptr) && (strcmp(specific, c->fName) == 0))) - { - (void)debug_printf("\r\n***************\r\n"); - while (c->fName != nullptr) - { - (void)debug_printf("%s - %s\n", c->fName, c->fHelpText); - ++c; - } - } - ICommandInterpreterSimple::printHelp(specific); -} - -} // namespace bios diff --git a/libs/bsp/bspCommandInterpreterSimple/src/commandInterpreterSimple/CommandLine.cpp b/libs/bsp/bspCommandInterpreterSimple/src/commandInterpreterSimple/CommandLine.cpp deleted file mode 100644 index d281ba3247..0000000000 --- a/libs/bsp/bspCommandInterpreterSimple/src/commandInterpreterSimple/CommandLine.cpp +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright 2024 Accenture. - -#include "commandInterpreterSimple/CommandLine.h" - -#include - -#include -#include - -namespace bios -{ -ConstCommandToken const CommandLine::TOKEN_SEPERATORS = " ."; - -CommandLine::CommandLine(CommandToken const pCommand) -: fpTokenPosition(fTokenPosition), fNumTokens(0U), fpCommand(pCommand) -{ - (void)memset(fTokenPosition, static_cast(TOKEN_INVALID), sizeof(fTokenPosition)); - fNumTokens = 0U; - CommandToken token = strtok(fpCommand, TOKEN_SEPERATORS); - while ((nullptr != token) && (fNumTokens < MAX_NUM_TOKENS)) - { - fTokenPosition[fNumTokens] = static_cast(token - fpCommand); - token = strtok(nullptr, TOKEN_SEPERATORS); - ++fNumTokens; - } -} - -uint8_t CommandLine::getMatchingCommandIndex(uint8_t const idx, CommandSpec const& cs) const -{ - CommandSpec const* pCs = &cs; - uint8_t i = 0U; - CommandToken const token = getToken(idx); - if (nullptr == token) - { - return TOKEN_INVALID; - } - while (nullptr != pCs->fName) - { - if (0 == strcmp(pCs->fName, token)) - { - return i; - } - ++i; - ++pCs; - } - return TOKEN_INVALID; -} - -bool CommandLine::tokenEqualsString(uint8_t const tokenIdx, char const* const s) const -{ - return (0 == strcmp(getToken(tokenIdx), s)); -} - -void CommandLine::shift() -{ - if (fNumTokens > 0U) - { - --fNumTokens; - ++fpTokenPosition; - } -} - -void CommandLine::print() const -{ - for (uint8_t i = 0U; i < getNumberOfTokens(); ++i) - { - (void)printf("%s ", getToken(i)); - } - (void)printf("\n"); -} - -void CommandLine::getCommand(estd::string& s) const -{ - for (uint8_t i = 0U; i < getNumberOfTokens(); ++i) - { - s.append(getToken(i)); - if (i != getNumberOfTokens() - 1) - { - s.append("."); - } - } -} - -} // namespace bios diff --git a/libs/bsp/bspCommandInterpreterSimple/test/gtest/CMakeLists.txt b/libs/bsp/bspCommandInterpreterSimple/test/gtest/CMakeLists.txt deleted file mode 100644 index b2f004f5b5..0000000000 --- a/libs/bsp/bspCommandInterpreterSimple/test/gtest/CMakeLists.txt +++ /dev/null @@ -1,6 +0,0 @@ -add_executable(bspCommandInterpreterSimpleTest src/IncludeTest.cpp) - -target_link_libraries(bspCommandInterpreterSimpleTest PRIVATE gtest_main) - -gtest_discover_tests(bspCommandInterpreterSimpleTest - PROPERTIES LABELS "bspCommandInterpreterSimpleTest") diff --git a/libs/bsp/bspCommandInterpreterSimple/test/gtest/src/IncludeTest.cpp b/libs/bsp/bspCommandInterpreterSimple/test/gtest/src/IncludeTest.cpp deleted file mode 100644 index d7b628e4eb..0000000000 --- a/libs/bsp/bspCommandInterpreterSimple/test/gtest/src/IncludeTest.cpp +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright 2024 Accenture. - -#include - -namespace -{ -TEST(BspTest, IncludeCheck) -{ - // This test currently only checks if the includes are working. -} - -} // namespace diff --git a/libs/bsp/bspError/CMakeLists.txt b/libs/bsp/bspError/CMakeLists.txt deleted file mode 100644 index 9cda4896f1..0000000000 --- a/libs/bsp/bspError/CMakeLists.txt +++ /dev/null @@ -1,5 +0,0 @@ -add_library(bspError src/BspError.cpp) - -target_include_directories(bspError PUBLIC include) - -target_link_libraries(bspError bsp bspInterrupts) diff --git a/libs/bsp/bspError/doc/index.rst b/libs/bsp/bspError/doc/index.rst deleted file mode 100644 index 8c369b6f80..0000000000 --- a/libs/bsp/bspError/doc/index.rst +++ /dev/null @@ -1,8 +0,0 @@ -bspError -======== - -Overview --------- - -The module ``bspError`` provides Error handling API for Board Support Package(BSP). It -handles BSP errors, which are represented as events. diff --git a/libs/bsp/bspError/include/bspError/BspError.h b/libs/bsp/bspError/include/bspError/BspError.h deleted file mode 100644 index 5602a23d9d..0000000000 --- a/libs/bsp/bspError/include/bspError/BspError.h +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright 2024 Accenture. - -#ifndef GUARD_00A5BD7E_31EC_4CAF_A1B4_C4659B74160B -#define GUARD_00A5BD7E_31EC_4CAF_A1B4_C4659B74160B - -#include "bsp/error/IEventListener.h" - -#include - -namespace bios -{ - -class BspError -{ -public: - BspError(); - - // static void event(uint32_t event, bool active, uint32_t status = IEventListener::INVALID); - static void event( - uint32_t event, - bool active, - uint32_t status0 = IEventListener::INVALID, - uint32_t status1 = IEventListener::INVALID, - uint32_t status2 = IEventListener::INVALID, - uint32_t status3 = IEventListener::INVALID); - static void setListener(IEventListener& l); - - static inline uint32_t getError() { return sEvent; } - -private: - static uint32_t sEvent; - static uint32_t sOldEvent; - static IEventListener* fListener; -}; - -} // namespace bios - -#endif /* GUARD_00A5BD7E_31EC_4CAF_A1B4_C4659B74160B */ diff --git a/libs/bsp/bspError/include/bspError/BspErrorTester.h b/libs/bsp/bspError/include/bspError/BspErrorTester.h deleted file mode 100644 index 4d53fe1c55..0000000000 --- a/libs/bsp/bspError/include/bspError/BspErrorTester.h +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright 2024 Accenture. - -#ifndef GUARD_3A575477_50CD_4859_8364_AFADE25BFE05 -#define GUARD_3A575477_50CD_4859_8364_AFADE25BFE05 - -#include "bspError/BspError.h" -#include "util/command/SimpleCommand.h" - -#include - -namespace bios -{ - -class Console; - -class BspErrorTester -: public IEventListener -, public ::util::command::SimpleCommand -{ -public: - explicit BspErrorTester(::util::stream::ISharedOutputStream& sharedStream); - - void event( - uint32_t event, - bool active, - uint32_t status0, - uint32_t status1, - uint32_t status2, - uint32_t status3) override; - -protected: - void executeCommand(::util::command::CommandContext& context); - -private: - ::util::stream::ISharedOutputStream& fSharedStream; -}; - -} // namespace bios - -#endif /* GUARD_3A575477_50CD_4859_8364_AFADE25BFE05 */ diff --git a/libs/bsp/bspError/module.spec b/libs/bsp/bspError/module.spec deleted file mode 100644 index 50ed87e068..0000000000 --- a/libs/bsp/bspError/module.spec +++ /dev/null @@ -1,2 +0,0 @@ -maturity: raw -oss: true diff --git a/libs/bsp/bspError/src/BspError.cpp b/libs/bsp/bspError/src/BspError.cpp deleted file mode 100644 index 3d2c1a6bd7..0000000000 --- a/libs/bsp/bspError/src/BspError.cpp +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright 2024 Accenture. - -#include "bspError/BspError.h" - -#include - -namespace bios -{ - -uint32_t BspError::sEvent = 0UL; -uint32_t BspError::sOldEvent = 0UL; -IEventListener* BspError::fListener = nullptr; - -BspError::BspError() -{ - BspError::fListener = nullptr; - sEvent = 0UL; - sOldEvent = 0UL; -} - -void BspError::setListener(IEventListener& l) { fListener = &l; } - -void BspError::event( - uint32_t const event, - bool const active, - uint32_t status0, - uint32_t status1, - uint32_t status2, - uint32_t status3) -{ - { - uint32_t const lock = getMachineStateRegisterValueAndSuspendAllInterrupts(); - if (active) - { - sEvent |= event; - } - else - { - sEvent &= ~event; - } - - resumeAllInterrupts(lock); - } - if (sEvent != sOldEvent) - { - if (fListener != nullptr) - { - fListener->event(event, active, status0, status1, status2, status3); - } - sOldEvent = sEvent; - } -} - -} // namespace bios diff --git a/libs/bsp/bspError/src/BspErrorTester.cpp b/libs/bsp/bspError/src/BspErrorTester.cpp deleted file mode 100644 index 2e7b747b11..0000000000 --- a/libs/bsp/bspError/src/BspErrorTester.cpp +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright 2024 Accenture. - -#include "bspError/BspErrorTester.h" - -#include - -namespace bios -{ -BspErrorTester::BspErrorTester(::util::stream::ISharedOutputStream& sharedStream) -: SimpleCommand( - "bspError", - "get BspErrors", - ExecuteFunction::create(*this)) -, fSharedStream(sharedStream) -{} - -void BspErrorTester::executeCommand(::util::command::CommandContext& context) - -{ - uint32_t const error = BspError::getError(); - (void)::util::format::SharedStringWriter(context).printf("error = %x", error); -} - -void BspErrorTester::event( - uint32_t const event, - bool const active, - uint32_t const status0, - uint32_t const /*status1*/ - , - uint32_t const /*status2*/ - , - uint32_t const /*status3*/) -{ - (void)::util::format::SharedStringWriter(fSharedStream) - .printf("error = %x -> %d , status = %x", event, active, status0); -} - -} // namespace bios diff --git a/libs/bsp/bspError/test/gtest/CMakeLists.txt b/libs/bsp/bspError/test/gtest/CMakeLists.txt deleted file mode 100644 index 56a05c66ff..0000000000 --- a/libs/bsp/bspError/test/gtest/CMakeLists.txt +++ /dev/null @@ -1,5 +0,0 @@ -add_executable(bspErrorTest src/IncludeTest.cpp) - -target_link_libraries(bspErrorTest PRIVATE bspError util gtest_main) - -gtest_discover_tests(bspErrorTest PROPERTIES LABELS "bspErrorTest") diff --git a/libs/bsp/bspError/test/gtest/src/IncludeTest.cpp b/libs/bsp/bspError/test/gtest/src/IncludeTest.cpp deleted file mode 100644 index 284e7339c3..0000000000 --- a/libs/bsp/bspError/test/gtest/src/IncludeTest.cpp +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright 2024 Accenture. - -#include "bspError/BspError.h" -#include "bspError/BspErrorTester.h" - -#include - -namespace -{ -TEST(BspTest, IncludeCheck) -{ - // This test currently only checks if the includes are working. -} - -} // anonymous namespace diff --git a/libs/bsp/bspInputManager/CMakeLists.txt b/libs/bsp/bspInputManager/CMakeLists.txt index 76de45a740..bd5c0b94df 100644 --- a/libs/bsp/bspInputManager/CMakeLists.txt +++ b/libs/bsp/bspInputManager/CMakeLists.txt @@ -8,10 +8,8 @@ target_include_directories(bspInputManager PUBLIC include) target_link_libraries( bspInputManager PUBLIC bsp - bspCommandInterpreterSimple bspDynamicClient bspIo - bspTestConsoleWithCommandInterpreter estd platform util) diff --git a/libs/bsp/bspInputManager/test/gtest/CMakeLists.txt b/libs/bsp/bspInputManager/test/gtest/CMakeLists.txt index 33638fec7d..22b20414d1 100644 --- a/libs/bsp/bspInputManager/test/gtest/CMakeLists.txt +++ b/libs/bsp/bspInputManager/test/gtest/CMakeLists.txt @@ -7,7 +7,6 @@ target_link_libraries( PRIVATE bspDynamicClient utbspIo util - bspCommandInterpreterSimple gtest_main) gtest_discover_tests(bspInputManagerTest PROPERTIES LABELS diff --git a/libs/bsp/bspTestConsoleWithCommandInterpreter/CMakeLists.txt b/libs/bsp/bspTestConsoleWithCommandInterpreter/CMakeLists.txt deleted file mode 100644 index a488d9c277..0000000000 --- a/libs/bsp/bspTestConsoleWithCommandInterpreter/CMakeLists.txt +++ /dev/null @@ -1,9 +0,0 @@ -add_library(bspTestConsoleWithCommandInterpreter src/console/Console.cpp - src/console/ConsoleMenu.cpp) - -target_include_directories(bspTestConsoleWithCommandInterpreter PUBLIC include) - -target_link_libraries( - bspTestConsoleWithCommandInterpreter - PUBLIC bsp bspCommandInterpreterSimple - PRIVATE bspCharInputOutput) diff --git a/libs/bsp/bspTestConsoleWithCommandInterpreter/doc/index.rst b/libs/bsp/bspTestConsoleWithCommandInterpreter/doc/index.rst deleted file mode 100644 index 46e0fa69f9..0000000000 --- a/libs/bsp/bspTestConsoleWithCommandInterpreter/doc/index.rst +++ /dev/null @@ -1,11 +0,0 @@ -:orphan: -bspTestConsoleWithCommandInterpreter -==================================== - - -Overview --------- - -This module contains a serial console tester. The ``Console`` manages the overall command-line -interface and user input, while ``ConsoleMenu`` defines specific command functionalities, both -working together to facilitate command processing in the system. diff --git a/libs/bsp/bspTestConsoleWithCommandInterpreter/include/console/Console.h b/libs/bsp/bspTestConsoleWithCommandInterpreter/include/console/Console.h deleted file mode 100644 index 1f8a4e0da6..0000000000 --- a/libs/bsp/bspTestConsoleWithCommandInterpreter/include/console/Console.h +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright 2024 Accenture. - -#ifndef GUARD_3ADAA8D7_0EB4_46F1_BB62_C8AA11E10522 -#define GUARD_3ADAA8D7_0EB4_46F1_BB62_C8AA11E10522 - -#include - -#include - -namespace bios -{ -class Console : public ::estd::singleton -{ -public: - Console(); - - virtual bool execute(); - - CommandInterpreter& getCommandInterpreter() const { return *fConsoleClient; } - - void add(CommandInterpreter* const client) - { - if (fConsoleClient == nullptr) - { - fConsoleClient = client; - } - else - { - fConsoleClient->add(client); - } - } - - static uint8_t const CONSOLE_BUFFER_SIZE = 96U; - -private: - static uint8_t const BACK_SPACE = 0x08U; - static uint8_t const BACK_SPACE_7F = 0x7FU; - static uint8_t const LINE_FEED = 0x0AU; - static uint8_t const CARRIAGE_RETURN = 0x0DU; - static uint8_t const ESCAPE = 0x1BU; - static uint8_t const CURSOR_UP = 0x5BU; - - bool gets(char* const buffer, uint8_t const size); - - uint8_t fReadPosition; - uint8_t fReadPrevPosition; - static char sfBuffer[CONSOLE_BUFFER_SIZE]; - static char sfBufferB[CONSOLE_BUFFER_SIZE]; - - CommandInterpreter* fConsoleClient; -}; - -} // namespace bios - -#endif diff --git a/libs/bsp/bspTestConsoleWithCommandInterpreter/include/console/ConsoleMenu.h b/libs/bsp/bspTestConsoleWithCommandInterpreter/include/console/ConsoleMenu.h deleted file mode 100644 index ef88e4161e..0000000000 --- a/libs/bsp/bspTestConsoleWithCommandInterpreter/include/console/ConsoleMenu.h +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright 2024 Accenture. - -#ifndef GUARD_17FB1545_47BD_4BBE_8030_AAB7C59A36DB -#define GUARD_17FB1545_47BD_4BBE_8030_AAB7C59A36DB - -#include - -namespace bios -{ -class Console; - -class ConsoleMenu -{ -public: - ConsoleMenu(Console& console); - - virtual bios::CommandReturnCode commandFunction(bios::CommandLine& commandLine); - -protected: - bios::CommandInterpreter fCommandInterpreter; - - static bios::CommandSpec const fCiSpec[]; -}; - -} // namespace bios - -#endif diff --git a/libs/bsp/bspTestConsoleWithCommandInterpreter/module.spec b/libs/bsp/bspTestConsoleWithCommandInterpreter/module.spec deleted file mode 100644 index 2fb389c066..0000000000 --- a/libs/bsp/bspTestConsoleWithCommandInterpreter/module.spec +++ /dev/null @@ -1,3 +0,0 @@ -maturity: raw -unit_test: false -oss: true diff --git a/libs/bsp/bspTestConsoleWithCommandInterpreter/src/console/Console.cpp b/libs/bsp/bspTestConsoleWithCommandInterpreter/src/console/Console.cpp deleted file mode 100644 index 5d68a847fd..0000000000 --- a/libs/bsp/bspTestConsoleWithCommandInterpreter/src/console/Console.cpp +++ /dev/null @@ -1,103 +0,0 @@ -// Copyright 2024 Accenture. - -#include "console/Console.h" - -#include -#include -#include - -#include - -namespace bios -{ -char Console::sfBuffer[CONSOLE_BUFFER_SIZE] = {0}; -char Console::sfBufferB[CONSOLE_BUFFER_SIZE] = {0x0}; - -Console::Console() -: ::estd::singleton(*this), fReadPosition(0U), fReadPrevPosition(0U), fConsoleClient(0) -{} - -bool Console::execute() -{ - static bool showPrompt = true; - - if (showPrompt) - { - LOGSYNCHRON("\r\n> "); - showPrompt = false; - } - if (gets(&(sfBuffer[0]), sizeof(sfBuffer))) - { - showPrompt = true; - if ((sfBuffer[0] != 0) && fConsoleClient) - { - LOGSYNCHRON("\n"); - CommandLine command(sfBuffer); - LOGSYNCHRON( - "\r\n(%s)\r\n", - fConsoleClient->errorCodeToString(fConsoleClient->processCommand(command))); - } - } - return true; -} - -bool Console::gets(char* const buffer, uint8_t const size) -{ - uint8_t const t = static_cast(charIoGetc()); - - if (t != 0U) - { - if (fReadPosition > (size - 1U)) - { - fReadPosition = 0U; - } - - if ((t != ESCAPE) && (t != CARRIAGE_RETURN) && (t != CURSOR_UP)) - { - (void)charIoPutc(static_cast(t)); - } - /* save content - cursor up */ - if (t == ESCAPE) - { - buffer[fReadPosition] = 0; - fReadPosition = 0U; - return true; - } - else if (t == CURSOR_UP) - { - fReadPosition = fReadPrevPosition; - for (uint8_t i = 0U; i < fReadPosition; i++) - { - buffer[i] = sfBufferB[i]; - (void)charIoPutc(static_cast(buffer[i])); - } - return false; - } - else if ((t == BACK_SPACE) || (t == BACK_SPACE_7F)) - { - if (fReadPosition != 0U) - { - --fReadPosition; - } - } - else if (t == CARRIAGE_RETURN) - { - fReadPrevPosition = fReadPosition; - for (uint8_t i = 0U; i < fReadPrevPosition; i++) - { - sfBufferB[i] = buffer[i]; - } - buffer[fReadPosition] = 0; - fReadPosition = 0U; - return true; - } - else - { - buffer[fReadPosition] = static_cast(t); - ++fReadPosition; - } - } - return false; -} - -} /* namespace bios */ diff --git a/libs/bsp/bspTestConsoleWithCommandInterpreter/src/console/ConsoleMenu.cpp b/libs/bsp/bspTestConsoleWithCommandInterpreter/src/console/ConsoleMenu.cpp deleted file mode 100644 index 05573cb2f2..0000000000 --- a/libs/bsp/bspTestConsoleWithCommandInterpreter/src/console/ConsoleMenu.cpp +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright 2024 Accenture. - -#include "console/ConsoleMenu.h" - -#include "console/Console.h" - -#include -#include -#include - -#include - -namespace bios -{ -CommandSpec const ConsoleMenu::fCiSpec[] = { - {"bsp", "bsp console"}, - {"t", "read system time"}, - {"7", "link information"}, - {"r", "reset"}, - {"d", "dreset"}, - {0, 0}, -}; - -extern "C" -{ -extern char const* getBinFileName(void); -} - -ConsoleMenu::ConsoleMenu(Console& console) -: fCommandInterpreter( - fCiSpec[0], - CommandInterpreter::CommandFunc::create(*this)) -{ - console.add(&fCommandInterpreter); -} - -CommandReturnCode ConsoleMenu::commandFunction(CommandLine& commandLine) -{ - if (commandLine.getMatchingCommandIndex(0U, fCiSpec[0]) != 0U) // Main Menu - { - return CMD_NOCMD; - } - - switch (static_cast(commandLine.getMatchingCommandIndex(1U, fCiSpec[0]))) - { - case 1: // System Time - { - (void)printf("current time: %u", static_cast(getSystemTimeUs())); - } - break; - case 2: // Link Date - { - (void)printf(" %s\n", getBinFileName()); - } - break; - case 3: - { - softwareSystemReset(); - break; - } - case 4: - { - softwareDestructiveReset(); - break; - } - default: - { - return CMD_NOCMD; - } - } - - return CMD_OK; -} - -} /* namespace bios */ diff --git a/libs/bsp/bspTestConsoleWithCommandInterpreter/test/gtest/CMakeLists.txt b/libs/bsp/bspTestConsoleWithCommandInterpreter/test/gtest/CMakeLists.txt deleted file mode 100644 index 56a43ab018..0000000000 --- a/libs/bsp/bspTestConsoleWithCommandInterpreter/test/gtest/CMakeLists.txt +++ /dev/null @@ -1,11 +0,0 @@ -add_executable(bspTestConsoleWithCommandInterpreterTest src/IncludeTest.cpp) - -target_include_directories(bspTestConsoleWithCommandInterpreterTest - PRIVATE ../../include) - -target_link_libraries(bspTestConsoleWithCommandInterpreterTest - PRIVATE bspCommandInterpreterSimple gtest_main) - -gtest_discover_tests( - bspTestConsoleWithCommandInterpreterTest - PROPERTIES LABELS "bspTestConsoleWithCommandInterpreterTest") diff --git a/libs/bsp/bspTestConsoleWithCommandInterpreter/test/gtest/src/IncludeTest.cpp b/libs/bsp/bspTestConsoleWithCommandInterpreter/test/gtest/src/IncludeTest.cpp deleted file mode 100644 index 11b3145764..0000000000 --- a/libs/bsp/bspTestConsoleWithCommandInterpreter/test/gtest/src/IncludeTest.cpp +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright 2024 Accenture. - -#include "console/Console.h" -#include "console/ConsoleMenu.h" - -#include - -namespace -{ -TEST(BspTest, IncludeCheck) -{ - // This test currently only checks if the includes are working. -} - -} // anonymous namespace diff --git a/libs/bsw/bsp/include/bsp/background/AbstractBackgroundJob.h b/libs/bsw/bsp/include/bsp/background/AbstractBackgroundJob.h deleted file mode 100644 index b422d2d849..0000000000 --- a/libs/bsw/bsp/include/bsp/background/AbstractBackgroundJob.h +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright 2024 Accenture. - -/** - * Contains abstract base class every class which wants to get jobs executed in - * a background task has to implement. - * \ingroup bsp - * - */ -#ifndef GUARD_146DE4AF_8CD4_403A_9707_74FF5FF80739 -#define GUARD_146DE4AF_8CD4_403A_9707_74FF5FF80739 - -#include - -namespace bsp -{ -/** - * Interface every BackgroundJob has to implement. - * - * - */ -class AbstractBackgroundJob : public ::estd::forward_list_node -{ -public: - /** - * Constructor - */ - AbstractBackgroundJob() - : ::estd::forward_list_node(), fRemoveRequested(false) - {} - - /** - * Contains the code which should be executed during the background task. - * \return * - true if execute shall be called again - * - false if execution is done and should not be called again - */ - virtual bool execute() = 0; - - /** - * Will be called once the background task has been killed. - * \note * This function will also be called if false is returned from execute - * \see execute() - */ - virtual void removed(); - - /** - * \return if remove has been requested - */ - bool isRemoveRequested() const; - - /** - * Clients should not use this method. Its to be used by the - * IBackgroundJobHandler. - * \param value new status of remove requested - * - * \see IBackgroundJobHandler::addJob() - * \see IBackgroundJobHandler::removeJob() - */ - void setRemoveRequested(bool value); - -private: - bool fRemoveRequested; -}; - -/* - * inline implementation - */ - -// virtual -inline void AbstractBackgroundJob::removed() {} - -inline bool AbstractBackgroundJob::isRemoveRequested() const { return fRemoveRequested; } - -inline void AbstractBackgroundJob::setRemoveRequested(bool const value) -{ - fRemoveRequested = value; -} - -} // namespace bsp - -#endif /*GUARD_146DE4AF_8CD4_403A_9707_74FF5FF80739*/ diff --git a/libs/bsw/bsp/include/bsp/background/IBackgroundJobHandler.h b/libs/bsw/bsp/include/bsp/background/IBackgroundJobHandler.h deleted file mode 100644 index 9a5f913ce8..0000000000 --- a/libs/bsw/bsp/include/bsp/background/IBackgroundJobHandler.h +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright 2024 Accenture. - -/** - * Contains interface of a class which runs jobs for other components during - * a background task (idle task). - * \ingroup bsp - * - * \note * In order to influence the system as little as possible the background task - * must be preemptive and jobs executed should have as little critical sections - * as possible if any. - * - */ -#ifndef GUARD_F1BC5D6A_6E50_47B1_BEBA_D7709994FBAE -#define GUARD_F1BC5D6A_6E50_47B1_BEBA_D7709994FBAE - -namespace bsp -{ -class AbstractBackgroundJob; - -/** - * Interface for BackgroundJobHandler - * - * Interface of a class which runs jobs for other components during a background - * task. - */ -class IBackgroundJobHandler -{ -public: - /** - * adds a background job - * \param job AbstractBackgroundJob which should be added - * \return true if call was successfull, false if not - */ - virtual bool addJob(AbstractBackgroundJob& job) = 0; - - /** - * removes a background job - * \param job AbstractBackgroundJob which should be deleted - */ - virtual bool removeJob(AbstractBackgroundJob& job) = 0; - -protected: - IBackgroundJobHandler& operator=(IBackgroundJobHandler const&) = default; -}; - -} // namespace bsp - -#endif /*GUARD_F1BC5D6A_6E50_47B1_BEBA_D7709994FBAE*/ diff --git a/libs/bsw/bsp/include/bsp/can/ICanPhy.h b/libs/bsw/bsp/include/bsp/can/ICanPhy.h deleted file mode 100644 index 20b5d0c377..0000000000 --- a/libs/bsw/bsp/include/bsp/can/ICanPhy.h +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright 2024 Accenture. - -#ifndef GUARD_788E1E7D_4B7E_404B_AE2F_BF12EC9FAF80 -#define GUARD_788E1E7D_4B7E_404B_AE2F_BF12EC9FAF80 - -#include "bsp/Bsp.h" - -#include - -#include -#include - -namespace bsp -{ -namespace can -{ -/** - * Interface for CAN phy implementations. - */ -class ICanPhy -{ - struct OperatingModes - { - enum type - { - MODE_INVALID, - MODE_STANDBY, - MODE_SLEEP, - MODE_LISTEN_ONLY, - MODE_NORMAL - }; - }; - -public: - using ChannelMask = ::estd::bitset<32>; - - using OperatingMode = ::util::types::Enum; - - virtual ::bsp::BspReturnCode - setOperatingMode(OperatingMode mode, ChannelMask channels = ChannelMask()) - = 0; - - virtual OperatingMode operatingMode(uint8_t channel) const = 0; - - virtual bool hasError(uint8_t channel) const = 0; - - virtual uint8_t numberOfChannels() const = 0; - -protected: - ICanPhy& operator=(ICanPhy const&) = default; -}; - -} // namespace can -} // namespace bsp - -#endif /* GUARD_788E1E7D_4B7E_404B_AE2F_BF12EC9FAF80 */ diff --git a/libs/bsw/bsp/include/bsp/can/canTransceiver/CanJob.h b/libs/bsw/bsp/include/bsp/can/canTransceiver/CanJob.h deleted file mode 100644 index 4767c4309c..0000000000 --- a/libs/bsw/bsp/include/bsp/can/canTransceiver/CanJob.h +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright 2024 Accenture. - -/** - * \ingroup can - */ -#ifndef GUARD_BA68CB3C_8BCC_46EC_B646_E223A142DFB4 -#define GUARD_BA68CB3C_8BCC_46EC_B646_E223A142DFB4 - -#include -#include -#include -#include - -#include - -namespace can -{ -struct CanCommandJob -{ - ::estd::array data; - uint32_t canId; - uint8_t length; -}; - -struct CanJob -{ - ::estd::array data; - uint32_t canId; - uint8_t busId; - uint8_t length; -}; - -struct CanJobWithCallback : CanJob -{ - void* callback; - uint64_t timestamp; -}; - -inline ::estd::slice payloadOf(CanJob& job) -{ - return ::estd::slice::from_pointer(job.data.data(), job.length); -} - -inline uint8_t setPayload(CanJob& job, ::estd::slice const& data) -{ - job.length = static_cast(data.size()); - (void)::estd::memory::copy(job.data, data); - return job.length; -} - -inline uint8_t setPayload(CanJob& job, uint8_t const* const data, uint8_t const length) -{ - job.length = length; - memcpy(job.data.data(), data, length); - return job.length; -} - -} // namespace can - -#endif /* GUARD_BA68CB3C_8BCC_46EC_B646_E223A142DFB4 */ diff --git a/libs/bsw/bsp/include/bsp/commandInterpreter/CommandSpec.h b/libs/bsw/bsp/include/bsp/commandInterpreter/CommandSpec.h deleted file mode 100644 index a224a5e77f..0000000000 --- a/libs/bsw/bsp/include/bsp/commandInterpreter/CommandSpec.h +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright 2024 Accenture. - -#ifndef GUARD_85BBDD33_B784_4F2B_968E_240820E76807 -#define GUARD_85BBDD33_B784_4F2B_968E_240820E76807 - -namespace bios -{ -struct CommandSpec -{ // lint --e{970} CommandInterpreter uses C strings, so usage of char is OK - char const* fName; - char const* fHelpText; -}; -} // namespace bios - -#endif /* GUARD_85BBDD33_B784_4F2B_968E_240820E76807 */ diff --git a/libs/bsw/bsp/include/bsp/commandInterpreter/ICommandInterpreter.h b/libs/bsw/bsp/include/bsp/commandInterpreter/ICommandInterpreter.h deleted file mode 100644 index 2feb65260a..0000000000 --- a/libs/bsw/bsp/include/bsp/commandInterpreter/ICommandInterpreter.h +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright 2024 Accenture. - -#ifndef GUARD_EA8CB8A2_19E6_44ED_957D_762E86A1FA59 -#define GUARD_EA8CB8A2_19E6_44ED_957D_762E86A1FA59 - -#include "CommandSpec.h" -#include "ReturnCode.h" - -#include -#include -#include - -namespace bios -{ -class CommandInterpreter; - -class CommandLine; - -class ICommandInterpreter : public ::estd::forward_list_node -{ // lint --e{970} CommandInterpreter uses C strings, so usage of char is OK - UNCOPYABLE(ICommandInterpreter); - -public: - using CommandFunc = ::estd::function; - - virtual CommandReturnCode processCommand(CommandLine& commandLine) = 0; - virtual void add(CommandInterpreter& child) = 0; - virtual char const* getName() const = 0; - virtual char const* getHelpText() const = 0; - virtual char const* errorCodeToString(CommandReturnCode code) const = 0; - virtual void printHelp() = 0; -}; - -} // namespace bios - -#endif /* GUARD_EA8CB8A2_19E6_44ED_957D_762E86A1FA59 */ diff --git a/libs/bsw/bsp/include/bsp/commandInterpreter/ICommandInterpreterSimple.h b/libs/bsw/bsp/include/bsp/commandInterpreter/ICommandInterpreterSimple.h deleted file mode 100644 index 5c027f5532..0000000000 --- a/libs/bsw/bsp/include/bsp/commandInterpreter/ICommandInterpreterSimple.h +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright 2024 Accenture. - -#ifndef GUARD_BCEFE50D_DF7B_4E67_B24D_A6639AB5B41F -#define GUARD_BCEFE50D_DF7B_4E67_B24D_A6639AB5B41F - -#include "CommandSpec.h" -#include "ReturnCode.h" - -#include -#include - -namespace bios -{ -class CommandLine; - -class ICommandInterpreterSimple -{ // lint --e{970} CommandInterpreter uses C strings, so usage of char is OK - UNCOPYABLE(ICommandInterpreterSimple); - -public: - using CommandFunc = ::estd::function; - - ICommandInterpreterSimple() : next(nullptr) {} - - virtual CommandReturnCode processCommand(CommandLine& commandLine) - { - if (next != nullptr) - { - return (next->processCommand(commandLine)); - } - return CMD_NOCMD; - } - - virtual void printHelp(char const* specific = nullptr) - { - if (next != nullptr) - { - next->printHelp(specific); - } - } - - void add(ICommandInterpreterSimple* const client) - { - if ((next != client) && (client != nullptr)) - { - if (next != nullptr) - { - next->add(client); - } - else - { - next = client; - } - } - } - -protected: - ICommandInterpreterSimple* getNext() { return next; } - -private: - ICommandInterpreterSimple* next; -}; - -} /* namespace bios */ - -#endif /* GUARD_BCEFE50D_DF7B_4E67_B24D_A6639AB5B41F */ diff --git a/libs/bsw/bsp/include/bsp/commandInterpreter/ReturnCode.h b/libs/bsw/bsp/include/bsp/commandInterpreter/ReturnCode.h deleted file mode 100644 index 4d82be449a..0000000000 --- a/libs/bsw/bsp/include/bsp/commandInterpreter/ReturnCode.h +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright 2024 Accenture. - -#ifndef GUARD_9D026900_89F3_4AA8_AA72_427AC489A913 -#define GUARD_9D026900_89F3_4AA8_AA72_427AC489A913 - -namespace bios -{ -enum CommandReturnCode -{ - CMD_OK, - CMD_ERROR, - CMD_NOCMD, - CMD_NUM_CODES -}; -} - -#endif /* GUARD_9D026900_89F3_4AA8_AA72_427AC489A913 */ diff --git a/libs/bsw/bsp/include/bsp/error/IEventListener.h b/libs/bsw/bsp/include/bsp/error/IEventListener.h deleted file mode 100644 index 4493a7eb8c..0000000000 --- a/libs/bsw/bsp/include/bsp/error/IEventListener.h +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright 2024 Accenture. - -#ifndef GUARD_8F64FED2_77A8_43B6_99FE_8AED4251BBAC -#define GUARD_8F64FED2_77A8_43B6_99FE_8AED4251BBAC - -#include - -namespace bios -{ -class IEventListener -{ -public: - static uint32_t const INVALID = 0xffffffffU; - - static uint32_t const ADCERROR = 0x00000001U; - static uint32_t const FLASHERROR = 0x00000002U; - static uint32_t const EEPERROR = 0x00000004U; - static uint32_t const TIMERERROR = 0x00000008U; - static uint32_t const PWMERROR = 0x00000010U; - static uint32_t const SPIERROR = 0x00000020U; - static uint32_t const CLOCKMONITORERROR = 0x00000040U; - static uint32_t const WDERROR = 0x00000080U; - static uint32_t const DMAERROR = 0x00000100U; - static uint32_t const STANDBYWARNING = 0x00000200U; - static uint32_t const RAMERROR = 0x00000400U; - static uint32_t const SAFE_IO = 0x00000800U; - static uint32_t const SAFE_SPOC = 0x00001000U; - static uint32_t const SAFE_EMIOS1 = 0x00002000U; - static uint32_t const OVER_TEMPERATURE = 0x00004000U; - - static uint32_t const EVENT15 = 0x00008000U; - static uint32_t const EVENT16 = 0x00010000U; - static uint32_t const EVENT17 = 0x00020000U; - static uint32_t const EVENT18 = 0x00040000U; - static uint32_t const EVENT19 = 0x00080000U; - static uint32_t const EVENT20 = 0x00100000U; - static uint32_t const EVENT21 = 0x00200000U; - static uint32_t const EVENT22 = 0x00400000U; - static uint32_t const EVENT23 = 0x00800000U; - static uint32_t const EVENT24 = 0x01000000U; - static uint32_t const EVENT25 = 0x02000000U; - static uint32_t const EVENT26 = 0x04000000U; - static uint32_t const EVENT27 = 0x08000000U; - static uint32_t const EVENT28 = 0x10000000U; - static uint32_t const EVENT29 = 0x20000000U; - static uint32_t const EVENT30 = 0x40000000U; - static uint32_t const SYSTEM_UNLOCKEDWARNING = 0x80000000U; - - virtual void event( - uint32_t event, - bool active, - uint32_t status0 = INVALID, - uint32_t status1 = INVALID, - uint32_t status2 = INVALID, - uint32_t status3 = INVALID - - ) - = 0; - -protected: - IEventListener& operator=(IEventListener const&) = default; -}; - -} // namespace bios - -#endif /* GUARD_8F64FED2_77A8_43B6_99FE_8AED4251BBAC */ diff --git a/libs/bsw/bsp/include/bsp/ethernet/ILinkStatusListener.h b/libs/bsw/bsp/include/bsp/ethernet/ILinkStatusListener.h deleted file mode 100644 index 760b63e86c..0000000000 --- a/libs/bsw/bsp/include/bsp/ethernet/ILinkStatusListener.h +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright 2024 Accenture. - -#ifndef GUARD_A6DC0BE7_E06D_4B81_A90E_E3127700529C -#define GUARD_A6DC0BE7_E06D_4B81_A90E_E3127700529C - -#include -#include -#include - -namespace ethernet -{ - -class IEthernetDevice; - -namespace port -{ -static uint8_t const ANY_PORT = 254U; -static uint8_t const UNKNOWN_PORT = 255U; -} // namespace port - -/** - * Interface for classes interested in ethernet link status. - */ -class ILinkStatusListener -: public ::estd::forward_list_node -, public ::estd::uncopyable -{ -protected: - ILinkStatusListener(); - -public: - /** - * Link status codes - */ - enum LinkStatus - { - /** No link */ - LINK_DOWN = 0U, - /** Link is up */ - LINK_UP, - /** Link information is not available */ - LINK_INVALID, - /** Ethernet port is not available */ - PORT_UNAVAILABLE - }; - - /** - * Notifies about a change in the status of a ethernet link. - */ - virtual void linkStatusChanged(IEthernetDevice* pDevice, LinkStatus linkStatus, uint8_t port) - = 0; -}; - -/* - * inline methods - */ - -inline ILinkStatusListener::ILinkStatusListener() -: ::estd::forward_list_node(), ::estd::uncopyable() -{} - -} // namespace ethernet - -#endif /* GUARD_A6DC0BE7_E06D_4B81_A90E_E3127700529C */ diff --git a/libs/bsw/bsp/include/bsp/ethernet/IMdio.h b/libs/bsw/bsp/include/bsp/ethernet/IMdio.h deleted file mode 100644 index 8711c3f83d..0000000000 --- a/libs/bsw/bsp/include/bsp/ethernet/IMdio.h +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright 2024 Accenture. - -/** - * \ingroup bsp_ethernet - */ -#ifndef GUARD_49810DF0_6E88_461D_BA8C_AEBDD095D87B -#define GUARD_49810DF0_6E88_461D_BA8C_AEBDD095D87B - -#include "bsp/Bsp.h" - -#include - -namespace bsp -{ -namespace ethernet -{ -/** - * Interface for MDIO driver. - * - * \par MDIO - * MDIO allows to access registers in a standardized way. - * The phy address is limited to 5 bits, i.e. valid values - * range from 0 - 31. - * \deprecated Newer implementations should use IMdioClause22 or IMdioClause45 instead - */ -class IMdio -{ -public: - /** - * Reads a 16 bit MIIM value from a phy register identified by - * phyAddress and regAddress. - */ - virtual bsp::BspReturnCode miimRead(uint8_t phyAddress, uint8_t regAddress, uint16_t& data) = 0; - - /** - * Writes a 16 bit MIIM value to a phy register identified by - * phyAddress and regAddress. - */ - virtual bsp::BspReturnCode miimWrite(uint8_t phyAddress, uint8_t regAddress, uint16_t data) = 0; - - /** - * Reads a 8 bit SMI value from a switch register - * identified by a given regAddress. - */ - virtual bsp::BspReturnCode smiRead(uint8_t regAddress, uint8_t& data) = 0; - - /** - * Writes a 8 bit SMI value to a switch register - * identified by a given regAddress. - */ - virtual bsp::BspReturnCode smiWrite(uint8_t regAddress, uint8_t data) = 0; - -protected: - IMdio& operator=(IMdio const&) = default; -}; - -} // namespace ethernet -} // namespace bsp - -#endif /* GUARD_49810DF0_6E88_461D_BA8C_AEBDD095D87B */ diff --git a/libs/bsw/bsp/include/bsp/ethernet/IMdioClause22.h b/libs/bsw/bsp/include/bsp/ethernet/IMdioClause22.h deleted file mode 100644 index 7173b4d972..0000000000 --- a/libs/bsw/bsp/include/bsp/ethernet/IMdioClause22.h +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright 2024 Accenture. - -/** - * \ingroup bsp_ethernet - */ -#ifndef GUARD_9695B585_5AFB_44CC_B709_59592B13F419 -#define GUARD_9695B585_5AFB_44CC_B709_59592B13F419 - -#include "bsp/Bsp.h" - -#include - -namespace bsp -{ -namespace ethernet -{ -/** - * Interface for MDIO clause 22 driver. - * - * \par MDIO - * MDIO allows to access registers in a standardized way. - * The PHY address is limited to 5 bits, i.e. valid values - * range from 0 - 31. - */ -class IMdioClause22 -{ -public: - /** - * Reads a 16 bit MIIM value from a PHY register identified by - * the PHY address (also named PHYAD) and register address. - */ - virtual bsp::BspReturnCode - miimRead(uint8_t phyAddress, uint8_t regAddress, uint16_t& data) const - = 0; - - /** - * Writes a 16 bit MIIM value to a PHY register identified by - * the PHY address (also named PHYAD) and register address. - */ - virtual bsp::BspReturnCode miimWrite(uint8_t phyAddress, uint8_t regAddress, uint16_t data) = 0; - -protected: - IMdioClause22& operator=(IMdioClause22 const&) = default; -}; - -} // namespace ethernet -} // namespace bsp - -#endif /* GUARD_9695B585_5AFB_44CC_B709_59592B13F419 */ diff --git a/libs/bsw/bsp/include/bsp/ethernet/IMdioClause45.h b/libs/bsw/bsp/include/bsp/ethernet/IMdioClause45.h deleted file mode 100644 index f3e38a4ea9..0000000000 --- a/libs/bsw/bsp/include/bsp/ethernet/IMdioClause45.h +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright 2024 Accenture. - -/** - * \ingroup bsp_ethernet - */ -#ifndef GUARD_6FB24926_53D6_4444_B6A3_D4D1FC164F05 -#define GUARD_6FB24926_53D6_4444_B6A3_D4D1FC164F05 - -#include "bsp/Bsp.h" - -#include - -namespace bsp -{ -namespace ethernet -{ -/** - * Interface for MDIO clause 45 driver. - * - * \par MDIO - * MDIO allows to access registers in a standardized way. - * The PHY and device address are limited to 5 bits, i.e. valid - * values range from 0 - 31. - */ -class IMdioClause45 -{ -public: - /** - * Reads a 16 bit MIIM value from a PHY register identified by - * the PHY address (also named PHYAD), device address (also - * named DEVAD) and register address. - */ - virtual bsp::BspReturnCode - miimRead(uint8_t phyAddress, uint8_t devAddress, uint16_t regAddress, uint16_t& data) const - = 0; - - /** - * Writes a 16 bit MIIM value to a PHY register identified by - * the PHY address (also named PHYAD), device address (also - * named DEVAD) and register address. - */ - virtual bsp::BspReturnCode - miimWrite(uint8_t phyAddress, uint8_t devAddress, uint16_t regAddress, uint16_t data) - = 0; - -protected: - IMdioClause45& operator=(IMdioClause45 const&) = default; -}; - -} // namespace ethernet -} // namespace bsp - -#endif /* GUARD_6FB24926_53D6_4444_B6A3_D4D1FC164F05 */ diff --git a/libs/bsw/bsp/include/bsp/flash/IFlash.h b/libs/bsw/bsp/include/bsp/flash/IFlash.h deleted file mode 100644 index aeaba55c79..0000000000 --- a/libs/bsw/bsp/include/bsp/flash/IFlash.h +++ /dev/null @@ -1,159 +0,0 @@ -// Copyright 2024 Accenture. - -#ifndef GUARD_5676EA4E_2F67_4842_A14D_2688944DE5F4 -#define GUARD_5676EA4E_2F67_4842_A14D_2688944DE5F4 - -#include -#include - -namespace bsp -{ -namespace flash -{ -/** - * IFlash formulates a interface to access the Flash Memory. - */ -struct IFlash -{ - /** - * A FlashBlock is a logical abstraction of one or more physical flashblocks. - * - *
-     * example:
-     *  | <------- Flasblock ----------------> |
-     *  -----------------------------------------------------------
-     *  | PHY Block 8 Byte | PHY Block 16 Byte | PHY Block 8 Byte |
-     *  -----------------------------------------------------------
-     * 
- */ - class FlashBlock - { - public: - FlashBlock(uint32_t offset, uint32_t length); - - uint32_t offset() const; - - uint32_t length() const; - - bool isValid() const; - - private: - uint32_t const _offset; - uint32_t const _length; - }; - - /** - * Get a memory view of the flash memory managed by the IFlash implementor. - * - * \return a memoryView of the the entire flash memory. - */ - virtual ::estd::slice memory() const = 0; - - /** - * Writes data to flash. - * - * \param offset into the flash memory to determine where data shall be written to. - * \param data which shall be written. - * - * \return amount of bytes written. - * - * \attention a write call might not write the entire data immediately to the flash, data - * might be buffered between successive write calls. - * To make sure all data is written to flash call flush. - */ - virtual uint32_t write(uint32_t offset, ::estd::slice data) = 0; - - /** - * Makes sure all buffered data is written to the flash. - * - * \return true if all buffered data have been flushed successfully to the flash, - * otherwise false. - */ - virtual bool flush() = 0; - - /** - * Erase flash. - * - * \param flashBlock which shall be deleted. - * \attention one logical flash block can consist of multiple physical flashblock, - * it is inevitable that the logical flash block complies to the underlying - * physical flash block boundaries. To make sure this is the case one - * can use the block method which returns a logical flash block which - * contains the provided memory area. - * - * \return true if the flash was erased sucessfully, otherwise false. - */ - virtual bool erase(FlashBlock const& flashBlock) = 0; - - /** - * Get a logical flash block based on an offset and a length. - * - * \param offset into the flash. - * \pre the offset must point to the start of a flash block. - * - * \return a flash block (start, size) wrapping at least the amount specified or - * the closest possible block. If the request exceedes the flash itself - * or an error occurs an invalid FlashBlock will be returned. - * - * examples: - *
-     *
-     * Logical Flashblock fits
-     * -----------------------
-     *  params:
-     *  offset = 8
-     *  length = 16
-     *
-     *  Actual flash layout:
-     *  -----------------------------------------------------------
-     *  | PHY Block 8 Byte | PHY Block 16 Byte | PHY Block 8 Byte |
-     *  -----------------------------------------------------------
-     *                     |   |
-     *                      FlashBlock (offset=8, legnth= 16)
-     *
-     *
-     * Logical Flashblock is approximated
-     * ----------------------------------
-     *  params:
-     *  offset = 1
-     *  length = 12
-     *
-     *  Actual flash layout:
-     *  -----------------------------------------------------------
-     *  | PHY Block 8 Byte | PHY Block 16 Byte | PHY Block 8 Byte |
-     *  -----------------------------------------------------------
-     *  | <-----Returned Flashblock ---------> |
-     *     FlashBlock (offset=0, legnth= 24)
-     *
-     *
-     * Logical Flashblock is invalid
-     * -----------------------------
-     *  params:
-     *  offset = 24
-     *  length = 16
-     *
-     *  Actual flash layout:
-     *  -----------------------------------------------------------
-     *  | PHY Block 8 Byte | PHY Block 16 Byte | PHY Block 8 Byte |
-     *  -----------------------------------------------------------
-     *                                         | <----------- Too Long -------------> |
-     *                                         Invalid FlashBlock (offset=0, legnth= 0)
-     * 
- */ - virtual FlashBlock block(uint32_t offset, uint32_t length) const = 0; -}; - -inline IFlash::FlashBlock::FlashBlock(uint32_t const offset, uint32_t const length) -: _offset(offset), _length(length) -{} - -inline uint32_t IFlash::FlashBlock::offset() const { return _offset; } - -inline uint32_t IFlash::FlashBlock::length() const { return _length; } - -inline bool IFlash::FlashBlock::isValid() const { return _length != 0U; } - -} // namespace flash -} // namespace bsp - -#endif /* GUARD_5676EA4E_2F67_4842_A14D_2688944DE5F4 */ diff --git a/libs/bsw/bsp/include/bsp/flexray/IFlexrayPhy.h b/libs/bsw/bsp/include/bsp/flexray/IFlexrayPhy.h deleted file mode 100644 index 26f726e25d..0000000000 --- a/libs/bsw/bsp/include/bsp/flexray/IFlexrayPhy.h +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright 2024 Accenture. - -/** - * \ingroup bsp_flexray - */ -#ifndef GUARD_D2EAE788_E4B6_4BC8_962C_E68A681CE57A -#define GUARD_D2EAE788_E4B6_4BC8_962C_E68A681CE57A - -#include "bsp/Bsp.h" - -#include - -#include - -namespace bsp -{ -namespace flexray -{ -/** - * Interface for a Flexray phy. - */ -class IFlexrayPhy -{ - struct OperatingModes - { - enum type - { - MODE_RESET, - MODE_STANDBY, - MODE_SLEEP, - MODE_NORMAL, - MODE_POWER_OFF - }; - }; - - struct BranchModes - { - enum type - { - MODE_NORMAL, - MODE_TX_ONLY, - MODE_RX_ONLY, - MODE_DISABLED, - MODE_TX_ON_NOISE // only TX enabled on a noisy branch, RX will be enabled - // automatically after noise is reduced - }; - }; - -public: - using OperatingMode = ::util::types::Enum; - using BranchMode = ::util::types::Enum; - using BranchMask = ::estd::bitset<32>; - - /** - * Synchronously resets the Flexray phy. - * - * In most cases this will require setting the RST pin to LOW for some microseconds and then - * releasing it. - */ - virtual void reset() = 0; - - virtual ::bsp::BspReturnCode setOperatingMode(OperatingMode mode) = 0; - - virtual ::bsp::BspReturnCode setBranchMode(BranchMask branches, BranchMode mode) = 0; - - virtual uint8_t getNumberOfBranches() const = 0; - -protected: - IFlexrayPhy& operator=(IFlexrayPhy const&) = default; -}; - -} // namespace flexray -} // namespace bsp - -#endif /* GUARD_D2EAE788_E4B6_4BC8_962C_E68A681CE57A */ diff --git a/libs/bsw/bsp/include/bsp/hwInfo/IHardwareInfoProvider.h b/libs/bsw/bsp/include/bsp/hwInfo/IHardwareInfoProvider.h deleted file mode 100644 index 967e84c48a..0000000000 --- a/libs/bsw/bsp/include/bsp/hwInfo/IHardwareInfoProvider.h +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright 2024 Accenture. - -#ifndef GUARD_7D7035F2_88B1_4AE5_A82C_FF43F3DA7174 -#define GUARD_7D7035F2_88B1_4AE5_A82C_FF43F3DA7174 - -namespace bsp -{ -/** - * @class IHardwareInfoProvider - * - * Interface for accessing the Hardware Infos - */ -class IHardwareInfoProvider -{ -public: - virtual bool isFlexrayHighVersion() = 0; - - virtual bool isMostAvailable() = 0; - - virtual bool isComBoard() = 0; - - virtual bool isDebugCanAvailable() = 0; - -protected: - IHardwareInfoProvider& operator=(IHardwareInfoProvider const&) = default; -}; - -} /* namespace bsp */ - -#endif /* GUARD_7D7035F2_88B1_4AE5_A82C_FF43F3DA7174 */ diff --git a/libs/bsw/bsp/include/bsp/i2c/I2cCommon.h b/libs/bsw/bsp/include/bsp/i2c/I2cCommon.h deleted file mode 100644 index cb499757ea..0000000000 --- a/libs/bsw/bsp/include/bsp/i2c/I2cCommon.h +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright 2024 Accenture. - -#ifndef GUARD_0A746553_D1DF_418B_884E_465EE18AFC24 -#define GUARD_0A746553_D1DF_418B_884E_465EE18AFC24 - -#include "platform/estdint.h" -#include "util/types/Enum.h" - -namespace bsp -{ -struct I2cReturnCodes -{ - enum type - { - RES_OK, - RES_NACK, - RES_ARBITRATION_LOST, - RES_BUSY, - RES_BUS_BUSY, - RES_ERROR - }; -}; - -using I2cReturnCode = ::util::types::Enum; - -namespace i2c -{ -using AddressType = size_t; - -} // namespace i2c -} // namespace bsp - -#endif // GUARD_0A746553_D1DF_418B_884E_465EE18AFC24 diff --git a/libs/bsw/bsp/include/bsp/i2c/II2cMaster.h b/libs/bsw/bsp/include/bsp/i2c/II2cMaster.h deleted file mode 100644 index ae1e4be3f2..0000000000 --- a/libs/bsw/bsp/include/bsp/i2c/II2cMaster.h +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright 2024 Accenture. - -/** - * \ingroup bsp_i2c - */ -#ifndef GUARD_513A9FF8_08E6_4172_B3F4_A143A83C1B80 -#define GUARD_513A9FF8_08E6_4172_B3F4_A143A83C1B80 - -#include "bsp/i2c/I2cCommon.h" - -#include - -#include -#include -#include -#include - -namespace bsp -{ -namespace i2c -{ -class II2cMaster -{ -public: - using CompletionCallback = ::estd::function; - - /** - * Performs a non-blocking send transaction on the I2C bus - * \param address The address of the I2C slave on the bus - * \param data A pointer to the data which shall be sent. The application has to make sure - * that the pointer stays valid until callback is called. - * \param callback A callback which gets called after the operation finishes. - * \param sendStop Defines whether to eventually send a stop condition or not. This can be used - * to perform repeated start (e.g. write followed by read) - */ - virtual void write( - AddressType address, - ::estd::slice data, - CompletionCallback callback, - bool sendStop) - = 0; - - /** - * Performs a non-blocking read transaction on the I2C bus - * \param address The address of the I2C slave on the bus - * \param data Pointer where the received data should be written to. The application has to - * make sure that the pointer stays valid until callback is called. - * \param callback A callback which gets called after the operation finishes. - * \param sendStop Defines whether to eventually send a stop condition or not. This can be used - * to perform repeated start. - */ - virtual void read( - AddressType address, - ::estd::slice data, - CompletionCallback callback, - bool sendStop) - = 0; - -protected: - II2cMaster& operator=(II2cMaster const&) = default; -}; - -} // namespace i2c -} // namespace bsp - -#endif // GUARD_513A9FF8_08E6_4172_B3F4_A143A83C1B80 diff --git a/libs/bsw/bsp/include/bsp/lin/ILinDevice.h b/libs/bsw/bsp/include/bsp/lin/ILinDevice.h deleted file mode 100644 index 77c9acebb1..0000000000 --- a/libs/bsw/bsp/include/bsp/lin/ILinDevice.h +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright 2024 Accenture. - -#ifndef GUARD_E2A6457B_8D54_4DC9_9D4F_756ABA354A43 -#define GUARD_E2A6457B_8D54_4DC9_9D4F_756ABA354A43 - -#include - -namespace bios -{ -class ILinDevice -{ -public: - using tRawFrame = struct RawFrame - { - uint8_t payload[8]; - uint8_t id; - uint8_t payloadLength; - - enum - { - DIR_TX, - DIR_RX - } direction; - - enum - { - CRC_NORMAL, - CRC_ENHANCED - } crcType; - }; - - virtual void init(uint8_t speedMode = 0U) = 0; - - virtual void open() = 0; - - virtual void close() = 0; - - virtual void shutdown() = 0; - - virtual void sendWakeupPattern() = 0; - - virtual void sendSleepCommand() = 0; - - virtual bool wakeupPatternReceived() = 0; - - /* ********** ********** ********** ********** ********** */ - - virtual bool frameComplete() = 0; - - virtual bool slaveTimeout() = 0; - - virtual bool stuckAtZero() = 0; - - virtual bool bitError() = 0; - - virtual bool framingError() = 0; - - virtual bool checksumError() = 0; - - /* ********** ********** ********** ********** ********** */ - - virtual RawFrame& getRefToRawFrame() = 0; - - virtual void transceive() = 0; - - virtual void fetchRawFrame() = 0; - - /* ********** ********** ********** ********** ********** */ - - virtual uint8_t readTxPortAsGpio() { return 1U; } - - virtual uint8_t readRxPortAsGpio() { return 1U; } - -protected: - ILinDevice& operator=(ILinDevice const&) = default; -}; - -} // namespace bios - -#endif diff --git a/libs/bsw/bsp/include/bsp/lin/ILinPhy.h b/libs/bsw/bsp/include/bsp/lin/ILinPhy.h deleted file mode 100644 index 7d7071c97b..0000000000 --- a/libs/bsw/bsp/include/bsp/lin/ILinPhy.h +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright 2024 Accenture. - -#ifndef GUARD_57D8B37A_D490_49B2_B691_934E04A308E9 -#define GUARD_57D8B37A_D490_49B2_B691_934E04A308E9 - -#include - -namespace bsp -{ -namespace lin -{ -class ILinPhy -{ -public: - enum ErrorCode - { - LIN_PHY_ERROR, - LIN_PHY_NO_ERROR, - LIN_PHY_INVALID_STATE - }; - - enum Mode - { - LIN_PHY_MODE_UNDEFINED = 0, - LIN_PHY_MODE_STANDBY = 1, - LIN_PHY_MODE_ACTIVE = 2 - }; - - virtual void init(uint32_t channel = 0U) = 0; - - virtual void setMode(Mode mode, uint32_t channel = 0U) = 0; - - virtual Mode getMode(uint32_t channel = 0U) = 0; - - virtual ErrorCode getPhyErrorStatus(uint32_t channel = 0U) = 0; - -protected: - ILinPhy& operator=(ILinPhy const&) = default; -}; - -} // namespace lin -} // namespace bsp - -#endif /* GUARD_57D8B37A_D490_49B2_B691_934E04A308E9 */ diff --git a/libs/bsw/bsp/include/bsp/lin/ILinSciReceiver.h b/libs/bsw/bsp/include/bsp/lin/ILinSciReceiver.h deleted file mode 100644 index 585db67baa..0000000000 --- a/libs/bsw/bsp/include/bsp/lin/ILinSciReceiver.h +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright 2024 Accenture. - -#ifndef GUARD_53C96C3A_3F15_4751_9E94_D893F5C2A8CA -#define GUARD_53C96C3A_3F15_4751_9E94_D893F5C2A8CA - -#include - -namespace bsp -{ -namespace lin -{ -class ILinSciReceiver -{ -public: - struct RawData - { - uint8_t pid; - uint8_t payload[8]; - uint8_t payloadLength; - uint8_t crc; - }; - - virtual uint8_t payloadLength(uint8_t pid) = 0; - - virtual void push(RawData& rawData) = 0; - -protected: - ILinSciReceiver& operator=(ILinSciReceiver const&) = default; -}; - -} // namespace lin -} // namespace bsp - -#endif /* GUARD_53C96C3A_3F15_4751_9E94_D893F5C2A8CA */ diff --git a/libs/bsw/bsp/include/bsp/lin/linTransceiver/LinPhy.h b/libs/bsw/bsp/include/bsp/lin/linTransceiver/LinPhy.h deleted file mode 100644 index 3cd0c9701f..0000000000 --- a/libs/bsw/bsp/include/bsp/lin/linTransceiver/LinPhy.h +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright 2024 Accenture. - -#ifndef GUARD_4790E190_76FC_488F_AD2D_50C90F49A61D -#define GUARD_4790E190_76FC_488F_AD2D_50C90F49A61D - -#include "bsp/lin/ILinPhy.h" - -namespace bsp -{ -namespace lin -{ -class LinPhy : public ILinPhy -{ -public: - LinPhy(); - - /* ILinPhy */ - - void init(uint32_t channel = 0U) override; - - void setMode(Mode mode, uint32_t channel = 0U) override = 0; - - Mode getMode(uint32_t channel = 0U) override; - - ErrorCode getPhyErrorStatus(uint32_t channel = 0U) override = 0; - -protected: - Mode fMode; - - LinPhy& operator=(LinPhy const&) = default; -}; - -// -// implementation -// - -inline LinPhy::LinPhy() : fMode(LIN_PHY_MODE_UNDEFINED) {} - -inline void LinPhy::init(uint32_t /*channel*/) {} - -inline ILinPhy::Mode LinPhy::getMode(uint32_t /*channel*/) { return fMode; } - -} // namespace lin -} // namespace bsp - -#endif /* GUARD_4790E190_76FC_488F_AD2D_50C90F49A61D */ diff --git a/libs/bsw/bsp/include/bsp/power/AbstractPowerStateListener.h b/libs/bsw/bsp/include/bsp/power/AbstractPowerStateListener.h deleted file mode 100644 index 25b8d0b5f3..0000000000 --- a/libs/bsw/bsp/include/bsp/power/AbstractPowerStateListener.h +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright 2024 Accenture. - -/** - * Contains interface every PowerStateListener has to implement. - * \file AbstractPowerStateListener.h - * \ingroup bsp - * - */ - -#ifndef GUARD_BA4B5F1D_E80A_4B23_AC16_9154AC14803E -#define GUARD_BA4B5F1D_E80A_4B23_AC16_9154AC14803E - -#include -#include - -namespace bsp -{ -/** - * @class AbstractPowerStateListener - * - * Interface every PowerStateListener has to implement. - * The PowerStateListener will be notified if a change in the voltage level beyond the - * trigger level occurs. The trigger level has to be supplied when the listener - * is added to the PowerManager - */ -class AbstractPowerStateListener : public ::estd::forward_list_node -{ -public: - AbstractPowerStateListener(); - - /** - * Notifies the listener of a change in the voltage level beyond the - * trigger level. The trigger level has to be supplied when the listener - * is added to the PowerManager. - * \param currentVoltage current voltage in 1/100 Volts (i.e. 7.07V == 707) - */ - virtual void powerStateChanged(uint16_t currentVoltage) = 0; - -private: - friend class VoltageManager; - uint16_t fTriggerVoltage; - - uint16_t getTriggerVoltage() const; -}; - -/* - * inline implementation - */ -inline AbstractPowerStateListener::AbstractPowerStateListener() : fTriggerVoltage(0U) {} - -inline uint16_t AbstractPowerStateListener::getTriggerVoltage() const { return fTriggerVoltage; } - -} /* namespace bsp */ - -#endif /* GUARD_BA4B5F1D_E80A_4B23_AC16_9154AC14803E */ diff --git a/libs/bsw/bsp/include/bsp/power/IAwakened.h b/libs/bsw/bsp/include/bsp/power/IAwakened.h deleted file mode 100644 index ca98237d12..0000000000 --- a/libs/bsw/bsp/include/bsp/power/IAwakened.h +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2024 Accenture. - -#ifndef GUARD_7D39DD0A_8598_4A5C_9BA8_00F697948F68 -#define GUARD_7D39DD0A_8598_4A5C_9BA8_00F697948F68 - -namespace bios -{ -class IAwakened -{ - IAwakened& operator=(IAwakened const&); - -public: - /** - * for the check can be IAwakened - * the parameter is the nominal cycle time - */ - virtual bool wokenUp() = 0; -}; - -} // namespace bios - -#endif /* GUARD_7D39DD0A_8598_4A5C_9BA8_00F697948F68 */ diff --git a/libs/bsw/bsp/include/bsp/power/IUnderVoltageListener.h b/libs/bsw/bsp/include/bsp/power/IUnderVoltageListener.h deleted file mode 100644 index 91ac133c76..0000000000 --- a/libs/bsw/bsp/include/bsp/power/IUnderVoltageListener.h +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright 2024 Accenture. - -#ifndef GUARD_C1379F92_B8FD_46D7_A0DF_0C14DC89B4C3 -#define GUARD_C1379F92_B8FD_46D7_A0DF_0C14DC89B4C3 - -#include - -namespace bsp -{ -/** - * Interface every class has to implement which needs to be notified if undervoltage occured. - */ -class IUnderVoltageListener : public ::estd::forward_list_node -{ -public: - /** - * Notifies the listener that undervoltage occurred - */ - virtual void undervoltageOccurred() = 0; -}; - -} /* namespace bsp */ - -#endif /* GUARD_C1379F92_B8FD_46D7_A0DF_0C14DC89B4C3 */ diff --git a/libs/bsw/bsp/include/bsp/power/IVoltageManager.h b/libs/bsw/bsp/include/bsp/power/IVoltageManager.h deleted file mode 100644 index 4e47d61864..0000000000 --- a/libs/bsw/bsp/include/bsp/power/IVoltageManager.h +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright 2024 Accenture. - -#ifndef GUARD_C2531EBA_CDC3_4EAF_87D8_6860F0ECF78B -#define GUARD_C2531EBA_CDC3_4EAF_87D8_6860F0ECF78B - -#include - -namespace bsp -{ -class AbstractPowerStateListener; -class IUnderVoltageListener; - -/** - * Interface of a class which provides Information about the voltage on the board. - */ -class IVoltageManager -{ -public: - /** - * Registers a PowerStateListener at the VoltageManager. - * \param listener The listener to register - * \param triggerVoltage The trigger voltage in 1/100 Volts (i.e. 7.07V == 707) - **/ - virtual void - addPowerStateListener(AbstractPowerStateListener& listener, uint16_t triggerVoltage) - = 0; - - /** - * Removes a PowerStateListener from the VoltageManager. - * \param listener The listener to remove - **/ - virtual void removePowerStateListener(AbstractPowerStateListener& listener) = 0; - - /** - * Registers a UnderVoltageListener at the VoltageManager. - * \param listener The listener to register - **/ - virtual void addUnderVoltageListener(IUnderVoltageListener& listener) = 0; - - /** - * Removes a UnderVoltageListener from the VoltageManager. - * \param listener The listener to remove - **/ - virtual void removeUnderVoltageListener(IUnderVoltageListener& listener) = 0; - - /** - * Returns the current voltage. - * \return The current voltage in 1/100 Volts (i.e. 7.07V == 707) - **/ - virtual uint16_t getCurrentVoltage() = 0; - - /** - * Returns information whether undervoltage occurred. - * \return If undervoltage occurred since last notification over function - * undervoltageOccurred() - */ - virtual bool getUndervoltageOccurred() = 0; - -protected: - IVoltageManager& operator=(IVoltageManager const&) = default; -}; - -} /* namespace bsp */ - -#endif /* GUARD_C2531EBA_CDC3_4EAF_87D8_6860F0ECF78B */ diff --git a/libs/bsw/bsp/include/bsp/spi/ISpi.h b/libs/bsw/bsp/include/bsp/spi/ISpi.h deleted file mode 100644 index 731da065a9..0000000000 --- a/libs/bsw/bsp/include/bsp/spi/ISpi.h +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright 2024 Accenture. - -#ifndef GUARD_E3E96D5F_8DD8_4C72_82A0_B8E548DD0569 -#define GUARD_E3E96D5F_8DD8_4C72_82A0_B8E548DD0569 - -#include - -#include - -namespace bios -{ - -class ISpi -{ -public: - virtual bsp::BspReturnCode transfer( - uint8_t chan, - uint8_t* pWdata, - uint16_t wsize, - uint8_t* pRdata, - uint16_t rsize, - uint8_t* pRdataSynchron = nullptr) - = 0; -}; - -} // namespace bios - -#endif // GUARD_E3E96D5F_8DD8_4C72_82A0_B8E548DD0569 diff --git a/libs/bsw/bsp/include/bsp/stepperMotor/IStepperMotorDevice.h b/libs/bsw/bsp/include/bsp/stepperMotor/IStepperMotorDevice.h deleted file mode 100644 index 415c19f320..0000000000 --- a/libs/bsw/bsp/include/bsp/stepperMotor/IStepperMotorDevice.h +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright 2024 Accenture. - -#ifndef GUARD_F701F1AB_11D9_4337_87BD_8308B4116343 -#define GUARD_F701F1AB_11D9_4337_87BD_8308B4116343 - -#include - -namespace bios -{ -class IStepperMotorDevice -{ -public: - enum tStatus - { - OK_On = 0, - OK_Off, - OpenLoad1, - OpenLoad2, - OpenLoad3, - OpenLoad4, - OverCurrent1, - OverCurrent2, - OverCurrent3, - OverCurrent4, - OverTemperature, - OverVoltage, - UnderVoltage, - HWError - }; - - enum tDir - { - DIR_CLOCK = 0, - DIR_NOTCLOCK - }; - - virtual void init() = 0; - virtual void shutdown() = 0; - virtual void step() = 0; - /** - * Set MAX current, current in motor is step dependent. - * \param current in mA - * \return true =job Done. - */ - virtual bool setCurrent(uint32_t current) = 0; - /** - * Set Dir. - * \param dir dir to be set. - * \return true =job Done. - */ - virtual bool setDir(tDir dir) = 0; - /** - * Get actual status from device. - * \return tStatus - */ - virtual tStatus status() = 0; - /** - * Get HS resolution. - * \return how match microsteps is inside from HS, 0 - error - */ - virtual uint8_t getHalfStepResolution() = 0; - /** - * Get phase position from stepper motor. - * \return data valid - * \return phasePosition/Current vector position - */ - virtual bool getPhasePosition(uint16_t& phasePosition) = 0; - /** - * Set phase position for stepper motor. - * \param phasePosition Current vector position - * \return true - job done, false communication error - */ - virtual bool setPhasePosition(uint16_t phasePosition) = 0; - -protected: - IStepperMotorDevice& operator=(IStepperMotorDevice const&) = default; -}; - -} // namespace bios - -#endif /* GUARD_F701F1AB_11D9_4337_87BD_8308B4116343 */ diff --git a/libs/bsw/bsp/include/bsp/timer/ICompareTimer.h b/libs/bsw/bsp/include/bsp/timer/ICompareTimer.h deleted file mode 100644 index 839bd74520..0000000000 --- a/libs/bsw/bsp/include/bsp/timer/ICompareTimer.h +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright 2024 Accenture. - -#ifndef GUARD_F5FB0B5F_D227_4742_A67B_EE4142FFD390 -#define GUARD_F5FB0B5F_D227_4742_A67B_EE4142FFD390 - -#include - -namespace bios -{ -class ICompareTimer -{ -public: - /* - * Init without start. - */ - virtual void init() = 0; - - /** - * Start the timer. - * \param tick_mks,int_enable should be ISR active or not - */ - virtual uint8_t start(uint32_t tick_mks, bool int_enable) = 0; - - virtual void stop() = 0; - - virtual void clearIsrStatus() = 0; - - virtual bool getIsrStatus() = 0; - - virtual void isrEnable(bool autoClean = true) = 0; - - virtual bool getIsrEnableStatus() = 0; - - virtual void isrDisable(bool autoClean = true) = 0; - - /* - * Get compare value. - */ - virtual uint32_t getPeriodTime() = 0; - - /* - * Get current value. - */ - virtual uint32_t getCurrentTime() = 0; - -protected: - ICompareTimer& operator=(ICompareTimer const&) = default; -}; - -} /* namespace bios */ - -#endif /* GUARD_F5FB0B5F_D227_4742_A67B_EE4142FFD390 */ diff --git a/libs/bsw/bsp/include/bsp/timer/IHighResolutionTimer.h b/libs/bsw/bsp/include/bsp/timer/IHighResolutionTimer.h deleted file mode 100644 index 0c872e4cf3..0000000000 --- a/libs/bsw/bsp/include/bsp/timer/IHighResolutionTimer.h +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright 2024 Accenture. - -#ifndef GUARD_403616B7_511B_410C_9E29_0260013EC0AF -#define GUARD_403616B7_511B_410C_9E29_0260013EC0AF - -#include -#include - -namespace bios -{ -class IHighResolutionTimer -{ -public: - /** - * Start timer ( if timer is running then it will be stopped and started again ). - * \param d function to be called if timer expired - * \param timeInMkSec Time in mkSec. MAX value is dependent on implementation. - */ - virtual void set(::estd::function& d, uint32_t timeInMkSec) = 0; - /** - * Cancel timer. - */ - virtual void cancel() = 0; - -protected: - IHighResolutionTimer& operator=(IHighResolutionTimer const&) = default; -}; - -} // namespace bios - -#endif diff --git a/libs/bsw/bsp/include/bsp/xcp/IOverlayController.h b/libs/bsw/bsp/include/bsp/xcp/IOverlayController.h deleted file mode 100644 index f4183f6f4e..0000000000 --- a/libs/bsw/bsp/include/bsp/xcp/IOverlayController.h +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright 2024 Accenture. - -#ifndef GUARD_3E449B5D_624D_4BFA_A515_D29AEB498226 -#define GUARD_3E449B5D_624D_4BFA_A515_D29AEB498226 - -#include - -#include -#include -#include - -namespace bsp -{ -namespace memory -{ -struct OverlayDescriptor -{ - uint8_t coreId; - uintptr_t targetBaseAddress; - uint32_t overlayBlockSize; - uintptr_t redirectionBaseAddress; - - bool operator==(OverlayDescriptor const& descriptor) const - { - return ( - (this->coreId == descriptor.coreId) - && (this->targetBaseAddress == descriptor.targetBaseAddress) - && (this->overlayBlockSize == descriptor.overlayBlockSize) - && (this->redirectionBaseAddress == descriptor.redirectionBaseAddress)); - } -}; - -/** - * When using this class, be careful with caches. - */ -class IOverlayController -{ -public: - virtual ::bsp::BspReturnCode enableOverlayBlock(OverlayDescriptor const& descriptor) = 0; - virtual void disableOverlayBlock(OverlayDescriptor const& descriptor) = 0; - -protected: - IOverlayController& operator=(IOverlayController const&) = default; -}; - -} // namespace memory -} // namespace bsp - -#endif // GUARD_3E449B5D_624D_4BFA_A515_D29AEB498226 diff --git a/libs/bsw/bsp/mock/include/bsp/background/AbstractBackgroundJobMock.h b/libs/bsw/bsp/mock/include/bsp/background/AbstractBackgroundJobMock.h deleted file mode 100644 index fc7282b905..0000000000 --- a/libs/bsw/bsp/mock/include/bsp/background/AbstractBackgroundJobMock.h +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright 2024 Accenture. - -#ifndef GUARD_EBBC9665_9D66_4BF4_948F_F97F4F271A38 -#define GUARD_EBBC9665_9D66_4BF4_948F_F97F4F271A38 - -#include "bsp/background/AbstractBackgroundJob.h" - -#include - -namespace bsp -{ -class AbstractBackgroundJobMock : public AbstractBackgroundJob -{ -public: - MOCK_METHOD0(execute, bool()); - MOCK_METHOD0(removed, void()); -}; - -} // namespace bsp - -#endif /* GUARD_EBBC9665_9D66_4BF4_948F_F97F4F271A38 */ diff --git a/libs/bsw/bsp/mock/include/bsp/background/BackgroundJobHandlerMock.h b/libs/bsw/bsp/mock/include/bsp/background/BackgroundJobHandlerMock.h deleted file mode 100644 index ff285c70ef..0000000000 --- a/libs/bsw/bsp/mock/include/bsp/background/BackgroundJobHandlerMock.h +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright 2024 Accenture. - -#ifndef GUARD_F9E03412_0319_483F_890D_64F56223F5C4 -#define GUARD_F9E03412_0319_483F_890D_64F56223F5C4 - -#include "bsp/background/IBackgroundJobHandler.h" - -#include - -namespace bsp -{ -class BackgroundJobHandlerMock : public IBackgroundJobHandler -{ -public: - MOCK_METHOD1(addJob, bool(AbstractBackgroundJob&)); - MOCK_METHOD1(removeJob, bool(AbstractBackgroundJob&)); -}; - -} // namespace bsp - -#endif /* GUARD_F9E03412_0319_483F_890D_64F56223F5C4 */ diff --git a/libs/bsw/bsp/mock/include/bsp/can/CanPhyMock.h b/libs/bsw/bsp/mock/include/bsp/can/CanPhyMock.h deleted file mode 100644 index b703b00c03..0000000000 --- a/libs/bsw/bsp/mock/include/bsp/can/CanPhyMock.h +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright 2024 Accenture. - -#ifndef GUARD_C477BFD1_B07B_4651_9E17_C0EE83C24524 -#define GUARD_C477BFD1_B07B_4651_9E17_C0EE83C24524 - -#include "bsp/can/ICanPhy.h" - -#include - -namespace bsp -{ -namespace can -{ -class CanPhyMock : public ICanPhy -{ -public: - MOCK_METHOD2(setOperatingMode, ::bsp::BspReturnCode(OperatingMode, ChannelMask)); - MOCK_CONST_METHOD1(operatingMode, OperatingMode(uint8_t)); - MOCK_CONST_METHOD1(hasError, bool(uint8_t)); - MOCK_CONST_METHOD0(numberOfChannels, uint8_t()); -}; - -} // namespace can -} // namespace bsp - -#endif /* GUARD_C477BFD1_B07B_4651_9E17_C0EE83C24524 */ diff --git a/libs/bsw/bsp/mock/include/bsp/ethernet/MdioClause22Mock.h b/libs/bsw/bsp/mock/include/bsp/ethernet/MdioClause22Mock.h deleted file mode 100644 index 61a08d4bbe..0000000000 --- a/libs/bsw/bsp/mock/include/bsp/ethernet/MdioClause22Mock.h +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright 2024 Accenture. - -/** - * \ingroup bsp_ethernet - */ -#ifndef GUARD_18EB24D4_4FDF_4EF4_94FA_F525BC2AF61A -#define GUARD_18EB24D4_4FDF_4EF4_94FA_F525BC2AF61A - -#include "bsp/ethernet/IMdioClause22.h" - -#include - -namespace bsp -{ -namespace ethernet -{ -class MdioClause22Mock : public ::bsp::ethernet::IMdioClause22 -{ -public: - MOCK_CONST_METHOD3(miimRead, bsp::BspReturnCode(uint8_t, uint8_t, uint16_t&)); - - MOCK_METHOD3(miimWrite, bsp::BspReturnCode(uint8_t, uint8_t, uint16_t)); -}; - -} // namespace ethernet -} // namespace bsp - -#endif // GUARD_18EB24D4_4FDF_4EF4_94FA_F525BC2AF61A diff --git a/libs/bsw/bsp/mock/include/bsp/ethernet/MdioClause45Mock.h b/libs/bsw/bsp/mock/include/bsp/ethernet/MdioClause45Mock.h deleted file mode 100644 index 28a405cc6a..0000000000 --- a/libs/bsw/bsp/mock/include/bsp/ethernet/MdioClause45Mock.h +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright 2024 Accenture. - -/** - * \ingroup bsp_ethernet - */ -#ifndef GUARD_310512DA_D726_472F_877A_8BB644CAF3E9 -#define GUARD_310512DA_D726_472F_877A_8BB644CAF3E9 - -#include "bsp/ethernet/IMdioClause45.h" - -#include - -namespace bsp -{ -namespace ethernet -{ -class MdioClause45Mock : public ::bsp::ethernet::IMdioClause45 -{ -public: - MOCK_CONST_METHOD4(miimRead, bsp::BspReturnCode(uint8_t, uint8_t, uint16_t, uint16_t&)); - - MOCK_METHOD4(miimWrite, bsp::BspReturnCode(uint8_t, uint8_t, uint16_t, uint16_t)); -}; - -} // namespace ethernet -} // namespace bsp - -#endif // GUARD_310512DA_D726_472F_877A_8BB644CAF3E9 diff --git a/libs/bsw/bsp/mock/include/bsp/ethernet/MdioMock.h b/libs/bsw/bsp/mock/include/bsp/ethernet/MdioMock.h deleted file mode 100644 index 0b03d09a35..0000000000 --- a/libs/bsw/bsp/mock/include/bsp/ethernet/MdioMock.h +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright 2024 Accenture. - -/** - * \ingroup bsp_ethernet - */ -#ifndef GUARD_824793EA_55F5_48EC_BDDB_808F89539B2B -#define GUARD_824793EA_55F5_48EC_BDDB_808F89539B2B - -#include "bsp/ethernet/IMdio.h" - -#include - -namespace bsp -{ -namespace ethernet -{ -/** - * Mock for interface IMdio. - */ -class MdioMock : public ::bsp::ethernet::IMdio -{ -public: - /** \see IMdio::miimRead() */ - MOCK_METHOD3(miimRead, bsp::BspReturnCode(uint8_t, uint8_t, uint16_t&)); - - /** \see IMdio::miimWrite() */ - MOCK_METHOD3(miimWrite, bsp::BspReturnCode(uint8_t, uint8_t, uint16_t)); - - /** \see IMdio::smiRead() */ - MOCK_METHOD2(smiRead, bsp::BspReturnCode(uint8_t, uint8_t&)); - - /** \see IMdio::smiWrite() */ - MOCK_METHOD2(smiWrite, bsp::BspReturnCode(uint8_t, uint8_t)); -}; - -} // namespace ethernet -} // namespace bsp - -#endif /* GUARD_824793EA_55F5_48EC_BDDB_808F89539B2B */ diff --git a/libs/bsw/bsp/mock/include/bsp/hwInfo/HardwareInfoProviderMock.h b/libs/bsw/bsp/mock/include/bsp/hwInfo/HardwareInfoProviderMock.h deleted file mode 100644 index d7ecfbc9b5..0000000000 --- a/libs/bsw/bsp/mock/include/bsp/hwInfo/HardwareInfoProviderMock.h +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright 2024 Accenture. - -#ifndef GUARD_76305CEA_D06B_468A_A68F_F0AB4FEF9E5B -#define GUARD_76305CEA_D06B_468A_A68F_F0AB4FEF9E5B - -#include "bsp/hwInfo/IHardwareInfoProvider.h" - -#include - -namespace bsp -{ -class HardwareInfoProviderMock : public IHardwareInfoProvider -{ -public: - MOCK_METHOD0(isFlexrayHighVersion, bool()); - MOCK_METHOD0(isMostAvailable, bool()); - MOCK_METHOD0(isComBoard, bool()); - MOCK_METHOD0(isDebugCanAvailable, bool()); -}; - -} // namespace bsp - -#endif /* GUARD_76305CEA_D06B_468A_A68F_F0AB4FEF9E5B */ diff --git a/libs/bsw/bsp/mock/include/bsp/lin/linTransceiver/LinPhyMock.h b/libs/bsw/bsp/mock/include/bsp/lin/linTransceiver/LinPhyMock.h deleted file mode 100644 index bfbd22f144..0000000000 --- a/libs/bsw/bsp/mock/include/bsp/lin/linTransceiver/LinPhyMock.h +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2024 Accenture. - -#ifndef GUARD_D87C647C_7757_4F9C_8A36_43150D09F907 -#define GUARD_D87C647C_7757_4F9C_8A36_43150D09F907 1 - -#include "bsp/lin/linTransceiver/LinPhy.h" - -#include - -namespace bsp -{ -namespace lin -{ -class LinPhyMock : public LinPhy -{ -public: - MOCK_METHOD1(init, void(uint32_t)); - MOCK_METHOD2(setMode, void(Mode, uint32_t)); - MOCK_METHOD1(getMode, Mode(uint32_t)); - MOCK_METHOD1(getPhyErrorStatus, ErrorCode(uint32_t)); -}; -} // namespace lin -} // namespace bsp - -#endif diff --git a/libs/bsw/bsp/mock/include/bsp/power/AbstractPowerStateListenerMock.h b/libs/bsw/bsp/mock/include/bsp/power/AbstractPowerStateListenerMock.h deleted file mode 100644 index ff1182efc0..0000000000 --- a/libs/bsw/bsp/mock/include/bsp/power/AbstractPowerStateListenerMock.h +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright 2024 Accenture. - -#ifndef GUARD_F2AE18B5_0932_406D_9CB0_23351EC60EFA -#define GUARD_F2AE18B5_0932_406D_9CB0_23351EC60EFA - -#include "bsp/power/AbstractPowerStateListener.h" - -#include - -namespace bsp -{ -class AbstractPowerStateListenerMock : public AbstractPowerStateListener -{ -public: - MOCK_METHOD1(powerStateChanged, void(uint16_t)); -}; - -} // namespace bsp - -#endif /* GUARD_F2AE18B5_0932_406D_9CB0_23351EC60EFA */ diff --git a/libs/bsw/bsp/mock/include/bsp/power/VoltageManagerMock.h b/libs/bsw/bsp/mock/include/bsp/power/VoltageManagerMock.h deleted file mode 100644 index 5b1a8a7e92..0000000000 --- a/libs/bsw/bsp/mock/include/bsp/power/VoltageManagerMock.h +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright 2024 Accenture. - -#ifndef GUARD_82BE9184_1099_43C6_9986_902CF33F9224 -#define GUARD_82BE9184_1099_43C6_9986_902CF33F9224 - -#include "bsp/power/AbstractPowerStateListener.h" -#include "bsp/power/IUnderVoltageListener.h" -#include "bsp/power/IVoltageManager.h" - -#include - -namespace bsp -{ -using namespace ::testing; - -class VoltageManagerMock : public IVoltageManager -{ -public: - MOCK_METHOD2( - addPowerStateListener, void(AbstractPowerStateListener& listener, uint16_t triggerVoltage)); - - MOCK_METHOD1(removePowerStateListener, void(AbstractPowerStateListener& listener)); - - MOCK_METHOD1(addUnderVoltageListener, void(IUnderVoltageListener& listener)); - - MOCK_METHOD1(removeUnderVoltageListener, void(IUnderVoltageListener& listener)); - - MOCK_METHOD0(getCurrentVoltage, uint16_t()); - - MOCK_METHOD0(getUndervoltageOccurred, bool()); -}; - -} // namespace bsp - -#endif /* GUARD_82BE9184_1099_43C6_9986_902CF33F9224 */ diff --git a/libs/bsw/bsp/mock/include/bsp/timer/CompareTimerMock.h b/libs/bsw/bsp/mock/include/bsp/timer/CompareTimerMock.h deleted file mode 100644 index 7febca9008..0000000000 --- a/libs/bsw/bsp/mock/include/bsp/timer/CompareTimerMock.h +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright 2024 Accenture. - -#ifndef GUARD_1B3D7F97_04DD_4FAE_9965_28D4F7B292E6 -#define GUARD_1B3D7F97_04DD_4FAE_9965_28D4F7B292E6 - -#include "bsp/timer/ICompareTimer.h" - -#include - -namespace bios -{ -class CompareTimerMock : public ICompareTimer -{ -public: - MOCK_METHOD0(init, void()); - MOCK_METHOD2(start, uint8_t(uint32_t, bool)); - MOCK_METHOD0(stop, void()); - MOCK_METHOD0(clearIsrStatus, void()); - MOCK_METHOD0(getIsrStatus, bool()); - MOCK_METHOD1(isrEnable, void(bool)); - MOCK_METHOD0(getIsrEnableStatus, bool()); - MOCK_METHOD1(isrDisable, void(bool)); - MOCK_METHOD0(getPeriodTime, uint32_t()); - MOCK_METHOD0(getCurrentTime, uint32_t()); -}; - -} // namespace bios - -#endif /* GUARD_1B3D7F97_04DD_4FAE_9965_28D4F7B292E6 */ diff --git a/libs/bsw/bsp/mock/include/bsp/xcp/OverlayControllerMock.h b/libs/bsw/bsp/mock/include/bsp/xcp/OverlayControllerMock.h deleted file mode 100644 index 44dcda02df..0000000000 --- a/libs/bsw/bsp/mock/include/bsp/xcp/OverlayControllerMock.h +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright 2024 Accenture. - -#ifndef GUARD_2FC4874A_9B3F_442F_91D5_3B3788F133AC -#define GUARD_2FC4874A_9B3F_442F_91D5_3B3788F133AC - -#include "bsp/xcp/IOverlayController.h" - -#include - -namespace bsp -{ -namespace memory -{ -struct OverlayControllerMock : IOverlayController -{ - MOCK_METHOD1(enableOverlayBlock, ::bsp::BspReturnCode(OverlayDescriptor const&)); - MOCK_METHOD1(disableOverlayBlock, void(OverlayDescriptor const&)); -}; - -} // namespace memory -} // namespace bsp - -#endif diff --git a/libs/bsw/bsp/test/gtest/CMakeLists.txt b/libs/bsw/bsp/test/gtest/CMakeLists.txt index b04b55878f..35c08f4f16 100644 --- a/libs/bsw/bsp/test/gtest/CMakeLists.txt +++ b/libs/bsw/bsp/test/gtest/CMakeLists.txt @@ -1,13 +1,9 @@ add_executable( bspTest - src/bsp/background/AbstractBackgroundJobTest.cpp src/bsp/can/canTransceiver/CanPhyTest.cpp - src/bsp/can/ICanPhyTest.cpp - src/bsp/lin/linTransceiver/LinPhyTest.cpp - src/bsp/power/AbstractPowerStateListenerTest.cpp src/bsp/timer/IsEqualAfterTimeoutTest.cpp src/bsp/IncludeTest.cpp - src/bsp/IncludeTestCommandInterpreterSimple.cpp) + ) target_include_directories(bspTest PRIVATE) diff --git a/libs/bsw/bsp/test/gtest/src/bsp/IncludeTest.cpp b/libs/bsw/bsp/test/gtest/src/bsp/IncludeTest.cpp index c6638bec08..7b86a49290 100644 --- a/libs/bsw/bsp/test/gtest/src/bsp/IncludeTest.cpp +++ b/libs/bsw/bsp/test/gtest/src/bsp/IncludeTest.cpp @@ -2,47 +2,20 @@ #include "bsp/Bsp.h" #include "bsp/SystemTime.h" -#include "bsp/background/AbstractBackgroundJob.h" -#include "bsp/background/IBackgroundJobHandler.h" -#include "bsp/can/ICanPhy.h" #include "bsp/can/canTransceiver/CanPhy.h" #include "bsp/charInputOutput/Bspio.h" -#include "bsp/commandInterpreter/ICommandInterpreter.h" #include "bsp/eeprom/IEepromDriver.h" #include "bsp/eepromemulation/IEepromEmulationDriver.h" -#include "bsp/ethernet/IMdio.h" -#include "bsp/ethernet/IMdioClause22.h" -#include "bsp/ethernet/IMdioClause45.h" -#include "bsp/flash/IFlashDriver.h" -#include "bsp/flexray/IFlexrayPhy.h" -#include "bsp/hwInfo/IHardwareInfoProvider.h" -#include "bsp/i2c/I2cCommon.h" -#include "bsp/i2c/II2cMaster.h" -#include "bsp/lin/ILinDevice.h" -#include "bsp/lin/ILinSciReceiver.h" -#include "bsp/power/AbstractPowerStateListener.h" #include "bsp/power/IEcuPowerStateController.h" -#include "bsp/power/IUnderVoltageListener.h" -#include "bsp/power/IVoltageManager.h" -#include "bsp/timer/ICompareTimer.h" -#include "bsp/timer/IHighResolutionTimer.h" #include "bsp/timer/SystemTimer.h" -#include "bsp/xcp/IOverlayController.h" #include // Include mock classes -#include "bsp/background/AbstractBackgroundJobMock.h" -#include "bsp/background/BackgroundJobHandlerMock.h" -#include "bsp/can/CanPhyMock.h" #include "bsp/can/canTransceiver/CanPhyMock.h" #include "bsp/eeprom/EepromDriverMock.h" #include "bsp/eepromemulation/EepromEmulationDriverMock.h" -#include "bsp/error/IEventListener.h" -#include "bsp/hwInfo/HardwareInfoProviderMock.h" #include "bsp/memory/safeMemoryAccess.h" -#include "bsp/power/AbstractPowerStateListenerMock.h" -#include "bsp/stepperMotor/IStepperMotorDevice.h" #include "bsp/timer/SystemTimerMock.h" namespace diff --git a/libs/bsw/bsp/test/gtest/src/bsp/IncludeTestCommandInterpreterSimple.cpp b/libs/bsw/bsp/test/gtest/src/bsp/IncludeTestCommandInterpreterSimple.cpp deleted file mode 100644 index 458688a7af..0000000000 --- a/libs/bsw/bsp/test/gtest/src/bsp/IncludeTestCommandInterpreterSimple.cpp +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright 2024 Accenture. - -#include "bsp/commandInterpreter/ICommandInterpreterSimple.h" - -#include - -namespace -{ -TEST(IncludeTestCommandInterpreterSimple, IncludeCheck) -{ - // This test currently only checks if the includes are working. -} - -} // anonymous namespace diff --git a/libs/bsw/bsp/test/gtest/src/bsp/background/AbstractBackgroundJobTest.cpp b/libs/bsw/bsp/test/gtest/src/bsp/background/AbstractBackgroundJobTest.cpp deleted file mode 100644 index 09c739741c..0000000000 --- a/libs/bsw/bsp/test/gtest/src/bsp/background/AbstractBackgroundJobTest.cpp +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright 2024 Accenture. - -/** - * \ingroup bsp - */ - -#include "bsp/background/AbstractBackgroundJob.h" - -#include - -namespace -{ -class MyBackgroundJob : public ::bsp::AbstractBackgroundJob -{ -public: - bool execute() override { return true; } -}; - -/** - * \desc - * Verifies that a newly constructed job has not remove requested. - */ -TEST(AbstractBackgroundJobTest, Constructor) -{ - MyBackgroundJob job; - EXPECT_FALSE(job.isRemoveRequested()); -} - -/** - * \desc - * Verifies that a setRemoveRequested will request removal. - */ -TEST(AbstractBackgroundJobTest, SetRemoveRequested) -{ - MyBackgroundJob job; - EXPECT_FALSE(job.isRemoveRequested()); - job.setRemoveRequested(true); - EXPECT_TRUE(job.isRemoveRequested()); - job.removed(); -} - -} // anonymous namespace diff --git a/libs/bsw/bsp/test/gtest/src/bsp/can/ICanPhyTest.cpp b/libs/bsw/bsp/test/gtest/src/bsp/can/ICanPhyTest.cpp deleted file mode 100644 index 138d5de1e6..0000000000 --- a/libs/bsw/bsp/test/gtest/src/bsp/can/ICanPhyTest.cpp +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright 2024 Accenture. - -#include "bsp/background/BackgroundJobHandlerMock.h" -#include "bsp/can/CanPhyMock.h" - -#include - -namespace -{ -using namespace ::bsp; -using namespace testing; - -TEST(ICanPhy, ICanPhyDefaultConstructorIsCalled) { can::CanPhyMock canPhy; } - -} // anonymous namespace diff --git a/libs/bsw/bsp/test/gtest/src/bsp/can/canTransceiver/CanPhyTest.cpp b/libs/bsw/bsp/test/gtest/src/bsp/can/canTransceiver/CanPhyTest.cpp index 7545a3dca4..9a756715a9 100644 --- a/libs/bsw/bsp/test/gtest/src/bsp/can/canTransceiver/CanPhyTest.cpp +++ b/libs/bsw/bsp/test/gtest/src/bsp/can/canTransceiver/CanPhyTest.cpp @@ -2,8 +2,6 @@ #include "bsp/can/canTransceiver/CanPhy.h" -#include "bsp/can/CanPhyMock.h" - #include namespace diff --git a/libs/bsw/bsp/test/gtest/src/bsp/lin/linTransceiver/LinPhyTest.cpp b/libs/bsw/bsp/test/gtest/src/bsp/lin/linTransceiver/LinPhyTest.cpp deleted file mode 100644 index bf28f93cd5..0000000000 --- a/libs/bsw/bsp/test/gtest/src/bsp/lin/linTransceiver/LinPhyTest.cpp +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright 2024 Accenture. - -#include "bsp/lin/linTransceiver/LinPhy.h" - -#include - -namespace -{ -class LinPhyMock : public ::bsp::lin::LinPhy -{ -public: - void setMode(Mode mode, uint32_t channel = 0) override - { - (void)channel; - fMode = mode; - } - - ErrorCode getPhyErrorStatus(uint32_t channel = 0) override - { - (void)channel; - return ErrorCode(); - } -}; - -using namespace testing; - -TEST(LinPhy, SimpleTest) -{ - LinPhyMock linPhy; - linPhy.init(); - linPhy.setMode(::bsp::lin::ILinPhy::LIN_PHY_MODE_UNDEFINED); - - EXPECT_EQ(::bsp::lin::ILinPhy::LIN_PHY_MODE_UNDEFINED, linPhy.getMode()); -} - -} // anonymous namespace diff --git a/libs/bsw/bsp/test/gtest/src/bsp/power/AbstractPowerStateListenerTest.cpp b/libs/bsw/bsp/test/gtest/src/bsp/power/AbstractPowerStateListenerTest.cpp deleted file mode 100644 index 25027cc83a..0000000000 --- a/libs/bsw/bsp/test/gtest/src/bsp/power/AbstractPowerStateListenerTest.cpp +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright 2024 Accenture. - -#include "bsp/power/AbstractPowerStateListenerMock.h" - -#include - -namespace bsp -{ -class VoltageManager -{ -public: - VoltageManager() - { - AbstractPowerStateListenerMock powerStateListener; - EXPECT_EQ(0U, powerStateListener.getTriggerVoltage()); - } -}; - -} // namespace bsp - -namespace -{ -using namespace ::bsp; -using namespace testing; - -TEST(AbstractPowerStateListener, SimpleTest) { VoltageManager voltageManager; } - -} // anonymous namespace diff --git a/libs/bsw/bsp/test/mock/gmock/include/spi/Spi.h b/libs/bsw/bsp/test/mock/gmock/include/spi/Spi.h deleted file mode 100644 index 40129dba15..0000000000 --- a/libs/bsw/bsp/test/mock/gmock/include/spi/Spi.h +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2024 Accenture. - -#ifndef GUARD_FA5D81D5_E128_4561_A62B_FF819A376541 -#define GUARD_FA5D81D5_E128_4561_A62B_FF819A376541 - -#include "bsp/Bsp.h" - -#include - -#include - -namespace bios -{ -class Spi -{ -public: - MOCK_METHOD6( - transfer, - bsp::BspReturnCode(uint8_t, uint8_t const*, uint16_t, uint8_t*, uint16_t, uint8_t*)); - MOCK_METHOD1(Get, int(int)); -}; - -} // namespace bios - -#endif /* GUARD_FA5D81D5_E128_4561_A62B_FF819A376541 */ diff --git a/libs/bsw/logger/include/logger/LoggerBackgroundJob.h b/libs/bsw/logger/include/logger/LoggerBackgroundJob.h deleted file mode 100644 index 77738e5c54..0000000000 --- a/libs/bsw/logger/include/logger/LoggerBackgroundJob.h +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright 2024 Accenture. - -#ifndef GUARD_ED1F6B5A_28B1_4380_AD4B_B444BF60FCB7 -#define GUARD_ED1F6B5A_28B1_4380_AD4B_B444BF60FCB7 - -#include "logger/BufferedLoggerOutput.h" -#include "logger/IEntryOutput.h" - -#include -#include -#include - -namespace logger -{ -template -class LoggerBackgroundJob : public bsp::AbstractBackgroundJob -{ -public: - LoggerBackgroundJob( - bsp::IBackgroundJobHandler& backgroundJobHandler, - T& entryBuffer, - IEntryOutput& entryOutput); - virtual ~LoggerBackgroundJob(); - - void init(); - void shutdown(); - - void flush(); - - bool execute() override; - -private: - bsp::IBackgroundJobHandler& _backgroundJobHandler; - T& _entryBuffer; - IEntryOutput& _entryOutput; - typename T::EntryRefType _entryRef; -}; - -template -LoggerBackgroundJob::LoggerBackgroundJob( - bsp::IBackgroundJobHandler& backgroundJobHandler, - T& entryBuffer, - IEntryOutput& entryOutput) -: bsp::AbstractBackgroundJob() -, _backgroundJobHandler(backgroundJobHandler) -, _entryBuffer(entryBuffer) -, _entryOutput(entryOutput) -, _entryRef() -{} - -template -LoggerBackgroundJob::~LoggerBackgroundJob() -{} - -template -void LoggerBackgroundJob::init() -{ - (void)_backgroundJobHandler.addJob(*this); -} - -template -void LoggerBackgroundJob::shutdown() -{ - (void)_backgroundJobHandler.removeJob(*this); -} - -template -void LoggerBackgroundJob::flush() -{ - bool iterate = true; - - while (iterate) - { - iterate = _entryBuffer.outputEntry(_entryOutput, _entryRef); - } -} - -template -bool LoggerBackgroundJob::execute() -{ - (void)_entryBuffer.outputEntry(_entryOutput, _entryRef); - return true; -} - -} /* namespace logger */ - -#endif // GUARD_ED1F6B5A_28B1_4380_AD4B_B444BF60FCB7 diff --git a/libs/bsw/logger/test/CMakeLists.txt b/libs/bsw/logger/test/CMakeLists.txt index ccd3519006..18e1ee603d 100644 --- a/libs/bsw/logger/test/CMakeLists.txt +++ b/libs/bsw/logger/test/CMakeLists.txt @@ -10,7 +10,6 @@ add_executable( src/logger/DefaultLoggerTimeTest.cpp src/logger/EntryBufferTest.cpp src/logger/EntrySerializerTest.cpp - src/logger/LoggerBackgroundJobTest.cpp src/logger/PersistentComponentConfigTest.cpp src/logger/SharedStreamEntryOutputTest.cpp) diff --git a/libs/bsw/logger/test/src/logger/LoggerBackgroundJobTest.cpp b/libs/bsw/logger/test/src/logger/LoggerBackgroundJobTest.cpp deleted file mode 100644 index 0b5c07968e..0000000000 --- a/libs/bsw/logger/test/src/logger/LoggerBackgroundJobTest.cpp +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright 2024 Accenture. - -#include "logger/LoggerBackgroundJob.h" - -#include - -#include - -using namespace bsp; -using namespace logger; - -namespace -{ -struct LoggerBackgroundJobTest -: ::testing::Test -, IBackgroundJobHandler -, IEntryOutput -{ - using EntryIndexType = uint32_t; - using EntryRefType = uint32_t; - using TimestampType = uint32_t; - - bool addJob(AbstractBackgroundJob& job) override - { - _job = &job; - return true; - } - - bool removeJob(AbstractBackgroundJob& /*job*/) override - { - _job = nullptr; - return true; - } - - bool outputEntry(IEntryOutput& output, uint32_t& entryRef) - { - EXPECT_EQ(this, &output); - _entryRef = ++entryRef; - return _entryRef < 5U; - } - - void outputEntry( - uint32_t entryIndex, - uint32_t timestamp, - ::util::logger::ComponentInfo const& componentInfo, - ::util::logger::LevelInfo const& levelInfo, - char const* str, - ::util::format::IPrintfArgumentReader& argReader) override - {} - - AbstractBackgroundJob* _job = nullptr; - uint32_t _entryRef = 0; -}; - -TEST_F(LoggerBackgroundJobTest, testInitAndShutdown) -{ - ::util::stream::declare::StringBufferOutputStream<200> outputStream; - LoggerBackgroundJob cut(*this, *this, *this); - ASSERT_EQ(nullptr, _job); - cut.init(); - ASSERT_EQ(&cut, _job); - ASSERT_EQ(0U, _entryRef); - cut.execute(); - ASSERT_EQ(1U, _entryRef); - cut.execute(); - ASSERT_EQ(2U, _entryRef); - cut.shutdown(); - ASSERT_EQ(nullptr, _job); - cut.flush(); - ASSERT_EQ(5U, _entryRef); -} - -} // namespace