TaskIF refactor SPI refactor #89

Merged
meierj merged 3 commits from mueller/task-if-refactor-spi-refactor into develop 2022-05-23 16:22:41 +02:00
68 changed files with 388 additions and 549 deletions
Showing only changes of commit f35b0ffbbd - Show all commits

View File

@ -10,9 +10,10 @@ folder_list=(
) )
cmake_fmt="cmake-format" cmake_fmt="cmake-format"
file_selectors="-iname CMakeLists.txt"
if command -v ${cmake_fmt} &> /dev/null; then if command -v ${cmake_fmt} &> /dev/null; then
cmake_fmt_cmd="${cmake_fmt} -i CMakeLists.txt" ${cmake_fmt} -i CMakeLists.txt
eval ${cmake_fmt_cmd} find ./src ${file_selectors} | xargs ${cmake_fmt} -i
else else
echo "No ${cmake_fmt} tool found, not formatting CMake files" echo "No ${cmake_fmt} tool found, not formatting CMake files"
fi fi

View File

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

View File

@ -1,6 +1,4 @@
target_sources(${LIB_FSFW_NAME} PRIVATE target_sources(${LIB_FSFW_NAME} PRIVATE version.cpp)
version.cpp
)
# Core # Core
@ -37,7 +35,7 @@ add_subdirectory(tmtcservices)
# Optional # Optional
if(FSFW_ADD_MONITORING) if(FSFW_ADD_MONITORING)
add_subdirectory(monitoring) add_subdirectory(monitoring)
endif() endif()
if(FSFW_ADD_PUS) if(FSFW_ADD_PUS)
add_subdirectory(pus) add_subdirectory(pus)

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,5 +1 @@
target_sources(${LIB_FSFW_NAME} target_sources(${LIB_FSFW_NAME} PRIVATE ObjectManager.cpp SystemObject.cpp)
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_5_EVENT_REPORTING = 0x53000005,
PUS_SERVICE_8_FUNCTION_MGMT = 0x53000008, PUS_SERVICE_8_FUNCTION_MGMT = 0x53000008,
PUS_SERVICE_9_TIME_MGMT = 0x53000009, PUS_SERVICE_9_TIME_MGMT = 0x53000009,
PUS_SERVICE_11_TC_SCHEDULER = 0x53000011,
PUS_SERVICE_17_TEST = 0x53000017, PUS_SERVICE_17_TEST = 0x53000017,
PUS_SERVICE_20_PARAMETERS = 0x53000020, PUS_SERVICE_20_PARAMETERS = 0x53000020,
PUS_SERVICE_200_MODE_MGMT = 0x53000200, PUS_SERVICE_200_MODE_MGMT = 0x53000200,

View File

@ -7,25 +7,23 @@ elseif(FSFW_OSAL MATCHES "linux")
add_subdirectory(linux) add_subdirectory(linux)
elseif(FSFW_OSAL MATCHES "host") elseif(FSFW_OSAL MATCHES "host")
add_subdirectory(host) add_subdirectory(host)
if (WIN32) if(WIN32)
add_subdirectory(windows) add_subdirectory(windows)
elseif(UNIX) elseif(UNIX)
# We still need to pull in some Linux specific sources # We still need to pull in some Linux specific sources
target_sources(${LIB_FSFW_NAME} PUBLIC target_sources(${LIB_FSFW_NAME} PUBLIC linux/tcpipHelpers.cpp)
linux/tcpipHelpers.cpp endif()
)
endif ()
else() else()
message(WARNING "The OS_FSFW variable was not set. Assuming host OS..") message(WARNING "${MSG_PREFIX} The FSFW_OSAL variable was not set. Assuming host OS..")
# Not set. Assumuing this is a host build, try to determine host OS # Not set. Assumuing this is a host build, try to determine host OS
if (WIN32) if(WIN32)
add_subdirectory(host) add_subdirectory(host)
add_subdirectory(windows) add_subdirectory(windows)
elseif (UNIX) elseif(UNIX)
add_subdirectory(linux) add_subdirectory(linux)
else () else()
# MacOS or other OSes have not been tested yet / are not supported. # MacOS or other OSes have not been tested yet / are not supported.
message(FATAL_ERROR "The host OS could not be determined! Aborting.") message(FATAL_ERROR "The host OS could not be determined! Aborting.")
endif() endif()

View File

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

View File

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

View File

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

View File

@ -133,7 +133,7 @@ ReturnValue_t FixedTimeslotTask::addSlot(object_id_t componentId, uint32_t slotT
return HasReturnvaluesIF::RETURN_FAILED; return HasReturnvaluesIF::RETURN_FAILED;
} }
ReturnValue_t FixedTimeslotTask::checkSequence() const { return pollingSeqTable.checkSequence(); } ReturnValue_t FixedTimeslotTask::checkSequence() { return pollingSeqTable.checkSequence(); }
uint32_t FixedTimeslotTask::getPeriodMs() const { return period * 1000; } uint32_t FixedTimeslotTask::getPeriodMs() const { return period * 1000; }
@ -176,3 +176,5 @@ bool FixedTimeslotTask::delayForInterval(chron_ms* previousWakeTimeMs, const chr
(*previousWakeTimeMs) = currentStartTime; (*previousWakeTimeMs) = currentStartTime;
return false; return false;
} }
bool FixedTimeslotTask::isEmpty() const { return pollingSeqTable.isEmpty(); }

