possible bugfix
Some checks failed
EIVE/eive-obsw/pipeline/head There was a failure building this commit
Some checks failed
EIVE/eive-obsw/pipeline/head There was a failure building this commit
This commit is contained in:
parent
232372fd96
commit
e1c06ce1f5
@ -174,7 +174,7 @@ class TcBase : public ploc::SpTcBase, public MPSoCReturnValuesIF {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
updateFields();
|
updateSpFields();
|
||||||
res = checkSizeAndSerializeHeader();
|
res = checkSizeAndSerializeHeader();
|
||||||
if (res != result::OK) {
|
if (res != result::OK) {
|
||||||
return res;
|
return res;
|
||||||
@ -306,7 +306,7 @@ class FlashFopen : public ploc::SpTcBase {
|
|||||||
*(spParams.buf + nameSize) = NULL_TERMINATOR;
|
*(spParams.buf + nameSize) = NULL_TERMINATOR;
|
||||||
std::memcpy(payloadStart + nameSize + sizeof(NULL_TERMINATOR), &accessMode, sizeof(accessMode));
|
std::memcpy(payloadStart + nameSize + sizeof(NULL_TERMINATOR), &accessMode, sizeof(accessMode));
|
||||||
spParams.setPayloadLen(nameSize + sizeof(NULL_TERMINATOR) + sizeof(accessMode));
|
spParams.setPayloadLen(nameSize + sizeof(NULL_TERMINATOR) + sizeof(accessMode));
|
||||||
updateFields();
|
updateSpFields();
|
||||||
return calcCrc();
|
return calcCrc();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -354,7 +354,7 @@ class TcFlashWrite : public ploc::SpTcBase {
|
|||||||
}
|
}
|
||||||
std::memcpy(payloadStart + sizeof(writeLen), writeData, writeLen);
|
std::memcpy(payloadStart + sizeof(writeLen), writeData, writeLen);
|
||||||
spParams.setPayloadLen(static_cast<uint16_t>(writeLen) + 4);
|
spParams.setPayloadLen(static_cast<uint16_t>(writeLen) + 4);
|
||||||
updateFields();
|
updateSpFields();
|
||||||
auto res = checkSizeAndSerializeHeader();
|
auto res = checkSizeAndSerializeHeader();
|
||||||
if (res != result::OK) {
|
if (res != result::OK) {
|
||||||
return res;
|
return res;
|
||||||
@ -379,7 +379,7 @@ class TcFlashDelete : public ploc::SpTcBase {
|
|||||||
std::memcpy(payloadStart, filename.c_str(), nameSize);
|
std::memcpy(payloadStart, filename.c_str(), nameSize);
|
||||||
*(payloadStart + nameSize) = NULL_TERMINATOR;
|
*(payloadStart + nameSize) = NULL_TERMINATOR;
|
||||||
spParams.setPayloadLen(nameSize + sizeof(NULL_TERMINATOR));
|
spParams.setPayloadLen(nameSize + sizeof(NULL_TERMINATOR));
|
||||||
updateFields();
|
updateSpFields();
|
||||||
auto res = checkSizeAndSerializeHeader();
|
auto res = checkSizeAndSerializeHeader();
|
||||||
if (res != result::OK) {
|
if (res != result::OK) {
|
||||||
return res;
|
return res;
|
||||||
|
@ -26,16 +26,19 @@ struct SpTcParams {
|
|||||||
|
|
||||||
class SpTcBase {
|
class SpTcBase {
|
||||||
public:
|
public:
|
||||||
SpTcBase(SpTcParams params) : spParams(params) { updateFields(); }
|
SpTcBase(SpTcParams params) : spParams(params) {
|
||||||
|
payloadStart = spParams.buf + ccsds::HEADER_LEN;
|
||||||
|
updateSpFields();
|
||||||
|
}
|
||||||
|
|
||||||
SpTcBase(SpTcParams params, uint16_t apid, uint16_t seqCount) : spParams(params) {
|
SpTcBase(SpTcParams params, uint16_t apid, uint16_t seqCount) : spParams(params) {
|
||||||
spParams.creator.setApid(apid);
|
spParams.creator.setApid(apid);
|
||||||
spParams.creator.setSeqCount(seqCount);
|
spParams.creator.setSeqCount(seqCount);
|
||||||
updateFields();
|
payloadStart = spParams.buf + ccsds::HEADER_LEN;
|
||||||
|
updateSpFields();
|
||||||
}
|
}
|
||||||
|
|
||||||
void updateFields() {
|
void updateSpFields() {
|
||||||
payloadStart = spParams.buf + ccsds::HEADER_LEN;
|
|
||||||
spParams.creator.setDataLen(spParams.dataFieldLen - 1);
|
spParams.creator.setDataLen(spParams.dataFieldLen - 1);
|
||||||
spParams.creator.setPacketType(ccsds::PacketType::TC);
|
spParams.creator.setPacketType(ccsds::PacketType::TC);
|
||||||
}
|
}
|
||||||
@ -55,7 +58,7 @@ class SpTcBase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ReturnValue_t serializeHeader() {
|
ReturnValue_t serializeHeader() {
|
||||||
updateFields();
|
updateSpFields();
|
||||||
size_t serLen = 0;
|
size_t serLen = 0;
|
||||||
return spParams.creator.serializeBe(spParams.buf, serLen, spParams.maxSize);
|
return spParams.creator.serializeBe(spParams.buf, serLen, spParams.maxSize);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user