From d416a8f74fdd55e6da3d793ca57e83ba732f192c Mon Sep 17 00:00:00 2001 From: kpetridis <petridkon@gmail.com> Date: Wed, 6 Apr 2022 22:15:15 +0300 Subject: [PATCH] Added documentation --- inc/Services/RealTimeForwardingControlService.hpp | 8 +++++++- src/Services/RealTimeForwardingControlService.cpp | 8 ++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/inc/Services/RealTimeForwardingControlService.hpp b/inc/Services/RealTimeForwardingControlService.hpp index d78e9581..09718f96 100644 --- a/inc/Services/RealTimeForwardingControlService.hpp +++ b/inc/Services/RealTimeForwardingControlService.hpp @@ -65,11 +65,13 @@ private: * Checks whether the specified message type already exists in the specified application process and service * type definition. */ - bool reportExistsInAppProcessConfiguration(uint8_t target, uint8_t applicationID, uint8_t serviceType); + bool reportExistsInAppProcessConfiguration(uint8_t applicationID, uint8_t serviceType, uint8_t messageType); /** * Performs the necessary error checking/logging for a specific application process ID. Also, skips the necessary * bytes from the request message, in case of an invalid request. + * + * @return True: if the application is valid and passes all the necessary error checking. */ bool checkApplicationOfAppProcessConfig(Message& request, uint8_t applicationID, uint8_t numOfServices); @@ -92,6 +94,8 @@ private: /** * Performs the necessary error checking/logging for a specific service type. Also, skips the necessary bytes * from the request message, in case of an invalid request. + * + * @return True: if the service type is valid and passes all the necessary error checking. */ bool checkService(Message& request, uint8_t applicationID, uint8_t serviceType, uint8_t numOfMessages); @@ -109,6 +113,8 @@ private: /** * Checks if the maximum number of message types that can be contained inside a service type definition, is * already reached. + * + * @return True: if the message type is valid and passes all the necessary error checking. */ bool checkMessage(Message& request, uint8_t applicationID, uint8_t serviceType, uint8_t messageType); diff --git a/src/Services/RealTimeForwardingControlService.cpp b/src/Services/RealTimeForwardingControlService.cpp index 577f5839..a47bf769 100644 --- a/src/Services/RealTimeForwardingControlService.cpp +++ b/src/Services/RealTimeForwardingControlService.cpp @@ -71,17 +71,17 @@ bool RealTimeForwardingControlService::maxReportTypesReached(Message& request, u bool RealTimeForwardingControlService::checkMessage(Message& request, uint8_t applicationID, uint8_t serviceType, uint8_t messageType) { if (maxReportTypesReached(request, applicationID, serviceType) or - reportExistsInAppProcessConfiguration(messageType, applicationID, serviceType)) { + reportExistsInAppProcessConfiguration(applicationID, serviceType, messageType)) { return false; } return true; } -bool RealTimeForwardingControlService::reportExistsInAppProcessConfiguration(uint8_t target, uint8_t applicationID, - uint8_t serviceType) { +bool RealTimeForwardingControlService::reportExistsInAppProcessConfiguration(uint8_t applicationID, uint8_t serviceType, + uint8_t messageType) { return std::find(applicationProcessConfiguration.definitions[applicationID][serviceType].begin(), applicationProcessConfiguration.definitions[applicationID][serviceType].end(), - target) != applicationProcessConfiguration.definitions[applicationID][serviceType].end(); + messageType) != applicationProcessConfiguration.definitions[applicationID][serviceType].end(); } void RealTimeForwardingControlService::addReportTypesToAppProcessConfiguration(Message& request) { -- GitLab