flash delete wip
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:35:28 +01:00
parent 5763485688
commit 5875868f72
3 changed files with 66 additions and 6 deletions

View File

@ -16,6 +16,12 @@ static const DeviceCommandId_t TM_MEMORY_READ_REPORT = 6;
static const DeviceCommandId_t TC_FLASHFOPEN = 7;
static const DeviceCommandId_t TC_FLASHFCLOSE = 8;
static const DeviceCommandId_t TC_FLASHWRITE = 9;
static const DeviceCommandId_t TC_FLASHDELETE = 10;
static const DeviceCommandId_t TC_REPLAY_START = 11;
static const DeviceCommandId_t TC_REPLAY_STOP = 12;
static const DeviceCommandId_t TC_REPLAY_WRITE_SEQUENCE = 13;
static const DeviceCommandId_t TC_DOWNLINK_PWR_ON = 14;
static const DeviceCommandId_t TC_DOWNLINK_PWR_OFF = 15;
static const uint16_t SIZE_ACK_REPORT = 14;
static const uint16_t SIZE_EXE_REPORT = 14;
@ -25,11 +31,17 @@ static const uint16_t SIZE_TM_MEM_READ_REPORT = 18;
* SpacePacket apids of PLOC telecommands and telemetry.
*/
namespace apid {
static const uint16_t TC_REPLAY_START = 0x110;
static const uint16_t TC_REPLAY_STOP = 0x111;
static const uint16_t TC_REPLAY_WRITE_SEQUENCE = 0x112;
static const uint16_t TC_DOWNLINK_PWR_ON = 0x113;
static const uint16_t TC_MEM_WRITE = 0x114;
static const uint16_t TC_MEM_READ = 0x115;
static const uint16_t TC_FLASHWRITE = 0x117;
static const uint16_t TC_FLASHFOPEN = 0x119;
static const uint16_t TC_FLASHFCLOSE = 0x11A;
static const uint16_t TC_FLASHDELETE = 0x11C;
static const uint16_t TC_DOWLINK_PWR_OFF = 0x124;
static const uint16_t TM_MEMORY_READ_REPORT = 0x404;
static const uint16_t ACK_SUCCESS = 0x400;
static const uint16_t ACK_FAILURE = 0x401;
@ -313,6 +325,29 @@ public:
}
};
/**
* @brief Class to help creation of flash fclose command.
*/
class FlashDelete: public TcBase {
public:
FlashDelete(uint16_t sequenceCount) :
TcBase(apid::TC_FLASHDELETE , sequenceCount) {
}
ReturnValue_t createPacket(std::string filename) {
ReturnValue_t result = RETURN_OK;
size_t nameSize = filename.size();
std::memcpy(this->getPacketData(), filename.c_str(), nameSize);
result = addCrc();
if (result != RETURN_OK) {
return result;
}
this->setPacketDataLength(nameSize + CRC_SIZE - 1);
return result;
}
};
/**
* @brief Class to build flash write space packet.
*/