separate store and stream file commands
Some checks failed
EIVE/eive-obsw/pipeline/head There was a failure building this commit
Some checks failed
EIVE/eive-obsw/pipeline/head There was a failure building this commit
This commit is contained in:
parent
eb883ed93f
commit
520b8d0700
@ -516,7 +516,7 @@ ReturnValue_t FreshMpsocHandler::executeRegularCmd(ActionId_t actionId,
|
||||
break;
|
||||
}
|
||||
case (mpsoc::TC_SIMPLEX_STREAM_FILE): {
|
||||
result = commandTcSimplexSendFile(commandData, commandDataLen);
|
||||
result = commandTcSimplexStreamFile(commandData, commandDataLen);
|
||||
break;
|
||||
}
|
||||
case (mpsoc::TC_DOWNLINK_DATA_MODULATE): {
|
||||
@ -669,14 +669,25 @@ ReturnValue_t FreshMpsocHandler::commandTcCamTakePic(const uint8_t* commandData,
|
||||
return returnvalue::OK;
|
||||
}
|
||||
|
||||
ReturnValue_t FreshMpsocHandler::commandTcSimplexSendFile(const uint8_t* commandData,
|
||||
size_t commandDataLen) {
|
||||
mpsoc::TcSimplexSendFile tcSimplexSendFile(spParams, commandSequenceCount);
|
||||
ReturnValue_t result = tcSimplexSendFile.setPayload(commandData, commandDataLen);
|
||||
ReturnValue_t FreshMpsocHandler::commandTcSimplexStreamFile(const uint8_t* commandData,
|
||||
size_t commandDataLen) {
|
||||
mpsoc::TcSimplexStreamFile tcSimplexStreamFile(spParams, commandSequenceCount);
|
||||
ReturnValue_t result = tcSimplexStreamFile.setPayload(commandData, commandDataLen);
|
||||
if (result != returnvalue::OK) {
|
||||
return result;
|
||||
}
|
||||
finishAndSendTc(mpsoc::TC_SIMPLEX_STREAM_FILE, tcSimplexSendFile);
|
||||
finishAndSendTc(mpsoc::TC_SIMPLEX_STREAM_FILE, tcSimplexStreamFile);
|
||||
return returnvalue::OK;
|
||||
}
|
||||
|
||||
ReturnValue_t FreshMpsocHandler::commandTcSimplexStoreFile(const uint8_t* commandData,
|
||||
size_t commandDataLen) {
|
||||
mpsoc::TcSimplexStoreFile tcSimplexStoreFile(spParams, commandSequenceCount);
|
||||
ReturnValue_t result = tcSimplexStoreFile.setPayload(commandData, commandDataLen);
|
||||
if (result != returnvalue::OK) {
|
||||
return result;
|
||||
}
|
||||
finishAndSendTc(mpsoc::TC_SIMPLEX_STORE_FILE, tcSimplexStoreFile);
|
||||
return returnvalue::OK;
|
||||
}
|
||||
|
||||
|
@ -183,7 +183,8 @@ class FreshMpsocHandler : public FreshDeviceHandlerBase, public CommandsActionsI
|
||||
ReturnValue_t commandTcCamCmdSend(const uint8_t* commandData, size_t commandDataLen);
|
||||
ReturnValue_t commandTcModeIdle();
|
||||
ReturnValue_t commandTcCamTakePic(const uint8_t* commandData, size_t commandDataLen);
|
||||
ReturnValue_t commandTcSimplexSendFile(const uint8_t* commandData, size_t commandDataLen);
|
||||
ReturnValue_t commandTcSimplexStreamFile(const uint8_t* commandData, size_t commandDataLen);
|
||||
ReturnValue_t commandTcSimplexStoreFile(const uint8_t* commandData, size_t commandDataLen);
|
||||
ReturnValue_t commandTcDownlinkDataModulate(const uint8_t* commandData, size_t commandDataLen);
|
||||
ReturnValue_t commandTcModeSnapshot();
|
||||
|
||||
|
@ -81,7 +81,7 @@ enum FileAccessModes : uint8_t {
|
||||
|
||||
static constexpr uint32_t HK_SET_ID = 0;
|
||||
static constexpr uint32_t DEADBEEF_ADDR = 0x40000004;
|
||||
static constexpr uint32_t DEADBEEF_VALUE= 0xdeadbeef;
|
||||
static constexpr uint32_t DEADBEEF_VALUE = 0xdeadbeef;
|
||||
|
||||
namespace poolid {
|
||||
enum {
|
||||
@ -157,7 +157,6 @@ static constexpr DeviceCommandId_t TC_FLASH_READ_FULL_FILE = 30;
|
||||
static const DeviceCommandId_t TC_SIMPLEX_STORE_FILE = 31;
|
||||
static const DeviceCommandId_t TC_VERIFY_BOOT = 32;
|
||||
|
||||
|
||||
// Will reset the sequence count of the OBSW. Not required anymore after MPSoC update.
|
||||
static const DeviceCommandId_t OBSW_RESET_SEQ_COUNT_LEGACY = 50;
|
||||
|
||||
@ -901,9 +900,36 @@ class TcCamTakePic : public TcBase {
|
||||
/**
|
||||
* @brief Class to build simplex send file command
|
||||
*/
|
||||
class TcSimplexSendFile : public TcBase {
|
||||
class TcSimplexStreamFile : public TcBase {
|
||||
public:
|
||||
TcSimplexSendFile(ploc::SpTcParams params, uint16_t sequenceCount)
|
||||
TcSimplexStreamFile(ploc::SpTcParams params, uint16_t sequenceCount)
|
||||
: TcBase(params, apid::TC_SIMPLEX_SEND_FILE, sequenceCount) {}
|
||||
|
||||
ReturnValue_t setPayload(const uint8_t* commandData, size_t commandDataLen) {
|
||||
if (commandDataLen > MAX_DATA_LENGTH) {
|
||||
return INVALID_LENGTH;
|
||||
}
|
||||
std::string fileName(reinterpret_cast<const char*>(commandData));
|
||||
if (fileName.size() + sizeof(NULL_TERMINATOR) > MAX_FILENAME_SIZE) {
|
||||
return FILENAME_TOO_LONG;
|
||||
}
|
||||
|
||||
std::memcpy(payloadStart, fileName.data(), fileName.length());
|
||||
payloadStart[fileName.length()] = 0;
|
||||
spParams.setFullPayloadLen(fileName.length() + 1);
|
||||
return returnvalue::OK;
|
||||
}
|
||||
|
||||
private:
|
||||
static constexpr size_t MAX_DATA_LENGTH = 256;
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Class to build simplex send file command
|
||||
*/
|
||||
class TcSimplexStoreFile : public TcBase {
|
||||
public:
|
||||
TcSimplexStoreFile(ploc::SpTcParams params, uint16_t sequenceCount)
|
||||
: TcBase(params, apid::TC_SIMPLEX_SEND_FILE, sequenceCount) {}
|
||||
|
||||
ReturnValue_t setPayload(const uint8_t* commandData, size_t commandDataLen) {
|
||||
|
2
tmtc
2
tmtc
@ -1 +1 @@
|
||||
Subproject commit 18860ec2c670230722f47a149a2486377a75da52
|
||||
Subproject commit 05d595523624e0388d74e5f09ac3e4d3657ebf91
|
Loading…
x
Reference in New Issue
Block a user