diff --git a/linux/devices/devicedefinitions/PlocMPSoCDefinitions.h b/linux/devices/devicedefinitions/PlocMPSoCDefinitions.h index babed275..7895adf9 100644 --- a/linux/devices/devicedefinitions/PlocMPSoCDefinitions.h +++ b/linux/devices/devicedefinitions/PlocMPSoCDefinitions.h @@ -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; } diff --git a/linux/devices/ploc/PlocMPSoCHandler.cpp b/linux/devices/ploc/PlocMPSoCHandler.cpp index 7f22b14d..f756bff9 100644 --- a/linux/devices/ploc/PlocMPSoCHandler.cpp +++ b/linux/devices/ploc/PlocMPSoCHandler.cpp @@ -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; } diff --git a/mission/devices/devicedefinitions/SpBase.h b/mission/devices/devicedefinitions/SpBase.h index 11d67a59..8678cf9d 100644 --- a/mission/devices/devicedefinitions/SpBase.h +++ b/mission/devices/devicedefinitions/SpBase.h @@ -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;