mpsoc flash delete command
Some checks failed
EIVE/eive-obsw/pipeline/head There was a failure building this commit

This commit is contained in:
Jakob Meier
2022-03-21 08:53:55 +01:00
parent 5875868f72
commit be45d21486
5 changed files with 16 additions and 9 deletions

View File

@ -326,12 +326,12 @@ public:
};
/**
* @brief Class to help creation of flash fclose command.
* @brief Class to help creation of flash delete command.
*/
class FlashDelete: public TcBase {
class TcFlashDelete: public TcBase {
public:
FlashDelete(uint16_t sequenceCount) :
TcFlashDelete(uint16_t sequenceCount) :
TcBase(apid::TC_FLASHDELETE , sequenceCount) {
}

View File

@ -295,10 +295,14 @@ ReturnValue_t PlocMPSoCHandler::prepareTcMemRead(const uint8_t * commandData,
ReturnValue_t PlocMPSoCHandler::prepareTcFlashDelete(const uint8_t * commandData,
size_t commandDataLen) {
if (commandDataLen > config::MAX_PATH_SIZE + config::MAX_FILENAME_SIZE) {
return NAME_TOO_LONG;
}
ReturnValue_t result = RETURN_OK;
sequenceCount++;
mpsoc::TcFlashDelete tcFlashDelete(sequenceCount);
result = tcFlashDelete.createPacket(commandData, commandDataLen);
result = tcFlashDelete.createPacket(
std::string(reinterpret_cast<const char*>(commandData), commandDataLen));
if (result != RETURN_OK) {
sequenceCount--;
return result;

View File

@ -88,6 +88,9 @@ private:
//! P2: Received sequence count
static const Event MPSOC_HANDLER_SEQ_CNT_MISMATCH = MAKE_EVENT(5, severity::LOW);
//! [EXPORT] : [COMMENT] Received command has file string with invalid length
static const ReturnValue_t NAME_TOO_LONG = MAKE_RETURN_CODE(0xD0);
static const uint16_t APID_MASK = 0x7FF;
static const uint16_t PACKET_SEQUENCE_COUNT_MASK = 0x3FFF;