comment out more code which was removed
All checks were successful
EIVE/eive-obsw/pipeline/pr-develop This commit looks good

This commit is contained in:
2022-11-08 10:10:57 +01:00
parent 8dbb3dcd9b
commit 3b575acd55
5 changed files with 437 additions and 453 deletions

View File

@ -445,45 +445,6 @@ class MPSoCBootSelect : public TcBase {
}
};
/**
* @brief This class creates the command to enable or disable the NVMs connected to the
* supervisor.
*/
// class EnableNvms : public ploc::SpTcBase {
// public:
// /**
// * @brief Constructor
// *
// * @param mem The memory to boot from: NVM0 (0), NVM1 (1)
// * @param bp0 Partition pin 0
// * @param bp1 Partition pin 1
// * @param bp2 Partition pin 2
// */
// EnableNvms(ploc::SpTcParams params) : ploc::SpTcBase(params) {
// spParams.setFullPayloadLen(DATA_FIELD_LENGTH);
// spParams.creator.setApid(APID_ENABLE_NVMS);
// spParams.creator.setSeqCount(DEFAULT_SEQUENCE_COUNT);
// }
//
// ReturnValue_t buildPacket(uint8_t nvm01, uint8_t nvm3) {
// auto res = checkSizeAndSerializeHeader();
// if (res != returnvalue::OK) {
// return res;
// }
// initPacket(nvm01, nvm3);
// return calcAndSetCrc();
// }
//
// private:
// static const uint8_t DATA_FIELD_LENGTH = 4;
// static const uint8_t CRC_OFFSET = 2;
//
// void initPacket(uint8_t nvm01, uint8_t nvm3) {
// payloadStart[0] = nvm01;
// payloadStart[1] = nvm3;
// }
// };
/**
* @brief This class generates the space packet to update the time of the PLOC supervisor.
*/
@ -715,37 +676,6 @@ class SetAlertlimit : public TcBase {
}
};
/**
* @brief This class packages the space packet to enable or disable ADC channels.
*/
class SetAdcEnabledChannels : public TcBase {
public:
/**
* @brief Constructor
*
* @param ch Defines channels to be enabled or disabled.
*/
SetAdcEnabledChannels(TcParams params)
: TcBase(params, Apids::ADC_MON, static_cast<uint8_t>(AdcMonServiceIds::SET_ENABLED_CHANNELS),
2) {}
ReturnValue_t buildPacket(uint16_t ch) {
auto res = checkSizeAndSerializeHeader();
if (res != returnvalue::OK) {
return res;
}
initPacket(ch);
return calcAndSetCrc();
}
private:
void initPacket(uint16_t ch) {
size_t serializedSize = 0;
SerializeAdapter::serialize(&ch, &payloadStart, &serializedSize, sizeof(ch),
SerializeIF::Endianness::BIG);
}
};
/**
* @brief This class packages the space packet to configures the window size and striding step of
* the moving average filter applied to the ADC readings.
@ -842,60 +772,6 @@ class RunAutoEmTests : public TcBase {
void initPacket(uint8_t test) { payloadStart[0] = test; }
};
/**
* @brief This class packages the space packet to wipe or dump parts of the MRAM.
*/
// class MramCmd : public TcBase {
// public:
// enum class MramAction { WIPE, DUMP };
//
// /**
// * @brief Constructor
// *
// * @param start Start address of the MRAM section to wipe or dump
// * @param stop End address of the MRAM section to wipe or dump
// * @param action Dump or wipe MRAM
// *
// * @note The content at the stop address is excluded from the dump or wipe operation.
// */
// MramCmd(TcParams params)
// : TcBase(params, Apids::DATA_LOGGER) {
// setLenFromPayloadLen(6);
// }
//
// ReturnValue_t buildPacket(uint32_t start, uint32_t stop, MramAction action) {
// if (action == MramAction::WIPE) {
// setServiceId(static_cast<uint8_t>(DataLoggerServiceIds::WIPE_MRAM));
// } else if (action == MramAction::DUMP) {
// setServiceId(static_cast<uint8_t>(DataLoggerServiceIds::DUMP_MRAM));
// } else {
// sif::debug << "WipeMram: Invalid action specified";
// }
// auto res = checkSizeAndSerializeHeader();
// if (res != returnvalue::OK) {
// return res;
// }
// initPacket(start, stop);
// return calcAndSetCrc();
// }
//
// private:
//
// uint32_t start = 0;
// uint32_t stop = 0;
//
// void initPacket(uint32_t start, uint32_t stop) {
// uint8_t concatBuffer[6];
// concatBuffer[0] = static_cast<uint8_t>(start >> 16);
// concatBuffer[1] = static_cast<uint8_t>(start >> 8);
// concatBuffer[2] = static_cast<uint8_t>(start);
// concatBuffer[3] = static_cast<uint8_t>(stop >> 16);
// concatBuffer[4] = static_cast<uint8_t>(stop >> 8);
// concatBuffer[5] = static_cast<uint8_t>(stop);
// std::memcpy(payloadStart, concatBuffer, sizeof(concatBuffer));
// }
// };
/**
* @brief This class packages the space packet change the state of a GPIO. This command is only
* required for ground testing.
@ -967,59 +843,6 @@ class ReadGpio : public TcBase {
}
};
/**
* @brief This class packages the space packet to perform the factory reset. The op parameter is
* optional.
*
* @details: Without OP: All MRAM entries will be cleared.
* OP = 0x01: Only the mirror entries will be wiped.
* OP = 0x02: Only the circular entries will be wiped.
*/
// class FactoryReset : public TcBase {
// public:
// enum class Op { CLEAR_ALL, MIRROR_ENTRIES, CIRCULAR_ENTRIES };
//
// /**
// * @brief Constructor
// *
// * @param op
// */
// FactoryReset(TcParams params)
// : TcBase(params, Apids::TMTC_MAN, static_cast<uint8_t>(TmtcServiceIds::)) {
// // spParams.creator.setApid(APID_FACTORY_RESET);
// spParams.creator.setSeqCount(DEFAULT_SEQUENCE_COUNT);
// }
//
// ReturnValue_t buildPacket(Op op) {
// auto res = checkSizeAndSerializeHeader();
// if (res != returnvalue::OK) {
// return res;
// }
// initPacket(op);
// return calcAndSetCrc();
// }
//
// private:
// static const uint16_t DEFAULT_SEQUENCE_COUNT = 1;
//
// void initPacket(Op op) {
// size_t packetDataLen = 2;
// switch (op) {
// case Op::MIRROR_ENTRIES:
// payloadStart[0] = 1;
// packetDataLen = 3;
// break;
// case Op::CIRCULAR_ENTRIES:
// payloadStart[0] = 2;
// packetDataLen = 3;
// break;
// default:
// break;
// }
// spParams.setFullPayloadLen(packetDataLen);
// }
// };
class SetShutdownTimeout : public TcBase {
public:
SetShutdownTimeout(TcParams params)
@ -1068,10 +891,7 @@ class CheckMemory : public TcBase {
}
private:
uint8_t memoryId = 0;
uint8_t n = 1;
uint32_t startAddress = 0;
uint32_t length = 0;
void initPacket(uint8_t memoryId, uint32_t startAddress, uint32_t length) {
uint8_t* data = payloadStart;
@ -1177,10 +997,7 @@ class EraseMemory : public TcBase {
private:
static const uint16_t PAYLOAD_LENGTH = 10; // length without CRC field
uint8_t memoryId = 0;
uint8_t n = 1;
uint32_t startAddress = 0;
uint32_t length = 0;
void initPacket(uint8_t memoryId, uint32_t startAddress, uint32_t length) {
uint8_t* data = payloadStart;
@ -1196,97 +1013,6 @@ class EraseMemory : public TcBase {
}
};
/**
* @brief This class creates the space packet to enable the auto TM generation
*/
class EnableAutoTm : public TcBase {
public:
EnableAutoTm(TcParams params) : TcBase(params) {
spParams.setFullPayloadLen(PAYLOAD_LENGTH + 2);
// spParams.creator.setApid(APID_AUTO_TM);
// spParams.creator.setSeqCount(DEFAULT_SEQUENCE_COUNT);
}
ReturnValue_t buildPacket() {
auto res = checkSizeAndSerializeHeader();
if (res != returnvalue::OK) {
return res;
}
payloadStart[0] = ENABLE;
return calcAndSetCrc();
}
private:
static const uint16_t PAYLOAD_LENGTH = 1; // length without CRC field
static const uint8_t ENABLE = 1;
};
/**
* @brief This class creates the space packet to disable the auto TM generation
*/
class DisableAutoTm : public TcBase {
public:
DisableAutoTm(TcParams params) : TcBase(params) {
spParams.setFullPayloadLen(PAYLOAD_LENGTH + 2);
// spParams.creator.setApid(APID_AUTO_TM);
// spParams.creator.setSeqCount(DEFAULT_SEQUENCE_COUNT);
}
ReturnValue_t buildPacket() {
auto res = checkSizeAndSerializeHeader();
if (res != returnvalue::OK) {
return res;
}
payloadStart[0] = DISABLE;
return calcAndSetCrc();
}
private:
static const uint16_t PAYLOAD_LENGTH = 1; // length without CRC field
static const uint8_t DISABLE = 0;
};
/**
* @brief This class creates the space packet to request the logging data from the supervisor
*/
class RequestLoggingData : public TcBase {
public:
/**
* Subapid
*/
enum class Sa : uint8_t {
REQUEST_COUNTERS = 1, /**< REQUEST_COUNTERS */
REQUEST_EVENT_BUFFERS = 2, /**< REQUEST_EVENT_BUFFERS */
CLEAR_COUNTERS = 3, /**< CLEAR_COUNTERS */
SET_LOGGING_TOPIC = 4 /**< SET_LOGGING_TOPIC */
};
RequestLoggingData(TcParams params) : TcBase(params) {
spParams.setFullPayloadLen(PAYLOAD_LENGTH + 2);
// spParams.creator.setApid(APID_REQUEST_LOGGING_DATA);
// spParams.creator.setSeqCount(DEFAULT_SEQUENCE_COUNT);
}
/**
* @param sa
* @param tpc Topic
* @return
*/
ReturnValue_t buildPacket(Sa sa, uint8_t tpc = 0) {
auto res = checkSizeAndSerializeHeader();
if (res != returnvalue::OK) {
return res;
}
payloadStart[0] = static_cast<uint8_t>(sa);
payloadStart[1] = tpc;
return calcAndSetCrc();
}
private:
static const uint16_t PAYLOAD_LENGTH = 2; // length without CRC field
static const uint8_t TPC_OFFSET = 1;
};
class VerificationReport : public ploc::SpTmReader {
public:
VerificationReport(const uint8_t* buf, size_t maxSize) : ploc::SpTmReader(buf, maxSize) {}
@ -1961,6 +1687,262 @@ class AdcReport : public StaticLocalDataSet<ADC_RPT_SET_ENTRIES> {
sif::info << "AdcReport: ADC eng 15: " << this->adcEng15 << std::endl;
}
};
namespace notimpl {
/**
* @brief This class packages the space packet to perform the factory reset. The op parameter is
* optional.
*
* @details: Without OP: All MRAM entries will be cleared.
* OP = 0x01: Only the mirror entries will be wiped.
* OP = 0x02: Only the circular entries will be wiped.
*/
class FactoryReset : public TcBase {
public:
enum class Op { CLEAR_ALL, MIRROR_ENTRIES, CIRCULAR_ENTRIES };
/**
* @brief Constructor
*
* @param op
*/
FactoryReset(TcParams params) : TcBase(params, Apids::TMTC_MAN, 0x11, 1) {}
ReturnValue_t buildPacket(Op op) {
auto res = checkSizeAndSerializeHeader();
if (res != returnvalue::OK) {
return res;
}
initPacket(op);
return calcAndSetCrc();
}
private:
void initPacket(Op op) {
size_t packetDataLen = 2;
switch (op) {
case Op::MIRROR_ENTRIES:
payloadStart[0] = 1;
packetDataLen = 3;
break;
case Op::CIRCULAR_ENTRIES:
payloadStart[0] = 2;
packetDataLen = 3;
break;
default:
break;
}
spParams.setFullPayloadLen(packetDataLen);
}
};
/**
* @brief This class creates the command to enable or disable the NVMs connected to the
* supervisor.
*/
class EnableNvms : public TcBase {
public:
/**
* @brief Constructor
*
* @param mem The memory to boot from: NVM0 (0), NVM1 (1)
* @param bp0 Partition pin 0
* @param bp1 Partition pin 1
* @param bp2 Partition pin 2
*/
EnableNvms(TcParams params) : TcBase(params, Apids::TMTC_MAN, 0x06, 2) {}
ReturnValue_t buildPacket(uint8_t nvm01, uint8_t nvm3) {
auto res = checkSizeAndSerializeHeader();
if (res != returnvalue::OK) {
return res;
}
initPacket(nvm01, nvm3);
return calcAndSetCrc();
}
private:
void initPacket(uint8_t nvm01, uint8_t nvm3) {
payloadStart[0] = nvm01;
payloadStart[1] = nvm3;
}
};
/**
* @brief This class packages the space packet to wipe or dump parts of the MRAM.
*/
class MramCmd : public TcBase {
public:
enum class MramAction { WIPE, DUMP };
/**
* @brief Constructor
*
* @param start Start address of the MRAM section to wipe or dump
* @param stop End address of the MRAM section to wipe or dump
* @param action Dump or wipe MRAM
*
* @note The content at the stop address is excluded from the dump or wipe operation.
*/
MramCmd(TcParams params) : TcBase(params, Apids::DATA_LOGGER) { setLenFromPayloadLen(6); }
ReturnValue_t buildPacket(uint32_t start, uint32_t stop, MramAction action) {
if (action == MramAction::WIPE) {
setServiceId(static_cast<uint8_t>(DataLoggerServiceIds::WIPE_MRAM));
} else if (action == MramAction::DUMP) {
setServiceId(static_cast<uint8_t>(DataLoggerServiceIds::DUMP_MRAM));
} else {
sif::debug << "WipeMram: Invalid action specified";
}
auto res = checkSizeAndSerializeHeader();
if (res != returnvalue::OK) {
return res;
}
initPacket(start, stop);
return calcAndSetCrc();
}
private:
uint32_t start = 0;
uint32_t stop = 0;
void initPacket(uint32_t start, uint32_t stop) {
uint8_t concatBuffer[6];
concatBuffer[0] = static_cast<uint8_t>(start >> 16);
concatBuffer[1] = static_cast<uint8_t>(start >> 8);
concatBuffer[2] = static_cast<uint8_t>(start);
concatBuffer[3] = static_cast<uint8_t>(stop >> 16);
concatBuffer[4] = static_cast<uint8_t>(stop >> 8);
concatBuffer[5] = static_cast<uint8_t>(stop);
std::memcpy(payloadStart, concatBuffer, sizeof(concatBuffer));
}
};
/**
* @brief This class creates the space packet to enable the auto TM generation
*/
class EnableAutoTm : public TcBase {
public:
EnableAutoTm(TcParams params) : TcBase(params) {
spParams.setFullPayloadLen(PAYLOAD_LENGTH + 2);
// spParams.creator.setApid(APID_AUTO_TM);
// spParams.creator.setSeqCount(DEFAULT_SEQUENCE_COUNT);
}
ReturnValue_t buildPacket() {
auto res = checkSizeAndSerializeHeader();
if (res != returnvalue::OK) {
return res;
}
payloadStart[0] = ENABLE;
return calcAndSetCrc();
}
private:
static const uint16_t PAYLOAD_LENGTH = 1; // length without CRC field
static const uint8_t ENABLE = 1;
};
/**
* @brief This class creates the space packet to disable the auto TM generation
*/
class DisableAutoTm : public TcBase {
public:
DisableAutoTm(TcParams params) : TcBase(params) {
spParams.setFullPayloadLen(PAYLOAD_LENGTH + 2);
// spParams.creator.setApid(APID_AUTO_TM);
// spParams.creator.setSeqCount(DEFAULT_SEQUENCE_COUNT);
}
ReturnValue_t buildPacket() {
auto res = checkSizeAndSerializeHeader();
if (res != returnvalue::OK) {
return res;
}
payloadStart[0] = DISABLE;
return calcAndSetCrc();
}
private:
static const uint16_t PAYLOAD_LENGTH = 1; // length without CRC field
static const uint8_t DISABLE = 0;
};
/**
* @brief This class packages the space packet to enable or disable ADC channels.
*/
class SetAdcEnabledChannels : public TcBase {
public:
/**
* @brief Constructor
*
* @param ch Defines channels to be enabled or disabled.
*/
SetAdcEnabledChannels(TcParams params)
: TcBase(params, Apids::ADC_MON, static_cast<uint8_t>(AdcMonServiceIds::SET_ENABLED_CHANNELS),
2) {}
ReturnValue_t buildPacket(uint16_t ch) {
auto res = checkSizeAndSerializeHeader();
if (res != returnvalue::OK) {
return res;
}
initPacket(ch);
return calcAndSetCrc();
}
private:
void initPacket(uint16_t ch) {
size_t serializedSize = 0;
SerializeAdapter::serialize(&ch, &payloadStart, &serializedSize, sizeof(ch),
SerializeIF::Endianness::BIG);
}
};
/**
* @brief This class creates the space packet to request the logging data from the supervisor
*/
class RequestLoggingData : public TcBase {
public:
/**
* Subapid
*/
enum class Sa : uint8_t {
REQUEST_COUNTERS = 1, /**< REQUEST_COUNTERS */
REQUEST_EVENT_BUFFERS = 2, /**< REQUEST_EVENT_BUFFERS */
CLEAR_COUNTERS = 3, /**< CLEAR_COUNTERS */
SET_LOGGING_TOPIC = 4 /**< SET_LOGGING_TOPIC */
};
RequestLoggingData(TcParams params) : TcBase(params) {
spParams.setFullPayloadLen(PAYLOAD_LENGTH + 2);
// spParams.creator.setApid(APID_REQUEST_LOGGING_DATA);
// spParams.creator.setSeqCount(DEFAULT_SEQUENCE_COUNT);
}
/**
* @param sa
* @param tpc Topic
* @return
*/
ReturnValue_t buildPacket(Sa sa, uint8_t tpc = 0) {
auto res = checkSizeAndSerializeHeader();
if (res != returnvalue::OK) {
return res;
}
payloadStart[0] = static_cast<uint8_t>(sa);
payloadStart[1] = tpc;
return calcAndSetCrc();
}
private:
static const uint16_t PAYLOAD_LENGTH = 2; // length without CRC field
static const uint8_t TPC_OFFSET = 1;
};
} // namespace notimpl
} // namespace supv
#endif /* MISSION_DEVICES_DEVICEDEFINITIONS_PLOCSVPDEFINITIONS_H_ */