diff --git a/inc/Services/RealTimeForwardingControlService.hpp b/inc/Services/RealTimeForwardingControlService.hpp index d78e95816f932c09572bad9abb43ab8b7f6c7aaf..09718f964f5f3ba0b382bfba186e07c701699b39 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 577f5839b7751b904f67efc9e3d90cfeed02304f..a47bf769cb564aef55544e7a08bbdc575133c08d 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) {