Merge remote-tracking branch 'upstream/development' into mueller/possible-ring-buffer-fix
fsfw/fsfw/pipeline/pr-development There was a failure building this commit Details

This commit is contained in:
Robin Müller 2022-06-21 10:48:04 +02:00
commit 45792e86b9
70 changed files with 488 additions and 597 deletions

View File

@ -4,9 +4,10 @@ if [[ ! -f README.md ]]; then
fi
cmake_fmt="cmake-format"
file_selectors="-iname CMakeLists.txt"
if command -v ${cmake_fmt} &> /dev/null; then
cmake_fmt_cmd="${cmake_fmt} -i CMakeLists.txt"
eval ${cmake_fmt_cmd}
${cmake_fmt} -i CMakeLists.txt
find ./src ${file_selectors} | xargs ${cmake_fmt} -i
else
echo "No ${cmake_fmt} tool found, not formatting CMake files"
fi
@ -14,9 +15,9 @@ 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 clang-format --style=file -i
find ./hal ${file_selectors} | xargs clang-format --style=file -i
find ./tests ${file_selectors} | xargs clang-format --style=file -i
find ./src ${file_selectors} | xargs ${cpp_format} --style=file -i
find ./hal ${file_selectors} | xargs ${cpp_format} --style=file -i
find ./tests ${file_selectors} | xargs ${cpp_format} --style=file -i
else
echo "No ${cpp_format} tool found, not formatting C++/C files"
fi

View File

