new command to only perform mem check
All checks were successful
EIVE/eive-obsw/pipeline/pr-develop This commit looks good

This commit is contained in:
2022-08-22 12:08:39 +02:00
parent f98411f421
commit e71e2e7879
5 changed files with 96 additions and 39 deletions

View File

@ -84,14 +84,17 @@ class PlocSupvHelper : public SystemObject, public ExecutableObjectIF, public Ha
//! P2: Apid of command for which the reception of the execution report failed
static const Event EXE_RECEPTION_FAILURE = MAKE_EVENT(18, severity::LOW);
//! [EXPORT] : [COMMENT] Update procedure failed when sending packet.
//! P1: Bytes written, P2: Sequence Count
//! P1: First byte percent, Third and Fourht bytes Sequence Count, P2: Bytes written
static const Event WRITE_MEMORY_FAILED = MAKE_EVENT(19, severity::LOW);
static const Event SUPV_REPLY_SIZE_MISSMATCH = MAKE_EVENT(20, severity::LOW);
static const Event SUPV_REPLY_CRC_MISSMATCH = MAKE_EVENT(21, severity::LOW);
//! [EXPORT] : [COMMENT] Will be triggered every 5 percent of the update progress.
//! P1: Bytes written, P2: Sequence Count
//! P1: First byte percent, Third and Fourht bytes Sequence Count, P2: Bytes written
static constexpr Event SUPV_UPDATE_PROGRESS = MAKE_EVENT(22, severity::INFO);
//! Status of memory check command
//! P1: Returncode, 0 for success, other value with returncode for failure
static constexpr Event SUPV_MEM_CHECK_STATUS = MAKE_EVENT(23, severity::INFO);
PlocSupvHelper(object_id_t objectId);
virtual ~PlocSupvHelper();
@ -115,6 +118,7 @@ class PlocSupvHelper : public SystemObject, public ExecutableObjectIF, public Ha
size_t startBytesWritten, uint16_t initSeqCount);
ReturnValue_t startUpdate(std::string file, uint8_t memoryId, uint32_t startAddress);
ReturnValue_t performMemCheck(uint8_t memoryId, uint32_t startAddress, size_t sizeToCheck);
/**
* @brief This initiate the continuation of a failed update.
*/
@ -130,6 +134,8 @@ class PlocSupvHelper : public SystemObject, public ExecutableObjectIF, public Ha
*/
void stopProcess();
static uint32_t buildProgParams1(uint8_t percent, uint16_t seqCount);
private:
static const uint8_t INTERFACE_ID = CLASS_ID::PLOC_SUPV_HELPER;
@ -177,7 +183,7 @@ class PlocSupvHelper : public SystemObject, public ExecutableObjectIF, public Ha
EventBufferRequest eventBufferReq;
enum class InternalState { IDLE, UPDATE, CONTINUE_UPDATE, REQUEST_EVENT_BUFFER };
enum class InternalState { IDLE, UPDATE, CONTINUE_UPDATE, REQUEST_EVENT_BUFFER, CHECK_MEMORY };
InternalState internalState = InternalState::IDLE;
@ -233,7 +239,8 @@ class PlocSupvHelper : public SystemObject, public ExecutableObjectIF, public Ha
* @note It can take up to 70 seconds until the supervisor replies with an acknowledgment
* failure report.
*/
ReturnValue_t handleTmReception(size_t remainingBytes, uint32_t timeout = 70000);
ReturnValue_t handleTmReception(size_t remainingBytes, uint8_t* readBuf = nullptr,
uint32_t timeout = 70000);
ReturnValue_t checkReceivedTm(ploc::SpTmReader& reader);
ReturnValue_t selectMemory();