Merge remote-tracking branch 'upstream/development' into mueller/dle_parser

This commit is contained in:
Robin Müller 2022-11-28 08:27:24 +01:00
commit 50930b41ba
No known key found for this signature in database
GPG Key ID: 71B58F8A3CDFA9AC
14 changed files with 54 additions and 19 deletions

View File

@ -12,6 +12,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
## Fixes ## Fixes
- Only delete health table entry in `HealthHelper` destructor if
health table was set.
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/710/files
- I2C Bugfixes: Do not keep iterator as member and fix some incorrect handling with the iterator. - I2C Bugfixes: Do not keep iterator as member and fix some incorrect handling with the iterator.
Also properly reset the reply size for successfull transfers and erroneous transfers. Also properly reset the reply size for successfull transfers and erroneous transfers.
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/700 PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/700
@ -26,11 +29,15 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
- `DleParser` helper class to parse DLE encoded packets from a byte stream. - `DleParser` helper class to parse DLE encoded packets from a byte stream.
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/711 PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/711
- `UioMapper` is able to resolve symlinks now.
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/709
- Add new `UnsignedByteField` class - Add new `UnsignedByteField` class
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/660 PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/660
## Changes ## Changes
- `AcceptsTelemetryIF`: `getReportReceptionQueue` is const now
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/712
- Moved some container returnvalues to dedicated header and namespace - Moved some container returnvalues to dedicated header and namespace
to they can be used without template specification. to they can be used without template specification.
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/707 PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/707

View File

@ -346,9 +346,15 @@ if(FSFW_BUILD_TESTS)
DEPENDENCIES ${FSFW_TEST_TGT}) DEPENDENCIES ${FSFW_TEST_TGT})
else() else()
setup_target_for_coverage_lcov( setup_target_for_coverage_lcov(
NAME ${FSFW_TEST_TGT}_coverage EXECUTABLE ${FSFW_TEST_TGT} NAME
DEPENDENCIES ${FSFW_TEST_TGT} ${FSFW_TEST_TGT}_coverage
GENHTML_ARGS --html-epilog ${CMAKE_SOURCE_DIR}/unittests/lcov_epilog.html) EXECUTABLE
${FSFW_TEST_TGT}
DEPENDENCIES
${FSFW_TEST_TGT}
GENHTML_ARGS
--html-epilog
${CMAKE_SOURCE_DIR}/unittests/lcov_epilog.html)
endif() endif()
endif() endif()
endif() endif()

View File

