Compare commits
18 Commits
container_
...
cfdp-bugfi
Author | SHA1 | Date | |
---|---|---|---|
9fe8579377 | |||
4518fec65c | |||
dac1aacab2 | |||
0042f92fdf | |||
656faf8169 | |||
f84431e965 | |||
0cec9ebb73 | |||
a440b7c394 | |||
bbfc1b2b34 | |||
025b379e8b
|
|||
b50f092939 | |||
2f90e12179 | |||
5e3f5c4121 | |||
1f36c082ef | |||
aa84e93603 | |||
8f63a0e747 | |||
6fc8f756a7 | |||
d98ed40e3d |
23
CHANGELOG.md
23
CHANGELOG.md
@ -10,12 +10,31 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
|
|||||||
|
|
||||||
## Fixes
|
## Fixes
|
||||||
|
|
||||||
|
- Important bugfix in CFDP PDU header format: The entity length field and the transaction sequence
|
||||||
|
number fields stored the actual length of the field instead of the length minus 1 like specified
|
||||||
|
in the CFDP standard.
|
||||||
- PUS Health Service: Size check for set health command.
|
- PUS Health Service: Size check for set health command.
|
||||||
- PUS Health Service: Perform operation completion for announce health command.
|
Perform operation completion for announce health command.
|
||||||
|
https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/746
|
||||||
|
- Linux OSAL `getUptime` fix: Check validity of `/proc/uptime` file before reading uptime.
|
||||||
|
https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/745
|
||||||
|
- Small tweak for version getter
|
||||||
|
https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/744
|
||||||
|
|
||||||
|
## Added
|
||||||
|
|
||||||
|
- add CFDP subsystem ID
|
||||||
|
https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/742
|
||||||
|
|
||||||
## Changed
|
## Changed
|
||||||
|
- Bump ETL version to 20.35.14
|
||||||
|
https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/748
|
||||||
|
- Renamed `PCDU_2` subsystem ID to `POWER_SWITCH_IF`.
|
||||||
|
https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/743
|
||||||
|
- Add new `PowerSwitchIF::SWITCH_UNKNOWN` returnvalue.
|
||||||
|
https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/743
|
||||||
- Assert that `FixedArrayList` is larger than 0 at compile time.
|
- Assert that `FixedArrayList` is larger than 0 at compile time.
|
||||||
|
https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/740
|
||||||
|
|
||||||
# [v6.0.0] 2023-02-10
|
# [v6.0.0] 2023-02-10
|
||||||
|
|
||||||
|
@ -72,7 +72,7 @@ set(FSFW_ETL_LIB_MAJOR_VERSION
|
|||||||
20
|
20
|
||||||
CACHE STRING "ETL library major version requirement")
|
CACHE STRING "ETL library major version requirement")
|
||||||
set(FSFW_ETL_LIB_VERSION
|
set(FSFW_ETL_LIB_VERSION
|
||||||
${FSFW_ETL_LIB_MAJOR_VERSION}.28.0
|
${FSFW_ETL_LIB_MAJOR_VERSION}.35.14
|
||||||
CACHE STRING "ETL library exact version requirement")
|
CACHE STRING "ETL library exact version requirement")
|
||||||
set(FSFW_ETL_LINK_TARGET etl::etl)
|
set(FSFW_ETL_LINK_TARGET etl::etl)
|
||||||
|
|
||||||
|
@ -24,8 +24,8 @@ ReturnValue_t HeaderCreator::serialize(uint8_t **buffer, size_t *size, size_t ma
|
|||||||
*buffer += 1;
|
*buffer += 1;
|
||||||
**buffer = pduDataFieldLen & 0x00ff;
|
**buffer = pduDataFieldLen & 0x00ff;
|
||||||
*buffer += 1;
|
*buffer += 1;
|
||||||
**buffer = segmentationCtrl << 7 | pduConf.sourceId.getWidth() << 4 | segmentMetadataFlag << 3 |
|
**buffer = segmentationCtrl << 7 | ((pduConf.sourceId.getWidth() - 1) << 4) |
|
||||||
pduConf.seqNum.getWidth();
|
segmentMetadataFlag << 3 | (pduConf.seqNum.getWidth() - 1);
|
||||||
*buffer += 1;
|
*buffer += 1;
|
||||||
*size += 4;
|
*size += 4;
|
||||||
ReturnValue_t result = pduConf.sourceId.serialize(buffer, size, maxSize, streamEndianness);
|
ReturnValue_t result = pduConf.sourceId.serialize(buffer, size, maxSize, streamEndianness);
|
||||||
|
@ -78,11 +78,11 @@ cfdp::SegmentationControl PduHeaderReader::getSegmentationControl() const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
cfdp::WidthInBytes PduHeaderReader::getLenEntityIds() const {
|
cfdp::WidthInBytes PduHeaderReader::getLenEntityIds() const {
|
||||||
return static_cast<cfdp::WidthInBytes>((pointers.fixedHeader->fourthByte >> 4) & 0x07);
|
return static_cast<cfdp::WidthInBytes>(((pointers.fixedHeader->fourthByte >> 4) & 0b111) + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
cfdp::WidthInBytes PduHeaderReader::getLenSeqNum() const {
|
cfdp::WidthInBytes PduHeaderReader::getLenSeqNum() const {
|
||||||
return static_cast<cfdp::WidthInBytes>(pointers.fixedHeader->fourthByte & 0x07);
|
return static_cast<cfdp::WidthInBytes>((pointers.fixedHeader->fourthByte & 0b111) + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
cfdp::SegmentMetadataFlag PduHeaderReader::getSegmentMetadataFlag() const {
|
cfdp::SegmentMetadataFlag PduHeaderReader::getSegmentMetadataFlag() const {
|
||||||
|
@ -10,7 +10,7 @@ enum : uint8_t {
|
|||||||
CDH = 28,
|
CDH = 28,
|
||||||
TCS_1 = 59,
|
TCS_1 = 59,
|
||||||
PCDU_1 = 42,
|
PCDU_1 = 42,
|
||||||
PCDU_2 = 43,
|
POWER_SWITCH_IF = 43,
|
||||||
HEATER = 50,
|
HEATER = 50,
|
||||||
T_SENSORS = 52,
|
T_SENSORS = 52,
|
||||||
FDIR = 70,
|
FDIR = 70,
|
||||||
@ -33,6 +33,7 @@ enum : uint8_t {
|
|||||||
PUS_SERVICE_23 = 103,
|
PUS_SERVICE_23 = 103,
|
||||||
MGM_LIS3MDL = 106,
|
MGM_LIS3MDL = 106,
|
||||||
MGM_RM3100 = 107,
|
MGM_RM3100 = 107,
|
||||||
|
CFDP = 108,
|
||||||
|
|
||||||
FW_SUBSYSTEM_ID_RANGE
|
FW_SUBSYSTEM_ID_RANGE
|
||||||
};
|
};
|
||||||
|
@ -76,14 +76,17 @@ timeval Clock::getUptime() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ReturnValue_t Clock::getUptime(timeval* uptime) {
|
ReturnValue_t Clock::getUptime(timeval* uptime) {
|
||||||
// TODO This is not posix compatible and delivers only seconds precision
|
|
||||||
// Linux specific file read but more precise.
|
|
||||||
double uptimeSeconds;
|
double uptimeSeconds;
|
||||||
if (std::ifstream("/proc/uptime", std::ios::in) >> uptimeSeconds) {
|
std::ifstream ifile("/proc/uptime");
|
||||||
|
if (ifile.bad()) {
|
||||||
|
return returnvalue::FAILED;
|
||||||
|
}
|
||||||
|
if (ifile >> uptimeSeconds) {
|
||||||
uptime->tv_sec = uptimeSeconds;
|
uptime->tv_sec = uptimeSeconds;
|
||||||
uptime->tv_usec = uptimeSeconds * (double)1e6 - (uptime->tv_sec * 1e6);
|
uptime->tv_usec = uptimeSeconds * (double)1e6 - (uptime->tv_sec * 1e6);
|
||||||
|
return returnvalue::OK;
|
||||||
}
|
}
|
||||||
return returnvalue::OK;
|
return returnvalue::FAILED;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Wait for new FSFW Clock function delivering seconds uptime.
|
// Wait for new FSFW Clock function delivering seconds uptime.
|
||||||
|
@ -32,7 +32,7 @@ class Fuse : public SystemObject,
|
|||||||
gp_id_t poolIdPower;
|
gp_id_t poolIdPower;
|
||||||
};
|
};
|
||||||
|
|
||||||
static const uint8_t SUBSYSTEM_ID = SUBSYSTEM_ID::PCDU_1;
|
static const uint8_t SUBSYSTEM_ID = SUBSYSTEM_ID::POWER_SWITCH_IF;
|
||||||
//! PSS detected that current on a fuse is totally out of bounds.
|
//! PSS detected that current on a fuse is totally out of bounds.
|
||||||
static const Event FUSE_CURRENT_HIGH = MAKE_EVENT(1, severity::LOW);
|
static const Event FUSE_CURRENT_HIGH = MAKE_EVENT(1, severity::LOW);
|
||||||
//! PSS detected a fuse that went off.
|
//! PSS detected a fuse that went off.
|
||||||
|
@ -28,10 +28,12 @@ class PowerSwitchIF {
|
|||||||
static const ReturnValue_t SWITCH_TIMEOUT = MAKE_RETURN_CODE(2);
|
static const ReturnValue_t SWITCH_TIMEOUT = MAKE_RETURN_CODE(2);
|
||||||
static const ReturnValue_t FUSE_ON = MAKE_RETURN_CODE(3);
|
static const ReturnValue_t FUSE_ON = MAKE_RETURN_CODE(3);
|
||||||
static const ReturnValue_t FUSE_OFF = MAKE_RETURN_CODE(4);
|
static const ReturnValue_t FUSE_OFF = MAKE_RETURN_CODE(4);
|
||||||
static const uint8_t SUBSYSTEM_ID = SUBSYSTEM_ID::PCDU_2;
|
static const ReturnValue_t SWITCH_UNKNOWN = MAKE_RETURN_CODE(5);
|
||||||
static const Event SWITCH_WENT_OFF = MAKE_EVENT(
|
|
||||||
0, severity::LOW); //!< Someone detected that a switch went off which shouldn't. Severity:
|
static const uint8_t SUBSYSTEM_ID = SUBSYSTEM_ID::POWER_SWITCH_IF;
|
||||||
//!< Low, Parameter1: switchId1, Parameter2: switchId2
|
//!< Someone detected that a switch went off which shouldn't. Severity:
|
||||||
|
//!< Low, Parameter1: switchId1, Parameter2: switchId2
|
||||||
|
static const Event SWITCH_WENT_OFF = MAKE_EVENT(0, severity::LOW);
|
||||||
/**
|
/**
|
||||||
* send a direct command to the Power Unit to enable/disable the specified switch.
|
* send a direct command to the Power Unit to enable/disable the specified switch.
|
||||||
*
|
*
|
||||||
@ -50,6 +52,7 @@ class PowerSwitchIF {
|
|||||||
* @return
|
* @return
|
||||||
* - @c SWITCH_ON if the specified switch is on.
|
* - @c SWITCH_ON if the specified switch is on.
|
||||||
* - @c SWITCH_OFF if the specified switch is off.
|
* - @c SWITCH_OFF if the specified switch is off.
|
||||||
|
* - @c SWITCH_UNKNOWN if the state of the specified switch is unknown.
|
||||||
* - @c returnvalue::FAILED if an error occured
|
* - @c returnvalue::FAILED if an error occured
|
||||||
*/
|
*/
|
||||||
virtual ReturnValue_t getSwitchState(power::Switch_t switchNr) const = 0;
|
virtual ReturnValue_t getSwitchState(power::Switch_t switchNr) const = 0;
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
#include "version.h"
|
#include "version.h"
|
||||||
|
|
||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
|
#include <cstring>
|
||||||
|
|
||||||
#include "fsfw/FSFWVersion.h"
|
#include "fsfw/FSFWVersion.h"
|
||||||
|
|
||||||
@ -20,7 +21,7 @@ fsfw::Version::Version(int major, int minor, int revision, const char* addInfo)
|
|||||||
|
|
||||||
void fsfw::Version::getVersion(char* str, size_t maxLen) const {
|
void fsfw::Version::getVersion(char* str, size_t maxLen) const {
|
||||||
size_t len = snprintf(str, maxLen, "%d.%d.%d", major, minor, revision);
|
size_t len = snprintf(str, maxLen, "%d.%d.%d", major, minor, revision);
|
||||||
if (addInfo != nullptr) {
|
if (addInfo != nullptr and std::strcmp(addInfo, "") != 0) {
|
||||||
snprintf(str + len, maxLen - len, "-%s", addInfo);
|
snprintf(str + len, maxLen - len, "-%s", addInfo);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -30,7 +31,7 @@ namespace fsfw {
|
|||||||
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
||||||
std::ostream& operator<<(std::ostream& os, const Version& v) {
|
std::ostream& operator<<(std::ostream& os, const Version& v) {
|
||||||
os << v.major << "." << v.minor << "." << v.revision;
|
os << v.major << "." << v.minor << "." << v.revision;
|
||||||
if (v.addInfo != nullptr) {
|
if (v.addInfo != nullptr and std::strcmp(v.addInfo, "") != 0) {
|
||||||
os << "-" << v.addInfo;
|
os << "-" << v.addInfo;
|
||||||
}
|
}
|
||||||
return os;
|
return os;
|
||||||
|
@ -97,7 +97,7 @@ TEST_CASE("CFDP Header", "[cfdp]") {
|
|||||||
REQUIRE(creator.serialize(&serTarget, &serSize, serBuf.size(),
|
REQUIRE(creator.serialize(&serTarget, &serSize, serBuf.size(),
|
||||||
SerializeIF::Endianness::BIG) == returnvalue::OK);
|
SerializeIF::Endianness::BIG) == returnvalue::OK);
|
||||||
CHECK(serBuf[0] == 0x3f);
|
CHECK(serBuf[0] == 0x3f);
|
||||||
CHECK(serBuf[3] == 0x99);
|
CHECK(serBuf[3] == 0x88);
|
||||||
REQUIRE(creator.getCrcFlag() == true);
|
REQUIRE(creator.getCrcFlag() == true);
|
||||||
REQUIRE(creator.getDirection() == cfdp::Direction::TOWARDS_SENDER);
|
REQUIRE(creator.getDirection() == cfdp::Direction::TOWARDS_SENDER);
|
||||||
REQUIRE(creator.getLargeFileFlag() == true);
|
REQUIRE(creator.getLargeFileFlag() == true);
|
||||||
@ -127,7 +127,7 @@ TEST_CASE("CFDP Header", "[cfdp]") {
|
|||||||
REQUIRE(creator.getTransmissionMode() == cfdp::TransmissionMode::UNACKNOWLEDGED);
|
REQUIRE(creator.getTransmissionMode() == cfdp::TransmissionMode::UNACKNOWLEDGED);
|
||||||
REQUIRE(creator.getSegmentationControl() == true);
|
REQUIRE(creator.getSegmentationControl() == true);
|
||||||
// Last three bits are 2 now (length of seq number) and bit 1 to bit 3 is 4 (len entity IDs)
|
// Last three bits are 2 now (length of seq number) and bit 1 to bit 3 is 4 (len entity IDs)
|
||||||
REQUIRE(serBuf[3] == 0b11001010);
|
REQUIRE(serBuf[3] == 0b10111001);
|
||||||
uint32_t entityId = 0;
|
uint32_t entityId = 0;
|
||||||
size_t deSerSize = 0;
|
size_t deSerSize = 0;
|
||||||
SerializeAdapter::deSerialize(&entityId, serBuf.data() + 4, &deSerSize,
|
SerializeAdapter::deSerialize(&entityId, serBuf.data() + 4, &deSerSize,
|
||||||
@ -175,7 +175,7 @@ TEST_CASE("CFDP Header", "[cfdp]") {
|
|||||||
REQUIRE(serBuf[1] == 0);
|
REQUIRE(serBuf[1] == 0);
|
||||||
REQUIRE(serBuf[2] == 0);
|
REQUIRE(serBuf[2] == 0);
|
||||||
// Entity and Transaction Sequence number are 1 byte large
|
// Entity and Transaction Sequence number are 1 byte large
|
||||||
REQUIRE(serBuf[3] == 0b00010001);
|
REQUIRE(serBuf[3] == 0b00000000);
|
||||||
// Source ID
|
// Source ID
|
||||||
REQUIRE(serBuf[4] == 0);
|
REQUIRE(serBuf[4] == 0);
|
||||||
// Transaction Seq Number
|
// Transaction Seq Number
|
||||||
@ -220,7 +220,7 @@ TEST_CASE("CFDP Header", "[cfdp]") {
|
|||||||
REQUIRE(serBuf[1] == 0);
|
REQUIRE(serBuf[1] == 0);
|
||||||
REQUIRE(serBuf[2] == 0);
|
REQUIRE(serBuf[2] == 0);
|
||||||
// Entity and Transaction Sequence number are 1 byte large
|
// Entity and Transaction Sequence number are 1 byte large
|
||||||
REQUIRE(serBuf[3] == 0b00010001);
|
REQUIRE(serBuf[3] == 0b00000000);
|
||||||
REQUIRE(serSize == 7);
|
REQUIRE(serSize == 7);
|
||||||
// Deser call not strictly necessary
|
// Deser call not strictly necessary
|
||||||
auto reader = PduHeaderReader(serBuf.data(), serBuf.size());
|
auto reader = PduHeaderReader(serBuf.data(), serBuf.size());
|
||||||
@ -270,7 +270,7 @@ TEST_CASE("CFDP Header", "[cfdp]") {
|
|||||||
REQUIRE(reader.parseData() == returnvalue::OK);
|
REQUIRE(reader.parseData() == returnvalue::OK);
|
||||||
// Everything except version bit flipped to one now
|
// Everything except version bit flipped to one now
|
||||||
REQUIRE(serBuf[0] == 0x3f);
|
REQUIRE(serBuf[0] == 0x3f);
|
||||||
REQUIRE(serBuf[3] == 0b11001010);
|
REQUIRE(serBuf[3] == 0b10111001);
|
||||||
REQUIRE(reader.getWholePduSize() == 14);
|
REQUIRE(reader.getWholePduSize() == 14);
|
||||||
|
|
||||||
REQUIRE(reader.getCrcFlag() == true);
|
REQUIRE(reader.getCrcFlag() == true);
|
||||||
|
@ -68,7 +68,7 @@ TEST_CASE("File Data PDU", "[cfdp][pdu]") {
|
|||||||
// Bits 1 to 3 length of enitity IDs is 2
|
// Bits 1 to 3 length of enitity IDs is 2
|
||||||
// Bit 4: Segment metadata flag is set
|
// Bit 4: Segment metadata flag is set
|
||||||
// Bit 5 to seven: length of transaction seq num is 2
|
// Bit 5 to seven: length of transaction seq num is 2
|
||||||
REQUIRE(fileDataBuffer[3] == 0b10101010);
|
REQUIRE(fileDataBuffer[3] == 0b10011001);
|
||||||
REQUIRE((fileDataBuffer[10] >> 6) &
|
REQUIRE((fileDataBuffer[10] >> 6) &
|
||||||
0b11 == cfdp::RecordContinuationState::CONTAINS_START_AND_END);
|
0b11 == cfdp::RecordContinuationState::CONTAINS_START_AND_END);
|
||||||
// Segment metadata length
|
// Segment metadata length
|
||||||
|
@ -30,7 +30,7 @@ TEST_CASE("CFDP File Directive", "[cfdp][pdu]") {
|
|||||||
REQUIRE(serBuf[1] == 0);
|
REQUIRE(serBuf[1] == 0);
|
||||||
REQUIRE(serBuf[2] == 5);
|
REQUIRE(serBuf[2] == 5);
|
||||||
// Entity and Transaction Sequence number are 1 byte large
|
// Entity and Transaction Sequence number are 1 byte large
|
||||||
REQUIRE(serBuf[3] == 0b00010001);
|
REQUIRE(serBuf[3] == 0b00000000);
|
||||||
// Source ID
|
// Source ID
|
||||||
REQUIRE(serBuf[4] == 0);
|
REQUIRE(serBuf[4] == 0);
|
||||||
// Transaction Seq Number
|
// Transaction Seq Number
|
||||||
@ -82,4 +82,4 @@ TEST_CASE("CFDP File Directive", "[cfdp][pdu]") {
|
|||||||
// Invalid file directive
|
// Invalid file directive
|
||||||
REQUIRE(fdDeser.parseData() == cfdp::INVALID_DIRECTIVE_FIELD);
|
REQUIRE(fdDeser.parseData() == cfdp::INVALID_DIRECTIVE_FIELD);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -33,8 +33,8 @@ TEST_CASE("CFDP Base", "[cfdp]") {
|
|||||||
// PDU data field length is 5 (4 + Directive code octet)
|
// PDU data field length is 5 (4 + Directive code octet)
|
||||||
REQUIRE(serBuf[1] == 0);
|
REQUIRE(serBuf[1] == 0);
|
||||||
REQUIRE(serBuf[2] == 5);
|
REQUIRE(serBuf[2] == 5);
|
||||||
// Entity and Transaction Sequence number are 1 byte large
|
// Entity and Transaction Sequence number are 1 byte large, value minus one is stored
|
||||||
REQUIRE(serBuf[3] == 0b00010001);
|
REQUIRE(serBuf[3] == 0b00000000);
|
||||||
// Source ID
|
// Source ID
|
||||||
REQUIRE(serBuf[4] == 0);
|
REQUIRE(serBuf[4] == 0);
|
||||||
// Transaction Seq Number
|
// Transaction Seq Number
|
||||||
|
Reference in New Issue
Block a user