2021-08-04 10:20:36 +02:00
|
|
|
#ifndef MISSION_DEVICES_PLOCUPDATER_H_
|
|
|
|
#define MISSION_DEVICES_PLOCUPDATER_H_
|
|
|
|
|
|
|
|
#include "fsfw/action/CommandActionHelper.h"
|
2021-08-04 13:20:28 +02:00
|
|
|
#include "fsfw/returnvalues/HasReturnValuesIF.h"
|
2021-08-04 10:20:36 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief An object of this class can be used to perform the software updates of the PLOC. The
|
|
|
|
* software update will be fetched via file system messages from the SD card handler,
|
|
|
|
* split into multiple space packets and sent to the PlocSupervisorHandler.
|
|
|
|
*
|
|
|
|
* @details The MPSoC has to boot memories (NVM0 and NVM1) where each stores two images (Partition A
|
|
|
|
* and Partition B)
|
|
|
|
*
|
|
|
|
* @author J. Meier
|
|
|
|
*/
|
|
|
|
class PlocUpdater : public SystemObject,
|
|
|
|
public HasActionsIF,
|
2021-08-04 13:20:28 +02:00
|
|
|
public ExecutableObjectIF,
|
|
|
|
public HasReturnvaluesIF {
|
2021-08-04 10:20:36 +02:00
|
|
|
public:
|
|
|
|
|
|
|
|
static const ActionId_t UPDATE_NVM0_A = 0;
|
|
|
|
static const ActionId_t UPDATE_NVM0_B = 0;
|
|
|
|
static const ActionId_t UPDATE_NVM1_A = 0;
|
|
|
|
static const ActionId_t UPDATE_NVM1_B = 0;
|
|
|
|
|
|
|
|
PlocUpdater();
|
|
|
|
virtual ~PlocUpdater();
|
|
|
|
|
|
|
|
ReturnValue_t executeAction(ActionId_t actionId, MessageQueueId_t commandedBy,
|
|
|
|
const uint8_t* data, size_t size);
|
|
|
|
MessageQueueId_t getCommandQueue() const;
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
|
|
static const uint8_t INTERFACE_ID = CLASS_ID::PLOC_UPDATER;
|
|
|
|
|
|
|
|
//! [EXPORT] : [COMMENT] Updater is already performing an update
|
|
|
|
static const ReturnValue_t UPDATER_BUSY = MAKE_RETURN_CODE(0xA0);
|
2021-08-04 13:20:28 +02:00
|
|
|
//! [EXPORT] : [COMMENT] Received update command with invalid path string (too long).
|
|
|
|
static const ReturnValue_t PATH_TOO_LONG = MAKE_RETURN_CODE(0xA0);
|
2021-08-04 10:20:36 +02:00
|
|
|
|
2021-08-04 13:20:28 +02:00
|
|
|
static const uint32_t QUEUE_SIZE = config::PLOC_UPDATER_QUEUE_SIZE;
|
|
|
|
static const size_t MAX_PLOC_UPDATE_PATH = 20;
|
2021-08-04 10:20:36 +02:00
|
|
|
|
|
|
|
CommandActionHelper commandActionHelper;
|
2021-08-04 13:20:28 +02:00
|
|
|
|
|
|
|
ReturnValue_t checkPath(size_t size);
|
2021-08-04 10:20:36 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* MISSION_DEVICES_PLOCUPDATER_H_ */
|