Merge branch 'mueller/refactor-tmtc-stack' of https://egit.irs.uni-stuttgart.de/fsfw/fsfw into mueller/refactor-tmtc-stack

This commit is contained in:
Robin Müller 2022-08-30 10:58:06 +02:00
commit 10fc4dd89d
6 changed files with 21 additions and 14 deletions

View File

@ -35,7 +35,7 @@ void Factory::produceFsfwObjects(void) {
}
void Factory::setStaticFrameworkObjectIds() {
PusServiceBase::packetSource = objects::NO_OBJECT;
PusServiceBase::PUS_DISTRIBUTOR = objects::NO_OBJECT;
PusServiceBase::PACKET_DESTINATION = objects::NO_OBJECT;
CommandingServiceBase::defaultPacketSource = objects::NO_OBJECT;

View File

@ -3,6 +3,11 @@ if [[ ! -f README.md ]]; then
cd ..
fi
folder_list=(
"./src"
"./unittests"
)
cmake_fmt="cmake-format"
file_selectors="-iname CMakeLists.txt"
if command -v ${cmake_fmt} &> /dev/null; then
@ -15,8 +20,10 @@ fi
cpp_format="clang-format"
file_selectors="-iname *.h -o -iname *.cpp -o -iname *.c -o -iname *.tpp"
if command -v ${cpp_format} &> /dev/null; then
find ./src ${file_selectors} | xargs ${cpp_format} --style=file -i
find ./unittests ${file_selectors} | xargs ${cpp_format} --style=file -i
for dir in ${folder_list[@]}; do
echo "Auto-formatting ${dir} recursively"
find ${dir} ${file_selectors} | xargs clang-format --style=file -i
done
else
echo "No ${cpp_format} tool found, not formatting C++/C files"
fi

View File

@ -14,7 +14,6 @@
#include "internal/HasLocalDpIFManagerAttorney.h"
#include "internal/LocalPoolDataSetAttorney.h"
// TODO: Get rid of this. This should be a constructor argument, not something hardcoded in any way
object_id_t LocalDataPoolManager::defaultHkDestination = objects::PUS_SERVICE_3_HOUSEKEEPING;
LocalDataPoolManager::LocalDataPoolManager(HasLocalDataPoolIF* owner, MessageQueueIF* queueToUse,

View File

@ -12,7 +12,7 @@ MessageQueueMessage::MessageQueueMessage() : messageSize(getMinimumMessageSize()
MessageQueueMessage::MessageQueueMessage(uint8_t* data, size_t size)
: messageSize(MessageQueueMessage::HEADER_SIZE + size) {
if (size <= MessageQueueMessage::MAX_DATA_SIZE) {
std::memcpy(internalBuffer + MessageQueueMessage::HEADER_SIZE, data, size);
std::memcpy(MessageQueueMessage::getData(), data, size);
this->messageSize = MessageQueueMessage::HEADER_SIZE + size;
} else {
#if FSFW_CPP_OSTREAM_ENABLED == 1

View File

@ -581,10 +581,11 @@ inline ReturnValue_t Service11TelecommandScheduling<MAX_NUM_TCS>::getMapFilterFr
}
// additional security check, this should never be true
if (itBegin->first > itEnd->first) {
if (itBegin > itEnd) {
#if FSFW_CPP_OSTREAM_ENABLED == 1
sif::error << "11::getMapFilterFromData: itBegin > itEnd\n" << std::endl;
#else
sif::printError("11::GetMapFilterFromData: itBegin > itEnd\n");
sif::printError("11::getMapFilterFromData: itBegin > itEnd\n");
#endif
return returnvalue::FAILED;
}

View File

@ -39,13 +39,13 @@ class CCSDSTime {
* Struct for CDS day-segmented format.
*/
struct CDS_short {
uint8_t pField;
uint8_t dayMSB;
uint8_t dayLSB;
uint8_t msDay_hh;
uint8_t msDay_h;
uint8_t msDay_l;
uint8_t msDay_ll;
uint8_t pField = P_FIELD_CDS_SHORT;
uint8_t dayMSB = 0;
uint8_t dayLSB = 0;
uint8_t msDay_hh = 0;
uint8_t msDay_h = 0;
uint8_t msDay_l = 0;
uint8_t msDay_ll = 0;
};
/**
* Struct for the CCS fromat in day of month variation with max resolution