bugfixes in some mpsoc TCs
All checks were successful
EIVE/eive-obsw/pipeline/head This commit looks good
EIVE/eive-obsw/pipeline/pr-develop This commit looks good

This commit is contained in:
Jakob Meier 2023-02-28 19:56:42 +01:00
parent 809626b6e3
commit 6004233c67
3 changed files with 10 additions and 5 deletions

View File

@ -116,6 +116,7 @@ static const uint16_t TC_WRITE_SEQ_EXECUTION_DELAY = 80;
// Requires approx. 2 seconds for execution. 8 => 4 seconds
static const uint16_t TC_DOWNLINK_PWR_ON_EXECUTION_DELAY = 8;
static const uint16_t TC_CAM_TAKE_PIC_EXECUTION_DELAY = 20;
static const uint16_t TC_SIMPLEX_SEND_FILE_DELAY = 80;
namespace status_code {
static const uint16_t DEFAULT_ERROR_CODE = 0x1;
@ -684,7 +685,7 @@ class TcCamTakePic : public TcBase {
if (commandDataLen - (fileName.size() + sizeof(NULL_TERMINATOR)) != PARAMETER_SIZE) {
return INVALID_LENGTH;
}
spParams.setFullPayloadLen(commandDataLen);
spParams.setFullPayloadLen(commandDataLen + CRC_SIZE);
std::memcpy(payloadStart, commandData, commandDataLen);
return returnvalue::OK;
}
@ -710,7 +711,7 @@ class TcSimplexSendFile : public TcBase {
if (fileName.size() + sizeof(NULL_TERMINATOR) > MAX_FILENAME_SIZE) {
return FILENAME_TOO_LONG;
}
spParams.setFullPayloadLen(commandDataLen);
spParams.setFullPayloadLen(commandDataLen + CRC_SIZE);
std::memcpy(payloadStart, commandData, commandDataLen);
return returnvalue::OK;
}
@ -731,7 +732,7 @@ class TcDownlinkDataModulate : public TcBase {
if (commandDataLen > MAX_DATA_LENGTH) {
return INVALID_LENGTH;
}
spParams.setFullPayloadLen(commandDataLen);
spParams.setFullPayloadLen(commandDataLen + CRC_SIZE);
std::memcpy(payloadStart, commandData, commandDataLen);
return returnvalue::OK;
}

View File

@ -826,16 +826,19 @@ ReturnValue_t PlocMPSoCHandler::enableReplyInReplyMap(DeviceCommandMap::iterator
}
case mpsoc::TC_DOWNLINK_PWR_ON: {
DeviceReplyIter iter = deviceReplyMap.find(mpsoc::EXE_REPORT);
//
iter->second.delayCycles = mpsoc::TC_DOWNLINK_PWR_ON_EXECUTION_DELAY;
break;
}
case mpsoc::TC_CAM_TAKE_PIC: {
DeviceReplyIter iter = deviceReplyMap.find(mpsoc::EXE_REPORT);
//
iter->second.delayCycles = mpsoc::TC_CAM_TAKE_PIC_EXECUTION_DELAY;
break;
}
case mpsoc::TC_SIMPLEX_SEND_FILE: {
DeviceReplyIter iter = deviceReplyMap.find(mpsoc::EXE_REPORT);
iter->second.delayCycles = mpsoc::TC_SIMPLEX_SEND_FILE_DELAY;
break;
}
default:
break;
}

View File

@ -14,6 +14,7 @@ struct SpTcParams {
SpTcParams(SpacePacketCreator& creator, uint8_t* buf, size_t maxSize)
: creator(creator), buf(buf), maxSize(maxSize) {}
// Set full payload length. Must also consider the two CRC bytes
void setFullPayloadLen(size_t fullPayloadLen_) { fullPayloadLen = fullPayloadLen_; }
SpacePacketCreator& creator;