Merge remote-tracking branch 'upstream/mueller/master' into mueller/master
This commit is contained in:
commit
ce0f30f685
@ -10,6 +10,7 @@ endif()
|
||||
option(FSFW_WARNING_SHADOW_LOCAL_GCC "Enable -Wshadow=local warning in GCC" ON)
|
||||
# Options to exclude parts of the FSFW from compilation.
|
||||
option(FSFW_ADD_INTERNAL_TESTS "Add internal unit tests" ON)
|
||||
option(FSFW_ADD_HAL "Add Hardware Abstraction Layer" ON)
|
||||
|
||||
# Optional sources
|
||||
option(FSFW_ADD_PUS "Compile with PUS sources" ON)
|
||||
@ -21,7 +22,7 @@ option(FSFW_ADD_COORDINATES "Compile with coordinate components" OFF)
|
||||
option(FSFW_ADD_TMSTORAGE "Compile with tm storage components" OFF)
|
||||
|
||||
# Contrib sources
|
||||
option(FSFW_ADD_SPG4_PROPAGATOR "Add SPG4 propagator code" OFF)
|
||||
option(FSFW_ADD_SGP4_PROPAGATOR "Add SGP4 propagator code" OFF)
|
||||
|
||||
set(LIB_FSFW_NAME fsfw)
|
||||
add_library(${LIB_FSFW_NAME})
|
||||
@ -94,7 +95,9 @@ message(STATUS "Compiling FSFW for the ${OS_FSFW_NAME} operating system.")
|
||||
|
||||
add_subdirectory(src)
|
||||
add_subdirectory(tests)
|
||||
add_subdirectory(hal)
|
||||
if(FSFW_ADD_HAL)
|
||||
add_subdirectory(hal)
|
||||
endif()
|
||||
add_subdirectory(contrib)
|
||||
|
||||
# The project CMakeLists file has to set the FSFW_CONFIG_PATH and add it.
|
||||
|
@ -1,11 +1,9 @@
|
||||
if(FSFW_ADD_SPG4_PROPAGATOR)
|
||||
target_sources(${LIB_FSFW_NAME} PRIVATE
|
||||
sgp4/sgp4unit.cpp
|
||||
)
|
||||
target_include_directories(${LIB_FSFW_NAME} PRIVATE
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/sgp4
|
||||
)
|
||||
target_include_directories(${LIB_FSFW_NAME} INTERFACE
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/sgp4
|
||||
)
|
||||
endif()
|
||||
target_include_directories(${LIB_FSFW_NAME} PRIVATE
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
)
|
||||
|
||||
target_include_directories(${LIB_FSFW_NAME} INTERFACE
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
)
|
||||
|
||||
add_subdirectory(fsfw_contrib)
|
||||
|
11
contrib/fsfw_contrib/CMakeLists.txt
Normal file
11
contrib/fsfw_contrib/CMakeLists.txt
Normal file
@ -0,0 +1,11 @@
|
||||
if(FSFW_ADD_SGP4_PROPAGATOR)
|
||||
target_sources(${LIB_FSFW_NAME} PRIVATE
|
||||
sgp4/sgp4unit.cpp
|
||||
)
|
||||
target_include_directories(${LIB_FSFW_NAME} PRIVATE
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/sgp4
|
||||
)
|
||||
target_include_directories(${LIB_FSFW_NAME} INTERFACE
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/sgp4
|
||||
)
|
||||
endif()
|
@ -6,4 +6,4 @@ target_include_directories(${LIB_FSFW_NAME} INTERFACE
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
)
|
||||
|
||||
add_subdirectory(fsfw)
|
||||
add_subdirectory(fsfw_hal)
|
||||
|
@ -1 +0,0 @@
|
||||
add_subdirectory(hal)
|
@ -1,4 +1,4 @@
|
||||
#include "fsfw/hal/common/gpio/GpioCookie.h"
|
||||
#include "fsfw_hal/common/gpio/GpioCookie.h"
|
||||
#include "fsfw/serviceinterface/ServiceInterface.h"
|
||||
|
||||
GpioCookie::GpioCookie() {
|
@ -1,4 +1,4 @@
|
||||
#include "fsfw/hal/devicehandlers/GyroL3GD20Handler.h"
|
||||
#include "fsfw_hal/devicehandlers/GyroL3GD20Handler.h"
|
||||
|
||||
#include "fsfw/datapool/PoolReadGuard.h"
|
||||
|
@ -1,14 +1,14 @@
|
||||
#ifndef MISSION_DEVICES_GYROL3GD20HANDLER_H_
|
||||
#define MISSION_DEVICES_GYROL3GD20HANDLER_H_
|
||||
|
||||
#include "OBSWConfig.h"
|
||||
#include "fsfw/FSFW.h"
|
||||
#include "devicedefinitions/GyroL3GD20Definitions.h"
|
||||
|
||||
#include <fsfw/devicehandlers/DeviceHandlerBase.h>
|
||||
#include <fsfw/globalfunctions/PeriodicOperationDivider.h>
|
||||
|
||||
#ifndef FSFW_HAL_L3GD20_GYRO_DEBUG
|
||||
#define FSFW_HAL_L3GD20_GYRO_DEBUG 1
|
||||
#define FSFW_HAL_L3GD20_GYRO_DEBUG 0
|
||||
#endif /* FSFW_HAL_L3GD20_GYRO_DEBUG */
|
||||
|
||||
/**
|
@ -1,4 +1,4 @@
|
||||
#include "fsfw/hal/linux/UnixFileGuard.h"
|
||||
#include "fsfw_hal/linux/UnixFileGuard.h"
|
||||
|
||||
UnixFileGuard::UnixFileGuard(std::string device, int* fileDescriptor, int flags,
|
||||
std::string diagnosticPrefix):
|
@ -1,6 +1,6 @@
|
||||
#include "fsfw/hal/linux/gpio/LinuxLibgpioIF.h"
|
||||
#include "fsfw/hal/common/gpio/gpioDefinitions.h"
|
||||
#include "fsfw/hal/common/gpio/GpioCookie.h"
|
||||
#include "fsfw_hal/linux/gpio/LinuxLibgpioIF.h"
|
||||
#include "fsfw_hal/common/gpio/gpioDefinitions.h"
|
||||
#include "fsfw_hal/common/gpio/GpioCookie.h"
|
||||
|
||||
#include <fsfw/serviceinterface/ServiceInterface.h>
|
||||
|
@ -1,6 +1,6 @@
|
||||
#include "fsfw/hal/linux/i2c/I2cComIF.h"
|
||||
#include "fsfw/hal/linux/utility.h"
|
||||
#include "fsfw/hal/linux/UnixFileGuard.h"
|
||||
#include "fsfw_hal/linux/i2c/I2cComIF.h"
|
||||
#include "fsfw_hal/linux/utility.h"
|
||||
#include "fsfw_hal/linux/UnixFileGuard.h"
|
||||
|
||||
#include "fsfw/serviceinterface/ServiceInterface.h"
|
||||
|
@ -1,4 +1,4 @@
|
||||
#include "fsfw/hal/linux/i2c/I2cCookie.h"
|
||||
#include "fsfw_hal/linux/i2c/I2cCookie.h"
|
||||
|
||||
I2cCookie::I2cCookie(address_t i2cAddress_, size_t maxReplyLen_,
|
||||
std::string deviceFile_) :
|
@ -1,7 +1,7 @@
|
||||
#include "fsfw/FSFW.h"
|
||||
|
||||
#include "fsfw/hal/linux/rpi/GpioRPi.h"
|
||||
#include "fsfw/hal/common/gpio/GpioCookie.h"
|
||||
#include "fsfw_hal/linux/rpi/GpioRPi.h"
|
||||
#include "fsfw_hal/common/gpio/GpioCookie.h"
|
||||
|
||||
#include <fsfw/serviceinterface/ServiceInterface.h>
|
||||
|
@ -1,8 +1,8 @@
|
||||
#include "fsfw/FSFW.h"
|
||||
#include "fsfw/hal/linux/spi/SpiComIF.h"
|
||||
#include "fsfw/hal/linux/spi/SpiCookie.h"
|
||||
#include "fsfw/hal/linux/utility.h"
|
||||
#include "fsfw/hal/linux/UnixFileGuard.h"
|
||||
#include "fsfw_hal/linux/spi/SpiComIF.h"
|
||||
#include "fsfw_hal/linux/spi/SpiCookie.h"
|
||||
#include "fsfw_hal/linux/utility.h"
|
||||
#include "fsfw_hal/linux/UnixFileGuard.h"
|
||||
|
||||
#include <fsfw/ipc/MutexFactory.h>
|
||||
#include <fsfw/globalfunctions/arrayprinter.h>
|
@ -3,7 +3,7 @@
|
||||
|
||||
#include "spiDefinitions.h"
|
||||
#include "returnvalues/classIds.h"
|
||||
#include "fsfw/hal/common/gpio/GpioIF.h"
|
||||
#include "fsfw_hal/common/gpio/GpioIF.h"
|
||||
|
||||
#include "fsfw/devicehandlers/DeviceCommunicationIF.h"
|
||||
#include "fsfw/objectmanager/SystemObject.h"
|
@ -1,4 +1,4 @@
|
||||
#include "fsfw/hal/linux/spi/SpiCookie.h"
|
||||
#include "fsfw_hal/linux/spi/SpiCookie.h"
|
||||
|
||||
SpiCookie::SpiCookie(address_t spiAddress, gpioId_t chipSelect, std::string spiDev,
|
||||
const size_t maxSize, spi::SpiModes spiMode, uint32_t spiSpeed):
|
@ -1,4 +1,4 @@
|
||||
#include "fsfw/hal/linux/uart/UartComIF.h"
|
||||
#include "fsfw_hal/linux/uart/UartComIF.h"
|
||||
#include "OBSWConfig.h"
|
||||
|
||||
#include "fsfw/serviceinterface/ServiceInterface.h"
|
@ -1,4 +1,4 @@
|
||||
#include "fsfw/hal/linux/uart/UartCookie.h"
|
||||
#include "fsfw_hal/linux/uart/UartCookie.h"
|
||||
|
||||
#include <fsfw/serviceinterface/ServiceInterface.h>
|
||||
|
@ -1,6 +1,6 @@
|
||||
#include "fsfw/FSFW.h"
|
||||
#include "fsfw/serviceinterface/ServiceInterface.h"
|
||||
#include "fsfw/hal/linux/utility.h"
|
||||
#include "fsfw_hal/linux/utility.h"
|
||||
|
||||
#include <cerrno>
|
||||
#include <cstring>
|
@ -1,10 +1,10 @@
|
||||
#include "fsfw/hal/stm32h7/devicetest/GyroL3GD20H.h"
|
||||
#include "fsfw_hal/stm32h7/devicetest/GyroL3GD20H.h"
|
||||
|
||||
#include "fsfw/hal/stm32h7/spi/mspInit.h"
|
||||
#include "fsfw/hal/stm32h7/spi/spiDefinitions.h"
|
||||
#include "fsfw/hal/stm32h7/spi/spiCore.h"
|
||||
#include "fsfw/hal/stm32h7/spi/spiInterrupts.h"
|
||||
#include "fsfw/hal/stm32h7/spi/stm32h743ziSpi.h"
|
||||
#include "fsfw_hal/stm32h7/spi/mspInit.h"
|
||||
#include "fsfw_hal/stm32h7/spi/spiDefinitions.h"
|
||||
#include "fsfw_hal/stm32h7/spi/spiCore.h"
|
||||
#include "fsfw_hal/stm32h7/spi/spiInterrupts.h"
|
||||
#include "fsfw_hal/stm32h7/spi/stm32h743ziSpi.h"
|
||||
|
||||
#include "fsfw/tasks/TaskFactory.h"
|
||||
#include "fsfw/serviceinterface/ServiceInterface.h"
|
@ -1,4 +1,4 @@
|
||||
#include <fsfw/hal/stm32h7/dma.h>
|
||||
#include <fsfw_hal/stm32h7/dma.h>
|
||||
|
||||
#include <cstdint>
|
||||
#include <cstddef>
|
@ -1,4 +1,4 @@
|
||||
#include "fsfw/hal/stm32h7/gpio/gpio.h"
|
||||
#include "fsfw_hal/stm32h7/gpio/gpio.h"
|
||||
|
||||
#include "stm32h7xx_hal_rcc.h"
|
||||
|
@ -1,11 +1,11 @@
|
||||
#include "fsfw/hal/stm32h7/spi/SpiComIF.h"
|
||||
#include "fsfw/hal/stm32h7/spi/SpiCookie.h"
|
||||
#include "fsfw_hal/stm32h7/spi/SpiComIF.h"
|
||||
#include "fsfw_hal/stm32h7/spi/SpiCookie.h"
|
||||
|
||||
#include "fsfw/tasks/SemaphoreFactory.h"
|
||||
#include "fsfw/hal/stm32h7/spi/spiCore.h"
|
||||
#include "fsfw/hal/stm32h7/spi/spiInterrupts.h"
|
||||
#include "fsfw/hal/stm32h7/spi/mspInit.h"
|
||||
#include "fsfw/hal/stm32h7/gpio/gpio.h"
|
||||
#include "fsfw_hal/stm32h7/spi/spiCore.h"
|
||||
#include "fsfw_hal/stm32h7/spi/spiInterrupts.h"
|
||||
#include "fsfw_hal/stm32h7/spi/mspInit.h"
|
||||
#include "fsfw_hal/stm32h7/gpio/gpio.h"
|
||||
|
||||
// FreeRTOS required special Semaphore handling from an ISR. Therefore, we use the concrete
|
||||
// instance here, because RTEMS and FreeRTOS are the only relevant OSALs currently
|
@ -5,7 +5,7 @@
|
||||
#include "fsfw/devicehandlers/DeviceCommunicationIF.h"
|
||||
#include "fsfw/objectmanager/SystemObject.h"
|
||||
|
||||
#include "fsfw/hal/stm32h7/spi/spiDefinitions.h"
|
||||
#include "fsfw_hal/stm32h7/spi/spiDefinitions.h"
|
||||
#include "stm32h7xx_hal_spi.h"
|
||||
#include "stm32h743xx.h"
|
||||
|
@ -1,4 +1,4 @@
|
||||
#include "fsfw/hal/stm32h7/spi/SpiCookie.h"
|
||||
#include "fsfw_hal/stm32h7/spi/SpiCookie.h"
|
||||
|
||||
|
||||
SpiCookie::SpiCookie(address_t deviceAddress, spi::SpiBus spiIdx, spi::TransferModes transferMode,
|
@ -1,7 +1,7 @@
|
||||
#include "fsfw/hal/stm32h7/dma.h"
|
||||
#include "fsfw/hal/stm32h7/spi/mspInit.h"
|
||||
#include "fsfw/hal/stm32h7/spi/spiCore.h"
|
||||
#include "fsfw/hal/stm32h7/spi/spiInterrupts.h"
|
||||
#include "fsfw_hal/stm32h7/dma.h"
|
||||
#include "fsfw_hal/stm32h7/spi/mspInit.h"
|
||||
#include "fsfw_hal/stm32h7/spi/spiCore.h"
|
||||
#include "fsfw_hal/stm32h7/spi/spiInterrupts.h"
|
||||
|
||||
#include "stm32h743xx.h"
|
||||
#include "stm32h7xx_hal_spi.h"
|
@ -1,5 +1,5 @@
|
||||
#include "fsfw/hal/stm32h7/spi/spiCore.h"
|
||||
#include "fsfw/hal/stm32h7/spi/spiDefinitions.h"
|
||||
#include "fsfw_hal/stm32h7/spi/spiCore.h"
|
||||
#include "fsfw_hal/stm32h7/spi/spiDefinitions.h"
|
||||
|
||||
#include <cstdio>
|
||||
|
@ -1,8 +1,8 @@
|
||||
#ifndef FSFW_HAL_STM32H7_SPI_SPICORE_H_
|
||||
#define FSFW_HAL_STM32H7_SPI_SPICORE_H_
|
||||
|
||||
#include "fsfw/hal/stm32h7/dma.h"
|
||||
#include "fsfw/hal/stm32h7/spi/spiDefinitions.h"
|
||||
#include "fsfw_hal/stm32h7/dma.h"
|
||||
#include "fsfw_hal/stm32h7/spi/spiDefinitions.h"
|
||||
|
||||
#include "stm32h7xx_hal.h"
|
||||
#include "stm32h7xx_hal_dma.h"
|
@ -1,4 +1,4 @@
|
||||
#include "fsfw/hal/stm32h7/spi/spiDefinitions.h"
|
||||
#include "fsfw_hal/stm32h7/spi/spiDefinitions.h"
|
||||
|
||||
void spi::assignSpiMode(SpiModes spiMode, SPI_HandleTypeDef& spiHandle) {
|
||||
switch(spiMode) {
|
@ -1,5 +1,5 @@
|
||||
#include "fsfw/hal/stm32h7/spi/spiInterrupts.h"
|
||||
#include "fsfw/hal/stm32h7/spi/spiCore.h"
|
||||
#include "fsfw_hal/stm32h7/spi/spiInterrupts.h"
|
||||
#include "fsfw_hal/stm32h7/spi/spiCore.h"
|
||||
|
||||
#include "stm32h7xx_hal.h"
|
||||
#include "stm32h7xx_hal_dma.h"
|
@ -1,6 +1,6 @@
|
||||
#include "fsfw/hal/stm32h7/spi/stm32h743ziSpi.h"
|
||||
#include "fsfw/hal/stm32h7/spi/spiCore.h"
|
||||
#include "fsfw/hal/stm32h7/spi/spiInterrupts.h"
|
||||
#include "fsfw_hal/stm32h7/spi/stm32h743ziSpi.h"
|
||||
#include "fsfw_hal/stm32h7/spi/spiCore.h"
|
||||
#include "fsfw_hal/stm32h7/spi/spiInterrupts.h"
|
||||
|
||||
#include "stm32h7xx_hal.h"
|
||||
#include "stm32h7xx_hal_rcc.h"
|
@ -4,7 +4,7 @@
|
||||
#include <fsfw/devicehandlers/DeviceHandlerBase.h>
|
||||
#include <fsfw/events/EventManager.h>
|
||||
#include <fsfw/health/HealthTable.h>
|
||||
#include <fsfw/tmtcpacket/pus/TmPacketStored.h>
|
||||
#include <fsfw/tmtcpacket/pus/tm/TmPacketStored.h>
|
||||
#include <fsfw/tmtcservices/CommandingServiceBase.h>
|
||||
#include <fsfw/tmtcservices/PusServiceBase.h>
|
||||
#include <fsfw/internalError/InternalErrorReporter.h>
|
||||
|
@ -9,5 +9,10 @@
|
||||
#cmakedefine FSFW_ADD_COORDINATES
|
||||
#cmakedefine FSFW_ADD_PUS
|
||||
#cmakedefine FSFW_ADD_MONITORING
|
||||
#cmakedefine FSFW_ADD_SGP4_PROPAGATOR
|
||||
|
||||
#ifndef FSFW_HAL_L3GD20_GYRO_DEBUG
|
||||
#define FSFW_HAL_L3GD20_GYRO_DEBUG 0
|
||||
#endif /* FSFW_HAL_L3GD20_GYRO_DEBUG */
|
||||
|
||||
#endif /* FSFW_FSFW_H_ */
|
||||
|
@ -7,7 +7,7 @@
|
||||
#ifndef PLATFORM_WIN
|
||||
#include <sys/time.h>
|
||||
#endif
|
||||
#include "fsfw/contrib/sgp4/sgp4unit.h"
|
||||
#include "fsfw-contrib/sgp4/sgp4unit.h"
|
||||
#include "fsfw/returnvalues/HasReturnvaluesIF.h"
|
||||
|
||||
class Sgp4Propagator {
|
||||
|
@ -8,4 +8,9 @@
|
||||
not enabled with FSFW_ADD_COORDINATES
|
||||
#endif
|
||||
|
||||
#ifndef FSFW_ADD_SGP4_PROPAGATOR
|
||||
#warning Coordinates files were included but SGP4 contributed code compilation was \
|
||||
not enabled with FSFW_ADD_SGP4_PROPAGATOR
|
||||
#endif
|
||||
|
||||
#endif /* FSFW_SRC_FSFW_COORDINATES_COORDINATESCONF_H_ */
|
||||
|
@ -12,119 +12,119 @@ MessageQueueId_t EventManagerIF::eventmanagerQueue = MessageQueueIF::NO_QUEUE;
|
||||
// So a good guess is 75 to a max of 100 pools required for each, which fits well.
|
||||
const LocalPool::LocalPoolConfig EventManager::poolConfig = {
|
||||
{fsfwconfig::FSFW_EVENTMGMR_MATCHTREE_NODES,
|
||||
sizeof(EventMatchTree::Node)},
|
||||
sizeof(EventMatchTree::Node)},
|
||||
{fsfwconfig::FSFW_EVENTMGMT_EVENTIDMATCHERS,
|
||||
sizeof(EventIdRangeMatcher)},
|
||||
sizeof(EventIdRangeMatcher)},
|
||||
{fsfwconfig::FSFW_EVENTMGMR_RANGEMATCHERS,
|
||||
sizeof(ReporterRangeMatcher)}
|
||||
sizeof(ReporterRangeMatcher)}
|
||||
};
|
||||
|
||||
EventManager::EventManager(object_id_t setObjectId) :
|
||||
SystemObject(setObjectId),
|
||||
factoryBackend(0, poolConfig, false, true) {
|
||||
mutex = MutexFactory::instance()->createMutex();
|
||||
eventReportQueue = QueueFactory::instance()->createMessageQueue(
|
||||
MAX_EVENTS_PER_CYCLE, EventMessage::EVENT_MESSAGE_SIZE);
|
||||
SystemObject(setObjectId),
|
||||
factoryBackend(0, poolConfig, false, true) {
|
||||
mutex = MutexFactory::instance()->createMutex();
|
||||
eventReportQueue = QueueFactory::instance()->createMessageQueue(
|
||||
MAX_EVENTS_PER_CYCLE, EventMessage::EVENT_MESSAGE_SIZE);
|
||||
}
|
||||
|
||||
EventManager::~EventManager() {
|
||||
QueueFactory::instance()->deleteMessageQueue(eventReportQueue);
|
||||
MutexFactory::instance()->deleteMutex(mutex);
|
||||
QueueFactory::instance()->deleteMessageQueue(eventReportQueue);
|
||||
MutexFactory::instance()->deleteMutex(mutex);
|
||||
}
|
||||
|
||||
MessageQueueId_t EventManager::getEventReportQueue() {
|
||||
return eventReportQueue->getId();
|
||||
return eventReportQueue->getId();
|
||||
}
|
||||
|
||||
ReturnValue_t EventManager::performOperation(uint8_t opCode) {
|
||||
ReturnValue_t result = HasReturnvaluesIF::RETURN_OK;
|
||||
while (result == HasReturnvaluesIF::RETURN_OK) {
|
||||
EventMessage message;
|
||||
result = eventReportQueue->receiveMessage(&message);
|
||||
if (result == HasReturnvaluesIF::RETURN_OK) {
|
||||
ReturnValue_t result = HasReturnvaluesIF::RETURN_OK;
|
||||
while (result == HasReturnvaluesIF::RETURN_OK) {
|
||||
EventMessage message;
|
||||
result = eventReportQueue->receiveMessage(&message);
|
||||
if (result == HasReturnvaluesIF::RETURN_OK) {
|
||||
#if FSFW_OBJ_EVENT_TRANSLATION == 1
|
||||
printEvent(&message);
|
||||
printEvent(&message);
|
||||
#endif
|
||||
notifyListeners(&message);
|
||||
}
|
||||
}
|
||||
return HasReturnvaluesIF::RETURN_OK;
|
||||
notifyListeners(&message);
|
||||
}
|
||||
}
|
||||
return HasReturnvaluesIF::RETURN_OK;
|
||||
}
|
||||
|
||||
void EventManager::notifyListeners(EventMessage* message) {
|
||||
lockMutex();
|
||||
for (auto iter = listenerList.begin(); iter != listenerList.end(); ++iter) {
|
||||
if (iter->second.match(message)) {
|
||||
MessageQueueSenderIF::sendMessage(iter->first, message,
|
||||
message->getSender());
|
||||
}
|
||||
}
|
||||
unlockMutex();
|
||||
lockMutex();
|
||||
for (auto iter = listenerList.begin(); iter != listenerList.end(); ++iter) {
|
||||
if (iter->second.match(message)) {
|
||||
MessageQueueSenderIF::sendMessage(iter->first, message,
|
||||
message->getSender());
|
||||
}
|
||||
}
|
||||
unlockMutex();
|
||||
}
|
||||
|
||||
ReturnValue_t EventManager::registerListener(MessageQueueId_t listener,
|
||||
bool forwardAllButSelected) {
|
||||
auto result = listenerList.insert(
|
||||
std::pair<MessageQueueId_t, EventMatchTree>(listener,
|
||||
EventMatchTree(&factoryBackend, forwardAllButSelected)));
|
||||
if (!result.second) {
|
||||
return HasReturnvaluesIF::RETURN_FAILED;
|
||||
}
|
||||
return HasReturnvaluesIF::RETURN_OK;
|
||||
auto result = listenerList.insert(
|
||||
std::pair<MessageQueueId_t, EventMatchTree>(listener,
|
||||
EventMatchTree(&factoryBackend, forwardAllButSelected)));
|
||||
if (!result.second) {
|
||||
return HasReturnvaluesIF::RETURN_FAILED;
|
||||
}
|
||||
return HasReturnvaluesIF::RETURN_OK;
|
||||
}
|
||||
|
||||
ReturnValue_t EventManager::subscribeToEvent(MessageQueueId_t listener,
|
||||
EventId_t event) {
|
||||
return subscribeToEventRange(listener, event);
|
||||
EventId_t event) {
|
||||
return subscribeToEventRange(listener, event);
|
||||
}
|
||||
|
||||
ReturnValue_t EventManager::subscribeToAllEventsFrom(MessageQueueId_t listener,
|
||||
object_id_t object) {
|
||||
return subscribeToEventRange(listener, 0, 0, true, object);
|
||||
object_id_t object) {
|
||||
return subscribeToEventRange(listener, 0, 0, true, object);
|
||||
}
|
||||
|
||||
ReturnValue_t EventManager::subscribeToEventRange(MessageQueueId_t listener,
|
||||
EventId_t idFrom, EventId_t idTo, bool idInverted,
|
||||
object_id_t reporterFrom, object_id_t reporterTo,
|
||||
bool reporterInverted) {
|
||||
auto iter = listenerList.find(listener);
|
||||
if (iter == listenerList.end()) {
|
||||
return LISTENER_NOT_FOUND;
|
||||
}
|
||||
lockMutex();
|
||||
ReturnValue_t result = iter->second.addMatch(idFrom, idTo, idInverted,
|
||||
reporterFrom, reporterTo, reporterInverted);
|
||||
unlockMutex();
|
||||
return result;
|
||||
EventId_t idFrom, EventId_t idTo, bool idInverted,
|
||||
object_id_t reporterFrom, object_id_t reporterTo,
|
||||
bool reporterInverted) {
|
||||
auto iter = listenerList.find(listener);
|
||||
if (iter == listenerList.end()) {
|
||||
return LISTENER_NOT_FOUND;
|
||||
}
|
||||
lockMutex();
|
||||
ReturnValue_t result = iter->second.addMatch(idFrom, idTo, idInverted,
|
||||
reporterFrom, reporterTo, reporterInverted);
|
||||
unlockMutex();
|
||||
return result;
|
||||
}
|
||||
|
||||
ReturnValue_t EventManager::unsubscribeFromEventRange(MessageQueueId_t listener,
|
||||
EventId_t idFrom, EventId_t idTo, bool idInverted,
|
||||
object_id_t reporterFrom, object_id_t reporterTo,
|
||||
bool reporterInverted) {
|
||||
auto iter = listenerList.find(listener);
|
||||
if (iter == listenerList.end()) {
|
||||
return LISTENER_NOT_FOUND;
|
||||
}
|
||||
lockMutex();
|
||||
ReturnValue_t result = iter->second.removeMatch(idFrom, idTo, idInverted,
|
||||
reporterFrom, reporterTo, reporterInverted);
|
||||
unlockMutex();
|
||||
return result;
|
||||
EventId_t idFrom, EventId_t idTo, bool idInverted,
|
||||
object_id_t reporterFrom, object_id_t reporterTo,
|
||||
bool reporterInverted) {
|
||||
auto iter = listenerList.find(listener);
|
||||
if (iter == listenerList.end()) {
|
||||
return LISTENER_NOT_FOUND;
|
||||
}
|
||||
lockMutex();
|
||||
ReturnValue_t result = iter->second.removeMatch(idFrom, idTo, idInverted,
|
||||
reporterFrom, reporterTo, reporterInverted);
|
||||
unlockMutex();
|
||||
return result;
|
||||
}
|
||||
|
||||
void EventManager::lockMutex() {
|
||||
mutex->lockMutex(timeoutType, timeoutMs);
|
||||
mutex->lockMutex(timeoutType, timeoutMs);
|
||||
}
|
||||
|
||||
void EventManager::unlockMutex() {
|
||||
mutex->unlockMutex();
|
||||
mutex->unlockMutex();
|
||||
}
|
||||
|
||||
void EventManager::setMutexTimeout(MutexIF::TimeoutType timeoutType,
|
||||
uint32_t timeoutMs) {
|
||||
this->timeoutType = timeoutType;
|
||||
this->timeoutMs = timeoutMs;
|
||||
uint32_t timeoutMs) {
|
||||
this->timeoutType = timeoutType;
|
||||
this->timeoutMs = timeoutMs;
|
||||
}
|
||||
|
||||
#if FSFW_OBJ_EVENT_TRANSLATION == 1
|
||||
|
@ -11,7 +11,6 @@
|
||||
#include "FreeRTOS.h"
|
||||
#include "queue.h"
|
||||
|
||||
|
||||
/**
|
||||
* @brief This class manages sending and receiving of
|
||||
* message queue messages.
|
||||
|
@ -14,7 +14,7 @@ void utility::printUnixErrorGeneric(const char* const className,
|
||||
#if FSFW_VERBOSE_LEVEL >= 1
|
||||
if(outputType == sif::OutputTypes::OUT_ERROR) {
|
||||
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
||||
sif::error << className << "::" << function << ":" << failString << " error: "
|
||||
sif::error << className << "::" << function << ": " << failString << " error: "
|
||||
<< strerror(errno) << std::endl;
|
||||
#else
|
||||
sif::printError("%s::%s: %s error: %s\n", className, function, failString, strerror(errno));
|
||||
@ -22,7 +22,7 @@ void utility::printUnixErrorGeneric(const char* const className,
|
||||
}
|
||||
else {
|
||||
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
||||
sif::warning << className << "::" << function << ":" << failString << " error: "
|
||||
sif::warning << className << "::" << function << ": " << failString << " error: "
|
||||
<< strerror(errno) << std::endl;
|
||||
#else
|
||||
sif::printWarning("%s::%s: %s error: %s\n", className, function, failString, strerror(errno));
|
||||
|
@ -1,7 +1,7 @@
|
||||
#ifndef FSFW_SERVICEINTERFACE_SERVICEINTERFACE_H_
|
||||
#define FSFW_SERVICEINTERFACE_SERVICEINTERFACE_H_
|
||||
|
||||
#include <FSFWConfig.h>
|
||||
#include "fsfw/FSFW.h"
|
||||
#include "serviceInterfaceDefintions.h"
|
||||
|
||||
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
||||
|
@ -171,9 +171,11 @@ bool ServiceInterfaceBuffer::crAdditionEnabled() const {
|
||||
return addCrToPreamble;
|
||||
}
|
||||
|
||||
#if FSFW_COLORED_OUTPUT == 1
|
||||
void ServiceInterfaceBuffer::setAsciiColorPrefix(std::string colorPrefix) {
|
||||
this->colorPrefix = colorPrefix;
|
||||
this->colorPrefix = colorPrefix;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef UT699
|
||||
#include "../osal/rtems/Interrupt.h"
|
||||
|
@ -19,9 +19,11 @@ bool ServiceInterfaceStream::crAdditionEnabled() const {
|
||||
return streambuf.crAdditionEnabled();
|
||||
}
|
||||
|
||||
#if FSFW_COLORED_OUTPUT == 1
|
||||
void ServiceInterfaceStream::setAsciiColorPrefix(std::string asciiColorCode) {
|
||||
streambuf.setAsciiColorPrefix(asciiColorCode);
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -46,7 +46,9 @@ public:
|
||||
*/
|
||||
bool crAdditionEnabled() const;
|
||||
|
||||
#if FSFW_COLORED_OUTPUT == 1
|
||||
void setAsciiColorPrefix(std::string asciiColorCode);
|
||||
#endif
|
||||
|
||||
protected:
|
||||
ServiceInterfaceBuffer streambuf;
|
||||
|
@ -6,4 +6,4 @@ target_include_directories(${LIB_FSFW_NAME} INTERFACE
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
)
|
||||
|
||||
add_subdirectory(fsfw)
|
||||
add_subdirectory(fsfw_tests)
|
||||
|
@ -1 +0,0 @@
|
||||
add_subdirectory(tests)
|
@ -1,11 +1,11 @@
|
||||
#include "fsfw/tests/internal/InternalUnitTester.h"
|
||||
#include "fsfw/tests/internal/UnittDefinitions.h"
|
||||
#include "fsfw_tests/internal/InternalUnitTester.h"
|
||||
#include "fsfw_tests/internal/UnittDefinitions.h"
|
||||
|
||||
#include "fsfw/tests/internal/osal/IntTestMq.h"
|
||||
#include "fsfw/tests/internal/osal/IntTestSemaphore.h"
|
||||
#include "fsfw/tests/internal/osal/IntTestMutex.h"
|
||||
#include "fsfw/tests/internal/serialize/IntTestSerialization.h"
|
||||
#include "fsfw/tests/internal/globalfunctions/TestArrayPrinter.h"
|
||||
#include "fsfw_tests/internal/osal/IntTestMq.h"
|
||||
#include "fsfw_tests/internal/osal/IntTestSemaphore.h"
|
||||
#include "fsfw_tests/internal/osal/IntTestMutex.h"
|
||||
#include "fsfw_tests/internal/serialize/IntTestSerialization.h"
|
||||
#include "fsfw_tests/internal/globalfunctions/TestArrayPrinter.h"
|
||||
|
||||
#include <cstdlib>
|
||||
|
@ -1,4 +1,4 @@
|
||||
#include "fsfw/tests/internal/UnittDefinitions.h"
|
||||
#include "fsfw_tests/internal/UnittDefinitions.h"
|
||||
|
||||
ReturnValue_t unitt::put_error(std::string errorId) {
|
||||
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
@ -1,4 +1,4 @@
|
||||
#include "fsfw/tests/internal/globalfunctions/TestArrayPrinter.h"
|
||||
#include "fsfw_tests/internal/globalfunctions/TestArrayPrinter.h"
|
||||
|
||||
void arrayprinter::testArrayPrinter() {
|
||||
{
|
@ -1,5 +1,5 @@
|
||||
#include "fsfw/tests/internal/osal/IntTestMq.h"
|
||||
#include "fsfw/tests/internal/UnittDefinitions.h"
|
||||
#include "fsfw_tests/internal/osal/IntTestMq.h"
|
||||
#include "fsfw_tests/internal/UnittDefinitions.h"
|
||||
|
||||
#include <fsfw/ipc/MessageQueueIF.h>
|
||||
#include <fsfw/ipc/QueueFactory.h>
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user