diff --git a/inc/Helpers/AllMessageTypes.hpp b/inc/Helpers/AllMessageTypes.hpp index 6db8bf21219600265081c998c907fd554bfc938a..fb5c2c488647f0b54fa783dd09c72eff28801092 100644 --- a/inc/Helpers/AllMessageTypes.hpp +++ b/inc/Helpers/AllMessageTypes.hpp @@ -1,17 +1,9 @@ #ifndef ECSS_SERVICES_ALLMESSAGETYPES_HPP #define ECSS_SERVICES_ALLMESSAGETYPES_HPP -#include "Services/EventActionService.hpp" -#include "Services/EventReportService.hpp" -#include "Services/HousekeepingService.hpp" -#include "Services/LargePacketTransferService.hpp" -#include "Services/MemoryManagementService.hpp" -#include "Services/ParameterService.hpp" -#include "Services/ParameterStatisticsService.hpp" -#include "Services/RealTimeForwardingControlService.hpp" -#include "Services/RequestVerificationService.hpp" -#include "Services/TestService.hpp" -#include "Services/TimeBasedSchedulingService.hpp" +#include "ECSS_Definitions.hpp" +#include <etl/map.h> +#include <etl/vector.h> /** * Namespace containing all the message types for every service type. diff --git a/inc/Platform/x86/ECSS_Configuration.hpp b/inc/Platform/x86/ECSS_Configuration.hpp index 35cdbc1ad34c3d92a5fb5a78540d27f18d6915cb..6dbedb3a135a1eba0f72b7d4f6c2e30c0569506f 100644 --- a/inc/Platform/x86/ECSS_Configuration.hpp +++ b/inc/Platform/x86/ECSS_Configuration.hpp @@ -28,7 +28,7 @@ #define SERVICE_ONBOARDMONITORING ///< Compile ST[12] on-board monitoring #define SERVICE_PARAMETER ///< Compile ST[20] parameter management #define SERVICE_PARAMETERSTATISTICS ///< Compile ST[04] parameter statistics -#define SERVICE_REALTIMEFORWARDINGCONTROL ///< Compile ST[14] real time forwarding control +#define SERVICE_REALTIMEFORWARDINGCONTROL ///< Compile ST[14] real time forwarding control #define SERVICE_REQUESTVERIFICATION ///< Compile ST[01] request verification #define SERVICE_STORAGEANDRETRIEVAL ///< Compile ST[15] storage-and-retrieval of tm packets #define SERVICE_TEST ///< Compile ST[17] test diff --git a/src/Helpers/AllMessageTypes.cpp b/src/Helpers/AllMessageTypes.cpp index 8fdb9d5b13ba42e4f1334bcda0a80f6e76b977db..c67e09b31d3ebf98fd7a477d051b23beb7949a62 100644 --- a/src/Helpers/AllMessageTypes.cpp +++ b/src/Helpers/AllMessageTypes.cpp @@ -1,4 +1,15 @@ #include "Helpers/AllMessageTypes.hpp" +#include "Services/EventActionService.hpp" +#include "Services/EventReportService.hpp" +#include "Services/HousekeepingService.hpp" +#include "Services/LargePacketTransferService.hpp" +#include "Services/MemoryManagementService.hpp" +#include "Services/ParameterService.hpp" +#include "Services/ParameterStatisticsService.hpp" +#include "Services/RealTimeForwardingControlService.hpp" +#include "Services/RequestVerificationService.hpp" +#include "Services/TestService.hpp" +#include "Services/TimeBasedSchedulingService.hpp" namespace AllMessageTypes { etl::vector<uint8_t, ECSSMaxReportTypeDefinitions> st01Messages = {RequestVerificationService::MessageType::FailedAcceptanceReport, diff --git a/src/Services/RealTimeForwardingControlService.cpp b/src/Services/RealTimeForwardingControlService.cpp index 0898eea7c0bead1eefa67cd3524bc981c0269c62..b1dba5112b9011c1a1662856a1c9e1e949eae217 100644 --- a/src/Services/RealTimeForwardingControlService.cpp +++ b/src/Services/RealTimeForwardingControlService.cpp @@ -97,10 +97,9 @@ bool RealTimeForwardingControlService::checkMessage(Message& request, uint8_t ap bool RealTimeForwardingControlService::reportExistsInAppProcessConfiguration(uint8_t applicationID, uint8_t serviceType, uint8_t messageType) { - auto appServicePair = std::make_pair(applicationID, serviceType); - return std::find(applicationProcessConfiguration.definitions[appServicePair].begin(), - applicationProcessConfiguration.definitions[appServicePair].end(), - messageType) != applicationProcessConfiguration.definitions[appServicePair].end(); + auto key = std::make_pair(applicationID, serviceType); + auto& messages = applicationProcessConfiguration.definitions[key]; + return std::find(messages.begin(), messages.end(), messageType) != messages.end(); } void RealTimeForwardingControlService::addReportTypesToAppProcessConfiguration(Message& request) { diff --git a/test/Services/RealTimeForwardingControl.cpp b/test/Services/RealTimeForwardingControl.cpp index 4ea1f1a92401f580b4fedae1f408aa26207f9cb1..df65cc9322759ad4d955f5cb7b3d519b4a5dd52b 100644 --- a/test/Services/RealTimeForwardingControl.cpp +++ b/test/Services/RealTimeForwardingControl.cpp @@ -370,7 +370,7 @@ TEST_CASE("Add report types to the Application Process Configuration") { Services.reset(); } - SECTION("Requested addition of duplicate report type definitions") { + SECTION("Requested addition of duplicate report type definitions") { Message request(RealTimeForwardingControlService::ServiceType, RealTimeForwardingControlService::MessageType::AddReportTypesToAppProcessConfiguration, Message::TC, 1);