@ -1,9 +1,6 @@
target_include_directories(${LIB_FSFW_NAME} PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}
)
target_include_directories(${LIB_FSFW_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
target_include_directories(${LIB_FSFW_NAME} INTERFACE
${CMAKE_CURRENT_SOURCE_DIR}
)
target_include_directories(${LIB_FSFW_NAME}
INTERFACE ${CMAKE_CURRENT_SOURCE_DIR})
add_subdirectory(fsfw)

View File

@ -1,6 +1,4 @@
target_sources(${LIB_FSFW_NAME} PRIVATE
version.cpp
)
target_sources(${LIB_FSFW_NAME} PRIVATE version.cpp)
# Core

View File

@ -1,7 +1,3 @@
target_sources(${LIB_FSFW_NAME}
PRIVATE
ActionHelper.cpp
ActionMessage.cpp
CommandActionHelper.cpp
SimpleActionHelper.cpp
)
target_sources(
${LIB_FSFW_NAME} PRIVATE ActionHelper.cpp ActionMessage.cpp
CommandActionHelper.cpp SimpleActionHelper.cpp)

View File

@ -1,7 +1,4 @@
target_sources(${LIB_FSFW_NAME} PRIVATE
CFDPHandler.cpp
CFDPMessage.cpp
)
target_sources(${LIB_FSFW_NAME} PRIVATE CFDPHandler.cpp CFDPMessage.cpp)
add_subdirectory(pdu)
add_subdirectory(tlv)

View File

@ -1,11 +1,11 @@
target_sources(${LIB_FSFW_NAME} PRIVATE
PduConfig.cpp
target_sources(
${LIB_FSFW_NAME}
PRIVATE PduConfig.cpp
VarLenField.cpp
HeaderSerializer.cpp
HeaderDeserializer.cpp
FileDirectiveDeserializer.cpp
FileDirectiveSerializer.cpp
AckInfo.cpp
AckPduSerializer.cpp
AckPduDeserializer.cpp
@ -25,8 +25,6 @@ target_sources(${LIB_FSFW_NAME} PRIVATE
KeepAlivePduDeserializer.cpp
PromptPduSerializer.cpp
PromptPduDeserializer.cpp
FileDataSerializer.cpp
FileDataDeserializer.cpp
FileDataInfo.cpp
)
FileDataInfo.cpp)

View File

@ -1,10 +1,10 @@
target_sources(${LIB_FSFW_NAME} PRIVATE
EntityIdTlv.cpp
target_sources(
${LIB_FSFW_NAME}
PRIVATE EntityIdTlv.cpp
FilestoreRequestTlv.cpp
FilestoreResponseTlv.cpp
Lv.cpp
Tlv.cpp
FlowLabelTlv.cpp
MessageToUserTlv.cpp
FaultHandlerOverrideTlv.cpp
)
FaultHandlerOverrideTlv.cpp)

View File

@ -1,5 +1,2 @@
target_sources(${LIB_FSFW_NAME}
PRIVATE
SharedRingBuffer.cpp
SimpleRingBuffer.cpp
)
target_sources(${LIB_FSFW_NAME} PRIVATE SharedRingBuffer.cpp
SimpleRingBuffer.cpp)

View File

@ -1,4 +1,2 @@
target_sources(${LIB_FSFW_NAME} PRIVATE
ControllerBase.cpp
ExtendedControllerBase.cpp
)
target_sources(${LIB_FSFW_NAME} PRIVATE ControllerBase.cpp
ExtendedControllerBase.cpp)

View File

@ -1,5 +1,2 @@
target_sources(${LIB_FSFW_NAME}
PRIVATE
CoordinateTransformations.cpp
Sgp4Propagator.cpp
)
target_sources(${LIB_FSFW_NAME} PRIVATE CoordinateTransformations.cpp
Sgp4Propagator.cpp)

View File

@ -1,6 +1,6 @@
target_sources(${LIB_FSFW_NAME}
PRIVATE
Clcw.cpp
target_sources(
${LIB_FSFW_NAME}
PRIVATE Clcw.cpp
DataLinkLayer.cpp
Farm1StateLockout.cpp
Farm1StateOpen.cpp
@ -8,5 +8,4 @@ target_sources(${LIB_FSFW_NAME}
MapPacketExtraction.cpp
TcTransferFrame.cpp
TcTransferFrameLocal.cpp
VirtualChannelReception.cpp
)
VirtualChannelReception.cpp)

View File

@ -1,4 +1 @@
target_sources(${LIB_FSFW_NAME} PRIVATE
PoolDataSetBase.cpp
PoolEntry.cpp
)
target_sources(${LIB_FSFW_NAME} PRIVATE PoolDataSetBase.cpp PoolEntry.cpp)

View File

@ -1,10 +1,6 @@
target_sources(${LIB_FSFW_NAME}
PRIVATE
LocalDataPoolManager.cpp
LocalDataSet.cpp
LocalPoolDataSetBase.cpp
LocalPoolObjectBase.cpp
SharedLocalDataSet.cpp
)
target_sources(
${LIB_FSFW_NAME}
PRIVATE LocalDataPoolManager.cpp LocalDataSet.cpp LocalPoolDataSetBase.cpp
LocalPoolObjectBase.cpp SharedLocalDataSet.cpp)
add_subdirectory(internal)

View File

@ -1,5 +1,2 @@
target_sources(${LIB_FSFW_NAME}
PRIVATE
HasLocalDpIFUserAttorney.cpp
HasLocalDpIFManagerAttorney.cpp
)
target_sources(${LIB_FSFW_NAME} PRIVATE HasLocalDpIFUserAttorney.cpp
HasLocalDpIFManagerAttorney.cpp)

View File

@ -1,11 +1,10 @@
target_sources(${LIB_FSFW_NAME}
PRIVATE
AssemblyBase.cpp
target_sources(
${LIB_FSFW_NAME}
PRIVATE AssemblyBase.cpp
ChildHandlerBase.cpp
ChildHandlerFDIR.cpp
DeviceHandlerBase.cpp
DeviceHandlerFailureIsolation.cpp
DeviceHandlerMessage.cpp
DeviceTmReportingWrapper.cpp
HealthDevice.cpp
)
HealthDevice.cpp)

View File

@ -1,6 +1,3 @@
target_sources(${LIB_FSFW_NAME} PRIVATE
EventManager.cpp
EventMessage.cpp
)
target_sources(${LIB_FSFW_NAME} PRIVATE EventManager.cpp EventMessage.cpp)
add_subdirectory(eventmatching)

View File

@ -1,7 +1,3 @@
target_sources(${LIB_FSFW_NAME}
PRIVATE
EventIdRangeMatcher.cpp
EventMatchTree.cpp
ReporterRangeMatcher.cpp
SeverityRangeMatcher.cpp
)
target_sources(
${LIB_FSFW_NAME} PRIVATE EventIdRangeMatcher.cpp EventMatchTree.cpp
ReporterRangeMatcher.cpp SeverityRangeMatcher.cpp)

View File

@ -27,6 +27,7 @@ enum : uint8_t {
PUS_SERVICE_6 = 86,
PUS_SERVICE_8 = 88,
PUS_SERVICE_9 = 89,
PUS_SERVICE_11 = 91,
PUS_SERVICE_17 = 97,
PUS_SERVICE_23 = 103,
MGM_LIS3MDL = 106,

View File

@ -1,6 +1,3 @@
target_sources(${LIB_FSFW_NAME}
PRIVATE
EventCorrelation.cpp
FailureIsolationBase.cpp
FaultCounter.cpp
)
target_sources(
${LIB_FSFW_NAME} PRIVATE EventCorrelation.cpp FailureIsolationBase.cpp
FaultCounter.cpp)

View File

@ -1,13 +1,12 @@
target_sources(${LIB_FSFW_NAME}
PRIVATE
arrayprinter.cpp
target_sources(
${LIB_FSFW_NAME}
PRIVATE arrayprinter.cpp
AsciiConverter.cpp
CRC.cpp
DleEncoder.cpp
PeriodicOperationDivider.cpp
timevalOperations.cpp
Type.cpp
bitutility.cpp
)
bitutility.cpp)
add_subdirectory(math)

View File

@ -1,4 +1 @@
target_sources(${LIB_FSFW_NAME}
PRIVATE
QuaternionOperations.cpp
)
target_sources(${LIB_FSFW_NAME} PRIVATE QuaternionOperations.cpp)

View File

@ -1,6 +1,2 @@
target_sources(${LIB_FSFW_NAME}
PRIVATE
HealthHelper.cpp
HealthMessage.cpp
HealthTable.cpp
)
target_sources(${LIB_FSFW_NAME} PRIVATE HealthHelper.cpp HealthMessage.cpp
HealthTable.cpp)

View File

@ -1,5 +1,2 @@
target_sources(${LIB_FSFW_NAME}
PRIVATE
HousekeepingMessage.cpp
PeriodicHousekeepingHelper.cpp
)
target_sources(${LIB_FSFW_NAME} PRIVATE HousekeepingMessage.cpp
PeriodicHousekeepingHelper.cpp)

View File

@ -1,4 +1 @@
target_sources(${LIB_FSFW_NAME}
PRIVATE
InternalErrorReporter.cpp
)
target_sources(${LIB_FSFW_NAME} PRIVATE InternalErrorReporter.cpp)

View File

@ -1,6 +1,3 @@
target_sources(${LIB_FSFW_NAME} PRIVATE
CommandMessage.cpp
CommandMessageCleaner.cpp
MessageQueueMessage.cpp
MessageQueueBase.cpp
)
target_sources(
${LIB_FSFW_NAME} PRIVATE CommandMessage.cpp CommandMessageCleaner.cpp
MessageQueueMessage.cpp MessageQueueBase.cpp)

View File

@ -1,5 +1,2 @@
target_sources(${LIB_FSFW_NAME} PRIVATE
MemoryHelper.cpp
MemoryMessage.cpp
GenericFileSystemMessage.cpp
)
target_sources(${LIB_FSFW_NAME} PRIVATE MemoryHelper.cpp MemoryMessage.cpp
GenericFileSystemMessage.cpp)

View File

@ -1,5 +1 @@
target_sources(${LIB_FSFW_NAME}
PRIVATE
ModeHelper.cpp
ModeMessage.cpp
)
target_sources(${LIB_FSFW_NAME} PRIVATE ModeHelper.cpp ModeMessage.cpp)

View File

@ -1,5 +1,2 @@
target_sources(${LIB_FSFW_NAME}
PRIVATE
LimitViolationReporter.cpp
MonitoringMessage.cpp
)
target_sources(${LIB_FSFW_NAME} PRIVATE LimitViolationReporter.cpp
MonitoringMessage.cpp)

View File

@ -1,5 +1 @@
target_sources(${LIB_FSFW_NAME}
PRIVATE
ObjectManager.cpp
SystemObject.cpp
)
target_sources(${LIB_FSFW_NAME} PRIVATE ObjectManager.cpp SystemObject.cpp)

View File

@ -14,6 +14,7 @@ enum framework_objects : object_id_t {
PUS_SERVICE_5_EVENT_REPORTING = 0x53000005,
PUS_SERVICE_8_FUNCTION_MGMT = 0x53000008,
PUS_SERVICE_9_TIME_MGMT = 0x53000009,
PUS_SERVICE_11_TC_SCHEDULER = 0x53000011,
PUS_SERVICE_17_TEST = 0x53000017,
PUS_SERVICE_20_PARAMETERS = 0x53000020,
PUS_SERVICE_200_MODE_MGMT = 0x53000200,

View File

@ -11,9 +11,7 @@ elseif(FSFW_OSAL MATCHES "host")
add_subdirectory(windows)
elseif(UNIX)
# We still need to pull in some Linux specific sources
target_sources(${LIB_FSFW_NAME} PUBLIC
linux/tcpipHelpers.cpp
)
target_sources(${LIB_FSFW_NAME} PUBLIC linux/tcpipHelpers.cpp)
endif()
else()

View File

@ -1,17 +1,10 @@
if(DEFINED WIN32 OR DEFINED UNIX)
target_sources(${LIB_FSFW_NAME} PRIVATE
tcpipCommon.cpp
TcpIpBase.cpp
UdpTcPollingTask.cpp
UdpTmTcBridge.cpp
TcpTmTcServer.cpp
TcpTmTcBridge.cpp
)
target_sources(
${LIB_FSFW_NAME}
PRIVATE tcpipCommon.cpp TcpIpBase.cpp UdpTcPollingTask.cpp
UdpTmTcBridge.cpp TcpTmTcServer.cpp TcpTmTcBridge.cpp)
endif()
if(WIN32)
target_link_libraries(${LIB_FSFW_NAME} PRIVATE
wsock32
ws2_32
)
target_link_libraries(${LIB_FSFW_NAME} PRIVATE wsock32 ws2_32)
endif()

View File

@ -109,8 +109,8 @@ TcpTmTcServer::~TcpTmTcServer() { closeSocket(listenerTcpSocket); }
using namespace tcpip;
// If a connection is accepted, the corresponding socket will be assigned to the new socket
socket_t connSocket = 0;
// sockaddr clientSockAddr = {};
// socklen_t connectorSockAddrLen = 0;
sockaddr clientSockAddr = {};
socklen_t connectorSockAddrLen = 0;
int retval = 0;
// Listen for connection requests permanently for lifetime of program
@ -121,8 +121,7 @@ TcpTmTcServer::~TcpTmTcServer() { closeSocket(listenerTcpSocket); }
continue;
}
// connSocket = accept(listenerTcpSocket, &clientSockAddr, &connectorSockAddrLen);
connSocket = accept(listenerTcpSocket, nullptr, nullptr);
connSocket = accept(listenerTcpSocket, &clientSockAddr, &connectorSockAddrLen);
if (connSocket == INVALID_SOCKET) {
handleError(Protocol::TCP, ErrorSources::ACCEPT_CALL, 500);
@ -137,6 +136,7 @@ TcpTmTcServer::~TcpTmTcServer() { closeSocket(listenerTcpSocket); }
if (retval != 0) {
handleError(Protocol::TCP, ErrorSources::SHUTDOWN_CALL);
}
closeSocket(connSocket);
connSocket = 0;
}

View File

@ -1,6 +1,6 @@
target_sources(${LIB_FSFW_NAME}
PRIVATE
Clock.cpp
target_sources(
${LIB_FSFW_NAME}
PRIVATE Clock.cpp
FixedTimeslotTask.cpp
BinarySemaphore.cpp
BinSemaphUsingTask.cpp
@ -15,18 +15,16 @@ target_sources(${LIB_FSFW_NAME}
TaskFactory.cpp
Timekeeper.cpp
TaskManagement.cpp
QueueMapManager.cpp
)
QueueMapManager.cpp)
# FreeRTOS is required to link the FSFW now. It is recommended to compile
# FreeRTOS as a static library and set LIB_OS_NAME to the target name of the
# library.
if(NOT LIB_OS_NAME)
message(STATUS
message(
STATUS
"LIB_OS_NAME is empty. Make sure to include the FreeRTOS header path properly."
)
else()
target_link_libraries(${LIB_FSFW_NAME} PRIVATE
${LIB_OS_NAME}
)
target_link_libraries(${LIB_FSFW_NAME} PRIVATE ${LIB_OS_NAME})
endif()

View File

@ -1,5 +1,6 @@
target_sources(${LIB_FSFW_NAME} PRIVATE
Clock.cpp
target_sources(
${LIB_FSFW_NAME}
PRIVATE Clock.cpp
FixedTimeslotTask.cpp
MessageQueue.cpp
Mutex.cpp
@ -9,19 +10,14 @@ target_sources(${LIB_FSFW_NAME} PRIVATE
QueueMapManager.cpp
SemaphoreFactory.cpp
TaskFactory.cpp
taskHelpers.cpp
)
taskHelpers.cpp)
if(UNIX)
find_package(Threads REQUIRED)
target_link_libraries(${LIB_FSFW_NAME} PRIVATE
${CMAKE_THREAD_LIBS_INIT}
)
target_link_libraries(${LIB_FSFW_NAME} PRIVATE ${CMAKE_THREAD_LIBS_INIT})
if(NOT APPLE)
target_link_libraries(${LIB_FSFW_NAME} PRIVATE
rt
)
target_link_libraries(${LIB_FSFW_NAME} PRIVATE rt)
endif()
endif()

View File

@ -1,5 +1,6 @@
target_sources(${LIB_FSFW_NAME} PRIVATE
Clock.cpp
target_sources(
${LIB_FSFW_NAME}
PRIVATE Clock.cpp
BinarySemaphore.cpp
CountingSemaphore.cpp
FixedTimeslotTask.cpp
@ -13,17 +14,12 @@ target_sources(${LIB_FSFW_NAME} PRIVATE
SemaphoreFactory.cpp
TaskFactory.cpp
tcpipHelpers.cpp
unixUtility.cpp
)
unixUtility.cpp)
find_package(Threads REQUIRED)
target_link_libraries(${LIB_FSFW_NAME} PUBLIC
${CMAKE_THREAD_LIBS_INIT}
)
target_link_libraries(${LIB_FSFW_NAME} PUBLIC ${CMAKE_THREAD_LIBS_INIT})
if(NOT APPLE)
target_link_libraries(${LIB_FSFW_NAME} PUBLIC
rt
)
target_link_libraries(${LIB_FSFW_NAME} PUBLIC rt)
endif()

View File

@ -1,6 +1,6 @@
target_sources(${LIB_FSFW_NAME}
PRIVATE
Clock.cpp
target_sources(
${LIB_FSFW_NAME}
PRIVATE Clock.cpp
CpuUsage.cpp
InitTask.cpp
InternalErrorCodes.cpp
@ -14,7 +14,4 @@ target_sources(${LIB_FSFW_NAME}
RTEMSTaskBase.cpp
TaskFactory.cpp
BinarySemaphore.cpp
SemaphoreFactory.cpp
)
SemaphoreFactory.cpp)

View File

@ -1,4 +1 @@
target_sources(${LIB_FSFW_NAME} PRIVATE
tcpipHelpers.cpp
winTaskHelpers.cpp
)
target_sources(${LIB_FSFW_NAME} PRIVATE tcpipHelpers.cpp winTaskHelpers.cpp)

View File

@ -1,6 +1,3 @@
target_sources(${LIB_FSFW_NAME}
PRIVATE
ParameterHelper.cpp
ParameterMessage.cpp
ParameterWrapper.cpp
)
target_sources(
${LIB_FSFW_NAME} PRIVATE ParameterHelper.cpp ParameterMessage.cpp
ParameterWrapper.cpp)

View File

@ -1,8 +1,4 @@
target_sources(${LIB_FSFW_NAME} PRIVATE
Fuse.cpp
PowerComponent.cpp
PowerSensor.cpp
PowerSwitcher.cpp
DummyPowerSwitcher.cpp
PowerSwitcherComponent.cpp
)
target_sources(
${LIB_FSFW_NAME}
PRIVATE Fuse.cpp PowerComponent.cpp PowerSensor.cpp PowerSwitcher.cpp
DummyPowerSwitcher.cpp PowerSwitcherComponent.cpp)

View File

@ -3,8 +3,11 @@
#include <fsfw/ipc/QueueFactory.h>
#include <fsfw/power/PowerSwitchIF.h>
PowerSwitcherComponent::PowerSwitcherComponent(object_id_t objectId, PowerSwitchIF* pwrSwitcher, power::Switch_t pwrSwitch)
: SystemObject(objectId), switcher(pwrSwitcher, pwrSwitch), modeHelper(this),
PowerSwitcherComponent::PowerSwitcherComponent(object_id_t objectId, PowerSwitchIF *pwrSwitcher,
power::Switch_t pwrSwitch)
: SystemObject(objectId),
switcher(pwrSwitcher, pwrSwitch),
modeHelper(this),
healthHelper(this, objectId) {
queue = QueueFactory::instance()->createMessageQueue();
}
@ -49,9 +52,7 @@ ReturnValue_t PowerSwitcherComponent::initialize() {
return SystemObject::initialize();
}
MessageQueueId_t PowerSwitcherComponent::getCommandQueue() const {
return queue->getId();
}
MessageQueueId_t PowerSwitcherComponent::getCommandQueue() const { return queue->getId(); }
void PowerSwitcherComponent::getMode(Mode_t *mode, Submode_t *submode) {
*mode = this->mode;
@ -103,6 +104,4 @@ void PowerSwitcherComponent::setMode(Mode_t newMode, Submode_t newSubmode) {
announceMode(false);
}
HasHealthIF::HealthState PowerSwitcherComponent::getHealth() {
return healthHelper.getHealth();
}
HasHealthIF::HealthState PowerSwitcherComponent::getHealth() { return healthHelper.getHealth(); }

View File

@ -6,8 +6,8 @@
#include <fsfw/modes/HasModesIF.h>
#include <fsfw/modes/ModeHelper.h>
#include <fsfw/objectmanager/SystemObject.h>
#include <fsfw/power/definitions.h>
#include <fsfw/power/PowerSwitcher.h>
#include <fsfw/power/definitions.h>
#include <fsfw/tasks/ExecutableObjectIF.h>
class PowerSwitchIF;
@ -22,8 +22,7 @@ class PowerSwitchIF;
* Commanding this component to MODE_OFF will cause the switcher to turn the switch off while
* commanding in to MODE_ON will cause the switcher to turn the switch on.
*/
class PowerSwitcherComponent:
public SystemObject,
class PowerSwitcherComponent : public SystemObject,
public HasReturnvaluesIF,
public ExecutableObjectIF,
public HasModesIF,
@ -33,7 +32,6 @@ public:
power::Switch_t pwrSwitch);
private:
MessageQueueIF *queue = nullptr;
PowerSwitcher switcher;

View File

@ -1,5 +1,6 @@
target_sources(${LIB_FSFW_NAME} PRIVATE
Service1TelecommandVerification.cpp
target_sources(
${LIB_FSFW_NAME}
PRIVATE Service1TelecommandVerification.cpp
Service2DeviceAccess.cpp
Service3Housekeeping.cpp
Service5EventReporting.cpp
@ -8,5 +9,4 @@ target_sources(${LIB_FSFW_NAME} PRIVATE
Service17Test.cpp
Service20ParameterManagement.cpp
CService200ModeCommanding.cpp
CService201HealthCommanding.cpp
)
CService201HealthCommanding.cpp)

View File

@ -44,6 +44,12 @@ class Service11TelecommandScheduling final : public PusServiceBase {
static constexpr ReturnValue_t INVALID_RELATIVE_TIME =
HasReturnvaluesIF::makeReturnCode(CLASS_ID, 3);
static constexpr uint8_t SUBSYSTEM_ID = SUBSYSTEM_ID::PUS_SERVICE_11;
//! [EXPORT] : [COMMENT] Deletion of a TC from the map failed.
//! P1: First 32 bit of request ID, P2. Last 32 bit of Request ID
static constexpr Event TC_DELETION_FAILED = event::makeEvent(SUBSYSTEM_ID, 0, severity::MEDIUM);
// The types of PUS-11 subservices
enum Subservice : uint8_t {
ENABLE_SCHEDULING = 1,
@ -73,7 +79,10 @@ class Service11TelecommandScheduling final : public PusServiceBase {
uint16_t releaseTimeMarginSeconds = DEFAULT_RELEASE_TIME_MARGIN,
bool debugMode = false);
~Service11TelecommandScheduling();
~Service11TelecommandScheduling() override;
void enableExpiredTcDeletion();
void disableExpiredTcDeletion();
/** PusServiceBase overrides */
ReturnValue_t handleRequest(uint8_t subservice) override;
@ -82,8 +91,8 @@ class Service11TelecommandScheduling final : public PusServiceBase {
private:
struct TelecommandStruct {
uint64_t requestId;
uint32_t seconds;
uint64_t requestId{};
uint32_t seconds{};
store_address_t storeAddr; // uint16
};
@ -92,9 +101,11 @@ class Service11TelecommandScheduling final : public PusServiceBase {
// minimum release time offset to insert into schedule
const uint16_t RELEASE_TIME_MARGIN_SECONDS = 5;
// the maximum amount of stored TCs is defined here
static constexpr uint16_t MAX_STORED_TELECOMMANDS = 500;
/**
* By default, the scheduling will be disabled. This is a standard requirement
*/
bool schedulingEnabled = false;
bool deleteExpiredTcWhenDisabled = true;
bool debugMode = false;
StorageManagerIF* tcStore = nullptr;
AcceptsTelecommandsIF* tcRecipient = nullptr;
@ -109,6 +120,7 @@ class Service11TelecommandScheduling final : public PusServiceBase {
TelecommandMap telecommandMap;
ReturnValue_t handleResetCommand();
/**
* @brief Logic to be performed on an incoming TC[11,4].
* @return RETURN_OK if successful
@ -139,17 +151,6 @@ class Service11TelecommandScheduling final : public PusServiceBase {
*/
ReturnValue_t doFilterTimeshiftActivity(const uint8_t* data, size_t size);
/**
* @brief Deserializes a generic type from a payload buffer by using the FSFW
* SerializeAdapter Interface.
* @param output Output to be deserialized
* @param buf Payload buffer (application data)
* @param bufsize Remaining size of payload buffer (application data size)
* @return RETURN_OK if successful
*/
template <typename T>
ReturnValue_t deserializeViaFsfwInterface(T& output, const uint8_t* buf, size_t bufsize);
/**
* @brief Extracts the Request ID from the Application Data of a TC by utilizing a ctor of the
* class TcPacketPus.
@ -177,7 +178,7 @@ class Service11TelecommandScheduling final : public PusServiceBase {
* @param ssc Source Sequence Count
* @return Request ID
*/
uint64_t buildRequestId(uint32_t sourceId, uint16_t apid, uint16_t ssc) const;
[[nodiscard]] uint64_t buildRequestId(uint32_t sourceId, uint16_t apid, uint16_t ssc) const;
/**
* @brief Gets the filter range for filter TCs from a data packet
@ -194,7 +195,7 @@ class Service11TelecommandScheduling final : public PusServiceBase {
/**
* @brief Prints content of multimap. Use for simple debugging only.
*/
void debugPrintMultimapContent(void) const;
void debugPrintMultimapContent() const;
};
#include "Service11TelecommandScheduling.tpp"

View File

@ -1,11 +1,12 @@
#pragma once
#include <fsfw/objectmanager/ObjectManager.h>
#include <fsfw/serialize/SerializeAdapter.h>
#include <fsfw/tmtcservices/AcceptsTelecommandsIF.h>
#include <cstddef>
#include "fsfw/objectmanager/ObjectManager.h"
#include "fsfw/serialize/SerializeAdapter.h"
#include "fsfw/serviceinterface.h"
#include "fsfw/tmtcservices/AcceptsTelecommandsIF.h"
static constexpr auto DEF_END = SerializeIF::Endianness::BIG;
template <size_t MAX_NUM_TCS>
@ -18,7 +19,7 @@ inline Service11TelecommandScheduling<MAX_NUM_TCS>::Service11TelecommandScheduli
tcRecipient(tcRecipient) {}
template <size_t MAX_NUM_TCS>
inline Service11TelecommandScheduling<MAX_NUM_TCS>::~Service11TelecommandScheduling() {}
inline Service11TelecommandScheduling<MAX_NUM_TCS>::~Service11TelecommandScheduling() = default;
template <size_t MAX_NUM_TCS>
inline ReturnValue_t Service11TelecommandScheduling<MAX_NUM_TCS>::handleRequest(
@ -37,6 +38,17 @@ inline ReturnValue_t Service11TelecommandScheduling<MAX_NUM_TCS>::handleRequest(
return handleInvalidData("handleRequest");
}
switch (subservice) {
case Subservice::ENABLE_SCHEDULING: {
schedulingEnabled = true;
break;
}
case Subservice::DISABLE_SCHEDULING: {
schedulingEnabled = false;
break;
}
case Subservice::RESET_SCHEDULING: {
return handleResetCommand();
}
case Subservice::INSERT_ACTIVITY:
return doInsertActivity(data, size);
case Subservice::DELETE_ACTIVITY:
@ -48,25 +60,26 @@ inline ReturnValue_t Service11TelecommandScheduling<MAX_NUM_TCS>::handleRequest(
case Subservice::FILTER_TIMESHIFT_ACTIVITY:
return doFilterTimeshiftActivity(data, size);
default:
break;
return AcceptsTelecommandsIF::INVALID_SUBSERVICE;
}
return HasReturnvaluesIF::RETURN_FAILED;
return RETURN_OK;
}
template <size_t MAX_NUM_TCS>
inline ReturnValue_t Service11TelecommandScheduling<MAX_NUM_TCS>::performService() {
// DEBUG
// DebugPrintMultimapContent();
if (not schedulingEnabled) {
return RETURN_OK;
}
// get current time as UNIX timestamp
timeval tNow = {};
Clock::getClock_timeval(&tNow);
// TODO: Optionally limit the max number of released TCs per cycle?
// NOTE: The iterator is increased in the loop here. Increasing the iterator as for-loop arg
// does not work in this case as we are deleting the current element here.
for (auto it = telecommandMap.begin(); it != telecommandMap.end();) {
if (it->first <= tNow.tv_sec) {
if (schedulingEnabled) {
// release tc
TmTcMessage releaseMsg(it->second.storeAddr);
auto sendRet = this->requestQueue->sendMessage(recipientMsgQueueId, &releaseMsg, false);
@ -74,9 +87,6 @@ inline ReturnValue_t Service11TelecommandScheduling<MAX_NUM_TCS>::performService
if (sendRet != HasReturnvaluesIF::RETURN_OK) {
return sendRet;
}
telecommandMap.erase(it++);
if (debugMode) {
#if FSFW_CPP_OSTREAM_ENABLED == 1
sif::info << "Released TC & erased it from TC map" << std::endl;
@ -84,6 +94,10 @@ inline ReturnValue_t Service11TelecommandScheduling<MAX_NUM_TCS>::performService
sif::printInfo("Released TC & erased it from TC map\n");
#endif
}
telecommandMap.erase(it++);
} else if (deleteExpiredTcWhenDisabled) {
telecommandMap.erase(it++);
}
continue;
}
it++;
@ -112,12 +126,30 @@ inline ReturnValue_t Service11TelecommandScheduling<MAX_NUM_TCS>::initialize() {
return res;
}
template <size_t MAX_NUM_TCS>
inline ReturnValue_t Service11TelecommandScheduling<MAX_NUM_TCS>::handleResetCommand() {
for (auto it = telecommandMap.begin(); it != telecommandMap.end(); it++) {
ReturnValue_t result = tcStore->deleteData(it->second.storeAddr);
if (result != RETURN_OK) {
#if FSFW_CPP_OSTREAM_ENABLED == 1
// This should not happen
sif::warning << "Service11TelecommandScheduling::handleRequestDeleting: Deletion failed"
<< std::endl;
#else
sif::printWarning("Service11TelecommandScheduling::handleRequestDeleting: Deletion failed\n");
#endif
triggerEvent(TC_DELETION_FAILED, (it->second.requestId >> 32) & 0xffffffff,
it->second.requestId & 0xffffffff);
}
}
telecommandMap.clear();
return RETURN_OK;
}
template <size_t MAX_NUM_TCS>
inline ReturnValue_t Service11TelecommandScheduling<MAX_NUM_TCS>::doInsertActivity(
const uint8_t *data, size_t size) {
uint32_t timestamp = 0;
const uint8_t *initData = data;
size_t initSz = size;
ReturnValue_t result = SerializeAdapter::deSerialize(&timestamp, &data, &size, DEF_END);
if (result != RETURN_OK) {
return result;
@ -142,7 +174,7 @@ inline ReturnValue_t Service11TelecommandScheduling<MAX_NUM_TCS>::doInsertActivi
// store currentPacket and receive the store address
store_address_t addr{};
if (tcStore->addData(&addr, initData, initSz) != RETURN_OK ||
if (tcStore->addData(&addr, data, size) != RETURN_OK ||
addr.raw == storeId::INVALID_STORE_ADDRESS) {
#if FSFW_CPP_OSTREAM_ENABLED == 1
sif::error << "Service11TelecommandScheduling::doInsertActivity: Adding data to TC Store failed"
@ -404,7 +436,6 @@ inline ReturnValue_t Service11TelecommandScheduling<MAX_NUM_TCS>::doFilterTimesh
// and then insert it again as new entry
telecommandMap.insert(std::make_pair(tempKey, tempTc));
shiftedItemsCount++;
continue;
}
if (debugMode) {
@ -463,9 +494,9 @@ template <size_t MAX_NUM_TCS>
inline uint64_t Service11TelecommandScheduling<MAX_NUM_TCS>::buildRequestId(uint32_t sourceId,
uint16_t apid,
uint16_t ssc) const {
uint64_t sourceId64 = static_cast<uint64_t>(sourceId);
uint64_t apid64 = static_cast<uint64_t>(apid);
uint64_t ssc64 = static_cast<uint64_t>(ssc);
auto sourceId64 = static_cast<uint64_t>(sourceId);
auto apid64 = static_cast<uint64_t>(apid);
auto ssc64 = static_cast<uint64_t>(ssc);
return (sourceId64 << 32) | (apid64 << 16) | ssc64;
}
@ -483,7 +514,7 @@ inline ReturnValue_t Service11TelecommandScheduling<MAX_NUM_TCS>::getMapFilterFr
if (typeRaw > 3) {
return INVALID_TYPE_TIME_WINDOW;
}
TypeOfTimeWindow type = static_cast<TypeOfTimeWindow>(typeRaw);
auto type = static_cast<TypeOfTimeWindow>(typeRaw);
// we now have the type of delete activity - so now we set the range to delete,
// according to the type of time window.
@ -558,7 +589,10 @@ inline ReturnValue_t Service11TelecommandScheduling<MAX_NUM_TCS>::getMapFilterFr
// additional security check, this should never be true
if (itBegin->first > itEnd->first) {
#if FSFW_CPP_OSTREAM_ENABLED == 1
#else
sif::printError("11::GetMapFilterFromData: itBegin > itEnd\n");
#endif
return RETURN_FAILED;
}
@ -580,15 +614,17 @@ inline ReturnValue_t Service11TelecommandScheduling<MAX_NUM_TCS>::handleInvalidD
}
template <size_t MAX_NUM_TCS>
inline void Service11TelecommandScheduling<MAX_NUM_TCS>::debugPrintMultimapContent(void) const {
inline void Service11TelecommandScheduling<MAX_NUM_TCS>::debugPrintMultimapContent() const {
for ([[maybe_unused]] const auto &dit : telecommandMap) {
#if FSFW_DISABLE_PRINTOUT == 0
#if FSFW_CPP_OSTREAM_ENABLED == 1
sif::debug << "Service11TelecommandScheduling::debugPrintMultimapContent: Multimap Content"
<< std::endl;
sif::debug << "[" << dit->first << "]: Request ID: " << dit->second.requestId << " | "
<< "Store Address: " << dit->second.storeAddr << std::endl;
sif::debug << "[" << dit.first << "]: Request ID: " << dit.second.requestId << " | "
<< "Store Address: " << dit.second.storeAddr.raw << std::endl;
#else
sif::printDebug("Service11TelecommandScheduling::debugPrintMultimapContent: Multimap Content\n");
sif::printDebug(
"Service11TelecommandScheduling::debugPrintMultimapContent: Multimap Content\n");
for (auto dit = telecommandMap.begin(); dit != telecommandMap.end(); ++dit) {
sif::printDebug("[%d]: Request ID: %d | Store Address: %d\n", dit->first,
dit->second.requestId, dit->second.storeAddr);
@ -596,3 +632,14 @@ inline void Service11TelecommandScheduling<MAX_NUM_TCS>::debugPrintMultimapConte
#endif
#endif
}
}
template <size_t MAX_NUM_TCS>
inline void Service11TelecommandScheduling<MAX_NUM_TCS>::enableExpiredTcDeletion() {
deleteExpiredTcWhenDisabled = true;
}
template <size_t MAX_NUM_TCS>
inline void Service11TelecommandScheduling<MAX_NUM_TCS>::disableExpiredTcDeletion() {
deleteExpiredTcWhenDisabled = false;
}

View File

@ -86,8 +86,8 @@ ReturnValue_t Service5EventReporting::handleRequest(uint8_t subservice) {
// In addition to the default PUSServiceBase initialization, this service needs
// to be registered to the event manager to listen for events.
ReturnValue_t Service5EventReporting::initialize() {
EventManagerIF* manager = ObjectManager::instance()->get<EventManagerIF>(objects::EVENT_MANAGER);
if (manager == NULL) {
auto* manager = ObjectManager::instance()->get<EventManagerIF>(objects::EVENT_MANAGER);
if (manager == nullptr) {
return RETURN_FAILED;
}
// register Service 5 as listener for events

View File

@ -1,7 +1,2 @@
target_sources(${LIB_FSFW_NAME}
PRIVATE
RMAP.cpp
RMAPCookie.cpp
RmapDeviceCommunicationIF.cpp
)
target_sources(${LIB_FSFW_NAME} PRIVATE RMAP.cpp RMAPCookie.cpp
RmapDeviceCommunicationIF.cpp)

View File

@ -1,4 +1 @@
target_sources(${LIB_FSFW_NAME}
PRIVATE
SerialBufferAdapter.cpp
)
target_sources(${LIB_FSFW_NAME} PRIVATE SerialBufferAdapter.cpp)

View File

@ -1,5 +1,4 @@
target_sources(${LIB_FSFW_NAME} PRIVATE
ServiceInterfaceStream.cpp
ServiceInterfaceBuffer.cpp
ServiceInterfacePrinter.cpp
)
target_sources(
${LIB_FSFW_NAME}
PRIVATE ServiceInterfaceStream.cpp ServiceInterfaceBuffer.cpp
ServiceInterfacePrinter.cpp)

View File

@ -1,7 +1,3 @@
target_sources(${LIB_FSFW_NAME}
PRIVATE
ConstStorageAccessor.cpp
StorageAccessor.cpp
LocalPool.cpp
PoolManager.cpp
)
target_sources(
${LIB_FSFW_NAME} PRIVATE ConstStorageAccessor.cpp StorageAccessor.cpp
LocalPool.cpp PoolManager.cpp)

View File

@ -1,7 +1,3 @@
target_sources(${LIB_FSFW_NAME}
PRIVATE
Subsystem.cpp
SubsystemBase.cpp
)
target_sources(${LIB_FSFW_NAME} PRIVATE Subsystem.cpp SubsystemBase.cpp)
add_subdirectory(modes)

View File

@ -1,5 +1 @@
target_sources(${LIB_FSFW_NAME}
PRIVATE
ModeSequenceMessage.cpp
ModeStore.cpp
)
target_sources(${LIB_FSFW_NAME} PRIVATE ModeSequenceMessage.cpp ModeStore.cpp)

View File

@ -1,5 +1,2 @@
target_sources(${LIB_FSFW_NAME}
PRIVATE
FixedSequenceSlot.cpp
FixedSlotSequence.cpp
)
target_sources(${LIB_FSFW_NAME} PRIVATE FixedSequenceSlot.cpp
FixedSlotSequence.cpp)

View File

@ -9,7 +9,7 @@
CCSDSDistributor::CCSDSDistributor(uint16_t setDefaultApid, object_id_t setObjectId)
: TcDistributor(setObjectId), defaultApid(setDefaultApid) {}
CCSDSDistributor::~CCSDSDistributor() {}
CCSDSDistributor::~CCSDSDistributor() = default;
TcDistributor::TcMqMapIter CCSDSDistributor::selectDestination() {
#if CCSDS_DISTRIBUTOR_DEBUGGING == 1
@ -38,6 +38,7 @@ TcDistributor::TcMqMapIter CCSDSDistributor::selectDestination() {
" store failed!\n");
#endif
#endif
return queueMap.end();
}
SpacePacketBase currentPacket(packet);
@ -45,7 +46,7 @@ TcDistributor::TcMqMapIter CCSDSDistributor::selectDestination() {
sif::info << "CCSDSDistributor::selectDestination has packet with APID " << std::hex
<< currentPacket.getAPID() << std::dec << std::endl;
#endif
TcMqMapIter position = this->queueMap.find(currentPacket.getAPID());
auto position = this->queueMap.find(currentPacket.getAPID());
if (position != this->queueMap.end()) {
return position;
} else {

View File

@ -1,9 +1,4 @@
target_sources(${LIB_FSFW_NAME} PRIVATE
CCSDSDistributor.cpp
PUSDistributor.cpp
TcDistributor.cpp
TcPacketCheckPUS.cpp
TcPacketCheckCFDP.cpp
CFDPDistributor.cpp
)
target_sources(
${LIB_FSFW_NAME}
PRIVATE CCSDSDistributor.cpp PUSDistributor.cpp TcDistributor.cpp
TcPacketCheckPUS.cpp TcPacketCheckCFDP.cpp CFDPDistributor.cpp)

View File

@ -15,7 +15,7 @@ PUSDistributor::PUSDistributor(uint16_t setApid, object_id_t setObjectId,
tcStatus(RETURN_FAILED),
packetSource(setPacketSource) {}
PUSDistributor::~PUSDistributor() {}
PUSDistributor::~PUSDistributor() = default;
PUSDistributor::TcMqMapIter PUSDistributor::selectDestination() {
#if FSFW_CPP_OSTREAM_ENABLED == 1 && PUS_DISTRIBUTOR_DEBUGGING == 1
@ -23,7 +23,7 @@ PUSDistributor::TcMqMapIter PUSDistributor::selectDestination() {
sif::debug << "PUSDistributor::handlePacket received: " << storeId.poolIndex << ", "
<< storeId.packetIndex << std::endl;
#endif
TcMqMapIter queueMapIt = this->queueMap.end();
auto queueMapIt = this->queueMap.end();
if (this->currentPacket == nullptr) {
return queueMapIt;
}
@ -48,9 +48,7 @@ PUSDistributor::TcMqMapIter PUSDistributor::selectDestination() {
sif::warning << "PUSDistributor::handlePacket: Packet format invalid, " << keyword
<< " error" << std::endl;
#else
sif::printWarning(
"PUSDistributor::handlePacket: Packet format invalid, "
"%s error\n",
sif::printWarning("PUSDistributor::handlePacket: Packet format invalid, %s error\n",
keyword);
#endif
#endif
@ -133,8 +131,7 @@ ReturnValue_t PUSDistributor::initialize() {
return ObjectManagerIF::CHILD_INIT_FAILED;
}
CCSDSDistributorIF* ccsdsDistributor =
ObjectManager::instance()->get<CCSDSDistributorIF>(packetSource);
auto* ccsdsDistributor = ObjectManager::instance()->get<CCSDSDistributorIF>(packetSource);
if (ccsdsDistributor == nullptr) {
#if FSFW_CPP_OSTREAM_ENABLED == 1
sif::error << "PUSDistributor::initialize: Packet source invalid" << std::endl;

View File

@ -1,10 +1,9 @@
target_sources(${LIB_FSFW_NAME}
PRIVATE
AbstractTemperatureSensor.cpp
target_sources(
${LIB_FSFW_NAME}
PRIVATE AbstractTemperatureSensor.cpp
Heater.cpp
RedundantHeater.cpp
ThermalComponentCore.cpp
ThermalComponent.cpp
ThermalModule.cpp
ThermalMonitorReporter.cpp
)
ThermalMonitorReporter.cpp)

View File

@ -1,8 +1,3 @@
target_sources(${LIB_FSFW_NAME} PRIVATE
CCSDSTime.cpp
Countdown.cpp
Stopwatch.cpp
TimeMessage.cpp
TimeStamper.cpp
ClockCommon.cpp
)
target_sources(
${LIB_FSFW_NAME} PRIVATE CCSDSTime.cpp Countdown.cpp Stopwatch.cpp
TimeMessage.cpp TimeStamper.cpp ClockCommon.cpp)

View File

@ -1,4 +1 @@
target_sources(${LIB_FSFW_NAME}
PRIVATE
TmStoreMessage.cpp
)
target_sources(${LIB_FSFW_NAME} PRIVATE TmStoreMessage.cpp)

View File

@ -1,7 +1,4 @@
target_sources(${LIB_FSFW_NAME} PRIVATE
SpacePacket.cpp
SpacePacketBase.cpp
)
target_sources(${LIB_FSFW_NAME} PRIVATE SpacePacket.cpp SpacePacketBase.cpp)
add_subdirectory(cfdp)
add_subdirectory(packetmatcher)

View File

@ -1,4 +1 @@
target_sources(${LIB_FSFW_NAME} PRIVATE
CFDPPacket.cpp
CFDPPacketStored.cpp
)
target_sources(${LIB_FSFW_NAME} PRIVATE CFDPPacket.cpp CFDPPacketStored.cpp)

View File

@ -1,4 +1 @@
target_sources(${LIB_FSFW_NAME}
PRIVATE
PacketMatchTree.cpp
)
target_sources(${LIB_FSFW_NAME} PRIVATE PacketMatchTree.cpp)

View File

@ -1,6 +1,3 @@
target_sources(${LIB_FSFW_NAME} PRIVATE
TcPacketPusBase.cpp
TcPacketPus.cpp
TcPacketStoredBase.cpp
TcPacketStoredPus.cpp
)
target_sources(
${LIB_FSFW_NAME} PRIVATE TcPacketPusBase.cpp TcPacketPus.cpp
TcPacketStoredBase.cpp TcPacketStoredPus.cpp)

View File

@ -6,20 +6,20 @@
#include "fsfw/objectmanager/frameworkObjects.h"
#include "fsfw/serviceinterface/ServiceInterface.h"
StorageManagerIF* TcPacketStoredBase::store = nullptr;
StorageManagerIF* TcPacketStoredBase::STORE = nullptr;
TcPacketStoredBase::TcPacketStoredBase() {
this->storeAddress.raw = StorageManagerIF::INVALID_ADDRESS;
this->checkAndSetStore();
TcPacketStoredBase::checkAndSetStore();
}
TcPacketStoredBase::~TcPacketStoredBase() {}
TcPacketStoredBase::~TcPacketStoredBase() = default;
ReturnValue_t TcPacketStoredBase::getData(const uint8_t** dataPtr, size_t* dataSize) {
auto result = this->store->getData(storeAddress, dataPtr, dataSize);
auto result = TcPacketStoredBase::STORE->getData(storeAddress, dataPtr, dataSize);
if (result != HasReturnvaluesIF::RETURN_OK) {
#if FSFW_CPP_OSTREAM_ENABLED == 1
sif::warning << "TcPacketStoredBase: Could not get data!" << std::endl;
sif::warning << "TcPacketStoredBase: Could not get data" << std::endl;
#else
sif::printWarning("TcPacketStoredBase: Could not get data!\n");
#endif
@ -28,11 +28,13 @@ ReturnValue_t TcPacketStoredBase::getData(const uint8_t** dataPtr, size_t* dataS
}
bool TcPacketStoredBase::checkAndSetStore() {
if (this->store == nullptr) {
this->store = ObjectManager::instance()->get<StorageManagerIF>(objects::TC_STORE);
if (this->store == nullptr) {
if (TcPacketStoredBase::STORE == nullptr) {
TcPacketStoredBase::STORE = ObjectManager::instance()->get<StorageManagerIF>(objects::TC_STORE);
if (TcPacketStoredBase::STORE == nullptr) {
#if FSFW_CPP_OSTREAM_ENABLED == 1
sif::error << "TcPacketStoredBase::TcPacketStoredBase: TC Store not found!" << std::endl;
sif::error << "TcPacketStoredBase::TcPacketStoredBase: TC Store not found" << std::endl;
#else
sif::printError("TcPacketStoredBase::TcPacketStoredBase: TC Store not found\n");
#endif
return false;
}
@ -47,7 +49,7 @@ void TcPacketStoredBase::setStoreAddress(store_address_t setAddress,
size_t tempSize;
ReturnValue_t status = StorageManagerIF::RETURN_FAILED;
if (this->checkAndSetStore()) {
status = this->store->getData(this->storeAddress, &tempData, &tempSize);
status = TcPacketStoredBase::STORE->getData(this->storeAddress, &tempData, &tempSize);
}
if (status == StorageManagerIF::RETURN_OK) {

View File

@ -65,7 +65,7 @@ class TcPacketStoredBase : public TcPacketStoredIF {
* call tries to set it and throws an error message in case of failures.
* The default store is objects::TC_STORE.
*/
static StorageManagerIF* store;
static StorageManagerIF* STORE;
/**
* The address where the packet data of the object instance is stored.
*/
@ -77,7 +77,7 @@ class TcPacketStoredBase : public TcPacketStoredIF {
* @return @li @c true if the store is linked or could be created.
* @li @c false otherwise.
*/
bool checkAndSetStore();
static bool checkAndSetStore();
};
#endif /* TMTCPACKET_PUS_TcPacketStoredBase_H_ */
#endif /* TMTCPACKET_PUS_TCPACKETSTORED_H_ */

View File

@ -9,7 +9,8 @@
class TcPacketStoredIF {
public:
virtual ~TcPacketStoredIF(){};
virtual ~TcPacketStoredIF() = default;
;
/**
* With this call, the stored packet can be set to another packet in a store. This is useful

View File

@ -14,8 +14,8 @@ TcPacketStoredPus::TcPacketStoredPus(uint16_t apid, uint8_t service, uint8_t sub
}
uint8_t* pData = nullptr;
ReturnValue_t returnValue =
this->store->getFreeElement(&this->storeAddress, (TC_PACKET_MIN_SIZE + size), &pData);
if (returnValue != this->store->RETURN_OK) {
this->STORE->getFreeElement(&this->storeAddress, (TC_PACKET_MIN_SIZE + size), &pData);
if (returnValue != this->STORE->RETURN_OK) {
#if FSFW_CPP_OSTREAM_ENABLED == 1
sif::warning << "TcPacketStoredBase: Could not get free element from store!" << std::endl;
#endif
@ -44,19 +44,19 @@ TcPacketStoredPus::TcPacketStoredPus(const uint8_t* data, size_t size) : TcPacke
return;
}
if (this->checkAndSetStore()) {
ReturnValue_t status = store->addData(&storeAddress, data, size);
ReturnValue_t status = STORE->addData(&storeAddress, data, size);
if (status != HasReturnvaluesIF::RETURN_OK) {
this->setData(nullptr, size);
}
const uint8_t* storePtr = nullptr;
// Repoint base data pointer to the data in the store.
store->getData(storeAddress, &storePtr, &size);
STORE->getData(storeAddress, &storePtr, &size);
this->setData(const_cast<uint8_t*>(storePtr), size);
}
}
ReturnValue_t TcPacketStoredPus::deletePacket() {
ReturnValue_t result = this->store->deleteData(this->storeAddress);
ReturnValue_t result = this->STORE->deleteData(this->storeAddress);
this->storeAddress.raw = StorageManagerIF::INVALID_ADDRESS;
// To circumvent size checks
this->setData(nullptr, -1);
@ -68,7 +68,7 @@ TcPacketPusBase* TcPacketStoredPus::getPacketBase() { return this; }
bool TcPacketStoredPus::isSizeCorrect() {
const uint8_t* temp_data = nullptr;
size_t temp_size;
ReturnValue_t status = this->store->getData(this->storeAddress, &temp_data, &temp_size);
ReturnValue_t status = this->STORE->getData(this->storeAddress, &temp_data, &temp_size);
if (status == StorageManagerIF::RETURN_OK) {
if (this->getFullSize() == temp_size) {
return true;

View File

@ -1,9 +1,9 @@
target_sources(${LIB_FSFW_NAME} PRIVATE
TmPacketStoredPusA.cpp
target_sources(
${LIB_FSFW_NAME}
PRIVATE TmPacketStoredPusA.cpp
TmPacketStoredPusC.cpp
TmPacketPusA.cpp
TmPacketPusC.cpp
TmPacketStoredBase.cpp
TmPacketBase.cpp
TmPacketMinimal.cpp
)
TmPacketMinimal.cpp)

View File

@ -1,7 +1,7 @@
#ifndef FRAMEWORK_TMTCSERVICES_ACCEPTSTELECOMMANDSIF_H_
#define FRAMEWORK_TMTCSERVICES_ACCEPTSTELECOMMANDSIF_H_
#include "../ipc/MessageQueueSenderIF.h"
#include "fsfw/ipc/MessageQueueSenderIF.h"
/**
* @brief This interface is implemented by classes that are sinks for
@ -20,7 +20,7 @@ class AcceptsTelecommandsIF {
/**
* @brief The virtual destructor as it is mandatory for C++ interfaces.
*/
virtual ~AcceptsTelecommandsIF() {}
virtual ~AcceptsTelecommandsIF() = default;
/**
* @brief Getter for the service id.
* @details Any receiving service (at least any PUS service) shall have a

View File

@ -1,10 +1,9 @@
target_sources(${LIB_FSFW_NAME}
PRIVATE
CommandingServiceBase.cpp
target_sources(
${LIB_FSFW_NAME}
PRIVATE CommandingServiceBase.cpp
PusServiceBase.cpp
PusVerificationReport.cpp
TmTcBridge.cpp
TmTcMessage.cpp
VerificationReporter.cpp
SpacePacketParser.cpp
)
SpacePacketParser.cpp)