Compare commits
1 Commits
develop
...
move-pus-t
Author | SHA1 | Date | |
---|---|---|---|
dfe7c378da |
@ -57,6 +57,13 @@ ReturnValue_t PusTmReader::parseData(bool crcCheck) {
|
|||||||
if (result != returnvalue::OK) {
|
if (result != returnvalue::OK) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
if (crcCheck) {
|
||||||
|
uint16_t crc16 = CRC::crc16ccitt(spReader.getFullData(), getFullPacketLen());
|
||||||
|
if (crc16 != 0) {
|
||||||
|
// Checksum failure
|
||||||
|
return PusIF::INVALID_CRC_16;
|
||||||
|
}
|
||||||
|
}
|
||||||
size_t currentOffset = SpacePacketReader::getHeaderLen();
|
size_t currentOffset = SpacePacketReader::getHeaderLen();
|
||||||
pointers.secHeaderStart = pointers.spHeaderStart + currentOffset;
|
pointers.secHeaderStart = pointers.spHeaderStart + currentOffset;
|
||||||
currentOffset += PusTmIF::MIN_SEC_HEADER_LEN;
|
currentOffset += PusTmIF::MIN_SEC_HEADER_LEN;
|
||||||
@ -77,13 +84,6 @@ ReturnValue_t PusTmReader::parseData(bool crcCheck) {
|
|||||||
}
|
}
|
||||||
currentOffset += sourceDataLen;
|
currentOffset += sourceDataLen;
|
||||||
pointers.crcStart = pointers.spHeaderStart + currentOffset;
|
pointers.crcStart = pointers.spHeaderStart + currentOffset;
|
||||||
if (crcCheck) {
|
|
||||||
uint16_t crc16 = CRC::crc16ccitt(spReader.getFullData(), getFullPacketLen());
|
|
||||||
if (crc16 != 0) {
|
|
||||||
// Checksum failure
|
|
||||||
return PusIF::INVALID_CRC_16;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return returnvalue::OK;
|
return returnvalue::OK;
|
||||||
}
|
}
|
||||||
bool PusTmReader::isNull() const { return spReader.isNull() or pointers.secHeaderStart == nullptr; }
|
bool PusTmReader::isNull() const { return spReader.isNull() or pointers.secHeaderStart == nullptr; }
|
||||||
|
Loading…
Reference in New Issue
Block a user