This commit is contained in:
Ulrich Mohr 2022-08-18 10:42:18 +02:00
parent a3b5993fdc
commit 7bcc4b18b7
3 changed files with 27 additions and 19 deletions

View File

@ -163,6 +163,8 @@ ReturnValue_t CoreController::initializeAfterTaskCreation() {
return result;
}
ReturnValue_t CoreController::executeAction(Action *action) { return action->handle(); }
ReturnValue_t CoreController::handleAction(core::SwitchRebootFileHandlingAction *action) {
std::string path = sdcMan->getCurrentMountPrefix() + REBOOT_FILE;
// Disable the reboot file mechanism
@ -749,24 +751,24 @@ ReturnValue_t CoreController::handleAction(core::ListDirectoryIntoFileAction *ac
// 2 bytes for a and R flag, at least 5 bytes for minimum valid path /tmp with
// null termination, at least 7 bytes for minimum target file name /tmp/a with
// null termination.
//TODO make work again
// TODO make work again
// if (size < 14) {
// return HasActionsIF::INVALID_PARAMETERS;
// }
// We could also make -l optional, but I can't think of a reason why to not use -l..
// This flag specifies to run ls with -a
bool aFlag = 0;//data[0];
//data += 1;
// This flag specifies to run ls with -R
bool RFlag = 0;//data[1];
//data += 1;
bool aFlag = 0; // data[0];
// data += 1;
// This flag specifies to run ls with -R
bool RFlag = 0; // data[1];
// data += 1;
size_t remainingSize = 0;//size - 2;
size_t remainingSize = 0; // size - 2;
// One larger for null termination, which prevents undefined behaviour if the sent
// strings are not 0 terminated properly
std::vector<uint8_t> repoAndTargetFileBuffer(remainingSize + 1, 0);
//std::memcpy(repoAndTargetFileBuffer.data(), data, remainingSize);
// std::memcpy(repoAndTargetFileBuffer.data(), data, remainingSize);
const char *currentCharPtr = reinterpret_cast<const char *>(repoAndTargetFileBuffer.data());
// Full target file name
std::string repoName(currentCharPtr);

View File

@ -5,7 +5,7 @@
#include "fsfw/globalfunctions/CRC.h"
#include "linux/devices/devicedefinitions/PlocSupervisorDefinitions.h"
//TODO this is work in progress in adapting to new actions
// TODO this is work in progress in adapting to new actions
PlocMPSoCHandler::PlocMPSoCHandler(object_id_t objectId, object_id_t uartComIFid,
CookieIF* comCookie, PlocMPSoCHelper* plocMPSoCHelper,
@ -199,8 +199,6 @@ ReturnValue_t PlocMPSoCHandler::buildTransitionDeviceCommand(DeviceCommandId_t*
return NOTHING_TO_SEND;
}
void PlocMPSoCHandler::fillCommandAndReplyMap() {
this->insertInCommandMap(static_cast<DeviceCommandId_t>(PlocMpSoCCommands::TC_MEM_WRITE));
this->insertInCommandMap(static_cast<DeviceCommandId_t>(PlocMpSoCCommands::TC_MEM_READ));
@ -329,6 +327,12 @@ void PlocMPSoCHandler::handleEvent(EventMessage* eventMessage) {
}
}
ReturnValue_t PlocMPSoCHandler::buildCommandFromCommand(DeviceCommandId_t deviceCommand,
const uint8_t* commandData,
size_t commandDataLen) {
return NOTHING_TO_SEND;
}
ReturnValue_t PlocMPSoCHandler::handleAction(PlocMpSoCMemWriteAction* action) {
ReturnValue_t result = RETURN_OK;
sequenceCount++;
@ -345,7 +349,7 @@ ReturnValue_t PlocMPSoCHandler::handleAction(PlocMpSoCMemReadAction* action) {
ReturnValue_t result = RETURN_OK;
sequenceCount++;
mpsoc::TcMemRead tcMemRead(sequenceCount);
//result = tcMemRead.createPacket(commandData, commandDataLen);
// result = tcMemRead.createPacket(commandData, commandDataLen);
if (result != RETURN_OK) {
sequenceCount--;
return result;
@ -361,8 +365,8 @@ ReturnValue_t PlocMPSoCHandler::handleAction(PlocMpSoCFlashDeleteAction* action)
ReturnValue_t result = RETURN_OK;
sequenceCount++;
mpsoc::TcFlashDelete tcFlashDelete(sequenceCount);
//result = tcFlashDelete.createPacket(
// std::string(reinterpret_cast<const char*>(commandData), commandDataLen));
// result = tcFlashDelete.createPacket(
// std::string(reinterpret_cast<const char*>(commandData), commandDataLen));
if (result != RETURN_OK) {
sequenceCount--;
return result;
@ -374,7 +378,7 @@ ReturnValue_t PlocMPSoCHandler::handleAction(PlocMpSoCReplayStartAction* action)
ReturnValue_t result = RETURN_OK;
sequenceCount++;
mpsoc::TcReplayStart tcReplayStart(sequenceCount);
//result = tcReplayStart.createPacket(commandData, commandDataLen);
// result = tcReplayStart.createPacket(commandData, commandDataLen);
if (result != RETURN_OK) {
sequenceCount--;
return result;
@ -399,7 +403,7 @@ ReturnValue_t PlocMPSoCHandler::handleAction(PlocMpSoCDownlinkPwrOnAction* actio
ReturnValue_t result = RETURN_OK;
sequenceCount++;
mpsoc::TcDownlinkPwrOn tcDownlinkPwrOn(sequenceCount);
//result = tcDownlinkPwrOn.createPacket(commandData, commandDataLen);
// result = tcDownlinkPwrOn.createPacket(commandData, commandDataLen);
if (result != RETURN_OK) {
sequenceCount--;
return result;
@ -424,7 +428,7 @@ ReturnValue_t PlocMPSoCHandler::handleAction(PlocMpSoCReplayWriteSequenceAction*
ReturnValue_t result = RETURN_OK;
sequenceCount++;
mpsoc::TcReplayWriteSeq tcReplayWriteSeq(sequenceCount);
//result = tcReplayWriteSeq.createPacket(commandData, commandDataLen);
// result = tcReplayWriteSeq.createPacket(commandData, commandDataLen);
if (result != RETURN_OK) {
sequenceCount--;
return result;
@ -469,7 +473,7 @@ ReturnValue_t PlocMPSoCHandler::handleAction(PlocMpSoCCamCmdSendAction* action)
ReturnValue_t result = RETURN_OK;
sequenceCount++;
mpsoc::TcCamcmdSend tcCamCmdSend(sequenceCount);
//result = tcCamCmdSend.createPacket(commandData, commandDataLen);
// result = tcCamCmdSend.createPacket(commandData, commandDataLen);
if (result != RETURN_OK) {
sequenceCount--;
return result;
@ -485,7 +489,7 @@ ReturnValue_t PlocMPSoCHandler::handleAction(PlocMpSoCFlashWriteAction* action)
// return MPSoCReturnValuesIF::FILENAME_TOO_LONG;
// }
mpsoc::FlashWritePusCmd flashWritePusCmd;
//result = flashWritePusCmd.extractFields(data, size);
// result = flashWritePusCmd.extractFields(data, size);
if (result != RETURN_OK) {
return result;
}

View File

@ -59,6 +59,8 @@ ReturnValue_t PlocMemoryDumper::handleAction(DumpMemoryAction* action) {
MessageQueueId_t PlocMemoryDumper::getCommandQueue() const { return commandQueue->getId(); }
ActionHelper* PlocMemoryDumper::getActionHelper() { return &actionHelper; }
MessageQueueIF* PlocMemoryDumper::getCommandQueuePtr() { return commandQueue; }
void PlocMemoryDumper::readCommandQueue() {