TMTC Stack Refactoring #106
@ -5,6 +5,8 @@
|
|||||||
|
|
||||||
class ReadablePacketIF {
|
class ReadablePacketIF {
|
||||||
public:
|
public:
|
||||||
|
virtual ~ReadablePacketIF() = default;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This method returns a raw uint8_t pointer to the readable data
|
* This method returns a raw uint8_t pointer to the readable data
|
||||||
*/
|
*/
|
||||||
|
@ -6,8 +6,9 @@
|
|||||||
|
|
||||||
class RawUserDataReaderIF {
|
class RawUserDataReaderIF {
|
||||||
public:
|
public:
|
||||||
virtual const uint8_t* getUserData() const = 0;
|
~RawUserDataReaderIF() = default;
|
||||||
virtual size_t getUserDataLen() const = 0;
|
[[nodiscard]] virtual const uint8_t* getUserData() const = 0;
|
||||||
|
[[nodiscard]] virtual size_t getUserDataLen() const = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // FSFW_TMTCPACKET_RAWDATAIF_H
|
#endif // FSFW_TMTCPACKET_RAWDATAIF_H
|
||||||
|
@ -23,7 +23,9 @@ ReturnValue_t PusTcReader::parseData(bool withCrc) {
|
|||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
if (spReader.getBufSize() < PusTcIF::MIN_SIZE) {
|
// We already have access to the space packet fields here, so we can perform a sanity check
|
||||||
|
// on the length field
|
||||||
|
if (spReader.getFullPacketLen() < spReader.getBufSize()) {
|
||||||
return SerializeIF::STREAM_TOO_SHORT;
|
return SerializeIF::STREAM_TOO_SHORT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -57,7 +57,7 @@ ReturnValue_t PusTmReader::parseData(bool crcCheck) {
|
|||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
if (spReader.getBufSize() < PusTmIF::MIN_SIZE) {
|
if (spReader.getFullPacketLen() < spReader.getBufSize()) {
|
||||||
return SerializeIF::STREAM_TOO_SHORT;
|
return SerializeIF::STREAM_TOO_SHORT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user