ploc udpdater wip
This commit is contained in:
parent
ba51ca58f3
commit
c431deede0
@ -153,7 +153,7 @@ public:
|
||||
sd::SdCard prefSdCard = sd::SdCard::NONE);
|
||||
|
||||
/**
|
||||
* If sd::SdCard::NONE is passed as an argument, this funtion will get the currently
|
||||
* If sd::SdCard::NONE is passed as an argument, this function will get the currently
|
||||
* preferred SD card from the scratch buffer.
|
||||
* @param prefSdCardPtr
|
||||
* @return
|
||||
|
@ -19,6 +19,7 @@ enum commonClassIds: uint8_t {
|
||||
PLOC_SUPERVISOR_HANDLER, //PLSV
|
||||
SUS_HANDLER, //SUSS
|
||||
CCSDS_IP_CORE_BRIDGE, //IPCI
|
||||
PLOC_UPDATER, //PLUD
|
||||
COMMON_CLASS_ID_END // [EXPORT] : [END]
|
||||
};
|
||||
|
||||
|
@ -80,7 +80,9 @@ enum commonObjects: uint32_t {
|
||||
RW3 = 0x44120003,
|
||||
RW4 = 0x44120004,
|
||||
|
||||
START_TRACKER = 0x44130001
|
||||
START_TRACKER = 0x44130001,
|
||||
|
||||
PLOC_UPDATER = 0x44300000
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -76,6 +76,7 @@ namespace config {
|
||||
|
||||
/* Add mission configuration flags here */
|
||||
static constexpr uint32_t OBSW_FILESYSTEM_HANDLER_QUEUE_SIZE = 50;
|
||||
static constexpr uint32_t PLOC_UPDATER_QUEUE_SIZE = 50;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
@ -18,6 +18,7 @@ target_sources(${TARGET_NAME} PUBLIC
|
||||
GyroADIS16507Handler.cpp
|
||||
RwHandler.cpp
|
||||
StarTrackerHandler.cpp
|
||||
PlocUpdater.cpp
|
||||
)
|
||||
|
||||
|
||||
|
59
mission/devices/PlocUpdater.cpp
Normal file
59
mission/devices/PlocUpdater.cpp
Normal file
@ -0,0 +1,59 @@
|
||||
#include <mission/devices/PlocUpdater.h>
|
||||
|
||||
PlocUpdater::PlocUpdater() : commandActionHelper(this) {
|
||||
commandQueue = QueueFactory::instance()->createMessageQueue(QUEUE_SIZE);
|
||||
}
|
||||
|
||||
PlocUpdater::~PlocUpdater() {
|
||||
}
|
||||
|
||||
ReturnValue_t PlocUpdater::executeAction(ActionId_t actionId,
|
||||
MessageQueueId_t commandedBy, const uint8_t* data, uint32_t size) {
|
||||
if (state == BUSY) {
|
||||
return UPDATER_BUSY;
|
||||
}
|
||||
ReturnValue_t result = HasReturnvaluesIF::RETURN_FAILED;
|
||||
dumpData.address = 0;
|
||||
receivedDataSize = 0;
|
||||
timer.resetTimer();
|
||||
switch (actionId) {
|
||||
case UPDATE_NVM0_A:
|
||||
break;
|
||||
case UPDATE_NVM0_B:
|
||||
break;
|
||||
case UPDATE_NVM1_A:
|
||||
break;
|
||||
case UPDATE_NVM1_B:
|
||||
break;
|
||||
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;
|
||||
default:
|
||||
return INVALID_ACTION_ID;
|
||||
}
|
||||
return EXECUTION_FINISHED;
|
||||
}
|
||||
|
||||
MessageQueueId_t PlocUpdater::getCommandQueue() const {
|
||||
return commandQueue.getId();
|
||||
}
|
||||
|
||||
PlocUpdater::prepare
|
||||
getCurrentMountPrefix
|
||||
|
45
mission/devices/PlocUpdater.h
Normal file
45
mission/devices/PlocUpdater.h
Normal file
@ -0,0 +1,45 @@
|
||||
#ifndef MISSION_DEVICES_PLOCUPDATER_H_
|
||||
#define MISSION_DEVICES_PLOCUPDATER_H_
|
||||
|
||||
#include "fsfw/action/CommandActionHelper.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:
|
||||
|
||||
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);
|
||||
|
||||
static constexpr uint32_t QUEUE_SIZE = config::PLOC_UPDATER_QUEUE_SIZE;
|
||||
|
||||
CommandActionHelper commandActionHelper;
|
||||
};
|
||||
|
||||
#endif /* MISSION_DEVICES_PLOCUPDATER_H_ */
|
Loading…
x
Reference in New Issue
Block a user