diff --git a/inc/Message.hpp b/inc/Message.hpp index 2e69b57bf7e789eb59e27b4355921043315bee16..c6ee50067e4b67cddb0e263feae6100ec62cf2ce 100644 --- a/inc/Message.hpp +++ b/inc/Message.hpp @@ -72,8 +72,6 @@ public: void appendBits(uint8_t numBits, uint16_t data); /** - * Define the spare field in telemetry and telecommand user data field (7.4.3.2.c and 7.4.4.2.c) - * * Appends the remaining bits to complete a byte, in case the appendBits() is the last call * and the packet data field isn't integer multiple of bytes * diff --git a/inc/Service.hpp b/inc/Service.hpp index 09937508303e6a1b19dffca76e68db0266299802..fbd1aff83534859397e0cf935601f149e7922872 100644 --- a/inc/Service.hpp +++ b/inc/Service.hpp @@ -44,7 +44,7 @@ protected: * Note: For now, since we don't have any mechanisms to queue messages and send them later, * we just print the message to the screen */ - void storeMessage(const Message &message); + void storeMessage(Message &message); /** * This function declared only to remind us that every service must have a function like @@ -56,20 +56,21 @@ protected: * Default protected constructor for this Service */ Service() = default; + public: /** * @brief Unimplemented copy constructor * * Does not allow Services should be copied. There should be only one instance for each Service. */ - Service (Service const&) = delete; + Service(Service const &) = delete; /** * Unimplemented assignment operation * * Does not allow changing the instances of Services, as Services are singletons. */ - void operator=(Service const&) = delete; + void operator=(Service const &) = delete; /** * Default destructor @@ -79,12 +80,12 @@ public: /** * Default move constructor */ - Service(Service && service) noexcept = default; + Service(Service &&service) noexcept = default; /** * Default move assignment operator */ - Service & operator=(Service && service) noexcept = default; + Service &operator=(Service &&service) noexcept = default; }; diff --git a/src/Message.cpp b/src/Message.cpp index 8ee7e1816dbd971c7cc5640da1eb707c1da6bea5..e6b6834b8932cf929d18576fcf884c26c9a452ec 100644 --- a/src/Message.cpp +++ b/src/Message.cpp @@ -37,9 +37,10 @@ void Message::appendBits(uint8_t numBits, uint16_t data) { } void Message::finalize() { - assertI(dataSize < ECSS_MAX_MESSAGE_SIZE, ErrorHandler::MessageTooLarge); + // Define the spare field in telemetry and telecommand user data field (7.4.3.2.c and 7.4.4.2.c) if (currentBit != 0) { + currentBit = 0; dataSize++; } } diff --git a/src/Platform/x86/Service.cpp b/src/Platform/x86/Service.cpp index b148c24291543bac97bf6e13b460f7dda2f5c914..6a251f27d1d3a70713833baa949bdcc5a787ec0d 100644 --- a/src/Platform/x86/Service.cpp +++ b/src/Platform/x86/Service.cpp @@ -2,7 +2,7 @@ #include <iomanip> #include "Service.hpp" -void Service::storeMessage(Message & message) { +void Service::storeMessage(Message &message) { // appends the remaining bits to complete a byte message.finalize(); diff --git a/test/TestPlatform.cpp b/test/TestPlatform.cpp index 0880d64ea865d220846ac5659068606cbce65d62..f6297918c4bd8f09fe7e93a7902bf8ac9833963e 100644 --- a/test/TestPlatform.cpp +++ b/test/TestPlatform.cpp @@ -19,7 +19,7 @@ std::multimap<std::pair<ErrorHandler::ErrorSource, uint16_t>, bool> ServiceTests std::multimap<std::pair<ErrorHandler::ErrorSource, uint16_t>, bool>(); bool ServiceTests::expectingErrors = false; -void Service::storeMessage(const Message &message) { +void Service::storeMessage(Message &message) { // Just add the message to the queue ServiceTests::queue(message); }