@ -5,7 +5,11 @@
HealthHelper::HealthHelper(HasHealthIF* owner, object_id_t objectId) HealthHelper::HealthHelper(HasHealthIF* owner, object_id_t objectId)
: objectId(objectId), owner(owner) {} : objectId(objectId), owner(owner) {}
HealthHelper::~HealthHelper() { healthTable->removeObject(objectId); } HealthHelper::~HealthHelper() {
if (healthTable != nullptr) {
healthTable->removeObject(objectId);
}
}
ReturnValue_t HealthHelper::handleHealthCommand(CommandMessage* message) { ReturnValue_t HealthHelper::handleHealthCommand(CommandMessage* message) {
switch (message->getCommand()) { switch (message->getCommand()) {

View File

@ -181,7 +181,8 @@ class StorageManagerIF {
* @return Returns @returnvalue::OK if data was added. * @return Returns @returnvalue::OK if data was added.
* @returnvalue::FAILED if data could not be added, storageId is unchanged then. * @returnvalue::FAILED if data could not be added, storageId is unchanged then.
*/ */
virtual ReturnValue_t getFreeElement(store_address_t* storageId, size_t size, uint8_t** dataPtr) = 0; virtual ReturnValue_t getFreeElement(store_address_t* storageId, size_t size,
uint8_t** dataPtr) = 0;
[[nodiscard]] virtual bool hasDataAtId(store_address_t storeId) const = 0; [[nodiscard]] virtual bool hasDataAtId(store_address_t storeId) const = 0;

View File

@ -21,9 +21,11 @@ class AcceptsTelemetryIF {
* receiving message queue. * receiving message queue.
* @return The telemetry reception message queue id. * @return The telemetry reception message queue id.
*/ */
virtual MessageQueueId_t getReportReceptionQueue(uint8_t virtualChannel) = 0; [[nodiscard]] virtual MessageQueueId_t getReportReceptionQueue(uint8_t virtualChannel) const = 0;
virtual MessageQueueId_t getReportReceptionQueue() { return getReportReceptionQueue(0); } [[nodiscard]] virtual MessageQueueId_t getReportReceptionQueue() const {
return getReportReceptionQueue(0);
}
}; };
#endif /* FSFW_TMTCSERVICES_ACCEPTSTELEMETRYIF_H_ */ #endif /* FSFW_TMTCSERVICES_ACCEPTSTELEMETRYIF_H_ */

View File

@ -240,7 +240,7 @@ void TmTcBridge::registerCommDisconnect() {
} }
} }
MessageQueueId_t TmTcBridge::getReportReceptionQueue(uint8_t virtualChannel) { MessageQueueId_t TmTcBridge::getReportReceptionQueue(uint8_t virtualChannel) const {
return tmTcReceptionQueue->getId(); return tmTcReceptionQueue->getId();
} }

View File

@ -65,7 +65,7 @@ class TmTcBridge : public AcceptsTelemetryIF,
ReturnValue_t performOperation(uint8_t operationCode = 0) override; ReturnValue_t performOperation(uint8_t operationCode = 0) override;
/** AcceptsTelemetryIF override */ /** AcceptsTelemetryIF override */
MessageQueueId_t getReportReceptionQueue(uint8_t virtualChannel = 0) override; MessageQueueId_t getReportReceptionQueue(uint8_t virtualChannel) const override;
/** AcceptsTelecommandsIF override */ /** AcceptsTelecommandsIF override */
uint32_t getIdentifier() const override; uint32_t getIdentifier() const override;

View File

@ -1,6 +1,7 @@
#include "UioMapper.h" #include "UioMapper.h"
#include <fcntl.h> #include <fcntl.h>
#include <sys/stat.h>
#include <unistd.h> #include <unistd.h>
#include <filesystem> #include <filesystem>
@ -13,7 +14,23 @@ const char UioMapper::UIO_PATH_PREFIX[] = "/sys/class/uio/";
const char UioMapper::MAP_SUBSTR[] = "/maps/map"; const char UioMapper::MAP_SUBSTR[] = "/maps/map";
const char UioMapper::SIZE_FILE_PATH[] = "/size"; const char UioMapper::SIZE_FILE_PATH[] = "/size";
UioMapper::UioMapper(std::string uioFile, int mapNum) : uioFile(uioFile), mapNum(mapNum) {} UioMapper::UioMapper(std::string uioFile, int mapNum) : mapNum(mapNum) {
struct stat buf;
lstat(uioFile.c_str(), &buf);
if (S_ISLNK(buf.st_mode)) {
char* res = realpath(uioFile.c_str(), nullptr);
if (res) {
this->uioFile = res;
free(res);
} else {
#if FSFW_CPP_OSTREAM_ENABLED == 1
sif::error << "Could not resolve real path of UIO file " << uioFile << std::endl;
#endif
}
} else {
this->uioFile = std::move(uioFile);
}
}
UioMapper::~UioMapper() {} UioMapper::~UioMapper() {}
@ -22,7 +39,7 @@ ReturnValue_t UioMapper::getMappedAdress(uint32_t** address, Permissions permiss
int fd = open(uioFile.c_str(), O_RDWR); int fd = open(uioFile.c_str(), O_RDWR);
if (fd < 1) { if (fd < 1) {
#if FSFW_CPP_OSTREAM_ENABLED == 1 #if FSFW_CPP_OSTREAM_ENABLED == 1
sif::error << "PtmeAxiConfig::initialize: Invalid UIO device file" << std::endl; sif::error << "UioMapper::getMappedAdress: Invalid UIO device file " << uioFile << std::endl;
#endif #endif
return returnvalue::FAILED; return returnvalue::FAILED;
} }

View File

@ -1,7 +1,5 @@
target_sources(${FSFW_TEST_TGT} PRIVATE testHostFilesystem.cpp testFsMock.cpp) target_sources(${FSFW_TEST_TGT} PRIVATE testHostFilesystem.cpp testFsMock.cpp)
if(UNIX) if(UNIX)
target_sources(${FSFW_TEST_TGT} PRIVATE target_sources(${FSFW_TEST_TGT} PRIVATE testCommandExecutor.cpp)
testCommandExecutor.cpp
)
endif() endif()

View File

@ -6,7 +6,7 @@ AcceptsTmMock::AcceptsTmMock(object_id_t registeredId, MessageQueueId_t queueToR
AcceptsTmMock::AcceptsTmMock(MessageQueueId_t queueToReturn) AcceptsTmMock::AcceptsTmMock(MessageQueueId_t queueToReturn)
: SystemObject(objects::NO_OBJECT, false), returnedQueue(queueToReturn) {} : SystemObject(objects::NO_OBJECT, false), returnedQueue(queueToReturn) {}
MessageQueueId_t AcceptsTmMock::getReportReceptionQueue(uint8_t virtualChannel) { MessageQueueId_t AcceptsTmMock::getReportReceptionQueue(uint8_t virtualChannel) const {
return returnedQueue; return returnedQueue;
} }

View File

@ -9,7 +9,7 @@ class AcceptsTmMock : public SystemObject, public AcceptsTelemetryIF {
AcceptsTmMock(object_id_t registeredId, MessageQueueId_t queueToReturn); AcceptsTmMock(object_id_t registeredId, MessageQueueId_t queueToReturn);
explicit AcceptsTmMock(MessageQueueId_t queueToReturn); explicit AcceptsTmMock(MessageQueueId_t queueToReturn);
MessageQueueId_t getReportReceptionQueue(uint8_t virtualChannel) override; MessageQueueId_t getReportReceptionQueue(uint8_t virtualChannel) const override;
const char* getName() const override; const char* getName() const override;
MessageQueueId_t returnedQueue; MessageQueueId_t returnedQueue;

View File

@ -17,7 +17,7 @@ class FaultHandlerMock : public FaultHandlerBase {
void noticeOfSuspensionCb(TransactionId& id, ConditionCode code) override; void noticeOfSuspensionCb(TransactionId& id, ConditionCode code) override;
void noticeOfCancellationCb(TransactionId& id, ConditionCode code) override; void noticeOfCancellationCb(TransactionId& id, ConditionCode code) override;
void abandonCb(TransactionId& id,ConditionCode code) override; void abandonCb(TransactionId& id, ConditionCode code) override;
void ignoreCb(TransactionId& id, ConditionCode code) override; void ignoreCb(TransactionId& id, ConditionCode code) override;
FaultInfo& getFhInfo(FaultHandlerCode fhCode); FaultInfo& getFhInfo(FaultHandlerCode fhCode);