important fix and clarification
All checks were successful
EIVE/eive-obsw/pipeline/pr-develop This commit looks good

This commit is contained in:
2022-11-04 14:19:58 +01:00
parent dc024e5385
commit 2b9afbedff
4 changed files with 68 additions and 49 deletions

View File

@ -1808,11 +1808,11 @@ ReturnValue_t PlocSupervisorHandler::parseMramPackets(const uint8_t* packet, siz
std::memcpy(spacePacketBuffer + bufferTop, packet + idx, 1);
bufferTop += 1;
*foundLen += 1;
if (bufferTop >= supv::SPACE_PACKET_HEADER_LENGTH) {
if (bufferTop >= ccsds::HEADER_LEN) {
packetLen = readSpacePacketLength(spacePacketBuffer);
}
if (bufferTop == supv::SPACE_PACKET_HEADER_LENGTH + packetLen + 1) {
if (bufferTop == ccsds::HEADER_LEN + packetLen + 1) {
packetInBuffer = true;
bufferTop = 0;
return checkMramPacketApid();
@ -1838,7 +1838,7 @@ ReturnValue_t PlocSupervisorHandler::handleMramDumpPacket(DeviceCommandId_t id)
// Prepare packet for downlink
if (packetInBuffer) {
uint16_t packetLen = readSpacePacketLength(spacePacketBuffer);
result = verifyPacket(spacePacketBuffer, supv::SPACE_PACKET_HEADER_LENGTH + packetLen + 1);
result = verifyPacket(spacePacketBuffer, ccsds::HEADER_LEN + packetLen + 1);
if (result != returnvalue::OK) {
sif::warning << "PlocSupervisorHandler::handleMramDumpPacket: CRC failure" << std::endl;
return result;
@ -1940,8 +1940,7 @@ ReturnValue_t PlocSupervisorHandler::handleMramDumpFile(DeviceCommandId_t id) {
return SupvReturnValuesIF::MRAM_FILE_NOT_EXISTS;
}
std::ofstream file(activeMramFile, std::ios_base::app | std::ios_base::out);
file.write(reinterpret_cast<const char*>(spacePacketBuffer + supv::SPACE_PACKET_HEADER_LENGTH),
packetLen - 1);
file.write(reinterpret_cast<const char*>(spacePacketBuffer + ccsds::HEADER_LEN), packetLen - 1);
file.close();
return returnvalue::OK;
}