View File

@ -59,12 +59,14 @@ class FixedTimeslotTask : public FixedTimeslotTaskIF {
*/ */
ReturnValue_t addSlot(object_id_t componentId, uint32_t slotTimeMs, int8_t executionStep); ReturnValue_t addSlot(object_id_t componentId, uint32_t slotTimeMs, int8_t executionStep);
ReturnValue_t checkSequence() const override; ReturnValue_t checkSequence() override;
uint32_t getPeriodMs() const; uint32_t getPeriodMs() const;
ReturnValue_t sleepFor(uint32_t ms); ReturnValue_t sleepFor(uint32_t ms);
bool isEmpty() const override;
protected: protected:
using chron_ms = std::chrono::milliseconds; using chron_ms = std::chrono::milliseconds;

View File

@ -156,3 +156,5 @@ bool PeriodicTask::delayForInterval(chron_ms* previousWakeTimeMs, const chron_ms
(*previousWakeTimeMs) = currentStartTime; (*previousWakeTimeMs) = currentStartTime;
return false; return false;
} }
bool PeriodicTask::isEmpty() const { return objectList.empty(); }

View File

@ -73,6 +73,7 @@ class PeriodicTask : public PeriodicTaskIF {
ReturnValue_t sleepFor(uint32_t ms); ReturnValue_t sleepFor(uint32_t ms);
bool isEmpty() const override;
protected: protected:
using chron_ms = std::chrono::milliseconds; using chron_ms = std::chrono::milliseconds;
bool started; bool started;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -45,8 +45,7 @@ class Service11TelecommandScheduling final : public PusServiceBase {
HasReturnvaluesIF::makeReturnCode(CLASS_ID, 3); HasReturnvaluesIF::makeReturnCode(CLASS_ID, 3);
// The types of PUS-11 subservices // The types of PUS-11 subservices
enum Subservice : uint8_t { enum [[maybe_unused]] Subservice : uint8_t{ENABLE_SCHEDULING = 1,
ENABLE_SCHEDULING = 1,
DISABLE_SCHEDULING = 2, DISABLE_SCHEDULING = 2,
RESET_SCHEDULING = 3, RESET_SCHEDULING = 3,
INSERT_ACTIVITY = 4, INSERT_ACTIVITY = 4,
@ -56,8 +55,7 @@ class Service11TelecommandScheduling final : public PusServiceBase {
FILTER_TIMESHIFT_ACTIVITY = 8, FILTER_TIMESHIFT_ACTIVITY = 8,
DETAIL_REPORT = 9, DETAIL_REPORT = 9,
TIMEBASE_SCHEDULE_DETAIL_REPORT = 10, TIMEBASE_SCHEDULE_DETAIL_REPORT = 10,
TIMESHIFT_ALL_SCHEDULE_ACTIVITIES = 15 TIMESHIFT_ALL_SCHEDULE_ACTIVITIES = 15};
};
// The types of time windows for TC[11,6] and TC[11,8], as defined in ECSS-E-ST-70-41C, // The types of time windows for TC[11,6] and TC[11,8], as defined in ECSS-E-ST-70-41C,
// requirement 8.11.3c (p. 507) // requirement 8.11.3c (p. 507)
@ -73,7 +71,7 @@ class Service11TelecommandScheduling final : public PusServiceBase {
uint16_t releaseTimeMarginSeconds = DEFAULT_RELEASE_TIME_MARGIN, uint16_t releaseTimeMarginSeconds = DEFAULT_RELEASE_TIME_MARGIN,
bool debugMode = false); bool debugMode = false);
~Service11TelecommandScheduling(); ~Service11TelecommandScheduling() override;
/** PusServiceBase overrides */ /** PusServiceBase overrides */
ReturnValue_t handleRequest(uint8_t subservice) override; ReturnValue_t handleRequest(uint8_t subservice) override;
@ -82,8 +80,8 @@ class Service11TelecommandScheduling final : public PusServiceBase {
private: private:
struct TelecommandStruct { struct TelecommandStruct {
uint64_t requestId; uint64_t requestId{};
uint32_t seconds; uint32_t seconds{};
store_address_t storeAddr; // uint16 store_address_t storeAddr; // uint16
}; };
@ -92,9 +90,6 @@ class Service11TelecommandScheduling final : public PusServiceBase {
// minimum release time offset to insert into schedule // minimum release time offset to insert into schedule
const uint16_t RELEASE_TIME_MARGIN_SECONDS = 5; 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;
bool debugMode = false; bool debugMode = false;
StorageManagerIF* tcStore = nullptr; StorageManagerIF* tcStore = nullptr;
AcceptsTelecommandsIF* tcRecipient = nullptr; AcceptsTelecommandsIF* tcRecipient = nullptr;
@ -139,17 +134,6 @@ class Service11TelecommandScheduling final : public PusServiceBase {
*/ */
ReturnValue_t doFilterTimeshiftActivity(const uint8_t* data, size_t size); 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 * @brief Extracts the Request ID from the Application Data of a TC by utilizing a ctor of the
* class TcPacketPus. * class TcPacketPus.
@ -177,7 +161,7 @@ class Service11TelecommandScheduling final : public PusServiceBase {
* @param ssc Source Sequence Count * @param ssc Source Sequence Count
* @return Request ID * @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 * @brief Gets the filter range for filter TCs from a data packet
@ -194,7 +178,7 @@ class Service11TelecommandScheduling final : public PusServiceBase {
/** /**
* @brief Prints content of multimap. Use for simple debugging only. * @brief Prints content of multimap. Use for simple debugging only.
*/ */
void debugPrintMultimapContent(void) const; void debugPrintMultimapContent() const;
}; };
#include "Service11TelecommandScheduling.tpp" #include "Service11TelecommandScheduling.tpp"

View File

@ -1,11 +1,12 @@
#pragma once #pragma once
#include <fsfw/objectmanager/ObjectManager.h>
#include <fsfw/serialize/SerializeAdapter.h>
#include <fsfw/tmtcservices/AcceptsTelecommandsIF.h>
#include <cstddef> #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; static constexpr auto DEF_END = SerializeIF::Endianness::BIG;
template <size_t MAX_NUM_TCS> template <size_t MAX_NUM_TCS>
@ -18,7 +19,7 @@ inline Service11TelecommandScheduling<MAX_NUM_TCS>::Service11TelecommandScheduli
tcRecipient(tcRecipient) {} tcRecipient(tcRecipient) {}
template <size_t MAX_NUM_TCS> 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> template <size_t MAX_NUM_TCS>
inline ReturnValue_t Service11TelecommandScheduling<MAX_NUM_TCS>::handleRequest( inline ReturnValue_t Service11TelecommandScheduling<MAX_NUM_TCS>::handleRequest(
@ -116,8 +117,6 @@ template <size_t MAX_NUM_TCS>
inline ReturnValue_t Service11TelecommandScheduling<MAX_NUM_TCS>::doInsertActivity( inline ReturnValue_t Service11TelecommandScheduling<MAX_NUM_TCS>::doInsertActivity(
const uint8_t *data, size_t size) { const uint8_t *data, size_t size) {
uint32_t timestamp = 0; uint32_t timestamp = 0;
const uint8_t *initData = data;
size_t initSz = size;
ReturnValue_t result = SerializeAdapter::deSerialize(&timestamp, &data, &size, DEF_END); ReturnValue_t result = SerializeAdapter::deSerialize(&timestamp, &data, &size, DEF_END);
if (result != RETURN_OK) { if (result != RETURN_OK) {
return result; return result;
@ -142,7 +141,7 @@ inline ReturnValue_t Service11TelecommandScheduling<MAX_NUM_TCS>::doInsertActivi
// store currentPacket and receive the store address // store currentPacket and receive the store address
store_address_t addr{}; 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) { addr.raw == storeId::INVALID_STORE_ADDRESS) {
#if FSFW_CPP_OSTREAM_ENABLED == 1 #if FSFW_CPP_OSTREAM_ENABLED == 1
sif::error << "Service11TelecommandScheduling::doInsertActivity: Adding data to TC Store failed" sif::error << "Service11TelecommandScheduling::doInsertActivity: Adding data to TC Store failed"
@ -404,7 +403,6 @@ inline ReturnValue_t Service11TelecommandScheduling<MAX_NUM_TCS>::doFilterTimesh
// and then insert it again as new entry // and then insert it again as new entry
telecommandMap.insert(std::make_pair(tempKey, tempTc)); telecommandMap.insert(std::make_pair(tempKey, tempTc));
shiftedItemsCount++; shiftedItemsCount++;
continue;
} }
if (debugMode) { if (debugMode) {
@ -463,9 +461,9 @@ template <size_t MAX_NUM_TCS>
inline uint64_t Service11TelecommandScheduling<MAX_NUM_TCS>::buildRequestId(uint32_t sourceId, inline uint64_t Service11TelecommandScheduling<MAX_NUM_TCS>::buildRequestId(uint32_t sourceId,
uint16_t apid, uint16_t apid,
uint16_t ssc) const { uint16_t ssc) const {
uint64_t sourceId64 = static_cast<uint64_t>(sourceId); auto sourceId64 = static_cast<uint64_t>(sourceId);
uint64_t apid64 = static_cast<uint64_t>(apid); auto apid64 = static_cast<uint64_t>(apid);
uint64_t ssc64 = static_cast<uint64_t>(ssc); auto ssc64 = static_cast<uint64_t>(ssc);
return (sourceId64 << 32) | (apid64 << 16) | ssc64; return (sourceId64 << 32) | (apid64 << 16) | ssc64;
} }
@ -483,7 +481,7 @@ inline ReturnValue_t Service11TelecommandScheduling<MAX_NUM_TCS>::getMapFilterFr
if (typeRaw > 3) { if (typeRaw > 3) {
return INVALID_TYPE_TIME_WINDOW; 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, // we now have the type of delete activity - so now we set the range to delete,
// according to the type of time window. // according to the type of time window.
@ -558,7 +556,10 @@ inline ReturnValue_t Service11TelecommandScheduling<MAX_NUM_TCS>::getMapFilterFr
// additional security check, this should never be true // additional security check, this should never be true
if (itBegin->first > itEnd->first) { if (itBegin->first > itEnd->first) {
#if FSFW_CPP_OSTREAM_ENABLED == 1
#else
sif::printError("11::GetMapFilterFromData: itBegin > itEnd\n"); sif::printError("11::GetMapFilterFromData: itBegin > itEnd\n");
#endif
return RETURN_FAILED; return RETURN_FAILED;
} }
@ -580,19 +581,22 @@ inline ReturnValue_t Service11TelecommandScheduling<MAX_NUM_TCS>::handleInvalidD
} }
template <size_t MAX_NUM_TCS> template <size_t MAX_NUM_TCS>
inline void Service11TelecommandScheduling<MAX_NUM_TCS>::debugPrintMultimapContent(void) const { inline void Service11TelecommandScheduling<MAX_NUM_TCS>::debugPrintMultimapContent() const {
for (const auto &dit : telecommandMap) {
#if FSFW_DISABLE_PRINTOUT == 0 #if FSFW_DISABLE_PRINTOUT == 0
#if FSFW_CPP_OSTREAM_ENABLED == 1 #if FSFW_CPP_OSTREAM_ENABLED == 1
sif::debug << "Service11TelecommandScheduling::debugPrintMultimapContent: Multimap Content" sif::debug << "Service11TelecommandScheduling::debugPrintMultimapContent: Multimap Content"
<< std::endl; << std::endl;
sif::debug << "[" << dit->first << "]: Request ID: " << dit->second.requestId << " | " sif::debug << "[" << dit.first << "]: Request ID: " << dit.second.requestId << " | "
<< "Store Address: " << dit->second.storeAddr << std::endl; << "Store Address: " << dit.second.storeAddr.raw << std::endl;
#else #else
sif::printDebug("Service11TelecommandScheduling::debugPrintMultimapContent: Multimap Content\n"); sif::printDebug(
"Service11TelecommandScheduling::debugPrintMultimapContent: Multimap Content\n");
for (auto dit = telecommandMap.begin(); dit != telecommandMap.end(); ++dit) { for (auto dit = telecommandMap.begin(); dit != telecommandMap.end(); ++dit) {
sif::printDebug("[%d]: Request ID: %d | Store Address: %d\n", dit->first, sif::printDebug("[%d]: Request ID: %d | Store Address: %d\n", dit->first,
dit->second.requestId, dit->second.storeAddr); dit->second.requestId, dit->second.storeAddr);
} }
#endif #endif
#endif #endif
}
} }

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,6 +1,3 @@
target_sources(${LIB_FSFW_NAME} target_sources(${LIB_FSFW_NAME} PRIVATE FixedSequenceSlot.cpp
PRIVATE
FixedSequenceSlot.cpp
FixedSlotSequence.cpp FixedSlotSequence.cpp
PeriodicTaskBase.cpp PeriodicTaskBase.cpp)
)

View File

@ -1,9 +1,4 @@
target_sources(${LIB_FSFW_NAME} PRIVATE target_sources(
CCSDSDistributor.cpp ${LIB_FSFW_NAME}
PUSDistributor.cpp PRIVATE CCSDSDistributor.cpp PUSDistributor.cpp TcDistributor.cpp
TcDistributor.cpp TcPacketCheckPUS.cpp TcPacketCheckCFDP.cpp CFDPDistributor.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), tcStatus(RETURN_FAILED),
packetSource(setPacketSource) {} packetSource(setPacketSource) {}
PUSDistributor::~PUSDistributor() {} PUSDistributor::~PUSDistributor() = default;
PUSDistributor::TcMqMapIter PUSDistributor::selectDestination() { PUSDistributor::TcMqMapIter PUSDistributor::selectDestination() {
#if FSFW_CPP_OSTREAM_ENABLED == 1 && PUS_DISTRIBUTOR_DEBUGGING == 1 #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 << ", " sif::debug << "PUSDistributor::handlePacket received: " << storeId.poolIndex << ", "
<< storeId.packetIndex << std::endl; << storeId.packetIndex << std::endl;
#endif #endif
TcMqMapIter queueMapIt = this->queueMap.end(); auto queueMapIt = this->queueMap.end();
if (this->currentPacket == nullptr) { if (this->currentPacket == nullptr) {
return queueMapIt; return queueMapIt;
} }
@ -49,9 +49,7 @@ PUSDistributor::TcMqMapIter PUSDistributor::selectDestination() {
<< " error" << std::endl; << " error" << std::endl;
#else #else
sif::printWarning( sif::printWarning(
"PUSDistributor::handlePacket: Packet format invalid, " "PUSDistributor::handlePacket: Packet format invalid, %s error\n", keyword);
"%s error\n",
keyword);
#endif #endif
#endif #endif
} }
@ -133,7 +131,7 @@ ReturnValue_t PUSDistributor::initialize() {
return ObjectManagerIF::CHILD_INIT_FAILED; return ObjectManagerIF::CHILD_INIT_FAILED;
} }
CCSDSDistributorIF* ccsdsDistributor = auto* ccsdsDistributor =
ObjectManager::instance()->get<CCSDSDistributorIF>(packetSource); ObjectManager::instance()->get<CCSDSDistributorIF>(packetSource);
if (ccsdsDistributor == nullptr) { if (ccsdsDistributor == nullptr) {
#if FSFW_CPP_OSTREAM_ENABLED == 1 #if FSFW_CPP_OSTREAM_ENABLED == 1

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -6,20 +6,20 @@
#include "fsfw/objectmanager/frameworkObjects.h" #include "fsfw/objectmanager/frameworkObjects.h"
#include "fsfw/serviceinterface/ServiceInterface.h" #include "fsfw/serviceinterface/ServiceInterface.h"
StorageManagerIF* TcPacketStoredBase::store = nullptr; StorageManagerIF* TcPacketStoredBase::STORE = nullptr;
TcPacketStoredBase::TcPacketStoredBase() { TcPacketStoredBase::TcPacketStoredBase() {
this->storeAddress.raw = StorageManagerIF::INVALID_ADDRESS; 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) { 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 (result != HasReturnvaluesIF::RETURN_OK) {
#if FSFW_CPP_OSTREAM_ENABLED == 1 #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 #else
sif::printWarning("TcPacketStoredBase: Could not get data!\n"); sif::printWarning("TcPacketStoredBase: Could not get data!\n");
#endif #endif
@ -28,11 +28,13 @@ ReturnValue_t TcPacketStoredBase::getData(const uint8_t** dataPtr, size_t* dataS
} }
bool TcPacketStoredBase::checkAndSetStore() { bool TcPacketStoredBase::checkAndSetStore() {
if (this->store == nullptr) { if (TcPacketStoredBase::STORE == nullptr) {
this->store = ObjectManager::instance()->get<StorageManagerIF>(objects::TC_STORE); TcPacketStoredBase::STORE = ObjectManager::instance()->get<StorageManagerIF>(objects::TC_STORE);
if (this->store == nullptr) { if (TcPacketStoredBase::STORE == nullptr) {
#if FSFW_CPP_OSTREAM_ENABLED == 1 #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 #endif
return false; return false;
} }
@ -47,7 +49,7 @@ void TcPacketStoredBase::setStoreAddress(store_address_t setAddress,
size_t tempSize; size_t tempSize;
ReturnValue_t status = StorageManagerIF::RETURN_FAILED; ReturnValue_t status = StorageManagerIF::RETURN_FAILED;
if (this->checkAndSetStore()) { if (this->checkAndSetStore()) {
status = this->store->getData(this->storeAddress, &tempData, &tempSize); status = TcPacketStoredBase::STORE->getData(this->storeAddress, &tempData, &tempSize);
} }
if (status == StorageManagerIF::RETURN_OK) { 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. * call tries to set it and throws an error message in case of failures.
* The default store is objects::TC_STORE. * 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. * 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. * @return @li @c true if the store is linked or could be created.
* @li @c false otherwise. * @li @c false otherwise.
*/ */
bool checkAndSetStore(); static bool checkAndSetStore();
}; };
#endif /* TMTCPACKET_PUS_TcPacketStoredBase_H_ */ #endif /* TMTCPACKET_PUS_TCPACKETSTORED_H_ */

View File

@ -9,7 +9,7 @@
class TcPacketStoredIF { class TcPacketStoredIF {
public: public:
virtual ~TcPacketStoredIF(){}; virtual ~TcPacketStoredIF()= default;;
/** /**
* With this call, the stored packet can be set to another packet in a store. This is useful * 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; uint8_t* pData = nullptr;
ReturnValue_t returnValue = ReturnValue_t returnValue =
this->store->getFreeElement(&this->storeAddress, (TC_PACKET_MIN_SIZE + size), &pData); this->STORE->getFreeElement(&this->storeAddress, (TC_PACKET_MIN_SIZE + size), &pData);
if (returnValue != this->store->RETURN_OK) { if (returnValue != this->STORE->RETURN_OK) {
#if FSFW_CPP_OSTREAM_ENABLED == 1 #if FSFW_CPP_OSTREAM_ENABLED == 1
sif::warning << "TcPacketStoredBase: Could not get free element from store!" << std::endl; sif::warning << "TcPacketStoredBase: Could not get free element from store!" << std::endl;
#endif #endif
@ -44,19 +44,19 @@ TcPacketStoredPus::TcPacketStoredPus(const uint8_t* data, size_t size) : TcPacke
return; return;
} }
if (this->checkAndSetStore()) { if (this->checkAndSetStore()) {
ReturnValue_t status = store->addData(&storeAddress, data, size); ReturnValue_t status = STORE->addData(&storeAddress, data, size);
if (status != HasReturnvaluesIF::RETURN_OK) { if (status != HasReturnvaluesIF::RETURN_OK) {
this->setData(nullptr, size); this->setData(nullptr, size);
} }
const uint8_t* storePtr = nullptr; const uint8_t* storePtr = nullptr;
// Repoint base data pointer to the data in the store. // 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); this->setData(const_cast<uint8_t*>(storePtr), size);
} }
} }
ReturnValue_t TcPacketStoredPus::deletePacket() { 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; this->storeAddress.raw = StorageManagerIF::INVALID_ADDRESS;
// To circumvent size checks // To circumvent size checks
this->setData(nullptr, -1); this->setData(nullptr, -1);
@ -68,7 +68,7 @@ TcPacketPusBase* TcPacketStoredPus::getPacketBase() { return this; }
bool TcPacketStoredPus::isSizeCorrect() { bool TcPacketStoredPus::isSizeCorrect() {
const uint8_t* temp_data = nullptr; const uint8_t* temp_data = nullptr;
size_t temp_size; 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 (status == StorageManagerIF::RETURN_OK) {
if (this->getFullSize() == temp_size) { if (this->getFullSize() == temp_size) {
return true; return true;

View File

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

View File

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