tc replay stop wip
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
be45d21486
commit
664670573a
2
fsfw
2
fsfw
@ -1 +1 @@
|
||||
Subproject commit bac8b4088009a71afbb0225e634dabcbff0d9ec1
|
||||
Subproject commit 1b7e0371c337f9edae70f7bf1845a8a4854a6b8f
|
@ -85,6 +85,8 @@ public:
|
||||
|
||||
//! [EXPORT] : [COMMENT] Received command with invalid length
|
||||
static const ReturnValue_t INVALID_LENGTH = MAKE_RETURN_CODE(0xC0);
|
||||
//! [EXPORT] : [COMMENT] Command has invalid parameter
|
||||
static const ReturnValue_t INVALID_PARAMETER = MAKE_RETURN_CODE(0xC1);
|
||||
|
||||
/**
|
||||
* @brief Constructor
|
||||
@ -364,11 +366,93 @@ public:
|
||||
return RETURN_FAILED;
|
||||
}
|
||||
std::memcpy(this->getPacketData(), writeData, writeLen);
|
||||
addCrc();
|
||||
this->setPacketDataLength(static_cast<uint16_t>(writeLen + CRC_SIZE - 1));
|
||||
return RETURN_OK;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief This class helps to build the replay start command.
|
||||
*/
|
||||
class TcReplayStart: public TcBase {
|
||||
public:
|
||||
/**
|
||||
* @brief Constructor
|
||||
*/
|
||||
TcReplayStart(uint16_t sequenceCount) : TcBase(apid::TC_REPLAY_START, sequenceCount) {
|
||||
}
|
||||
|
||||
protected:
|
||||
|
||||
ReturnValue_t initPacket(const uint8_t* commandData, size_t commandDataLen) {
|
||||
ReturnValue_t result = RETURN_OK;
|
||||
result = lengthCheck(commandDataLen);
|
||||
if (result != RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
result = lengthData(commandData);
|
||||
if (result != RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
std::memcpy(this->localData.fields.buffer, commandData, commandDataLen);
|
||||
this->setPacketDataLength(commandDataLen + CRC_SIZE - 1);
|
||||
return result;
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
static const size_t COMMAND_DATA_LENGTH = 1;
|
||||
static const uint8_t REPEATING = 0;
|
||||
static const uint8_t ONCE = 1;
|
||||
|
||||
ReturnValue_t lengthCheck(size_t commandDataLen) {
|
||||
if (commandDataLen != COMMAND_DATA_LENGTH) {
|
||||
sif::warning << "TcReplayStart: Command has invalid length " << commandDataLen << std::endl;
|
||||
return INVALID_LENGTH;
|
||||
}
|
||||
return RETURN_OK;
|
||||
}
|
||||
|
||||
ReturnValue_t checkData(uint8_t replay) {
|
||||
if (replay != REPEATING && replay != ONCE) {
|
||||
sif::warning << "TcReplayStart::checkData: Invalid replay value" << std::endl;
|
||||
return INVALID_PARAMETER;
|
||||
}
|
||||
return RETURN_OK;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief This class helps to build the replay stop command.
|
||||
*/
|
||||
class TcReplayStart: public TcBase {
|
||||
public:
|
||||
/**
|
||||
* @brief Constructor
|
||||
*/
|
||||
TcReplayStart(uint16_t sequenceCount) : TcBase(apid::TC_REPLAY_START, sequenceCount) {
|
||||
}
|
||||
|
||||
protected:
|
||||
|
||||
ReturnValue_t initPacket(const uint8_t* commandData, size_t commandDataLen) {
|
||||
ReturnValue_t result = RETURN_OK;
|
||||
result = lengthCheck(commandDataLen);
|
||||
if (result != RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
result = lengthData(commandData);
|
||||
if (result != RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
std::memcpy(this->localData.fields.buffer, commandData, commandDataLen);
|
||||
this->setPacketDataLength(commandDataLen + CRC_SIZE - 1);
|
||||
return result;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif /* MISSION_DEVICES_DEVICEDEFINITIONS_PLOCMPSOCDEFINITIONS_H_ */
|
||||
|
@ -311,6 +311,20 @@ ReturnValue_t PlocMPSoCHandler::prepareTcFlashDelete(const uint8_t * commandData
|
||||
return RETURN_OK;
|
||||
}
|
||||
|
||||
ReturnValue_t PlocMPSoCHandler::prepareTcReplayStart(
|
||||
const uint8_t * commandData, size_t commandDataLen) {
|
||||
ReturnValue_t result = RETURN_OK;
|
||||
sequenceCount++;
|
||||
mpsoc::TcReplayStart tcReplayStart(sequenceCount);
|
||||
result = tcReplayStart.createPacket(commandData, commandDataLen);
|
||||
if (result != RETURN_OK) {
|
||||
sequenceCount--;
|
||||
return result;
|
||||
}
|
||||
copyToCommandBuffer (&tcFlashDelete);
|
||||
return RETURN_OK;
|
||||
}
|
||||
|
||||
void PlocMPSoCHandler::copyToCommandBuffer(mpsoc::TcBase* tc) {
|
||||
if (tc == nullptr) {
|
||||
sif::debug << "PlocMPSoCHandler::copyToCommandBuffer: Invalid TC" << std::endl;
|
||||
|
@ -130,7 +130,7 @@ private:
|
||||
ReturnValue_t prepareTcMemWrite(const uint8_t * commandData, size_t commandDataLen);
|
||||
ReturnValue_t prepareTcMemRead(const uint8_t * commandData, size_t commandDataLen);
|
||||
ReturnValue_t prepareTcFlashDelete(const uint8_t * commandData, size_t commandDataLen);
|
||||
// ReturnValue_t prepareTcReplayStart(const uint8_t * commandData, size_t commandDataLen);
|
||||
ReturnValue_t prepareTcReplayStart(const uint8_t * commandData, size_t commandDataLen);
|
||||
// ReturnValue_t prepareTcReplayStop(const uint8_t * commandData, size_t commandDataLen);
|
||||
// ReturnValue_t prepareTcDownlinkPwrOff(const uint8_t * commandData, size_t commandDataLen);
|
||||
// ReturnValue_t prepareTcDownlinkPwrOn(const uint8_t * commandData, size_t commandDataLen);
|
||||
|
2
tmtc
2
tmtc
@ -1 +1 @@
|
||||
Subproject commit 1af59ea7a53cd0cbbaf433710d99c6c27369a3d1
|
||||
Subproject commit 9005ccab3a07f569c45369f591c12b7613ffcac3
|
Loading…
Reference in New Issue
Block a user