From bf08d8130b6be7a52e66d110313b4fa7b48707ca Mon Sep 17 00:00:00 2001 From: kpetridis <petridkon@gmail.com> Date: Sun, 8 May 2022 15:20:07 +0300 Subject: [PATCH] Removed unused functions and variables --- inc/ErrorHandler.hpp | 5 ----- inc/Services/RealTimeForwardingControlService.hpp | 8 +------- src/Services/RealTimeForwardingControlService.cpp | 14 ++------------ 3 files changed, 3 insertions(+), 24 deletions(-) diff --git a/inc/ErrorHandler.hpp b/inc/ErrorHandler.hpp index c5409e1c..bb49070a 100644 --- a/inc/ErrorHandler.hpp +++ b/inc/ErrorHandler.hpp @@ -279,11 +279,6 @@ public: * Attempt to set a packet store size to a value that the available memory cannot handle (ST[15]). */ UnableToHandlePacketStoreSize = 36, - /** - * Attempt to add a new report type, when the addition of all report types is already enabled in the - * Application Process configuration (ST[14]) - */ - AllReportTypesAlreadyAllowed = 20, /** * Attempt to add a new service type, when the addition of all service types is already enabled in the * Application Process configuration (ST[14]) diff --git a/inc/Services/RealTimeForwardingControlService.hpp b/inc/Services/RealTimeForwardingControlService.hpp index 7d20fdf5..abeea61b 100644 --- a/inc/Services/RealTimeForwardingControlService.hpp +++ b/inc/Services/RealTimeForwardingControlService.hpp @@ -95,13 +95,7 @@ private: * * @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); - - /** - * Checks if all report types are allowed already, i.e. if the service type definition contains no report type - * definitions. - */ - bool allReportTypesAllowed(Message& request, uint8_t applicationID, uint8_t serviceType); + bool checkService(Message& request, uint8_t applicationID, uint8_t numOfMessages); /** * Checks if the maximum number of report type definitions per service type definition is reached. diff --git a/src/Services/RealTimeForwardingControlService.cpp b/src/Services/RealTimeForwardingControlService.cpp index 75c20e69..848f58eb 100644 --- a/src/Services/RealTimeForwardingControlService.cpp +++ b/src/Services/RealTimeForwardingControlService.cpp @@ -69,8 +69,7 @@ bool RealTimeForwardingControlService::maxServiceTypesReached(Message& request, return false; } -bool RealTimeForwardingControlService::checkService(Message& request, uint8_t applicationID, uint8_t serviceType, - uint8_t numOfMessages) { +bool RealTimeForwardingControlService::checkService(Message& request, uint8_t applicationID, uint8_t numOfMessages) { if (maxServiceTypesReached(request, applicationID)) { request.skipBytes(numOfMessages); return false; @@ -78,15 +77,6 @@ bool RealTimeForwardingControlService::checkService(Message& request, uint8_t ap return true; } -bool RealTimeForwardingControlService::allReportTypesAllowed(Message& request, uint8_t applicationID, - uint8_t serviceType) { - if (countReportsOfService(applicationID, serviceType) >= AllMessageTypes::messagesOfService[serviceType].size()) { - ErrorHandler::reportError(request, ErrorHandler::ExecutionStartErrorType::AllReportTypesAlreadyAllowed); - return true; - } - return false; -} - bool RealTimeForwardingControlService::maxReportTypesReached(Message& request, uint8_t applicationID, uint8_t serviceType) { if (countReportsOfService(applicationID, serviceType) >= AllMessageTypes::messagesOfService[serviceType].size()) { @@ -134,7 +124,7 @@ void RealTimeForwardingControlService::addReportTypesToAppProcessConfiguration(M uint8_t serviceType = request.readUint8(); uint8_t numOfMessages = request.readUint8(); - if (not checkService(request, applicationID, serviceType, numOfMessages)) { + if (not checkService(request, applicationID, numOfMessages)) { continue; } -- GitLab