use result namespace instead of interface
All checks were successful
EIVE/eive-obsw/pipeline/pr-develop This commit looks good
All checks were successful
EIVE/eive-obsw/pipeline/pr-develop This commit looks good
This commit is contained in:
@ -10,34 +10,67 @@
|
||||
#include <fsfw/tmtcpacket/ccsds/SpacePacketReader.h>
|
||||
#include <linux/devices/devicedefinitions/PlocSupervisorDefinitions.h>
|
||||
|
||||
#include "linux/devices/devicedefinitions/SupvReturnValuesIF.h"
|
||||
#include "mission/devices/devicedefinitions/SpBase.h"
|
||||
|
||||
using namespace returnvalue;
|
||||
|
||||
namespace supv {
|
||||
|
||||
static const uint8_t CLASS_ID = CLASS_ID::PLOC_SUPERVISOR_HANDLER;
|
||||
namespace result {
|
||||
static const uint8_t INTERFACE_ID = CLASS_ID::SUPV_RETURN_VALUES_IF;
|
||||
|
||||
static constexpr ReturnValue_t CRC_MISSMATCH = makeCode(CLASS_ID, 1);
|
||||
static constexpr ReturnValue_t APID_MISSMATCH = makeCode(CLASS_ID, 2);
|
||||
static constexpr ReturnValue_t BUF_TOO_SMALL = makeCode(CLASS_ID, 3);
|
||||
//! [EXPORT] : [COMMENT] Space Packet received from PLOC supervisor has invalid CRC
|
||||
static const ReturnValue_t CRC_FAILURE = MAKE_RETURN_CODE(0xA0);
|
||||
//! [EXPORT] : [COMMENT] Received ACK failure reply from PLOC supervisor
|
||||
static const ReturnValue_t RECEIVED_ACK_FAILURE = MAKE_RETURN_CODE(0xA1);
|
||||
//! [EXPORT] : [COMMENT] Received execution failure reply from PLOC supervisor
|
||||
static const ReturnValue_t RECEIVED_EXE_FAILURE = MAKE_RETURN_CODE(0xA2);
|
||||
//! [EXPORT] : [COMMENT] Received space packet with invalid APID from PLOC supervisor
|
||||
static const ReturnValue_t INVALID_APID = MAKE_RETURN_CODE(0xA3);
|
||||
//! [EXPORT] : [COMMENT] Failed to read current system time
|
||||
static const ReturnValue_t GET_TIME_FAILURE = MAKE_RETURN_CODE(0xA4);
|
||||
//! [EXPORT] : [COMMENT] Received command with invalid watchdog parameter. Valid watchdogs are 0
|
||||
//! for PS, 1 for PL and 2 for INT
|
||||
static const ReturnValue_t INVALID_WATCHDOG = MAKE_RETURN_CODE(0xA5);
|
||||
//! [EXPORT] : [COMMENT] Received watchdog timeout config command with invalid timeout. Valid
|
||||
//! timeouts must be in the range between 1000 and 360000 ms.
|
||||
static const ReturnValue_t INVALID_WATCHDOG_TIMEOUT = MAKE_RETURN_CODE(0xA6);
|
||||
//! [EXPORT] : [COMMENT] Received latchup config command with invalid latchup ID
|
||||
static const ReturnValue_t INVALID_LATCHUP_ID = MAKE_RETURN_CODE(0xA7);
|
||||
//! [EXPORT] : [COMMENT] Received set adc sweep period command with invalid sweep period. Must be
|
||||
//! larger than 21.
|
||||
static const ReturnValue_t SWEEP_PERIOD_TOO_SMALL = MAKE_RETURN_CODE(0xA8);
|
||||
//! [EXPORT] : [COMMENT] Receive auto EM test command with invalid test param. Valid params are 1
|
||||
//! and 2.
|
||||
static const ReturnValue_t INVALID_TEST_PARAM = MAKE_RETURN_CODE(0xA9);
|
||||
//! [EXPORT] : [COMMENT] Returned when scanning for MRAM dump packets failed.
|
||||
static const ReturnValue_t MRAM_PACKET_PARSING_FAILURE = MAKE_RETURN_CODE(0xAA);
|
||||
//! [EXPORT] : [COMMENT] Returned when the start and stop addresses of the MRAM dump or MRAM wipe
|
||||
//! commands are invalid (e.g. start address bigger than stop address)
|
||||
static const ReturnValue_t INVALID_MRAM_ADDRESSES = MAKE_RETURN_CODE(0xAB);
|
||||
//! [EXPORT] : [COMMENT] Expect reception of an MRAM dump packet but received space packet with
|
||||
//! other apid.
|
||||
static const ReturnValue_t NO_MRAM_PACKET = MAKE_RETURN_CODE(0xAC);
|
||||
//! [EXPORT] : [COMMENT] Path to PLOC directory on SD card does not exist
|
||||
static const ReturnValue_t PATH_DOES_NOT_EXIST = MAKE_RETURN_CODE(0xAD);
|
||||
//! [EXPORT] : [COMMENT] MRAM dump file does not exists. The file should actually already have
|
||||
//! been created with the reception of the first dump packet.
|
||||
static const ReturnValue_t MRAM_FILE_NOT_EXISTS = MAKE_RETURN_CODE(0xAE);
|
||||
//! [EXPORT] : [COMMENT] Received action command has invalid length
|
||||
static const ReturnValue_t INVALID_LENGTH = MAKE_RETURN_CODE(0xAF);
|
||||
//! [EXPORT] : [COMMENT] Filename too long
|
||||
static const ReturnValue_t FILENAME_TOO_LONG = MAKE_RETURN_CODE(0xB0);
|
||||
//! [EXPORT] : [COMMENT] Received update status report with invalid packet length field
|
||||
static const ReturnValue_t UPDATE_STATUS_REPORT_INVALID_LENGTH = MAKE_RETURN_CODE(0xB1);
|
||||
//! [EXPORT] : [COMMENT] Update status report does not contain expected CRC. There might be a bit
|
||||
//! flip in the update memory region.
|
||||
static const ReturnValue_t UPDATE_CRC_FAILURE = MAKE_RETURN_CODE(0xB2);
|
||||
//! [EXPORT] : [COMMENT] Supervisor helper task ist currently executing a command (wait until
|
||||
//! helper tas has finished or interrupt by sending the terminate command)
|
||||
static const ReturnValue_t SUPV_HELPER_EXECUTING = MAKE_RETURN_CODE(0xB3);
|
||||
|
||||
typedef struct {
|
||||
// The most significant bit of msec value is set to 0x80 to indicate that full
|
||||
// time and data information is transmitted, when the time has been synced with
|
||||
// the reference. If the time has not been synced with reference, then the most
|
||||
// significant bit is set to 0x00. Only the most significant bit is used for
|
||||
// this purpose (bit 15 of the field tm_msec)
|
||||
uint16_t tm_msec; // miliseconds 0-999;
|
||||
uint8_t tm_sec; // seconds after the minute, 0 to 60
|
||||
// (0 - 60 allows for the occasional leap second)
|
||||
uint8_t tm_min; // minutes after the hour, 0 to 59
|
||||
uint8_t tm_hour; // hours since midnight, 0 to 23
|
||||
uint8_t tm_mday; // day of the month, 1 to 31
|
||||
uint8_t tm_mon; // months 1 to 12
|
||||
uint8_t tm_year; // years since 1900
|
||||
} tas_time_t;
|
||||
static constexpr ReturnValue_t BUF_TOO_SMALL = MAKE_RETURN_CODE(0xC0);
|
||||
}; // namespace result
|
||||
|
||||
static constexpr uint16_t DEFAULT_SEQ_COUNT = 0;
|
||||
|
||||
@ -1065,15 +1098,15 @@ class VerificationReport {
|
||||
|
||||
virtual ReturnValue_t parse() {
|
||||
if (not readerBase.crcIsOk()) {
|
||||
return CRC_MISSMATCH;
|
||||
return result::CRC_FAILURE;
|
||||
}
|
||||
if (readerBase.getApid() != Apids::TMTC_MAN) {
|
||||
return APID_MISSMATCH;
|
||||
return result::INVALID_APID;
|
||||
}
|
||||
if (readerBase.getBufSize() < MIN_PAYLOAD_LEN + 8) {
|
||||
sif::error << "VerificationReport: Invalid verification report, payload too small"
|
||||
<< std::endl;
|
||||
return BUF_TOO_SMALL;
|
||||
return result::BUF_TOO_SMALL;
|
||||
}
|
||||
const uint8_t* payloadStart = readerBase.getPayloadStart();
|
||||
size_t remLen = PAYLOAD_LEN;
|
||||
@ -1119,7 +1152,7 @@ class VerificationReport {
|
||||
|
||||
virtual ReturnValue_t checkApid() { return returnvalue::FAILED; }
|
||||
|
||||
private:
|
||||
protected:
|
||||
TmBase& readerBase;
|
||||
uint8_t refApid = 0;
|
||||
uint8_t refServiceId = 0;
|
||||
@ -1209,6 +1242,10 @@ class ExecutionReport : public VerificationReport {
|
||||
ExecutionReport(TmBase& readerBase) : VerificationReport(readerBase) {}
|
||||
|
||||
ReturnValue_t parse() override {
|
||||
if (readerBase.getServiceId() == static_cast<uint8_t>(tm::TmtcId::EXEC_NAK)) {
|
||||
printStatusInformation();
|
||||
return result::RECEIVED_EXE_FAILURE;
|
||||
}
|
||||
/* uint16_t apid = this->getApid();
|
||||
if (apid == APID_EXE_SUCCESS) {
|
||||
return returnvalue::OK;
|
||||
@ -1660,7 +1697,7 @@ class UpdateStatusReport : public ploc::SpTmReader {
|
||||
|
||||
ReturnValue_t verifycrc(uint16_t goodCrc) const {
|
||||
if (crc != goodCrc) {
|
||||
return SupvReturnValuesIF::UPDATE_CRC_FAILURE;
|
||||
return result::UPDATE_CRC_FAILURE;
|
||||
}
|
||||
return returnvalue::OK;
|
||||
}
|
||||
@ -1681,7 +1718,7 @@ class UpdateStatusReport : public ploc::SpTmReader {
|
||||
|
||||
ReturnValue_t lengthCheck() {
|
||||
if (getFullPacketLen() != FULL_SIZE) {
|
||||
return SupvReturnValuesIF::UPDATE_STATUS_REPORT_INVALID_LENGTH;
|
||||
return result::UPDATE_STATUS_REPORT_INVALID_LENGTH;
|
||||
}
|
||||
return returnvalue::OK;
|
||||
}
|
||||
@ -2020,6 +2057,22 @@ class RequestLoggingData : public TcBase {
|
||||
static const uint8_t TPC_OFFSET = 1;
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
// The most significant bit of msec value is set to 0x80 to indicate that full
|
||||
// time and data information is transmitted, when the time has been synced with
|
||||
// the reference. If the time has not been synced with reference, then the most
|
||||
// significant bit is set to 0x00. Only the most significant bit is used for
|
||||
// this purpose (bit 15 of the field tm_msec)
|
||||
uint16_t tm_msec; // miliseconds 0-999;
|
||||
uint8_t tm_sec; // seconds after the minute, 0 to 60
|
||||
// (0 - 60 allows for the occasional leap second)
|
||||
uint8_t tm_min; // minutes after the hour, 0 to 59
|
||||
uint8_t tm_hour; // hours since midnight, 0 to 23
|
||||
uint8_t tm_mday; // day of the month, 1 to 31
|
||||
uint8_t tm_mon; // months 1 to 12
|
||||
uint8_t tm_year; // years since 1900
|
||||
} tas_time_t;
|
||||
|
||||
} // namespace notimpl
|
||||
|
||||
} // namespace supv
|
||||
|
Reference in New Issue
Block a user