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

This commit is contained in:
Robin Müller 2022-08-19 15:49:22 +02:00
parent 4aad06469d
commit 0ea993e16b
No known key found for this signature in database
GPG Key ID: 71B58F8A3CDFA9AC
6 changed files with 39 additions and 41 deletions

View File

@ -143,7 +143,7 @@ class TcBase : public ploc::SpTcBase, public MPSoCReturnValuesIF {
virtual ~TcBase() = default;
// Initial length field of space packet. Will always be updated when packet is created.
static const uint16_t INIT_LENGTH = 1;
static const uint16_t INIT_LENGTH = 2;
/**
* @brief Constructor

View File

@ -410,7 +410,7 @@ ReturnValue_t PlocMPSoCHandler::prepareTcMemWrite(const uint8_t* commandData,
sequenceCount--;
return result;
}
finishTcPrep();
finishTcPrep(tcMemWrite.getFullPacketLen());
return RETURN_OK;
}
@ -424,7 +424,7 @@ ReturnValue_t PlocMPSoCHandler::prepareTcMemRead(const uint8_t* commandData,
sequenceCount--;
return result;
}
finishTcPrep();
finishTcPrep(tcMemRead.getFullPacketLen());
tmMemReadReport.rememberRequestedSize = tcMemRead.getMemLen() * 4 + TmMemReadReport::FIX_SIZE;
return RETURN_OK;
}
@ -443,7 +443,7 @@ ReturnValue_t PlocMPSoCHandler::prepareTcFlashDelete(const uint8_t* commandData,
sequenceCount--;
return result;
}
finishTcPrep();
finishTcPrep(tcFlashDelete.getFullPacketLen());
return RETURN_OK;
}
@ -457,7 +457,7 @@ ReturnValue_t PlocMPSoCHandler::prepareTcReplayStart(const uint8_t* commandData,
sequenceCount--;
return result;
}
finishTcPrep();
finishTcPrep(tcReplayStart.getFullPacketLen());
return RETURN_OK;
}
@ -470,7 +470,7 @@ ReturnValue_t PlocMPSoCHandler::prepareTcReplayStop() {
sequenceCount--;
return result;
}
finishTcPrep();
finishTcPrep(tcReplayStop.getFullPacketLen());
return RETURN_OK;
}
@ -484,7 +484,7 @@ ReturnValue_t PlocMPSoCHandler::prepareTcDownlinkPwrOn(const uint8_t* commandDat
sequenceCount--;
return result;
}
finishTcPrep();
finishTcPrep(tcDownlinkPwrOn.getFullPacketLen());
return RETURN_OK;
}
@ -497,7 +497,7 @@ ReturnValue_t PlocMPSoCHandler::prepareTcDownlinkPwrOff() {
sequenceCount--;
return result;
}
finishTcPrep();
finishTcPrep(tcDownlinkPwrOff.getFullPacketLen());
return RETURN_OK;
}
@ -511,7 +511,7 @@ ReturnValue_t PlocMPSoCHandler::prepareTcReplayWriteSequence(const uint8_t* comm
sequenceCount--;
return result;
}
finishTcPrep();
finishTcPrep(tcReplayWriteSeq.getFullPacketLen());
return RETURN_OK;
}
@ -524,7 +524,7 @@ ReturnValue_t PlocMPSoCHandler::prepareTcModeReplay() {
sequenceCount--;
return result;
}
finishTcPrep();
finishTcPrep(tcModeReplay.getFullPacketLen());
return RETURN_OK;
}
@ -537,7 +537,7 @@ ReturnValue_t PlocMPSoCHandler::prepareTcModeIdle() {
sequenceCount--;
return result;
}
finishTcPrep();
finishTcPrep(tcModeIdle.getFullPacketLen());
return RETURN_OK;
}
@ -551,17 +551,19 @@ ReturnValue_t PlocMPSoCHandler::prepareTcCamCmdSend(const uint8_t* commandData,
sequenceCount--;
return result;
}
finishTcPrep();
finishTcPrep(tcCamCmdSend.getFullPacketLen());
nextReplyId = mpsoc::TM_CAM_CMD_RPT;
return RETURN_OK;
}
void PlocMPSoCHandler::finishTcPrep() { nextReplyId = mpsoc::ACK_REPORT; }
void PlocMPSoCHandler::finishTcPrep(size_t packetLen) {
nextReplyId = mpsoc::ACK_REPORT;
rawPacket = commandBuffer;
rawPacketLen = packetLen;
}
ReturnValue_t PlocMPSoCHandler::verifyPacket(const uint8_t* start, size_t foundLen) {
uint16_t receivedCrc = *(start + foundLen - 2) << 8 | *(start + foundLen - 1);
uint16_t recalculatedCrc = CRC::crc16ccitt(start, foundLen - 2);
if (receivedCrc != recalculatedCrc) {
if (CRC::crc16ccitt(start, foundLen) != 0) {
return MPSoCReturnValuesIF::CRC_FAILURE;
}
return RETURN_OK;
@ -683,7 +685,7 @@ ReturnValue_t PlocMPSoCHandler::handleCamCmdRpt(const uint8_t* data) {
reinterpret_cast<const char*>(dataFieldPtr),
tmCamCmdRpt.rememberSpacePacketSize - mpsoc::SPACE_PACKET_HEADER_SIZE - sizeof(uint16_t) - 3);
#if OBSW_DEBUG_PLOC_MPSOC == 1
uint8_t ackValue = *(packet.getPacketData() + packet.getPacketDataLength() - 2);
uint8_t ackValue = *(packetReader.getPacketData() + packetReader.getPacketDataLen() - 2);
sif::info << "PlocMPSoCHandler: CamCmdRpt message: " << camCmdRptMsg << std::endl;
sif::info << "PlocMPSoCHandler: CamCmdRpt Ack value: 0x" << std::hex
<< static_cast<unsigned int>(ackValue) << std::endl;

View File

@ -172,7 +172,7 @@ class PlocMPSoCHandler : public DeviceHandlerBase, public CommandsActionsIF {
ReturnValue_t prepareTcReplayWriteSequence(const uint8_t* commandData, size_t commandDataLen);
ReturnValue_t prepareTcCamCmdSend(const uint8_t* commandData, size_t commandDataLen);
ReturnValue_t prepareTcModeIdle();
void finishTcPrep();
void finishTcPrep(size_t packetLen);
/**
* @brief This function checks the crc of the received PLOC reply.

View File

@ -55,9 +55,8 @@ class AcsController : public ExtendedControllerBase {
void copyMgmData();
// Sun Sensors
std::array<SUS::SusDataset, 12> susSets {
std::array<SUS::SusDataset, 12> susSets{
SUS::SusDataset(objects::SUS_0_N_LOC_XFYFZM_PT_XF),
SUS::SusDataset(objects::SUS_1_N_LOC_XBYFZM_PT_XB),
SUS::SusDataset(objects::SUS_2_N_LOC_XFYBZB_PT_YB),

View File

@ -8,10 +8,7 @@
namespace acsctrl {
enum SetIds : uint32_t {
MGM_SENSOR_DATA,
SUS_SENSOR_DATA
};
enum SetIds : uint32_t { MGM_SENSOR_DATA, SUS_SENSOR_DATA };
enum PoolIds : lp_id_t {
MGM_0_LIS3_UT,
@ -63,11 +60,11 @@ class MgmData : public StaticLocalDataSet<MGM_SET_ENTRIES> {
private:
};
class SusData: public StaticLocalDataSet<SUS_SET_ENTRIES> {
public:
class SusData : public StaticLocalDataSet<SUS_SET_ENTRIES> {
public:
SusData(HasLocalDataPoolIF* hkOwner) : StaticLocalDataSet(hkOwner, SUS_SENSOR_DATA) {}
private:
private:
};
} // namespace acsctrl

2
tmtc

@ -1 +1 @@
Subproject commit d8b0d81ef3165325284956456138b529f6e9fae0
Subproject commit 00e99292cc158a347f485507537fa5b63262243b