53 lines
1.8 KiB
C++
53 lines
1.8 KiB
C++
#ifndef MISSION_DEVICES_PLOCUPDATER_H_
|
|
#define MISSION_DEVICES_PLOCUPDATER_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
|
|
* 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,
|
|
public ExecutableObjectIF,
|
|
public HasReturnvaluesIF {
|
|
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);
|
|
//! [EXPORT] : [COMMENT] Received update command with invalid path string (too long).
|
|
static const ReturnValue_t PATH_TOO_LONG = MAKE_RETURN_CODE(0xA0);
|
|
|
|
static const uint32_t QUEUE_SIZE = config::PLOC_UPDATER_QUEUE_SIZE;
|
|
static const size_t MAX_PLOC_UPDATE_PATH = 20;
|
|
|
|
CommandActionHelper commandActionHelper;
|
|
|
|
ReturnValue_t checkPath(size_t size);
|
|
};
|
|
|
|
#endif /* MISSION_DEVICES_PLOCUPDATER_H_ */
|