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

This commit is contained in:
2022-11-17 13:24:39 +01:00
parent 53535b6023
commit 72f8e359bb
3 changed files with 17 additions and 9 deletions

View File

@ -310,7 +310,9 @@ enum class TmtcManStatusCode : uint32_t {
BAD_SP_HEADER = 0x608
};
static const uint16_t APID_MASK = 0x3FF;
static constexpr uint16_t APID_MASK_TC = 0x200;
static constexpr uint16_t APID_MASK_TM = 0x400;
static constexpr uint16_t APID_MODULE_MASK = 0x7F;
static const uint16_t SEQUENCE_COUNT_MASK = 0xFFF;
static const uint8_t HK_SET_ENTRIES = 13;
@ -485,7 +487,8 @@ class TcBase : public ploc::SpTcBase {
: TcBase(params, apid, service, payloadLen, DEFAULT_SEQ_COUNT) {}
TcBase(TcParams params, uint16_t apid, uint8_t serviceId, size_t payloadLen, uint16_t seqCount)
: ploc::SpTcBase(params, apid, fullSpDataLenFromPayloadLen(payloadLen), seqCount) {
: ploc::SpTcBase(params, apid | APID_MASK_TC, fullSpDataLenFromPayloadLen(payloadLen),
seqCount) {
setup(serviceId);
}
@ -496,6 +499,8 @@ class TcBase : public ploc::SpTcBase {
payloadStart[supv::PAYLOAD_OFFSET] = id;
}
uint16_t getModuleApid() const { return getApid() & APID_MODULE_MASK; }
uint8_t getServiceId() const { return payloadStart[supv::PAYLOAD_OFFSET]; }
static size_t fullSpDataLenFromPayloadLen(size_t payloadLen) {
@ -541,6 +546,8 @@ class TmBase : public ploc::SpTmReader {
uint8_t getServiceId() const { return getPacketData()[TIMESTAMP_LEN]; }
uint16_t getModuleApid() const { return getApid() & APID_MODULE_MASK; }
const uint8_t* getPayloadStart() const { return getPacketData() + SECONDARY_HEADER_LEN; }
size_t getPayloadLen() const {
if (getFullPacketLen() > SECONDARY_HEADER_LEN + ccsds::HEADER_LEN) {
@ -1430,7 +1437,7 @@ class VerificationReport {
break;
}
}
} else if (statusCode < 0x200 and statusCode > 0x100) {
} else if (statusCode < 0x200 and statusCode >= 0x100) {
BootManStatusCode code = static_cast<BootManStatusCode>(statusCode);
switch (code) {
case BootManStatusCode::NOTHING_TODO: {
@ -1474,7 +1481,7 @@ class VerificationReport {
break;
}
}
} else if (statusCode < 0x300 and statusCode > 0x200) {
} else if (statusCode < 0x300 and statusCode >= 0x200) {
MemManStatusCode code = static_cast<MemManStatusCode>(statusCode);
switch (code) {
case MemManStatusCode::SP_NOT_AVAILABLE: {
@ -1522,7 +1529,7 @@ class VerificationReport {
break;
}
}
} else if (statusCode < 0x400 and statusCode > 0x300) {
} else if (statusCode < 0x400 and statusCode >= 0x300) {
PowerManStatusCode code = static_cast<PowerManStatusCode>(statusCode);
switch (code) {
case PowerManStatusCode::PG_LOW: {