ploc updater wip
This commit is contained in:
parent
c431deede0
commit
2700d4d28c
2
fsfw
2
fsfw
@ -1 +1 @@
|
|||||||
Subproject commit 0ff81294e7e209bb4a26171b10d80fe522e65bcf
|
Subproject commit 296c587e3de10c579847e04af3176b3acaa2d701
|
@ -8,52 +8,47 @@ PlocUpdater::~PlocUpdater() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ReturnValue_t PlocUpdater::executeAction(ActionId_t actionId,
|
ReturnValue_t PlocUpdater::executeAction(ActionId_t actionId,
|
||||||
MessageQueueId_t commandedBy, const uint8_t* data, uint32_t size) {
|
MessageQueueId_t commandedBy, const uint8_t* data, size_t size) {
|
||||||
|
ReturnValue_t result = RETURN_FAILED;
|
||||||
|
|
||||||
if (state == BUSY) {
|
if (state == BUSY) {
|
||||||
return UPDATER_BUSY;
|
return IS_BUSY;
|
||||||
}
|
}
|
||||||
ReturnValue_t result = HasReturnvaluesIF::RETURN_FAILED;
|
|
||||||
dumpData.address = 0;
|
if (size > MAX_PLOC_UPDATE_PATH) {
|
||||||
receivedDataSize = 0;
|
return PATH_TOO_LONG;
|
||||||
timer.resetTimer();
|
}
|
||||||
|
|
||||||
switch (actionId) {
|
switch (actionId) {
|
||||||
case UPDATE_NVM0_A:
|
case UPDATE_NVM0_A:
|
||||||
|
result = prepareNvm0AUpdate(std::string(data, size));
|
||||||
break;
|
break;
|
||||||
case UPDATE_NVM0_B:
|
case UPDATE_NVM0_B:
|
||||||
|
result = prepareNvm0BUpdate();
|
||||||
break;
|
break;
|
||||||
case UPDATE_NVM1_A:
|
case UPDATE_NVM1_A:
|
||||||
|
result = prepareNvm1AUpdate();
|
||||||
break;
|
break;
|
||||||
case UPDATE_NVM1_B:
|
case UPDATE_NVM1_B:
|
||||||
break;
|
result = prepareNvm1BUpdate();
|
||||||
dumpData.size = STRHandler::IMAGE_HEADER_SIZE;
|
|
||||||
dumpData.memoryId = STRHandler::ASC_MID_IMAGE;
|
|
||||||
result = commandActionHelper.commandAction(objects::STR_HANDLER,
|
|
||||||
STRHandler::ASC_SEND_IMAGE_TC_ID, &dumpData);
|
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
state = EXPECT_IMAGE_SIZE;
|
|
||||||
break;
|
|
||||||
case FETCH_MIRU_DATA:
|
|
||||||
dumpData.memoryId = STRHandler::ASC_MID_MASSMEMORY;
|
|
||||||
dumpData.size = chunkSize;
|
|
||||||
result = commandActionHelper.commandAction(objects::STR_HANDLER,
|
|
||||||
STRHandler::ASC_MIRU_DUMP_DATA_TC_ID, &dumpData);
|
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
state = MIRU_DATA_REQUESTED;
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
return INVALID_ACTION_ID;
|
return INVALID_ACTION_ID;
|
||||||
}
|
}
|
||||||
return EXECUTION_FINISHED;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
MessageQueueId_t PlocUpdater::getCommandQueue() const {
|
MessageQueueId_t PlocUpdater::getCommandQueue() const {
|
||||||
return commandQueue.getId();
|
return commandQueue.getId();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ReturnValue_t PlocUpdater::checkPath(size_t size) {
|
||||||
|
if (size > MAX_PLOC_UPDATE_PATH) {
|
||||||
|
return PATH_TOO_LONG;
|
||||||
|
}
|
||||||
|
return RETURN_OK;
|
||||||
|
}
|
||||||
|
|
||||||
PlocUpdater::prepare
|
PlocUpdater::prepare
|
||||||
getCurrentMountPrefix
|
getCurrentMountPrefix
|
||||||
|
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
#define MISSION_DEVICES_PLOCUPDATER_H_
|
#define MISSION_DEVICES_PLOCUPDATER_H_
|
||||||
|
|
||||||
#include "fsfw/action/CommandActionHelper.h"
|
#include "fsfw/action/CommandActionHelper.h"
|
||||||
|
#include "fsfw/returnvalues/HasReturnValuesIF.h"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief An object of this class can be used to perform the software updates of the PLOC. The
|
* @brief An object of this class can be used to perform the software updates of the PLOC. The
|
||||||
@ -15,7 +16,8 @@
|
|||||||
*/
|
*/
|
||||||
class PlocUpdater : public SystemObject,
|
class PlocUpdater : public SystemObject,
|
||||||
public HasActionsIF,
|
public HasActionsIF,
|
||||||
public ExecutableObjectIF {
|
public ExecutableObjectIF,
|
||||||
|
public HasReturnvaluesIF {
|
||||||
public:
|
public:
|
||||||
|
|
||||||
static const ActionId_t UPDATE_NVM0_A = 0;
|
static const ActionId_t UPDATE_NVM0_A = 0;
|
||||||
@ -36,10 +38,15 @@ private:
|
|||||||
|
|
||||||
//! [EXPORT] : [COMMENT] Updater is already performing an update
|
//! [EXPORT] : [COMMENT] Updater is already performing an update
|
||||||
static const ReturnValue_t UPDATER_BUSY = MAKE_RETURN_CODE(0xA0);
|
static const ReturnValue_t UPDATER_BUSY = MAKE_RETURN_CODE(0xA0);
|
||||||
|
//! [EXPORT] : [COMMENT] Received update command with invalid path string (too long).
|
||||||
|
static const ReturnValue_t PATH_TOO_LONG = MAKE_RETURN_CODE(0xA0);
|
||||||
|
|
||||||
static constexpr uint32_t QUEUE_SIZE = config::PLOC_UPDATER_QUEUE_SIZE;
|
static const uint32_t QUEUE_SIZE = config::PLOC_UPDATER_QUEUE_SIZE;
|
||||||
|
static const size_t MAX_PLOC_UPDATE_PATH = 20;
|
||||||
|
|
||||||
CommandActionHelper commandActionHelper;
|
CommandActionHelper commandActionHelper;
|
||||||
|
|
||||||
|
ReturnValue_t checkPath(size_t size);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* MISSION_DEVICES_PLOCUPDATER_H_ */
|
#endif /* MISSION_DEVICES_PLOCUPDATER_H_ */
|
||||||
|
2
tmtc
2
tmtc
@ -1 +1 @@
|
|||||||
Subproject commit 477743f6264689327528beb5344c39247af6c49e
|
Subproject commit 4aebf4c0d9a4a094e1a18753bca77d6a3b993378
|
Loading…
Reference in New Issue
Block a user