size_t uint16_t corrections

This commit is contained in:
Robin Müller 2020-05-15 19:51:39 +02:00
parent 1fb87db82e
commit eb5832180b
4 changed files with 6 additions and 5 deletions

View File

@ -82,7 +82,7 @@ void SpacePacketBase::setPacketDataLength( uint16_t new_length) {
this->data->header.packet_length_l = ( new_length & 0x00FF ); this->data->header.packet_length_l = ( new_length & 0x00FF );
} }
uint32_t SpacePacketBase::getFullSize() { size_t SpacePacketBase::getFullSize() {
//+1 is done because size in packet data length field is: size of data field -1 //+1 is done because size in packet data length field is: size of data field -1
return this->getPacketDataLength() + sizeof(this->data->header) + 1; return this->getPacketDataLength() + sizeof(this->data->header) + 1;
} }

View File

@ -2,9 +2,10 @@
#define SPACEPACKETBASE_H_ #define SPACEPACKETBASE_H_
#include <framework/tmtcpacket/ccsds_header.h> #include <framework/tmtcpacket/ccsds_header.h>
#include <cstddef>
/** /**
* \defgroup tmtcpackets Space Packets * @defgroup tmtcpackets Space Packets
* This is the group, where all classes associated with Telecommand and * This is the group, where all classes associated with Telecommand and
* Telemetry packets belong to. * Telemetry packets belong to.
* The class hierarchy resembles the dependency between the different standards * The class hierarchy resembles the dependency between the different standards
@ -167,7 +168,7 @@ public:
* This method returns the full raw packet size. * This method returns the full raw packet size.
* @return The full size of the packet in bytes. * @return The full size of the packet in bytes.
*/ */
uint32_t getFullSize(); size_t getFullSize();
uint32_t getApidAndSequenceCount() const; uint32_t getApidAndSequenceCount() const;

View File

@ -51,7 +51,7 @@ void TcPacketBase::setData(const uint8_t* pData) {
tcData = (TcPacketPointer*) pData; tcData = (TcPacketPointer*) pData;
} }
void TcPacketBase::setApplicationData(const uint8_t * pData, size_t dataLen) { void TcPacketBase::setApplicationData(const uint8_t * pData, uint16_t dataLen) {
SpacePacketBase::setData(pData); SpacePacketBase::setData(pData);
tcData = (TcPacketPointer*) pData; tcData = (TcPacketPointer*) pData;
SpacePacketBase::setPacketDataLength(dataLen + SpacePacketBase::setPacketDataLength(dataLen +

View File

@ -183,7 +183,7 @@ public:
* @param pData * @param pData
* @param dataLen * @param dataLen
*/ */
void setApplicationData(const uint8_t * pData, size_t dataLen); void setApplicationData(const uint8_t * pData, uint16_t dataLen);
/** /**
* This is a debugging helper method that prints the whole packet content * This is a debugging helper method that prints the whole packet content
* to the screen. * to the screen.