From 906f941f32bc949edf899e5e8b9ededf45797793 Mon Sep 17 00:00:00 2001 From: "Robin.Mueller" Date: Wed, 15 Apr 2020 15:53:46 +0200 Subject: [PATCH] ssize_t in deSerialize replaced by size_t --- container/FixedMap.h | 2 +- datapool/DataPoolParameterWrapper.cpp | 2 +- datapool/DataPoolParameterWrapper.h | 2 +- datapool/DataSet.cpp | 2 +- datapool/DataSet.h | 2 +- datapool/PIDReader.h | 2 +- datapool/PoolRawAccess.cpp | 14 ++--- datapool/PoolRawAccess.h | 2 +- datapool/PoolRawAccessHelper.cpp | 54 ++++++++++++-------- datapool/PoolRawAccessHelper.h | 12 +++-- datapool/PoolVariable.h | 2 +- datapool/PoolVector.h | 2 +- devicehandlers/DeviceTmReportingWrapper.cpp | 2 +- devicehandlers/DeviceTmReportingWrapper.h | 2 +- events/eventmatching/EventRangeMatcherBase.h | 2 +- globalfunctions/Type.cpp | 2 +- globalfunctions/Type.h | 2 +- globalfunctions/matching/MatchTree.h | 2 +- globalfunctions/matching/RangeMatcher.h | 20 +++++--- parameters/ParameterWrapper.cpp | 20 ++++---- parameters/ParameterWrapper.h | 8 +-- power/Fuse.cpp | 2 +- power/Fuse.h | 2 +- power/PowerComponent.cpp | 2 +- power/PowerComponent.h | 2 +- serialize/SerialArrayListAdapter.h | 7 ++- serialize/SerialBufferAdapter.cpp | 28 +++++----- serialize/SerialBufferAdapter.h | 14 ++++- serialize/SerialFixedArrayListAdapter.h | 20 +++++--- serialize/SerialLinkedListAdapter.h | 4 +- serialize/SerializeAdapter.h | 4 +- serialize/SerializeAdapterInternal.h | 17 +++--- serialize/SerializeElement.h | 2 +- serialize/SerializeIF.h | 2 +- storagemanager/StorageManagerIF.h | 3 +- subsystem/Subsystem.cpp | 4 +- subsystem/modes/ModeDefinitions.h | 2 +- test/UnitTestClass.cpp | 15 ++++-- test/UnitTestClass.h | 3 +- thermal/ThermalComponent.cpp | 4 +- thermal/ThermalComponent.h | 2 +- tmstorage/TmStorePackets.h | 4 +- tmtcpacket/packetmatcher/ApidMatcher.h | 5 +- tmtcpacket/packetmatcher/ServiceMatcher.h | 5 +- tmtcpacket/packetmatcher/SubserviceMatcher.h | 5 +- tmtcpacket/pus/TcPacketBase.cpp | 2 +- tmtcpacket/pus/TcPacketBase.h | 2 +- 47 files changed, 191 insertions(+), 129 deletions(-) diff --git a/container/FixedMap.h b/container/FixedMap.h index 7f3d28f7..c0eb90b2 100644 --- a/container/FixedMap.h +++ b/container/FixedMap.h @@ -201,7 +201,7 @@ public: return printSize; } - virtual ReturnValue_t deSerialize(const uint8_t** buffer, ssize_t* size, + virtual ReturnValue_t deSerialize(const uint8_t** buffer, size_t* size, bool bigEndian) { ReturnValue_t result = SerializeAdapter::deSerialize(&this->_size, buffer, size, bigEndian); diff --git a/datapool/DataPoolParameterWrapper.cpp b/datapool/DataPoolParameterWrapper.cpp index 7139a0d8..11399fb6 100644 --- a/datapool/DataPoolParameterWrapper.cpp +++ b/datapool/DataPoolParameterWrapper.cpp @@ -80,7 +80,7 @@ size_t DataPoolParameterWrapper::getSerializedSize() const { } ReturnValue_t DataPoolParameterWrapper::deSerialize(const uint8_t** buffer, - ssize_t* size, bool bigEndian) { + size_t* size, bool bigEndian) { return HasReturnvaluesIF::RETURN_FAILED; } diff --git a/datapool/DataPoolParameterWrapper.h b/datapool/DataPoolParameterWrapper.h index 45d3de53..99593310 100644 --- a/datapool/DataPoolParameterWrapper.h +++ b/datapool/DataPoolParameterWrapper.h @@ -16,7 +16,7 @@ public: virtual size_t getSerializedSize() const; - virtual ReturnValue_t deSerialize(const uint8_t** buffer, ssize_t* size, + virtual ReturnValue_t deSerialize(const uint8_t** buffer, size_t* size, bool bigEndian); ReturnValue_t copyFrom(const ParameterWrapper *from, diff --git a/datapool/DataSet.cpp b/datapool/DataSet.cpp index eabb4b8c..28cc4500 100644 --- a/datapool/DataSet.cpp +++ b/datapool/DataSet.cpp @@ -136,7 +136,7 @@ void DataSet::setValid(uint8_t valid) { } } -ReturnValue_t DataSet::deSerialize(const uint8_t** buffer, ssize_t* size, +ReturnValue_t DataSet::deSerialize(const uint8_t** buffer, size_t* size, bool bigEndian) { ReturnValue_t result = RETURN_FAILED; for (uint16_t count = 0; count < fill_count; count++) { diff --git a/datapool/DataSet.h b/datapool/DataSet.h index 888d45e6..1e34e07c 100644 --- a/datapool/DataSet.h +++ b/datapool/DataSet.h @@ -126,7 +126,7 @@ public: virtual size_t getSerializedSize() const; - ReturnValue_t deSerialize(const uint8_t** buffer, ssize_t* size, + ReturnValue_t deSerialize(const uint8_t** buffer, size_t* size, bool bigEndian); private: diff --git a/datapool/PIDReader.h b/datapool/PIDReader.h index 26a9e2a8..7572cd2c 100644 --- a/datapool/PIDReader.h +++ b/datapool/PIDReader.h @@ -136,7 +136,7 @@ public: return SerializeAdapter::getSerializedSize(&value); } - virtual ReturnValue_t deSerialize(const uint8_t** buffer, ssize_t* size, + virtual ReturnValue_t deSerialize(const uint8_t** buffer, size_t* size, bool bigEndian) { return SerializeAdapter::deSerialize(&value, buffer, size, bigEndian); } diff --git a/datapool/PoolRawAccess.cpp b/datapool/PoolRawAccess.cpp index b5f94c8c..a2f79343 100644 --- a/datapool/PoolRawAccess.cpp +++ b/datapool/PoolRawAccess.cpp @@ -197,11 +197,11 @@ size_t PoolRawAccess::getSerializedSize() const { return typeSize; } -ReturnValue_t PoolRawAccess::deSerialize(const uint8_t** buffer, ssize_t* size, +ReturnValue_t PoolRawAccess::deSerialize(const uint8_t** buffer, size_t* size, bool bigEndian) { - *size -= typeSize; - if (*size >= 0) { - + // TODO: Needs to be tested!!! + if (*size >= typeSize) { + *size -= typeSize; if (bigEndian) { #ifndef BYTE_ORDER_SYSTEM #error BYTE_ORDER_SYSTEM not defined @@ -212,12 +212,14 @@ ReturnValue_t PoolRawAccess::deSerialize(const uint8_t** buffer, ssize_t* size, #elif BYTE_ORDER_SYSTEM == BIG_ENDIAN memcpy(value, *buffer, typeSize); #endif - } else { + } + else { memcpy(value, *buffer, typeSize); } *buffer += typeSize; return HasReturnvaluesIF::RETURN_OK; - } else { + } + else { return SerializeIF::STREAM_TOO_SHORT; } } diff --git a/datapool/PoolRawAccess.h b/datapool/PoolRawAccess.h index 955c640b..b491d949 100644 --- a/datapool/PoolRawAccess.h +++ b/datapool/PoolRawAccess.h @@ -127,7 +127,7 @@ public: size_t getSerializedSize() const; - ReturnValue_t deSerialize(const uint8_t** buffer, ssize_t* size, + ReturnValue_t deSerialize(const uint8_t** buffer, size_t* size, bool bigEndian); protected: diff --git a/datapool/PoolRawAccessHelper.cpp b/datapool/PoolRawAccessHelper.cpp index cac6e506..643c7609 100644 --- a/datapool/PoolRawAccessHelper.cpp +++ b/datapool/PoolRawAccessHelper.cpp @@ -25,7 +25,7 @@ ReturnValue_t PoolRawAccessHelper::serialize(uint8_t **buffer, size_t *size, const size_t max_size, bool bigEndian) { SerializationArgs serializationArgs = {buffer, size, max_size, bigEndian}; ReturnValue_t result; - ssize_t remainingParametersSize = numberOfParameters * 4; + size_t remainingParametersSize = numberOfParameters * 4; for(uint8_t count=0; count < numberOfParameters; count++) { result = serializeCurrentPoolEntryIntoBuffer(serializationArgs, &remainingParametersSize, false); @@ -44,7 +44,7 @@ ReturnValue_t PoolRawAccessHelper::serializeWithValidityMask(uint8_t ** buffer, size_t * size, const size_t max_size, bool bigEndian) { ReturnValue_t result; SerializationArgs argStruct = {buffer, size, max_size, bigEndian}; - ssize_t remainingParametersSize = numberOfParameters * 4; + size_t remainingParametersSize = numberOfParameters * 4; uint8_t validityMaskSize = ceil((float)numberOfParameters/8.0); uint8_t validityMask[validityMaskSize]; memset(validityMask,0, validityMaskSize); @@ -67,49 +67,60 @@ ReturnValue_t PoolRawAccessHelper::serializeWithValidityMask(uint8_t ** buffer, return result; } -ReturnValue_t PoolRawAccessHelper::serializeCurrentPoolEntryIntoBuffer(SerializationArgs argStruct, - ssize_t * remainingParameters, bool withValidMask, uint8_t * validityMask) { +ReturnValue_t PoolRawAccessHelper::serializeCurrentPoolEntryIntoBuffer( + SerializationArgs argStruct, size_t * remainingParameters, + bool withValidMask, uint8_t * validityMask) { uint32_t currentPoolId; // Deserialize current pool ID from pool ID buffer ReturnValue_t result = AutoSerializeAdapter::deSerialize(¤tPoolId, &poolIdBuffer,remainingParameters,true); if(result != RETURN_OK) { - debug << std::hex << "Pool Raw Access Helper: Error deSeralizing pool IDs" << std::dec << std::endl; + debug << std::hex << "Pool Raw Access Helper: Error deSeralizing " + "pool IDs" << std::dec << std::endl; return result; } - result = handlePoolEntrySerialization(currentPoolId, argStruct, withValidMask, validityMask); + result = handlePoolEntrySerialization(currentPoolId, argStruct, + withValidMask, validityMask); return result; } -ReturnValue_t PoolRawAccessHelper::handlePoolEntrySerialization(uint32_t currentPoolId,SerializationArgs argStruct, - bool withValidMask, uint8_t * validityMask) { +ReturnValue_t PoolRawAccessHelper::handlePoolEntrySerialization( + uint32_t currentPoolId,SerializationArgs argStruct, bool withValidMask, + uint8_t * validityMask) { ReturnValue_t result = RETURN_FAILED; uint8_t arrayPosition = 0; uint8_t counter = 0; bool poolEntrySerialized = false; - //debug << "Pool Raw Access Helper: Handling Pool ID: " << std::hex << currentPoolId << std::endl; + //debug << "Pool Raw Access Helper: Handling Pool ID: " + // << std::hex << currentPoolId << std::endl; while(not poolEntrySerialized) { if(counter > DataSet::DATA_SET_MAX_SIZE) { - error << "Pool Raw Access Helper: Config error, max. number of possible data set variables exceeded" << std::endl; + error << "Pool Raw Access Helper: Config error, " + "max. number of possible data set variables exceeded" + << std::endl; return result; } counter ++; DataSet currentDataSet = DataSet(); //debug << "Current array position: " << (int)arrayPosition << std::endl; - PoolRawAccess currentPoolRawAccess(currentPoolId,arrayPosition,¤tDataSet,PoolVariableIF::VAR_READ); + PoolRawAccess currentPoolRawAccess(currentPoolId,arrayPosition, + ¤tDataSet,PoolVariableIF::VAR_READ); result = currentDataSet.read(); if (result != RETURN_OK) { - debug << std::hex << "Pool Raw Access Helper: Error reading raw dataset with returncode 0x" + debug << std::hex << "Pool Raw Access Helper: Error reading raw " + "dataset with returncode 0x" << result << std::dec << std::endl; return result; } - result = checkRemainingSize(¤tPoolRawAccess, &poolEntrySerialized, &arrayPosition); + result = checkRemainingSize(¤tPoolRawAccess, &poolEntrySerialized, + &arrayPosition); if(result != RETURN_OK) { - error << "Pool Raw Access Helper: Configuration Error at pool ID " << std::hex << currentPoolId + error << "Pool Raw Access Helper: Configuration Error at pool ID " + << std::hex << currentPoolId << ". Size till end smaller than 0" << std::dec << std::endl; return result; } @@ -125,8 +136,9 @@ ReturnValue_t PoolRawAccessHelper::handlePoolEntrySerialization(uint32_t current result = currentDataSet.serialize(argStruct.buffer, argStruct.size, argStruct.max_size, argStruct.bigEndian); if (result != RETURN_OK) { - debug << "Pool Raw Access Helper: Error serializing pool data with ID 0x" << std::hex << - currentPoolId << " into send buffer with return code " << result << std::dec << std::endl; + debug << "Pool Raw Access Helper: Error serializing pool data with " + "ID 0x" << std::hex << currentPoolId << " into send buffer " + "with return code " << result << std::dec << std::endl; return result; } @@ -134,9 +146,10 @@ ReturnValue_t PoolRawAccessHelper::handlePoolEntrySerialization(uint32_t current return result; } -ReturnValue_t PoolRawAccessHelper::checkRemainingSize(PoolRawAccess * currentPoolRawAccess, - bool * isSerialized, uint8_t * arrayPosition) { - int8_t remainingSize = currentPoolRawAccess->getSizeTillEnd() - currentPoolRawAccess->getSizeOfType(); +ReturnValue_t PoolRawAccessHelper::checkRemainingSize(PoolRawAccess* + currentPoolRawAccess, bool * isSerialized, uint8_t * arrayPosition) { + int8_t remainingSize = currentPoolRawAccess->getSizeTillEnd() - + currentPoolRawAccess->getSizeOfType(); if(remainingSize == 0) { *isSerialized = true; } @@ -158,7 +171,8 @@ void PoolRawAccessHelper::handleMaskModification(uint8_t * validityMask) { } } -uint8_t PoolRawAccessHelper::bitSetter(uint8_t byte, uint8_t position, bool value) { +uint8_t PoolRawAccessHelper::bitSetter(uint8_t byte, uint8_t position, + bool value) { if(position < 1 or position > 8) { debug << "Pool Raw Access: Bit setting invalid position" << std::endl; return byte; diff --git a/datapool/PoolRawAccessHelper.h b/datapool/PoolRawAccessHelper.h index 7d9b9b48..61d79731 100644 --- a/datapool/PoolRawAccessHelper.h +++ b/datapool/PoolRawAccessHelper.h @@ -80,13 +80,15 @@ private: * @param hkDataSize * @param max_size * @param bigEndian - * @param withValidMask Can be set optionally to set a provided validity mask - * @param validityMask Can be supplied and will be set if @c withValidMask is set to true + * @param withValidMask Can be set optionally to set a + * provided validity mask + * @param validityMask Can be supplied and will be set if + * @c withValidMask is set to true * @return */ - ReturnValue_t serializeCurrentPoolEntryIntoBuffer(SerializationArgs argStruct, - ssize_t * remainingParameters, bool withValidMask = false, - uint8_t * validityMask = nullptr); + ReturnValue_t serializeCurrentPoolEntryIntoBuffer( + SerializationArgs argStruct, size_t * remainingParameters, + bool withValidMask = false, uint8_t * validityMask = nullptr); ReturnValue_t handlePoolEntrySerialization(uint32_t currentPoolId, SerializationArgs argStruct, bool withValidMask = false, diff --git a/datapool/PoolVariable.h b/datapool/PoolVariable.h index d32cdf22..e85e3b15 100644 --- a/datapool/PoolVariable.h +++ b/datapool/PoolVariable.h @@ -203,7 +203,7 @@ public: return SerializeAdapter::getSerializedSize(&value); } - virtual ReturnValue_t deSerialize(const uint8_t** buffer, ssize_t* size, + virtual ReturnValue_t deSerialize(const uint8_t** buffer, size_t* size, bool bigEndian) { return SerializeAdapter::deSerialize(&value, buffer, size, bigEndian); } diff --git a/datapool/PoolVector.h b/datapool/PoolVector.h index 3e82a721..3e548211 100644 --- a/datapool/PoolVector.h +++ b/datapool/PoolVector.h @@ -215,7 +215,7 @@ public: return vector_size * SerializeAdapter::getSerializedSize(value); } - virtual ReturnValue_t deSerialize(const uint8_t** buffer, ssize_t* size, + virtual ReturnValue_t deSerialize(const uint8_t** buffer, size_t* size, bool bigEndian) { uint16_t i; ReturnValue_t result; diff --git a/devicehandlers/DeviceTmReportingWrapper.cpp b/devicehandlers/DeviceTmReportingWrapper.cpp index 4987c7fb..adddf4f3 100644 --- a/devicehandlers/DeviceTmReportingWrapper.cpp +++ b/devicehandlers/DeviceTmReportingWrapper.cpp @@ -31,7 +31,7 @@ size_t DeviceTmReportingWrapper::getSerializedSize() const { } ReturnValue_t DeviceTmReportingWrapper::deSerialize(const uint8_t** buffer, - ssize_t* size, bool bigEndian) { + size_t* size, bool bigEndian) { ReturnValue_t result = SerializeAdapter::deSerialize(&objectId, buffer, size, bigEndian); if (result != HasReturnvaluesIF::RETURN_OK) { diff --git a/devicehandlers/DeviceTmReportingWrapper.h b/devicehandlers/DeviceTmReportingWrapper.h index fce74814..e2fa4316 100644 --- a/devicehandlers/DeviceTmReportingWrapper.h +++ b/devicehandlers/DeviceTmReportingWrapper.h @@ -16,7 +16,7 @@ public: virtual size_t getSerializedSize() const; - virtual ReturnValue_t deSerialize(const uint8_t** buffer, ssize_t* size, + virtual ReturnValue_t deSerialize(const uint8_t** buffer, size_t* size, bool bigEndian); private: object_id_t objectId; diff --git a/events/eventmatching/EventRangeMatcherBase.h b/events/eventmatching/EventRangeMatcherBase.h index 8dea3e10..328a6b69 100644 --- a/events/eventmatching/EventRangeMatcherBase.h +++ b/events/eventmatching/EventRangeMatcherBase.h @@ -18,7 +18,7 @@ public: size_t getSerializedSize() const { return rangeMatcher.getSerializedSize(); } - ReturnValue_t deSerialize(const uint8_t** buffer, ssize_t* size, + ReturnValue_t deSerialize(const uint8_t** buffer, size_t* size, bool bigEndian) { return rangeMatcher.deSerialize(buffer, size, bigEndian); } diff --git a/globalfunctions/Type.cpp b/globalfunctions/Type.cpp index ea2ad896..11269dc2 100644 --- a/globalfunctions/Type.cpp +++ b/globalfunctions/Type.cpp @@ -85,7 +85,7 @@ size_t Type::getSerializedSize() const { return 2 * SerializeAdapter::getSerializedSize(&dontcare); } -ReturnValue_t Type::deSerialize(const uint8_t** buffer, ssize_t* size, +ReturnValue_t Type::deSerialize(const uint8_t** buffer, size_t* size, bool bigEndian) { uint8_t ptc; uint8_t pfc; diff --git a/globalfunctions/Type.h b/globalfunctions/Type.h index 244091f7..f4146f4e 100644 --- a/globalfunctions/Type.h +++ b/globalfunctions/Type.h @@ -44,7 +44,7 @@ public: virtual size_t getSerializedSize() const; - virtual ReturnValue_t deSerialize(const uint8_t** buffer, ssize_t* size, + virtual ReturnValue_t deSerialize(const uint8_t** buffer, size_t* size, bool bigEndian); private: diff --git a/globalfunctions/matching/MatchTree.h b/globalfunctions/matching/MatchTree.h index 498fe860..5a897f40 100644 --- a/globalfunctions/matching/MatchTree.h +++ b/globalfunctions/matching/MatchTree.h @@ -115,7 +115,7 @@ public: return size; } - ReturnValue_t deSerialize(const uint8_t** buffer, ssize_t* size, + ReturnValue_t deSerialize(const uint8_t** buffer, size_t* size, bool bigEndian) { return HasReturnvaluesIF::RETURN_OK; } diff --git a/globalfunctions/matching/RangeMatcher.h b/globalfunctions/matching/RangeMatcher.h index c0980255..3342cc27 100644 --- a/globalfunctions/matching/RangeMatcher.h +++ b/globalfunctions/matching/RangeMatcher.h @@ -29,32 +29,38 @@ public: ReturnValue_t serialize(uint8_t** buffer, size_t* size, const size_t max_size, bool bigEndian) const { - ReturnValue_t result = SerializeAdapter::serialize(&lowerBound, buffer, size, max_size, bigEndian); + ReturnValue_t result = SerializeAdapter::serialize(&lowerBound, + buffer, size, max_size, bigEndian); if (result != HasReturnvaluesIF::RETURN_OK) { return result; } - result = SerializeAdapter::serialize(&upperBound, buffer, size, max_size, bigEndian); + result = SerializeAdapter::serialize(&upperBound, buffer, size, + max_size, bigEndian); if (result != HasReturnvaluesIF::RETURN_OK) { return result; } - return SerializeAdapter::serialize(&inverted, buffer, size, max_size, bigEndian); + return SerializeAdapter::serialize(&inverted, buffer, size, + max_size, bigEndian); } size_t getSerializedSize() const { return sizeof(lowerBound) + sizeof(upperBound) + sizeof(bool); } - ReturnValue_t deSerialize(const uint8_t** buffer, ssize_t* size, + ReturnValue_t deSerialize(const uint8_t** buffer, size_t* size, bool bigEndian) { - ReturnValue_t result = SerializeAdapter::deSerialize(&lowerBound, buffer, size, bigEndian); + ReturnValue_t result = SerializeAdapter::deSerialize(&lowerBound, + buffer, size, bigEndian); if (result != HasReturnvaluesIF::RETURN_OK) { return result; } - result = SerializeAdapter::deSerialize(&upperBound, buffer, size, bigEndian); + result = SerializeAdapter::deSerialize(&upperBound, buffer, + size, bigEndian); if (result != HasReturnvaluesIF::RETURN_OK) { return result; } - return SerializeAdapter::deSerialize(&inverted, buffer, size, bigEndian); + return SerializeAdapter::deSerialize(&inverted, buffer, + size, bigEndian); } protected: bool doMatch(T input) { diff --git a/parameters/ParameterWrapper.cpp b/parameters/ParameterWrapper.cpp index 1420c076..475764c5 100644 --- a/parameters/ParameterWrapper.cpp +++ b/parameters/ParameterWrapper.cpp @@ -112,7 +112,7 @@ ReturnValue_t ParameterWrapper::deSerializeData(uint8_t startingRow, //treat from as a continuous Stream as we copy all of it const uint8_t *fromAsStream = (const uint8_t *) from; - ssize_t streamSize = fromRows * fromColumns * sizeof(T); + size_t streamSize = fromRows * fromColumns * sizeof(T); ReturnValue_t result = HasReturnvaluesIF::RETURN_OK; @@ -137,12 +137,12 @@ ReturnValue_t ParameterWrapper::deSerializeData(uint8_t startingRow, } ReturnValue_t ParameterWrapper::deSerialize(const uint8_t** buffer, - ssize_t* size, bool bigEndian) { + size_t* size, bool bigEndian) { return deSerialize(buffer, size, bigEndian, 0); } ReturnValue_t ParameterWrapper::deSerialize(const uint8_t** buffer, - ssize_t* size, bool bigEndian, uint16_t startWritingAtIndex) { + size_t* size, bool bigEndian, uint16_t startWritingAtIndex) { ParameterWrapper streamDescription; ReturnValue_t result = streamDescription.set(*buffer, *size, buffer, size); @@ -153,8 +153,10 @@ ReturnValue_t ParameterWrapper::deSerialize(const uint8_t** buffer, return copyFrom(&streamDescription, startWritingAtIndex); } -ReturnValue_t ParameterWrapper::set(const uint8_t* stream, ssize_t streamSize, - const uint8_t **remainingStream, ssize_t *remainingSize) { +ReturnValue_t ParameterWrapper::set(const uint8_t* stream, size_t streamSize, + const uint8_t **remainingStream, size_t *remainingSize) { + // TODO: Replaced ssize_t for remainingSize and streamSize + // is the logic here correct? ReturnValue_t result = SerializeAdapter::deSerialize(&type, &stream, &streamSize, true); if (result != HasReturnvaluesIF::RETURN_OK) { @@ -172,22 +174,22 @@ ReturnValue_t ParameterWrapper::set(const uint8_t* stream, ssize_t streamSize, return result; } - int32_t dataSize = type.getSize() * rows * columns; + size_t dataSize = type.getSize() * rows * columns; if (streamSize < dataSize) { return SerializeIF::STREAM_TOO_SHORT; } - data = NULL; + data = nullptr; readonlyData = stream; pointsToStream = true; stream += dataSize; - if (remainingStream != NULL) { + if (remainingStream != nullptr) { *remainingStream = stream; } streamSize -= dataSize; - if (remainingSize != NULL) { + if (remainingSize != nullptr) { *remainingSize = streamSize; } diff --git a/parameters/ParameterWrapper.h b/parameters/ParameterWrapper.h index 6f8f6fc9..ef54fe6d 100644 --- a/parameters/ParameterWrapper.h +++ b/parameters/ParameterWrapper.h @@ -30,10 +30,10 @@ public: virtual size_t getSerializedSize() const; - virtual ReturnValue_t deSerialize(const uint8_t** buffer, ssize_t* size, + virtual ReturnValue_t deSerialize(const uint8_t** buffer, size_t* size, bool bigEndian); - virtual ReturnValue_t deSerialize(const uint8_t** buffer, ssize_t* size, + virtual ReturnValue_t deSerialize(const uint8_t** buffer, size_t* size, bool bigEndian, uint16_t startWritingAtIndex = 0); template @@ -111,8 +111,8 @@ public: void setMatrix(const T& member) { this->set(member[0], sizeof(member)/sizeof(member[0]), sizeof(member[0])/sizeof(member[0][0])); } - ReturnValue_t set(const uint8_t *stream, ssize_t streamSize, - const uint8_t **remainingStream = NULL, ssize_t *remainingSize = + ReturnValue_t set(const uint8_t *stream, size_t streamSize, + const uint8_t **remainingStream = NULL, size_t *remainingSize = NULL); ReturnValue_t copyFrom(const ParameterWrapper *from, diff --git a/power/Fuse.cpp b/power/Fuse.cpp index 6a4e6caf..04079bb0 100644 --- a/power/Fuse.cpp +++ b/power/Fuse.cpp @@ -108,7 +108,7 @@ uint32_t Fuse::getSerializedSize() const { return size; } -ReturnValue_t Fuse::deSerialize(const uint8_t** buffer, ssize_t* size, +ReturnValue_t Fuse::deSerialize(const uint8_t** buffer, size_t* size, bool bigEndian) { ReturnValue_t result = RETURN_FAILED; for (DeviceList::iterator iter = devices.begin(); iter != devices.end(); diff --git a/power/Fuse.h b/power/Fuse.h index b3c9547a..aee03778 100644 --- a/power/Fuse.h +++ b/power/Fuse.h @@ -52,7 +52,7 @@ public: ReturnValue_t serialize(uint8_t** buffer, size_t* size, const size_t max_size, bool bigEndian) const; uint32_t getSerializedSize() const; - ReturnValue_t deSerialize(const uint8_t** buffer, ssize_t* size, + ReturnValue_t deSerialize(const uint8_t** buffer, size_t* size, bool bigEndian); void setAllMonitorsToUnchecked(); ReturnValue_t performOperation(uint8_t opCode); diff --git a/power/PowerComponent.cpp b/power/PowerComponent.cpp index 77e60d0e..0375adf0 100644 --- a/power/PowerComponent.cpp +++ b/power/PowerComponent.cpp @@ -56,7 +56,7 @@ float PowerComponent::getMax() { return max; } -ReturnValue_t PowerComponent::deSerialize(const uint8_t** buffer, ssize_t* size, +ReturnValue_t PowerComponent::deSerialize(const uint8_t** buffer, size_t* size, bool bigEndian) { ReturnValue_t result = SerializeAdapter::deSerialize(&min, buffer, size, bigEndian); diff --git a/power/PowerComponent.h b/power/PowerComponent.h index 1410e69d..6ddc067f 100644 --- a/power/PowerComponent.h +++ b/power/PowerComponent.h @@ -24,7 +24,7 @@ public: size_t getSerializedSize() const; - ReturnValue_t deSerialize(const uint8_t** buffer, ssize_t* size, + ReturnValue_t deSerialize(const uint8_t** buffer, size_t* size, bool bigEndian); ReturnValue_t getParameter(uint8_t domainId, uint16_t parameterId, diff --git a/serialize/SerialArrayListAdapter.h b/serialize/SerialArrayListAdapter.h index 21a669c2..6a3a276d 100644 --- a/serialize/SerialArrayListAdapter.h +++ b/serialize/SerialArrayListAdapter.h @@ -56,16 +56,19 @@ public: return printSize; } - virtual ReturnValue_t deSerialize(const uint8_t** buffer, ssize_t* size, + virtual ReturnValue_t deSerialize(const uint8_t** buffer, size_t* size, bool bigEndian) { return deSerialize(adaptee, buffer, size, bigEndian); } static ReturnValue_t deSerialize(ArrayList* list, - const uint8_t** buffer, ssize_t* size, bool bigEndian) { + const uint8_t** buffer, size_t* size, bool bigEndian) { count_t tempSize = 0; ReturnValue_t result = SerializeAdapter::deSerialize(&tempSize, buffer, size, bigEndian); + if(result != HasReturnvaluesIF::RETURN_OK) { + return result; + } if (tempSize > list->maxSize()) { return SerializeIF::TOO_MANY_ELEMENTS; } diff --git a/serialize/SerialBufferAdapter.cpp b/serialize/SerialBufferAdapter.cpp index 42ea3dad..5fb5e387 100644 --- a/serialize/SerialBufferAdapter.cpp +++ b/serialize/SerialBufferAdapter.cpp @@ -61,36 +61,38 @@ size_t SerialBufferAdapter::getSerializedSize() const { return bufferLength; } } + template ReturnValue_t SerialBufferAdapter::deSerialize(const uint8_t** buffer, - ssize_t* size, bool bigEndian) { + size_t* size, bool bigEndian) { //TODO Ignores Endian flag! - if (buffer != NULL) { - if(serializeLength){ - // Suggestion (would require removing rest of the block inside this if clause !): - //ReturnValue_t result = AutoSerializeAdapter::deSerialize(&bufferLength,buffer,size,bigEndian); - //if (result != HasReturnvaluesIF::RETURN_OK) { - // return result; - //} + // (Robin) the one of the buffer? wouldn't that be an issue for serialize + // as well? SerialFixedArrayListAdapter implements swapping of buffer + // fields (if buffer type is not uint8_t) + if (buffer != nullptr) { + if(serializeLength) { count_t serializedSize = AutoSerializeAdapter::getSerializedSize( &bufferLength); - if((*size - bufferLength - serializedSize) >= 0){ + if(bufferLength + serializedSize >= *size) { *buffer += serializedSize; *size -= serializedSize; - }else{ + } + else { return STREAM_TOO_SHORT; } } //No Else If, go on with buffer - if (*size - bufferLength >= 0) { + if (bufferLength >= *size) { *size -= bufferLength; memcpy(m_buffer, *buffer, bufferLength); (*buffer) += bufferLength; return HasReturnvaluesIF::RETURN_OK; - } else { + } + else { return STREAM_TOO_SHORT; } - } else { + } + else { return HasReturnvaluesIF::RETURN_FAILED; } } diff --git a/serialize/SerialBufferAdapter.h b/serialize/SerialBufferAdapter.h index 4a886cba..4421f341 100644 --- a/serialize/SerialBufferAdapter.h +++ b/serialize/SerialBufferAdapter.h @@ -49,7 +49,19 @@ public: virtual size_t getSerializedSize() const; - virtual ReturnValue_t deSerialize(const uint8_t** buffer, ssize_t* size, + /** + * @brief This function deserializes a buffer into the member buffer. + * @details + * If a length field is present, it is ignored, as the size should have + * been set in the constructor. If the size is not known beforehand, + * consider using SerialFixedArrayListAdapter instead. + * @param buffer [out] Resulting buffer + * @param size remaining size to deserialize, should be larger than buffer + * + size field size + * @param bigEndian + * @return + */ + virtual ReturnValue_t deSerialize(const uint8_t** buffer, size_t* size, bool bigEndian); uint8_t * getBuffer(); diff --git a/serialize/SerialFixedArrayListAdapter.h b/serialize/SerialFixedArrayListAdapter.h index 8bcbf09e..22c4b3a8 100644 --- a/serialize/SerialFixedArrayListAdapter.h +++ b/serialize/SerialFixedArrayListAdapter.h @@ -22,32 +22,38 @@ * @ingroup serialize */ template -class SerialFixedArrayListAdapter : public FixedArrayList, public SerializeIF { +class SerialFixedArrayListAdapter : + public FixedArrayList, + public SerializeIF { public: /** * Constructor Arguments are forwarded to FixedArrayList constructor * @param args */ template - SerialFixedArrayListAdapter(Args... args) : FixedArrayList(std::forward(args)...) { - } + SerialFixedArrayListAdapter(Args... args) : + FixedArrayList(std::forward(args)...) + {} ReturnValue_t serialize(uint8_t** buffer, size_t* size, const size_t max_size, bool bigEndian) const { - return SerialArrayListAdapter::serialize(this, buffer, size, max_size, bigEndian); + return SerialArrayListAdapter::serialize(this, + buffer, size, max_size, bigEndian); } size_t getSerializedSize() const { - return SerialArrayListAdapter::getSerializedSize(this); + return SerialArrayListAdapter:: + getSerializedSize(this); } - ReturnValue_t deSerialize(const uint8_t** buffer, ssize_t* size, + ReturnValue_t deSerialize(const uint8_t** buffer, size_t* size, bool bigEndian) { return SerialArrayListAdapter::deSerialize(this, buffer, size, bigEndian); } void swapArrayListEndianness() { - SerialArrayListAdapter::swapArrayListEndianness(this); + SerialArrayListAdapter:: + swapArrayListEndianness(this); } }; diff --git a/serialize/SerialLinkedListAdapter.h b/serialize/SerialLinkedListAdapter.h index b5c06a16..85f239b3 100644 --- a/serialize/SerialLinkedListAdapter.h +++ b/serialize/SerialLinkedListAdapter.h @@ -122,13 +122,13 @@ public: * @param bigEndian Specify endianness * @return */ - virtual ReturnValue_t deSerialize(const uint8_t** buffer, ssize_t* size, + virtual ReturnValue_t deSerialize(const uint8_t** buffer, size_t* size, bool bigEndian) { return deSerialize(SinglyLinkedList::start, buffer, size, bigEndian); } static ReturnValue_t deSerialize(LinkedElement* element, - const uint8_t** buffer, ssize_t* size, bool bigEndian) { + const uint8_t** buffer, size_t* size, bool bigEndian) { ReturnValue_t result = HasReturnvaluesIF::RETURN_OK; while ((result == HasReturnvaluesIF::RETURN_OK) && (element != NULL)) { result = element->value->deSerialize(buffer, size, bigEndian); diff --git a/serialize/SerializeAdapter.h b/serialize/SerializeAdapter.h index d926bfce..87e4457a 100644 --- a/serialize/SerializeAdapter.h +++ b/serialize/SerializeAdapter.h @@ -78,7 +78,7 @@ public: } template static ReturnValue_t deSerialize(T* object, const uint8_t** buffer, - ssize_t* size, bool bigEndian) { + size_t* size, bool bigEndian) { SerializeAdapter_::Is> adapter; return adapter.deSerialize(object, buffer, size, bigEndian); } @@ -98,7 +98,7 @@ public: } static ReturnValue_t deSerialize(T* object, const uint8_t** buffer, - ssize_t* size, bool bigEndian) { + size_t* size, bool bigEndian) { SerializeAdapter_::Is> adapter; return adapter.deSerialize(object, buffer, size, bigEndian); } diff --git a/serialize/SerializeAdapterInternal.h b/serialize/SerializeAdapterInternal.h index ed0f6c3b..0caf6786 100644 --- a/serialize/SerializeAdapterInternal.h +++ b/serialize/SerializeAdapterInternal.h @@ -33,7 +33,7 @@ public: size_t* size, const size_t max_size, bool bigEndian) { // function eventuelly serializes structs here. // does this work on every architecture? - //static_assert(std::is_fundamental::value); + // static_assert(std::is_fundamental::value); size_t ignoredSize = 0; if (size == nullptr) { size = &ignoredSize; @@ -57,18 +57,17 @@ public: /** * Deserialize buffer into object * @param object [out] Object to be deserialized with buffer data - * @param buffer buffer containing the data. Non-Const pointer to non-const - * pointer to const buffer. - * @param size int32_t type to allow value to be values smaller than 0, - * needed for range/size checking + * @param buffer contains the data. Non-Const pointer to non-const + * pointer to const data. + * @param size Size to deSerialize. wil be decremented by sizeof(T) * @param bigEndian Specify endianness * @return */ - ReturnValue_t deSerialize(T* object, const uint8_t** buffer, ssize_t* size, + ReturnValue_t deSerialize(T* object, const uint8_t** buffer, size_t* size, bool bigEndian) { T tmp; - *size -= sizeof(T); - if (*size >= 0) { + if (*size >= sizeof(T)) { + *size -= sizeof(T); memcpy(&tmp, *buffer, sizeof(T)); if (bigEndian) { *object = EndianSwapper::swap(tmp); @@ -109,7 +108,7 @@ public: return object->getSerializedSize(); } - ReturnValue_t deSerialize(T* object, const uint8_t** buffer, ssize_t* size, + ReturnValue_t deSerialize(T* object, const uint8_t** buffer, size_t* size, bool bigEndian) { return object->deSerialize(buffer, size, bigEndian); } diff --git a/serialize/SerializeElement.h b/serialize/SerializeElement.h index e2da5c14..592968c1 100644 --- a/serialize/SerializeElement.h +++ b/serialize/SerializeElement.h @@ -41,7 +41,7 @@ public: return SerializeAdapter::getSerializedSize(&entry); } - virtual ReturnValue_t deSerialize(const uint8_t** buffer, ssize_t* size, + virtual ReturnValue_t deSerialize(const uint8_t** buffer, size_t* size, bool bigEndian) { return SerializeAdapter::deSerialize(&entry, buffer, size, bigEndian); } diff --git a/serialize/SerializeIF.h b/serialize/SerializeIF.h index da401b2f..6036518a 100644 --- a/serialize/SerializeIF.h +++ b/serialize/SerializeIF.h @@ -47,7 +47,7 @@ public: virtual size_t getSerializedSize() const = 0; - virtual ReturnValue_t deSerialize(const uint8_t** buffer, ssize_t* size, + virtual ReturnValue_t deSerialize(const uint8_t** buffer, size_t* size, bool bigEndian) = 0; }; diff --git a/storagemanager/StorageManagerIF.h b/storagemanager/StorageManagerIF.h index e8d8b413..bb88931b 100644 --- a/storagemanager/StorageManagerIF.h +++ b/storagemanager/StorageManagerIF.h @@ -144,7 +144,8 @@ public: * @li RETURN_FAILED if data could not be added. * storageId is unchanged then. */ - virtual ReturnValue_t getFreeElement(store_address_t* storageId, const uint32_t size, uint8_t** p_data, bool ignoreFault = false ) = 0; + virtual ReturnValue_t getFreeElement(store_address_t* storageId, + const uint32_t size, uint8_t** p_data, bool ignoreFault = false ) = 0; /** * Clears the whole store. * Use with care! diff --git a/subsystem/Subsystem.cpp b/subsystem/Subsystem.cpp index e4a682ba..52f2c474 100644 --- a/subsystem/Subsystem.cpp +++ b/subsystem/Subsystem.cpp @@ -168,7 +168,7 @@ ReturnValue_t Subsystem::handleCommandMessage(CommandMessage* message) { &sizeRead); if (result == RETURN_OK) { Mode_t fallbackId; - ssize_t size = sizeRead; + size_t size = sizeRead; result = SerializeAdapter::deSerialize(&fallbackId, &pointer, &size, true); if (result == RETURN_OK) { @@ -193,7 +193,7 @@ ReturnValue_t Subsystem::handleCommandMessage(CommandMessage* message) { ModeSequenceMessage::getStoreAddress(message), &pointer, &sizeRead); if (result == RETURN_OK) { - ssize_t size = sizeRead; + size_t size = sizeRead; result = SerialArrayListAdapter::deSerialize(&table, &pointer, &size, true); if (result == RETURN_OK) { diff --git a/subsystem/modes/ModeDefinitions.h b/subsystem/modes/ModeDefinitions.h index 4c0c4a26..5e5631b2 100644 --- a/subsystem/modes/ModeDefinitions.h +++ b/subsystem/modes/ModeDefinitions.h @@ -53,7 +53,7 @@ public: return sizeof(value1) + sizeof(value2) + sizeof(value3) + sizeof(value4); } - virtual ReturnValue_t deSerialize(const uint8_t** buffer, ssize_t* size, + virtual ReturnValue_t deSerialize(const uint8_t** buffer, size_t* size, bool bigEndian) { ReturnValue_t result; diff --git a/test/UnitTestClass.cpp b/test/UnitTestClass.cpp index d20dfb0a..a0f65a08 100644 --- a/test/UnitTestClass.cpp +++ b/test/UnitTestClass.cpp @@ -157,7 +157,7 @@ ReturnValue_t UnitTestClass::test_autoserialization() { // Unit Test AutoSerializeAdapter serialize current_id = TestIds::AUTO_SERIALIZATION_DESERIALIZE; p_array = test_array.data(); - ssize_t remaining_size = serialized_size; + size_t remaining_size = serialized_size; AutoSerializeAdapter::deSerialize(&test_value_bool, const_cast(&p_array), &remaining_size, false); AutoSerializeAdapter::deSerialize(&tv_uint8, @@ -197,6 +197,8 @@ ReturnValue_t UnitTestClass::test_autoserialization() { abs(tv_sdouble - (-2.2421e19)) > 0.01) { return put_error(current_id); } + + // Check overflow return RETURN_OK; } @@ -285,9 +287,16 @@ ReturnValue_t UnitTestClass::test_serial_buffer_adapter() { return RETURN_OK; } -ReturnValue_t UnitTestClass::put_error(TestIds current_id) { +ReturnValue_t UnitTestClass::put_error(TestIds currentId) { + auto errorIter = testResultMap.find(currentId); + if(errorIter != testResultMap.end()) { + testResultMap.emplace(currentId, 1); + } + else { + errorIter->second ++; + } error << "Unit Tester failed at test ID " - << static_cast(current_id) << "\r\n" << std::flush; + << static_cast(currentId) << "\r\n" << std::flush; return RETURN_FAILED; } diff --git a/test/UnitTestClass.h b/test/UnitTestClass.h index d9ba9d1c..ffc7a2a2 100644 --- a/test/UnitTestClass.h +++ b/test/UnitTestClass.h @@ -56,7 +56,8 @@ private: TestIds current_id = TestIds::MISC; std::array test_array; - using TestResultMap = std::map; + using error_count_t = uint8_t; + using TestResultMap = std::map; using TestBuffer = std::vector; TestResultMap testResultMap; diff --git a/thermal/ThermalComponent.cpp b/thermal/ThermalComponent.cpp index 737ffd2e..ffe7ba7b 100644 --- a/thermal/ThermalComponent.cpp +++ b/thermal/ThermalComponent.cpp @@ -40,11 +40,11 @@ ReturnValue_t ThermalComponent::setTargetState(int8_t newState) { } } -ReturnValue_t ThermalComponent::setLimits(const uint8_t* data, ssize_t size) { +ReturnValue_t ThermalComponent::setLimits(const uint8_t* data, size_t size) { if (size != 4 * sizeof(parameters.lowerOpLimit)) { return MonitoringIF::INVALID_SIZE; } - ssize_t readSize = size; + size_t readSize = size; SerializeAdapter::deSerialize(&nopParameters.lowerNopLimit, &data, &readSize, true); SerializeAdapter::deSerialize(¶meters.lowerOpLimit, &data, diff --git a/thermal/ThermalComponent.h b/thermal/ThermalComponent.h index 37ed01c0..afe9aa10 100644 --- a/thermal/ThermalComponent.h +++ b/thermal/ThermalComponent.h @@ -53,7 +53,7 @@ public: ReturnValue_t setTargetState(int8_t newState); - virtual ReturnValue_t setLimits( const uint8_t* data, ssize_t size); + virtual ReturnValue_t setLimits( const uint8_t* data, size_t size); virtual ReturnValue_t getParameter(uint8_t domainId, uint16_t parameterId, ParameterWrapper *parameterWrapper, diff --git a/tmstorage/TmStorePackets.h b/tmstorage/TmStorePackets.h index 4e7bc94b..2c70ca78 100644 --- a/tmstorage/TmStorePackets.h +++ b/tmstorage/TmStorePackets.h @@ -48,7 +48,7 @@ public: return sizeof(apid) + sizeof(ssc); } - ReturnValue_t deSerialize(const uint8_t** buffer, ssize_t* size, + ReturnValue_t deSerialize(const uint8_t** buffer, size_t* size, bool bigEndian) { ReturnValue_t result = SerializeAdapter::deSerialize(&apid, buffer, size, bigEndian); @@ -257,7 +257,7 @@ public: }; - ReturnValue_t deSerialize(const uint8_t** buffer, ssize_t* size, + ReturnValue_t deSerialize(const uint8_t** buffer, size_t* size, bool bigEndian) { ReturnValue_t result = AutoSerializeAdapter::deSerialize(&apid, buffer, size, bigEndian); diff --git a/tmtcpacket/packetmatcher/ApidMatcher.h b/tmtcpacket/packetmatcher/ApidMatcher.h index 1ee44476..577425cc 100644 --- a/tmtcpacket/packetmatcher/ApidMatcher.h +++ b/tmtcpacket/packetmatcher/ApidMatcher.h @@ -30,9 +30,10 @@ public: size_t getSerializedSize() const { return SerializeAdapter::getSerializedSize(&apid); } - ReturnValue_t deSerialize(const uint8_t** buffer, ssize_t* size, + ReturnValue_t deSerialize(const uint8_t** buffer, size_t* size, bool bigEndian) { - return SerializeAdapter::deSerialize(&apid, buffer, size, bigEndian); + return SerializeAdapter::deSerialize(&apid, buffer, + size, bigEndian); } }; diff --git a/tmtcpacket/packetmatcher/ServiceMatcher.h b/tmtcpacket/packetmatcher/ServiceMatcher.h index b69ac7a5..698027da 100644 --- a/tmtcpacket/packetmatcher/ServiceMatcher.h +++ b/tmtcpacket/packetmatcher/ServiceMatcher.h @@ -30,9 +30,10 @@ public: size_t getSerializedSize() const { return SerializeAdapter::getSerializedSize(&service); } - ReturnValue_t deSerialize(const uint8_t** buffer, ssize_t* size, + ReturnValue_t deSerialize(const uint8_t** buffer, size_t* size, bool bigEndian) { - return SerializeAdapter::deSerialize(&service, buffer, size, bigEndian); + return SerializeAdapter::deSerialize(&service, buffer, + size, bigEndian); } }; diff --git a/tmtcpacket/packetmatcher/SubserviceMatcher.h b/tmtcpacket/packetmatcher/SubserviceMatcher.h index 9c93af64..5a8f7954 100644 --- a/tmtcpacket/packetmatcher/SubserviceMatcher.h +++ b/tmtcpacket/packetmatcher/SubserviceMatcher.h @@ -28,9 +28,10 @@ public: size_t getSerializedSize() const { return SerializeAdapter::getSerializedSize(&subService); } - ReturnValue_t deSerialize(const uint8_t** buffer, ssize_t* size, + ReturnValue_t deSerialize(const uint8_t** buffer, size_t* size, bool bigEndian) { - return SerializeAdapter::deSerialize(&subService, buffer, size, bigEndian); + return SerializeAdapter::deSerialize(&subService, buffer, + size, bigEndian); } private: uint8_t subService; diff --git a/tmtcpacket/pus/TcPacketBase.cpp b/tmtcpacket/pus/TcPacketBase.cpp index 630394f8..ba64689a 100644 --- a/tmtcpacket/pus/TcPacketBase.cpp +++ b/tmtcpacket/pus/TcPacketBase.cpp @@ -28,7 +28,7 @@ const uint8_t* TcPacketBase::getApplicationData() const { return &tcData->data; } -uint16_t TcPacketBase::getApplicationDataSize() { +size_t TcPacketBase::getApplicationDataSize() { return getPacketDataLength() - sizeof(tcData->data_field) - CRC_SIZE + 1; } diff --git a/tmtcpacket/pus/TcPacketBase.h b/tmtcpacket/pus/TcPacketBase.h index e6e6bdad..d84d6c45 100644 --- a/tmtcpacket/pus/TcPacketBase.h +++ b/tmtcpacket/pus/TcPacketBase.h @@ -151,7 +151,7 @@ public: * @return The size of the PUS Application Data (without Error Control * field) */ - uint16_t getApplicationDataSize(); + size_t getApplicationDataSize(); /** * This getter returns the Error Control Field of the packet. *