Merge remote-tracking branch 'upstream/development' into mueller/possible-ring-buffer-fix
This commit is contained in:
commit
45792e86b9
scripts
src
CMakeLists.txt
fsfw
CMakeLists.txt
action
cfdp
container
controller
coordinates
datalinklayer
datapool
datapoollocal
devicehandlers
events
fdir
globalfunctions
health
housekeeping
internalerror
ipc
memory
modes
monitoring
objectmanager
osal
parameters
power
pus
CMakeLists.txtService11TelecommandScheduling.hService11TelecommandScheduling.tppService5EventReporting.cpp
rmap
serialize
serviceinterface
storagemanager
subsystem
tasks
tcdistribution
thermal
timemanager
tmstorage
tmtcpacket
tmtcservices
@ -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
|
||||
|
@ -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)
|
||||
|
@ -1,6 +1,4 @@
|
||||
target_sources(${LIB_FSFW_NAME} PRIVATE
|
||||
version.cpp
|
||||
)
|
||||
target_sources(${LIB_FSFW_NAME} PRIVATE version.cpp)
|
||||
|
||||
# Core
|
||||
|
||||
@ -37,22 +35,22 @@ add_subdirectory(tmtcservices)
|
||||
# Optional
|
||||
|
||||
if(FSFW_ADD_MONITORING)
|
||||
add_subdirectory(monitoring)
|
||||
add_subdirectory(monitoring)
|
||||
endif()
|
||||
if(FSFW_ADD_PUS)
|
||||
add_subdirectory(pus)
|
||||
add_subdirectory(pus)
|
||||
endif()
|
||||
if(FSFW_ADD_TMSTORAGE)
|
||||
add_subdirectory(tmstorage)
|
||||
add_subdirectory(tmstorage)
|
||||
endif()
|
||||
if(FSFW_ADD_COORDINATES)
|
||||
add_subdirectory(coordinates)
|
||||
add_subdirectory(coordinates)
|
||||
endif()
|
||||
if(FSFW_ADD_RMAP)
|
||||
add_subdirectory(rmap)
|
||||
add_subdirectory(rmap)
|
||||
endif()
|
||||
if(FSFW_ADD_DATALINKLAYER)
|
||||
add_subdirectory(datalinklayer)
|
||||
add_subdirectory(datalinklayer)
|
||||
endif()
|
||||
|
||||
# OSAL
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
@ -1,32 +1,30 @@
|
||||
target_sources(${LIB_FSFW_NAME} PRIVATE
|
||||
PduConfig.cpp
|
||||
VarLenField.cpp
|
||||
HeaderSerializer.cpp
|
||||
HeaderDeserializer.cpp
|
||||
FileDirectiveDeserializer.cpp
|
||||
FileDirectiveSerializer.cpp
|
||||
|
||||
AckInfo.cpp
|
||||
AckPduSerializer.cpp
|
||||
AckPduDeserializer.cpp
|
||||
EofInfo.cpp
|
||||
EofPduSerializer.cpp
|
||||
EofPduDeserializer.cpp
|
||||
NakInfo.cpp
|
||||
NakPduSerializer.cpp
|
||||
NakPduDeserializer.cpp
|
||||
FinishedInfo.cpp
|
||||
FinishedPduSerializer.cpp
|
||||
FinishedPduDeserializer.cpp
|
||||
MetadataInfo.cpp
|
||||
MetadataPduSerializer.cpp
|
||||
MetadataPduDeserializer.cpp
|
||||
KeepAlivePduSerializer.cpp
|
||||
KeepAlivePduDeserializer.cpp
|
||||
PromptPduSerializer.cpp
|
||||
PromptPduDeserializer.cpp
|
||||
|
||||
FileDataSerializer.cpp
|
||||
FileDataDeserializer.cpp
|
||||
FileDataInfo.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
|
||||
EofInfo.cpp
|
||||
EofPduSerializer.cpp
|
||||
EofPduDeserializer.cpp
|
||||
NakInfo.cpp
|
||||
NakPduSerializer.cpp
|
||||
NakPduDeserializer.cpp
|
||||
FinishedInfo.cpp
|
||||
FinishedPduSerializer.cpp
|
||||
FinishedPduDeserializer.cpp
|
||||
MetadataInfo.cpp
|
||||
MetadataPduSerializer.cpp
|
||||
MetadataPduDeserializer.cpp
|
||||
KeepAlivePduSerializer.cpp
|
||||
KeepAlivePduDeserializer.cpp
|
||||
PromptPduSerializer.cpp
|
||||
PromptPduDeserializer.cpp
|
||||
FileDataSerializer.cpp
|
||||
FileDataDeserializer.cpp
|
||||
FileDataInfo.cpp)
|
||||
|
@ -1,10 +1,10 @@
|
||||
target_sources(${LIB_FSFW_NAME} PRIVATE
|
||||
EntityIdTlv.cpp
|
||||
FilestoreRequestTlv.cpp
|
||||
FilestoreResponseTlv.cpp
|
||||
Lv.cpp
|
||||
Tlv.cpp
|
||||
FlowLabelTlv.cpp
|
||||
MessageToUserTlv.cpp
|
||||
FaultHandlerOverrideTlv.cpp
|
||||
)
|
||||
target_sources(
|
||||
${LIB_FSFW_NAME}
|
||||
PRIVATE EntityIdTlv.cpp
|
||||
FilestoreRequestTlv.cpp
|
||||
FilestoreResponseTlv.cpp
|
||||
Lv.cpp
|
||||
Tlv.cpp
|
||||
FlowLabelTlv.cpp
|
||||
MessageToUserTlv.cpp
|
||||
FaultHandlerOverrideTlv.cpp)
|
||||
|
@ -1,5 +1,2 @@
|
||||
target_sources(${LIB_FSFW_NAME}
|
||||
PRIVATE
|
||||
SharedRingBuffer.cpp
|
||||
SimpleRingBuffer.cpp
|
||||
)
|
||||
target_sources(${LIB_FSFW_NAME} PRIVATE SharedRingBuffer.cpp
|
||||
SimpleRingBuffer.cpp)
|
||||
|
@ -1,4 +1,2 @@
|
||||
target_sources(${LIB_FSFW_NAME} PRIVATE
|
||||
ControllerBase.cpp
|
||||
ExtendedControllerBase.cpp
|
||||
)
|
||||
target_sources(${LIB_FSFW_NAME} PRIVATE ControllerBase.cpp
|
||||
ExtendedControllerBase.cpp)
|
||||
|
@ -1,5 +1,2 @@
|
||||
target_sources(${LIB_FSFW_NAME}
|
||||
PRIVATE
|
||||
CoordinateTransformations.cpp
|
||||
Sgp4Propagator.cpp
|
||||
)
|
||||
target_sources(${LIB_FSFW_NAME} PRIVATE CoordinateTransformations.cpp
|
||||
Sgp4Propagator.cpp)
|
||||
|
@ -1,12 +1,11 @@
|
||||
target_sources(${LIB_FSFW_NAME}
|
||||
PRIVATE
|
||||
Clcw.cpp
|
||||
DataLinkLayer.cpp
|
||||
Farm1StateLockout.cpp
|
||||
Farm1StateOpen.cpp
|
||||
Farm1StateWait.cpp
|
||||
MapPacketExtraction.cpp
|
||||
TcTransferFrame.cpp
|
||||
TcTransferFrameLocal.cpp
|
||||
VirtualChannelReception.cpp
|
||||
)
|
||||
target_sources(
|
||||
${LIB_FSFW_NAME}
|
||||
PRIVATE Clcw.cpp
|
||||
DataLinkLayer.cpp
|
||||
Farm1StateLockout.cpp
|
||||
Farm1StateOpen.cpp
|
||||
Farm1StateWait.cpp
|
||||
MapPacketExtraction.cpp
|
||||
TcTransferFrame.cpp
|
||||
TcTransferFrameLocal.cpp
|
||||
VirtualChannelReception.cpp)
|
||||
|
@ -1,4 +1 @@
|
||||
target_sources(${LIB_FSFW_NAME} PRIVATE
|
||||
PoolDataSetBase.cpp
|
||||
PoolEntry.cpp
|
||||
)
|
||||
target_sources(${LIB_FSFW_NAME} PRIVATE PoolDataSetBase.cpp PoolEntry.cpp)
|
||||
|
@ -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)
|
||||
add_subdirectory(internal)
|
||||
|
@ -1,5 +1,2 @@
|
||||
target_sources(${LIB_FSFW_NAME}
|
||||
PRIVATE
|
||||
HasLocalDpIFUserAttorney.cpp
|
||||
HasLocalDpIFManagerAttorney.cpp
|
||||
)
|
||||
target_sources(${LIB_FSFW_NAME} PRIVATE HasLocalDpIFUserAttorney.cpp
|
||||
HasLocalDpIFManagerAttorney.cpp)
|
||||
|
@ -1,11 +1,10 @@
|
||||
target_sources(${LIB_FSFW_NAME}
|
||||
PRIVATE
|
||||
AssemblyBase.cpp
|
||||
ChildHandlerBase.cpp
|
||||
ChildHandlerFDIR.cpp
|
||||
DeviceHandlerBase.cpp
|
||||
DeviceHandlerFailureIsolation.cpp
|
||||
DeviceHandlerMessage.cpp
|
||||
DeviceTmReportingWrapper.cpp
|
||||
HealthDevice.cpp
|
||||
)
|
||||
target_sources(
|
||||
${LIB_FSFW_NAME}
|
||||
PRIVATE AssemblyBase.cpp
|
||||
ChildHandlerBase.cpp
|
||||
ChildHandlerFDIR.cpp
|
||||
DeviceHandlerBase.cpp
|
||||
DeviceHandlerFailureIsolation.cpp
|
||||
DeviceHandlerMessage.cpp
|
||||
DeviceTmReportingWrapper.cpp
|
||||
HealthDevice.cpp)
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
@ -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,
|
||||
|
@ -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)
|
||||
|
@ -1,13 +1,12 @@
|
||||
target_sources(${LIB_FSFW_NAME}
|
||||
PRIVATE
|
||||
arrayprinter.cpp
|
||||
AsciiConverter.cpp
|
||||
CRC.cpp
|
||||
DleEncoder.cpp
|
||||
PeriodicOperationDivider.cpp
|
||||
timevalOperations.cpp
|
||||
Type.cpp
|
||||
bitutility.cpp
|
||||
)
|
||||
target_sources(
|
||||
${LIB_FSFW_NAME}
|
||||
PRIVATE arrayprinter.cpp
|
||||
AsciiConverter.cpp
|
||||
CRC.cpp
|
||||
DleEncoder.cpp
|
||||
PeriodicOperationDivider.cpp
|
||||
timevalOperations.cpp
|
||||
Type.cpp
|
||||
bitutility.cpp)
|
||||
|
||||
add_subdirectory(math)
|
||||
|
@ -1,4 +1 @@
|
||||
target_sources(${LIB_FSFW_NAME}
|
||||
PRIVATE
|
||||
QuaternionOperations.cpp
|
||||
)
|
||||
target_sources(${LIB_FSFW_NAME} PRIVATE QuaternionOperations.cpp)
|
||||
|
@ -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)
|
||||
|
@ -1,5 +1,2 @@
|
||||
target_sources(${LIB_FSFW_NAME}
|
||||
PRIVATE
|
||||
HousekeepingMessage.cpp
|
||||
PeriodicHousekeepingHelper.cpp
|
||||
)
|
||||
target_sources(${LIB_FSFW_NAME} PRIVATE HousekeepingMessage.cpp
|
||||
PeriodicHousekeepingHelper.cpp)
|
||||
|
@ -1,4 +1 @@
|
||||
target_sources(${LIB_FSFW_NAME}
|
||||
PRIVATE
|
||||
InternalErrorReporter.cpp
|
||||
)
|
||||
target_sources(${LIB_FSFW_NAME} PRIVATE InternalErrorReporter.cpp)
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
@ -1,5 +1 @@
|
||||
target_sources(${LIB_FSFW_NAME}
|
||||
PRIVATE
|
||||
ModeHelper.cpp
|
||||
ModeMessage.cpp
|
||||
)
|
||||
target_sources(${LIB_FSFW_NAME} PRIVATE ModeHelper.cpp ModeMessage.cpp)
|
||||
|
@ -1,5 +1,2 @@
|
||||
target_sources(${LIB_FSFW_NAME}
|
||||
PRIVATE
|
||||
LimitViolationReporter.cpp
|
||||
MonitoringMessage.cpp
|
||||
)
|
||||
target_sources(${LIB_FSFW_NAME} PRIVATE LimitViolationReporter.cpp
|
||||
MonitoringMessage.cpp)
|
||||
|
@ -1,5 +1 @@
|
||||
target_sources(${LIB_FSFW_NAME}
|
||||
PRIVATE
|
||||
ObjectManager.cpp
|
||||
SystemObject.cpp
|
||||
)
|
||||
target_sources(${LIB_FSFW_NAME} PRIVATE ObjectManager.cpp SystemObject.cpp)
|
||||
|
@ -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,
|
||||
|
@ -1,35 +1,33 @@
|
||||
# Check the OS_FSFW variable
|
||||
if(FSFW_OSAL MATCHES "freertos")
|
||||
add_subdirectory(freertos)
|
||||
add_subdirectory(freertos)
|
||||
elseif(FSFW_OSAL MATCHES "rtems")
|
||||
add_subdirectory(rtems)
|
||||
add_subdirectory(rtems)
|
||||
elseif(FSFW_OSAL MATCHES "linux")
|
||||
add_subdirectory(linux)
|
||||
add_subdirectory(linux)
|
||||
elseif(FSFW_OSAL MATCHES "host")
|
||||
add_subdirectory(host)
|
||||
if (WIN32)
|
||||
add_subdirectory(windows)
|
||||
elseif(UNIX)
|
||||
# We still need to pull in some Linux specific sources
|
||||
target_sources(${LIB_FSFW_NAME} PUBLIC
|
||||
linux/tcpipHelpers.cpp
|
||||
)
|
||||
endif ()
|
||||
add_subdirectory(host)
|
||||
if(WIN32)
|
||||
add_subdirectory(windows)
|
||||
elseif(UNIX)
|
||||
# We still need to pull in some Linux specific sources
|
||||
target_sources(${LIB_FSFW_NAME} PUBLIC linux/tcpipHelpers.cpp)
|
||||
endif()
|
||||
|
||||
else()
|
||||
|
||||
message(WARNING "The OS_FSFW variable was not set. Assuming host OS..")
|
||||
# Not set. Assumuing this is a host build, try to determine host OS
|
||||
if (WIN32)
|
||||
add_subdirectory(host)
|
||||
add_subdirectory(windows)
|
||||
elseif (UNIX)
|
||||
add_subdirectory(linux)
|
||||
else ()
|
||||
# MacOS or other OSes have not been tested yet / are not supported.
|
||||
message(FATAL_ERROR "The host OS could not be determined! Aborting.")
|
||||
endif()
|
||||
message(WARNING "The OS_FSFW variable was not set. Assuming host OS..")
|
||||
# Not set. Assumuing this is a host build, try to determine host OS
|
||||
if(WIN32)
|
||||
add_subdirectory(host)
|
||||
add_subdirectory(windows)
|
||||
elseif(UNIX)
|
||||
add_subdirectory(linux)
|
||||
else()
|
||||
# MacOS or other OSes have not been tested yet / are not supported.
|
||||
message(FATAL_ERROR "The host OS could not be determined! Aborting.")
|
||||
endif()
|
||||
|
||||
endif()
|
||||
|
||||
add_subdirectory(common)
|
||||
add_subdirectory(common)
|
||||
|
@ -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
|
||||
)
|
||||
endif()
|
||||
target_link_libraries(${LIB_FSFW_NAME} PRIVATE wsock32 ws2_32)
|
||||
endif()
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -1,32 +1,30 @@
|
||||
target_sources(${LIB_FSFW_NAME}
|
||||
PRIVATE
|
||||
Clock.cpp
|
||||
FixedTimeslotTask.cpp
|
||||
BinarySemaphore.cpp
|
||||
BinSemaphUsingTask.cpp
|
||||
CountingSemaphore.cpp
|
||||
CountingSemaphUsingTask.cpp
|
||||
MessageQueue.cpp
|
||||
Mutex.cpp
|
||||
MutexFactory.cpp
|
||||
PeriodicTask.cpp
|
||||
QueueFactory.cpp
|
||||
SemaphoreFactory.cpp
|
||||
TaskFactory.cpp
|
||||
Timekeeper.cpp
|
||||
TaskManagement.cpp
|
||||
QueueMapManager.cpp
|
||||
)
|
||||
target_sources(
|
||||
${LIB_FSFW_NAME}
|
||||
PRIVATE Clock.cpp
|
||||
FixedTimeslotTask.cpp
|
||||
BinarySemaphore.cpp
|
||||
BinSemaphUsingTask.cpp
|
||||
CountingSemaphore.cpp
|
||||
CountingSemaphUsingTask.cpp
|
||||
MessageQueue.cpp
|
||||
Mutex.cpp
|
||||
MutexFactory.cpp
|
||||
PeriodicTask.cpp
|
||||
QueueFactory.cpp
|
||||
SemaphoreFactory.cpp
|
||||
TaskFactory.cpp
|
||||
Timekeeper.cpp
|
||||
TaskManagement.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
|
||||
# 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
|
||||
"LIB_OS_NAME is empty. Make sure to include the FreeRTOS header path properly."
|
||||
)
|
||||
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()
|
||||
|
@ -1,27 +1,23 @@
|
||||
target_sources(${LIB_FSFW_NAME} PRIVATE
|
||||
Clock.cpp
|
||||
FixedTimeslotTask.cpp
|
||||
MessageQueue.cpp
|
||||
Mutex.cpp
|
||||
MutexFactory.cpp
|
||||
PeriodicTask.cpp
|
||||
QueueFactory.cpp
|
||||
QueueMapManager.cpp
|
||||
SemaphoreFactory.cpp
|
||||
TaskFactory.cpp
|
||||
taskHelpers.cpp
|
||||
)
|
||||
target_sources(
|
||||
${LIB_FSFW_NAME}
|
||||
PRIVATE Clock.cpp
|
||||
FixedTimeslotTask.cpp
|
||||
MessageQueue.cpp
|
||||
Mutex.cpp
|
||||
MutexFactory.cpp
|
||||
PeriodicTask.cpp
|
||||
QueueFactory.cpp
|
||||
QueueMapManager.cpp
|
||||
SemaphoreFactory.cpp
|
||||
TaskFactory.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()
|
||||
endif()
|
||||
|
@ -1,29 +1,25 @@
|
||||
target_sources(${LIB_FSFW_NAME} PRIVATE
|
||||
Clock.cpp
|
||||
BinarySemaphore.cpp
|
||||
CountingSemaphore.cpp
|
||||
FixedTimeslotTask.cpp
|
||||
InternalErrorCodes.cpp
|
||||
MessageQueue.cpp
|
||||
Mutex.cpp
|
||||
MutexFactory.cpp
|
||||
PeriodicPosixTask.cpp
|
||||
PosixThread.cpp
|
||||
QueueFactory.cpp
|
||||
SemaphoreFactory.cpp
|
||||
TaskFactory.cpp
|
||||
tcpipHelpers.cpp
|
||||
unixUtility.cpp
|
||||
)
|
||||
target_sources(
|
||||
${LIB_FSFW_NAME}
|
||||
PRIVATE Clock.cpp
|
||||
BinarySemaphore.cpp
|
||||
CountingSemaphore.cpp
|
||||
FixedTimeslotTask.cpp
|
||||
InternalErrorCodes.cpp
|
||||
MessageQueue.cpp
|
||||
Mutex.cpp
|
||||
MutexFactory.cpp
|
||||
PeriodicPosixTask.cpp
|
||||
PosixThread.cpp
|
||||
QueueFactory.cpp
|
||||
SemaphoreFactory.cpp
|
||||
TaskFactory.cpp
|
||||
tcpipHelpers.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()
|
||||
|
@ -1,20 +1,17 @@
|
||||
target_sources(${LIB_FSFW_NAME}
|
||||
PRIVATE
|
||||
Clock.cpp
|
||||
CpuUsage.cpp
|
||||
InitTask.cpp
|
||||
InternalErrorCodes.cpp
|
||||
MessageQueue.cpp
|
||||
PeriodicTask.cpp
|
||||
Mutex.cpp
|
||||
MutexFactory.cpp
|
||||
FixedTimeslotTask.cpp
|
||||
QueueFactory.cpp
|
||||
RtemsBasic.cpp
|
||||
RTEMSTaskBase.cpp
|
||||
TaskFactory.cpp
|
||||
BinarySemaphore.cpp
|
||||
SemaphoreFactory.cpp
|
||||
)
|
||||
|
||||
|
||||
target_sources(
|
||||
${LIB_FSFW_NAME}
|
||||
PRIVATE Clock.cpp
|
||||
CpuUsage.cpp
|
||||
InitTask.cpp
|
||||
InternalErrorCodes.cpp
|
||||
MessageQueue.cpp
|
||||
PeriodicTask.cpp
|
||||
Mutex.cpp
|
||||
MutexFactory.cpp
|
||||
FixedTimeslotTask.cpp
|
||||
QueueFactory.cpp
|
||||
RtemsBasic.cpp
|
||||
RTEMSTaskBase.cpp
|
||||
TaskFactory.cpp
|
||||
BinarySemaphore.cpp
|
||||
SemaphoreFactory.cpp)
|
||||
|
@ -1,4 +1 @@
|
||||
target_sources(${LIB_FSFW_NAME} PRIVATE
|
||||
tcpipHelpers.cpp
|
||||
winTaskHelpers.cpp
|
||||
)
|
||||
target_sources(${LIB_FSFW_NAME} PRIVATE tcpipHelpers.cpp winTaskHelpers.cpp)
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
@ -3,9 +3,12 @@
|
||||
#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),
|
||||
healthHelper(this, objectId) {
|
||||
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();
|
||||
}
|
||||
|
||||
@ -25,12 +28,12 @@ ReturnValue_t PowerSwitcherComponent::performOperation(uint8_t opCode) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if(switcher.active()) {
|
||||
if (switcher.active()) {
|
||||
switcher.doStateMachine();
|
||||
auto currState = switcher.getState();
|
||||
if (currState == PowerSwitcher::SWITCH_IS_OFF) {
|
||||
setMode(MODE_OFF, 0);
|
||||
} else if(currState == PowerSwitcher::SWITCH_IS_ON) {
|
||||
} else if (currState == PowerSwitcher::SWITCH_IS_ON) {
|
||||
setMode(MODE_ON, 0);
|
||||
}
|
||||
}
|
||||
@ -39,19 +42,17 @@ ReturnValue_t PowerSwitcherComponent::performOperation(uint8_t opCode) {
|
||||
|
||||
ReturnValue_t PowerSwitcherComponent::initialize() {
|
||||
ReturnValue_t result = modeHelper.initialize();
|
||||
if(result != HasReturnvaluesIF::RETURN_OK) {
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
result = healthHelper.initialize();
|
||||
if(result != HasReturnvaluesIF::RETURN_OK) {
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
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;
|
||||
@ -64,25 +65,25 @@ ReturnValue_t PowerSwitcherComponent::setHealth(HealthState health) {
|
||||
}
|
||||
|
||||
ReturnValue_t PowerSwitcherComponent::checkModeCommand(Mode_t mode, Submode_t submode,
|
||||
uint32_t *msToReachTheMode) {
|
||||
uint32_t *msToReachTheMode) {
|
||||
*msToReachTheMode = 5000;
|
||||
if(mode != MODE_ON and mode != MODE_OFF) {
|
||||
if (mode != MODE_ON and mode != MODE_OFF) {
|
||||
return TRANS_NOT_ALLOWED;
|
||||
}
|
||||
return RETURN_OK;
|
||||
}
|
||||
|
||||
void PowerSwitcherComponent::startTransition(Mode_t mode, Submode_t submode) {
|
||||
if(mode == MODE_OFF) {
|
||||
if (mode == MODE_OFF) {
|
||||
switcher.turnOff(true);
|
||||
switcher.doStateMachine();
|
||||
if(switcher.getState() == PowerSwitcher::SWITCH_IS_OFF) {
|
||||
if (switcher.getState() == PowerSwitcher::SWITCH_IS_OFF) {
|
||||
setMode(MODE_OFF, 0);
|
||||
}
|
||||
} else if (mode == MODE_ON) {
|
||||
switcher.turnOn(true);
|
||||
switcher.doStateMachine();
|
||||
if(switcher.getState() == PowerSwitcher::SWITCH_IS_ON) {
|
||||
if (switcher.getState() == PowerSwitcher::SWITCH_IS_ON) {
|
||||
setMode(MODE_ON, 0);
|
||||
}
|
||||
}
|
||||
@ -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(); }
|
||||
|
@ -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,19 +22,17 @@ 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,
|
||||
public HasReturnvaluesIF,
|
||||
public ExecutableObjectIF,
|
||||
public HasModesIF,
|
||||
public HasHealthIF {
|
||||
public:
|
||||
PowerSwitcherComponent(object_id_t objectId, PowerSwitchIF* pwrSwitcher,
|
||||
power::Switch_t pwrSwitch);
|
||||
class PowerSwitcherComponent : public SystemObject,
|
||||
public HasReturnvaluesIF,
|
||||
public ExecutableObjectIF,
|
||||
public HasModesIF,
|
||||
public HasHealthIF {
|
||||
public:
|
||||
PowerSwitcherComponent(object_id_t objectId, PowerSwitchIF *pwrSwitcher,
|
||||
power::Switch_t pwrSwitch);
|
||||
|
||||
private:
|
||||
|
||||
MessageQueueIF* queue = nullptr;
|
||||
private:
|
||||
MessageQueueIF *queue = nullptr;
|
||||
PowerSwitcher switcher;
|
||||
|
||||
Mode_t mode = MODE_OFF;
|
||||
@ -52,7 +50,7 @@ private:
|
||||
MessageQueueId_t getCommandQueue() const override;
|
||||
void getMode(Mode_t *mode, Submode_t *submode) override;
|
||||
ReturnValue_t checkModeCommand(Mode_t mode, Submode_t submode,
|
||||
uint32_t *msToReachTheMode) override;
|
||||
uint32_t *msToReachTheMode) override;
|
||||
void startTransition(Mode_t mode, Submode_t submode) override;
|
||||
void setToExternalControl() override;
|
||||
void announceMode(bool recursive) override;
|
||||
|
@ -1,12 +1,12 @@
|
||||
target_sources(${LIB_FSFW_NAME} PRIVATE
|
||||
Service1TelecommandVerification.cpp
|
||||
Service2DeviceAccess.cpp
|
||||
Service3Housekeeping.cpp
|
||||
Service5EventReporting.cpp
|
||||
Service8FunctionManagement.cpp
|
||||
Service9TimeManagement.cpp
|
||||
Service17Test.cpp
|
||||
Service20ParameterManagement.cpp
|
||||
CService200ModeCommanding.cpp
|
||||
CService201HealthCommanding.cpp
|
||||
)
|
||||
target_sources(
|
||||
${LIB_FSFW_NAME}
|
||||
PRIVATE Service1TelecommandVerification.cpp
|
||||
Service2DeviceAccess.cpp
|
||||
Service3Housekeeping.cpp
|
||||
Service5EventReporting.cpp
|
||||
Service8FunctionManagement.cpp
|
||||
Service9TimeManagement.cpp
|
||||
Service17Test.cpp
|
||||
Service20ParameterManagement.cpp
|
||||
CService200ModeCommanding.cpp
|
||||
CService201HealthCommanding.cpp)
|
||||
|
@ -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"
|
||||
|
@ -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,41 +60,43 @@ 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) {
|
||||
// release tc
|
||||
TmTcMessage releaseMsg(it->second.storeAddr);
|
||||
auto sendRet = this->requestQueue->sendMessage(recipientMsgQueueId, &releaseMsg, false);
|
||||
if (schedulingEnabled) {
|
||||
// release tc
|
||||
TmTcMessage releaseMsg(it->second.storeAddr);
|
||||
auto sendRet = this->requestQueue->sendMessage(recipientMsgQueueId, &releaseMsg, false);
|
||||
|
||||
if (sendRet != HasReturnvaluesIF::RETURN_OK) {
|
||||
return sendRet;
|
||||
}
|
||||
|
||||
telecommandMap.erase(it++);
|
||||
|
||||
if (debugMode) {
|
||||
if (sendRet != HasReturnvaluesIF::RETURN_OK) {
|
||||
return sendRet;
|
||||
}
|
||||
if (debugMode) {
|
||||
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
||||
sif::info << "Released TC & erased it from TC map" << std::endl;
|
||||
sif::info << "Released TC & erased it from TC map" << std::endl;
|
||||
#else
|
||||
sif::printInfo("Released TC & erased it from TC map\n");
|
||||
sif::printInfo("Released TC & erased it from TC map\n");
|
||||
#endif
|
||||
}
|
||||
telecommandMap.erase(it++);
|
||||
} else if (deleteExpiredTcWhenDisabled) {
|
||||
telecommandMap.erase(it++);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
@ -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(×tamp, &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,19 +614,32 @@ 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 << "Service11TelecommandScheduling::debugPrintMultimapContent: Multimap Content"
|
||||
<< 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");
|
||||
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);
|
||||
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);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
#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;
|
||||
}
|
||||
|
@ -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
|
||||
|
@ -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)
|
||||
|
@ -1,4 +1 @@
|
||||
target_sources(${LIB_FSFW_NAME}
|
||||
PRIVATE
|
||||
SerialBufferAdapter.cpp
|
||||
)
|
||||
target_sources(${LIB_FSFW_NAME} PRIVATE SerialBufferAdapter.cpp)
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
add_subdirectory(modes)
|
||||
|
@ -1,5 +1 @@
|
||||
target_sources(${LIB_FSFW_NAME}
|
||||
PRIVATE
|
||||
ModeSequenceMessage.cpp
|
||||
ModeStore.cpp
|
||||
)
|
||||
target_sources(${LIB_FSFW_NAME} PRIVATE ModeSequenceMessage.cpp ModeStore.cpp)
|
||||
|
@ -1,5 +1,2 @@
|
||||
target_sources(${LIB_FSFW_NAME}
|
||||
PRIVATE
|
||||
FixedSequenceSlot.cpp
|
||||
FixedSlotSequence.cpp
|
||||
)
|
||||
target_sources(${LIB_FSFW_NAME} PRIVATE FixedSequenceSlot.cpp
|
||||
FixedSlotSequence.cpp)
|
||||
|
@ -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 {
|
||||
|
@ -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)
|
||||
|
@ -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,10 +48,8 @@ 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",
|
||||
keyword);
|
||||
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;
|
||||
|
@ -1,10 +1,9 @@
|
||||
target_sources(${LIB_FSFW_NAME}
|
||||
PRIVATE
|
||||
AbstractTemperatureSensor.cpp
|
||||
Heater.cpp
|
||||
RedundantHeater.cpp
|
||||
ThermalComponentCore.cpp
|
||||
ThermalComponent.cpp
|
||||
ThermalModule.cpp
|
||||
ThermalMonitorReporter.cpp
|
||||
)
|
||||
target_sources(
|
||||
${LIB_FSFW_NAME}
|
||||
PRIVATE AbstractTemperatureSensor.cpp
|
||||
Heater.cpp
|
||||
RedundantHeater.cpp
|
||||
ThermalComponentCore.cpp
|
||||
ThermalComponent.cpp
|
||||
ThermalModule.cpp
|
||||
ThermalMonitorReporter.cpp)
|
||||
|
@ -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)
|
||||
|
@ -1,4 +1 @@
|
||||
target_sources(${LIB_FSFW_NAME}
|
||||
PRIVATE
|
||||
TmStoreMessage.cpp
|
||||
)
|
||||
target_sources(${LIB_FSFW_NAME} PRIVATE TmStoreMessage.cpp)
|
||||
|
@ -1,8 +1,5 @@
|
||||
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)
|
||||
add_subdirectory(pus)
|
||||
add_subdirectory(pus)
|
||||
|
@ -1,4 +1 @@
|
||||
target_sources(${LIB_FSFW_NAME} PRIVATE
|
||||
CFDPPacket.cpp
|
||||
CFDPPacketStored.cpp
|
||||
)
|
||||
target_sources(${LIB_FSFW_NAME} PRIVATE CFDPPacket.cpp CFDPPacketStored.cpp)
|
||||
|
@ -1,4 +1 @@
|
||||
target_sources(${LIB_FSFW_NAME}
|
||||
PRIVATE
|
||||
PacketMatchTree.cpp
|
||||
)
|
||||
target_sources(${LIB_FSFW_NAME} PRIVATE PacketMatchTree.cpp)
|
||||
|
@ -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)
|
||||
|
@ -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) {
|
||||
|
@ -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_ */
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
|
@ -1,9 +1,9 @@
|
||||
target_sources(${LIB_FSFW_NAME} PRIVATE
|
||||
TmPacketStoredPusA.cpp
|
||||
TmPacketStoredPusC.cpp
|
||||
TmPacketPusA.cpp
|
||||
TmPacketPusC.cpp
|
||||
TmPacketStoredBase.cpp
|
||||
TmPacketBase.cpp
|
||||
TmPacketMinimal.cpp
|
||||
)
|
||||
target_sources(
|
||||
${LIB_FSFW_NAME}
|
||||
PRIVATE TmPacketStoredPusA.cpp
|
||||
TmPacketStoredPusC.cpp
|
||||
TmPacketPusA.cpp
|
||||
TmPacketPusC.cpp
|
||||
TmPacketStoredBase.cpp
|
||||
TmPacketBase.cpp
|
||||
TmPacketMinimal.cpp)
|
||||
|
@ -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
|
||||
|
@ -1,10 +1,9 @@
|
||||
target_sources(${LIB_FSFW_NAME}
|
||||
PRIVATE
|
||||
CommandingServiceBase.cpp
|
||||
PusServiceBase.cpp
|
||||
PusVerificationReport.cpp
|
||||
TmTcBridge.cpp
|
||||
TmTcMessage.cpp
|
||||
VerificationReporter.cpp
|
||||
SpacePacketParser.cpp
|
||||
)
|
||||
target_sources(
|
||||
${LIB_FSFW_NAME}
|
||||
PRIVATE CommandingServiceBase.cpp
|
||||
PusServiceBase.cpp
|
||||
PusVerificationReport.cpp
|
||||
TmTcBridge.cpp
|
||||
TmTcMessage.cpp
|
||||
VerificationReporter.cpp
|
||||
SpacePacketParser.cpp)
|
||||
|
Loading…
x
Reference in New Issue
Block a user