flash write tc, fix in pus data extraction
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:
@ -290,7 +290,7 @@ public:
|
||||
size_t nameSize = filename.size();
|
||||
std::memcpy(this->getPacketData(), filename.c_str(),
|
||||
nameSize);
|
||||
std::memcpy(this->getPacketData() + nameSize, &accessMode,
|
||||
std::memcpy(this->getPacketData() + nameSize + 1, &accessMode,
|
||||
sizeof(accessMode));
|
||||
this->setPacketDataLength(nameSize + CRC_SIZE - 1);
|
||||
result = addCrc();
|
||||
@ -588,11 +588,12 @@ class FlashWritePusCmd : public MPSoCReturnValuesIF {
|
||||
if (obcFile.size() > (config::MAX_PATH_SIZE + config::MAX_FILENAME_SIZE)) {
|
||||
return FILENAME_TOO_LONG;
|
||||
}
|
||||
mpsocFile = std::string(reinterpret_cast<const char*>(commandData + obcFile.size()));
|
||||
mpsocFile = std::string(
|
||||
reinterpret_cast<const char*>(commandData + obcFile.size() + SIZE_NULL_TERMINATOR));
|
||||
if (mpsocFile.size() > MAX_FILENAME_SIZE) {
|
||||
return MPSOC_FILENAME_TOO_LONG;
|
||||
}
|
||||
return HasReturnvaluesIF::HasReturnvaluesIF::RETURN_OK;
|
||||
return HasReturnvaluesIF::RETURN_OK;
|
||||
}
|
||||
|
||||
std::string getObcFile() {
|
||||
@ -605,6 +606,7 @@ class FlashWritePusCmd : public MPSoCReturnValuesIF {
|
||||
|
||||
private:
|
||||
|
||||
static const size_t SIZE_NULL_TERMINATOR = 1;
|
||||
std::string obcFile = "";
|
||||
std::string mpsocFile = "";
|
||||
};
|
||||
|
Reference in New Issue
Block a user