Merged from development, added unit test for config file handler, removed obsolete stuff from handler
Some checks failed
EIVE/eive-obsw/pipeline/head There was a failure building this commit
Some checks failed
EIVE/eive-obsw/pipeline/head There was a failure building this commit
This commit is contained in:
@ -1,9 +1,5 @@
|
||||
target_sources(${OBSW_NAME} PUBLIC
|
||||
InitMission.cpp
|
||||
main.cpp
|
||||
ObjectFactory.cpp
|
||||
GlobalConfigHandler.cpp
|
||||
)
|
||||
target_sources(${OBSW_NAME} PUBLIC InitMission.cpp main.cpp ObjectFactory.cpp)
|
||||
|
||||
|
||||
add_subdirectory(fsfwconfig)
|
||||
add_subdirectory(boardconfig)
|
||||
|
@ -1,365 +0,0 @@
|
||||
/*
|
||||
* GlobalConfigHandler.cpp
|
||||
*
|
||||
* Created on: May 3, 2022
|
||||
* Author: metobs
|
||||
*/
|
||||
|
||||
#include "GlobalConfigHandler.h"
|
||||
#include <fsfw/ipc/MutexFactory.h>
|
||||
#include "fsfw/serviceinterface/ServiceInterface.h"
|
||||
#include <fsfw/ipc/MessageQueueIF.h>
|
||||
#include <fsfw/ipc/QueueFactory.h>
|
||||
|
||||
MutexIF* GlobalConfigHandler::configLock = nullptr;
|
||||
GlobalConfigHandler::GlobalConfigHandler(object_id_t objectId, std::string configFilePath):
|
||||
SystemObject(objectId),
|
||||
NVMParameterBase(configFilePath),
|
||||
parameterHelper(this),
|
||||
commandQueue(QueueFactory::instance()->createMessageQueue(20)),
|
||||
actionHelper(this, commandQueue){
|
||||
if (configLock == nullptr) {
|
||||
configLock = MutexFactory::instance()->createMutex();
|
||||
}
|
||||
|
||||
}
|
||||
ReturnValue_t GlobalConfigHandler::initialize(){
|
||||
|
||||
ReturnValue_t result = SystemObject::initialize();
|
||||
if (result != RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
|
||||
result = actionHelper.initialize(commandQueue);
|
||||
if(result != HasReturnvaluesIF::RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
|
||||
result = ReadConfigFile();
|
||||
if(result!=RETURN_OK){
|
||||
#if OBSW_VERBOSE_LEVEL >= 1
|
||||
sif::info << "GlobalConfigHandler::initialize: Creating JSON file at " << getFullName() << std::endl;
|
||||
#endif
|
||||
result=ResetConfigFile();
|
||||
if (result != RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
result = parameterHelper.initialize();
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
#if OBSW_VERBOSE_LEVEL >= 1
|
||||
sif::info << "GlobalConfigHandler::initialize: parameterHelper init failed with " << result << std::endl;
|
||||
#endif
|
||||
return result;
|
||||
}
|
||||
|
||||
#if OBSW_VERBOSE_LEVEL >= 1
|
||||
sif::info << "GlobalConfigHandler::initialize success " << std::endl;
|
||||
#endif
|
||||
return result;
|
||||
}
|
||||
GlobalConfigHandler::~GlobalConfigHandler() {
|
||||
|
||||
}
|
||||
|
||||
ReturnValue_t GlobalConfigHandler::performOperation(uint8_t operationCode) {
|
||||
ReturnValue_t result = RETURN_OK;
|
||||
sif::debug<<"GlobalConfigHandler::performOperation"<<std::endl;
|
||||
readCommandQueue();
|
||||
return result;
|
||||
}
|
||||
|
||||
void GlobalConfigHandler::readCommandQueue(){
|
||||
CommandMessage command;
|
||||
ReturnValue_t result = commandQueue->receiveMessage(&command);
|
||||
if (result != RETURN_OK) {
|
||||
return;
|
||||
}
|
||||
|
||||
result = parameterHelper.handleParameterMessage(&command);
|
||||
if (result == RETURN_OK) {
|
||||
return;
|
||||
}
|
||||
|
||||
result = actionHelper.handleActionMessage(&command);
|
||||
if (result == HasReturnvaluesIF::RETURN_OK) {
|
||||
sif::debug<<"GlobalConfigHandler::readCommandQueue handleActionMessage success"<<std::endl;
|
||||
return;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
ReturnValue_t GlobalConfigHandler::lockConfigFile(){
|
||||
ReturnValue_t result = RETURN_OK;
|
||||
result = configLock->lockMutex(MutexIF::TimeoutType::WAITING, 10);
|
||||
return result;
|
||||
}
|
||||
ReturnValue_t GlobalConfigHandler::unlockConfigFile(){
|
||||
ReturnValue_t result = RETURN_OK;
|
||||
result=configLock->unlockMutex();
|
||||
return result;
|
||||
}
|
||||
|
||||
template <typename T> ReturnValue_t GlobalConfigHandler::setConfigFileValue(std::string key, T data){
|
||||
ReturnValue_t result = RETURN_OK;
|
||||
ReturnValue_t resultSet = RETURN_OK;
|
||||
|
||||
result=lockConfigFile();
|
||||
if (result!= RETURN_OK){
|
||||
#if OBSW_VERBOSE_LEVEL >= 1
|
||||
sif::info << "GlobalConfigHandler::setConfigFileValue lock mutex failed with " << result << std::endl;
|
||||
#endif
|
||||
return result;
|
||||
}
|
||||
|
||||
resultSet=setValue(key, data);
|
||||
if(resultSet!=RETURN_OK){
|
||||
triggerEvent(SET_CONFIGFILEVALUE_FAILED, 0, 0);
|
||||
#if OBSW_VERBOSE_LEVEL >= 1
|
||||
sif::info << "GlobalConfigHandler::setConfigFileValue set json failed with " << result << std::endl;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
result=unlockConfigFile();
|
||||
if (result!= RETURN_OK){
|
||||
#if OBSW_VERBOSE_LEVEL >= 1
|
||||
sif::info << "GlobalConfigHandler::setConfigFileValue unlock mutex failed with " << result << std::endl;
|
||||
#endif
|
||||
return result;
|
||||
}
|
||||
|
||||
return resultSet;
|
||||
}
|
||||
template <typename T> ReturnValue_t GlobalConfigHandler::getConfigFileValue(std::string key, T& data){
|
||||
ReturnValue_t result = RETURN_OK;
|
||||
ReturnValue_t resultGet = RETURN_OK;
|
||||
|
||||
result=lockConfigFile();
|
||||
if (result!= RETURN_OK){
|
||||
#if OBSW_VERBOSE_LEVEL >= 1
|
||||
sif::info << "GlobalConfigHandler::getConfigFileValue lock mutex failed with " << result << std::endl;
|
||||
#endif
|
||||
return result;
|
||||
}
|
||||
|
||||
resultGet=getValue(key, data);
|
||||
if (resultGet!= RETURN_OK){
|
||||
triggerEvent(GET_CONFIGFILEVALUE_FAILED, 0, 0);
|
||||
#if OBSW_VERBOSE_LEVEL >= 1
|
||||
sif::info << "GlobalConfigHandler::getConfigFileValue lock mutex failed with " << result << std::endl;
|
||||
#endif
|
||||
}
|
||||
result=unlockConfigFile();
|
||||
if (result!= RETURN_OK){
|
||||
#if OBSW_VERBOSE_LEVEL >= 1
|
||||
sif::info << "GlobalConfigHandler::getConfigFileValue unlock mutex failed with " << result << std::endl;
|
||||
#endif
|
||||
return result;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
template <typename T> ReturnValue_t GlobalConfigHandler::insertConfigFileValue(std::string key, T data){
|
||||
ReturnValue_t result = RETURN_OK;
|
||||
ReturnValue_t resultInsert = RETURN_OK;
|
||||
|
||||
result=lockConfigFile();
|
||||
if (result!= RETURN_OK){
|
||||
#if OBSW_VERBOSE_LEVEL >= 1
|
||||
sif::info << "GlobalConfigHandler::insertConfigFileValue lock mutex failed with " << result << std::endl;
|
||||
#endif
|
||||
return result;
|
||||
}
|
||||
|
||||
resultInsert=insertValue(key, data);//Should never fail
|
||||
if(resultInsert!=RETURN_OK){
|
||||
triggerEvent(INSERT_CONFIGFILEVALUE_FAILED, 0, 0);
|
||||
#if OBSW_VERBOSE_LEVEL >= 1
|
||||
sif::info << "GlobalConfigHandler::insertConfigFileValue insert failed with " << result << std::endl;
|
||||
#endif
|
||||
}
|
||||
|
||||
result=unlockConfigFile();
|
||||
if (result!= RETURN_OK){
|
||||
#if OBSW_VERBOSE_LEVEL >= 1
|
||||
sif::info << "GlobalConfigHandler::insertConfigFileValue unlock mutex failed with " << result << std::endl;
|
||||
#endif
|
||||
return result;
|
||||
}
|
||||
|
||||
return resultInsert;
|
||||
}
|
||||
ReturnValue_t GlobalConfigHandler::resetConfigFileValues(){
|
||||
ReturnValue_t result = RETURN_OK;
|
||||
result=lockConfigFile();
|
||||
if (result!= RETURN_OK){
|
||||
#if OBSW_VERBOSE_LEVEL >= 1
|
||||
sif::info << "GlobalConfigHandler::resetConfigFileValues lock mutex failed with " << result << std::endl;
|
||||
#endif
|
||||
return result;
|
||||
}
|
||||
insertValue(PARAM_KEY_MAP[PARAM0], PARAM0_DEFAULT);
|
||||
insertValue(PARAM_KEY_MAP[PARAM1], PARAM1_DEFAULT);
|
||||
result=unlockConfigFile();
|
||||
if (result!= RETURN_OK){
|
||||
#if OBSW_VERBOSE_LEVEL >= 1
|
||||
sif::info << "GlobalConfigHandler::resetConfigFileValues unlock mutex failed with " << result << std::endl;
|
||||
#endif
|
||||
return result;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
ReturnValue_t GlobalConfigHandler::WriteConfigFile(){
|
||||
ReturnValue_t result = RETURN_OK;
|
||||
ReturnValue_t resultWrite = RETURN_OK;
|
||||
result=lockConfigFile();
|
||||
if (result!= RETURN_OK){
|
||||
#if OBSW_VERBOSE_LEVEL >= 1
|
||||
sif::info << "GlobalConfigHandler::WriteConfigFile lock mutex failed with " << result << std::endl;
|
||||
#endif
|
||||
return result;
|
||||
}
|
||||
|
||||
resultWrite =writeJsonFile();
|
||||
if(resultWrite!=RETURN_OK){
|
||||
triggerEvent(WRITE_CONFIGFILE_FAILED, 0, 0);
|
||||
#if OBSW_VERBOSE_LEVEL >= 1
|
||||
sif::info << "GlobalConfigHandler::WriteConfigFile write json failed with " << result << std::endl;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
result=unlockConfigFile();
|
||||
if (result!= RETURN_OK){
|
||||
#if OBSW_VERBOSE_LEVEL >= 1
|
||||
sif::info << "GlobalConfigHandler::WriteConfigFile unlock mutex failed with " << result << std::endl;
|
||||
#endif
|
||||
return result;
|
||||
}
|
||||
return resultWrite;
|
||||
}
|
||||
ReturnValue_t GlobalConfigHandler::ReadConfigFile(){
|
||||
ReturnValue_t result = RETURN_OK;
|
||||
ReturnValue_t resultRead = RETURN_OK;
|
||||
result=lockConfigFile();
|
||||
if (result!= RETURN_OK){
|
||||
#if OBSW_VERBOSE_LEVEL >= 1
|
||||
sif::info << "GlobalConfigHandler::ReadConfigFile lock mutex failed with " << result << std::endl;
|
||||
#endif
|
||||
return result;
|
||||
}
|
||||
|
||||
resultRead=readJsonFile();
|
||||
if(resultRead!=RETURN_OK){
|
||||
triggerEvent(READ_CONFIGFILE_FAILED, 0, 0);
|
||||
#if OBSW_VERBOSE_LEVEL >= 1
|
||||
sif::info << "GlobalConfigHandler::ReadConfigFile read json failed with " << result << std::endl;
|
||||
#endif
|
||||
}
|
||||
|
||||
result=unlockConfigFile();
|
||||
if (result!= RETURN_OK){
|
||||
#if OBSW_VERBOSE_LEVEL >= 1
|
||||
sif::info << "GlobalConfigHandler::ReadConfigFile unlock mutex failed with " << result << std::endl;
|
||||
#endif
|
||||
return result;
|
||||
}
|
||||
|
||||
return resultRead;
|
||||
}
|
||||
ReturnValue_t GlobalConfigHandler::ResetConfigFile(){
|
||||
ReturnValue_t result = RETURN_OK;
|
||||
resetConfigFileValues();
|
||||
result =writeJsonFile();
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
ReturnValue_t GlobalConfigHandler::setConfigFileName(std::string configFileName){
|
||||
ReturnValue_t result = RETURN_OK;
|
||||
setFullName(configFileName);
|
||||
result=ResetConfigFile();
|
||||
return result;
|
||||
}
|
||||
std::string GlobalConfigHandler::getConfigFileName(){
|
||||
|
||||
return getFullName();
|
||||
}
|
||||
|
||||
ReturnValue_t GlobalConfigHandler::getParameter(uint8_t domainId, uint8_t uniqueId,
|
||||
ParameterWrapper* parameterWrapper,
|
||||
const ParameterWrapper* newValues,
|
||||
uint16_t startAtIndex) {
|
||||
|
||||
ReturnValue_t result = RETURN_OK;
|
||||
switch(uniqueId){
|
||||
|
||||
case(ParamIds::PARAM0):{
|
||||
result=handleDoubleParamUpdate(PARAM_KEY_MAP[static_cast<ParamIds>(uniqueId)],
|
||||
parameterWrapper, newValues);
|
||||
break;
|
||||
}
|
||||
case(ParamIds::PARAM1):{
|
||||
result=handleIntParamUpdate(PARAM_KEY_MAP[static_cast<ParamIds>(uniqueId)],
|
||||
parameterWrapper, newValues);
|
||||
break;
|
||||
}
|
||||
default:{
|
||||
result=RETURN_FAILED;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
|
||||
}
|
||||
|
||||
//Taken from payloadPCDU Handler Definition
|
||||
ReturnValue_t GlobalConfigHandler::handleDoubleParamUpdate(std::string key,
|
||||
ParameterWrapper* parameterWrapper,
|
||||
const ParameterWrapper* newValues) {
|
||||
double newValue = 0.0;
|
||||
ReturnValue_t result = newValues->getElement<double>(&newValue, 0, 0);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
result=setConfigFileValue(key, newValue);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
// Do this so the dumping and loading with the framework works as well
|
||||
doubleDummy = newValue;
|
||||
parameterWrapper->set(doubleDummy);
|
||||
return WriteConfigFile();
|
||||
}
|
||||
|
||||
ReturnValue_t GlobalConfigHandler::handleIntParamUpdate(std::string key,
|
||||
ParameterWrapper* parameterWrapper,
|
||||
const ParameterWrapper* newValues) {
|
||||
int newValue = 0;
|
||||
ReturnValue_t result = newValues->getElement<int>(&newValue, 0, 0);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
result=setConfigFileValue(key, newValue);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
// Do this so the dumping and loading with the framework works as well
|
||||
intDummy = newValue;
|
||||
parameterWrapper->set(intDummy);
|
||||
return WriteConfigFile();
|
||||
}
|
||||
|
||||
MessageQueueId_t GlobalConfigHandler::getCommandQueue() const{
|
||||
return commandQueue->getId();
|
||||
}
|
||||
|
||||
ReturnValue_t GlobalConfigHandler::executeAction(ActionId_t actionId,
|
||||
MessageQueueId_t commandedBy, const uint8_t* data,
|
||||
size_t size) {
|
||||
|
||||
//Currently, no commands are used
|
||||
return RETURN_FAILED;
|
||||
}
|
@ -1,102 +0,0 @@
|
||||
/*
|
||||
* GlobalConfigHandler.h
|
||||
*
|
||||
* Created on: May 3, 2022
|
||||
* Author: metobs
|
||||
*/
|
||||
|
||||
#ifndef BSP_LINUX_GLOBALCONFIGHANDLER_H_
|
||||
#define BSP_LINUX_GLOBALCONFIGHANDLER_H_
|
||||
|
||||
#include <fsfw/objectmanager/SystemObject.h>
|
||||
#include <fsfw/storagemanager/StorageManagerIF.h>
|
||||
#include <fsfw/tasks/ExecutableObjectIF.h>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
#include <fsfw/serviceinterface/ServiceInterfaceStream.h>
|
||||
#include "mission/memory/NVMParameterBase.h"
|
||||
#include "OBSWConfig.h"
|
||||
#include "fsfw/parameters/HasParametersIF.h"
|
||||
#include "fsfw/parameters/ParameterHelper.h"
|
||||
#include <fsfw/action/ActionHelper.h>
|
||||
#include <fsfw/action/HasActionsIF.h>
|
||||
|
||||
static constexpr double PARAM0_DEFAULT = 5.0;
|
||||
static constexpr int PARAM1_DEFAULT = 905;
|
||||
|
||||
enum ParamIds : uint8_t {
|
||||
PARAM0 = 0,
|
||||
PARAM1 = 1,
|
||||
|
||||
};
|
||||
|
||||
static std::map<ParamIds, std::string> PARAM_KEY_MAP = {
|
||||
{PARAM0, "Parameter0"},
|
||||
{PARAM1, "Parameter1"},
|
||||
};
|
||||
/*
|
||||
* Idea: This class is intended to be used as a subclass for the Core Controller.
|
||||
* Its tasks is managing a configuration JSON file containing config values important for various object.
|
||||
* If some function to read or write a config value is called, a mutex should be used so only one call is done at a time.
|
||||
*/
|
||||
class GlobalConfigHandler: public SystemObject,
|
||||
public ExecutableObjectIF,
|
||||
public NVMParameterBase,
|
||||
public ReceivesParameterMessagesIF,
|
||||
public HasActionsIF{
|
||||
public:
|
||||
GlobalConfigHandler(object_id_t objectId, std::string configFilePath);
|
||||
virtual ~GlobalConfigHandler();
|
||||
|
||||
static const uint8_t SUBSYSTEM_ID = SUBSYSTEM_ID::CONFIGHANDLER;
|
||||
|
||||
static constexpr Event SET_CONFIGFILEVALUE_FAILED = MAKE_EVENT(1, severity::MEDIUM);
|
||||
static constexpr Event GET_CONFIGFILEVALUE_FAILED = MAKE_EVENT(2, severity::MEDIUM);
|
||||
static constexpr Event INSERT_CONFIGFILEVALUE_FAILED = MAKE_EVENT(3, severity::MEDIUM);
|
||||
static constexpr Event WRITE_CONFIGFILE_FAILED = MAKE_EVENT(4, severity::MEDIUM);
|
||||
static constexpr Event READ_CONFIGFILE_FAILED = MAKE_EVENT(5, severity::MEDIUM);
|
||||
|
||||
ReturnValue_t performOperation(uint8_t operationCode);
|
||||
void readCommandQueue();
|
||||
ReturnValue_t initialize();
|
||||
|
||||
ReturnValue_t lockConfigFile();
|
||||
ReturnValue_t unlockConfigFile();
|
||||
template <typename T> ReturnValue_t setConfigFileValue(std::string key, T data);
|
||||
template <typename T> ReturnValue_t getConfigFileValue(std::string key, T& data);
|
||||
template <typename T> ReturnValue_t insertConfigFileValue(std::string key, T data);
|
||||
ReturnValue_t resetConfigFileValues();
|
||||
ReturnValue_t WriteConfigFile();
|
||||
ReturnValue_t ReadConfigFile();
|
||||
ReturnValue_t ResetConfigFile();
|
||||
|
||||
ReturnValue_t setConfigFileName(std::string configFileName);
|
||||
std::string getConfigFileName();
|
||||
|
||||
ReturnValue_t getParameter(uint8_t domainId, uint8_t uniqueId,
|
||||
ParameterWrapper* parameterWrapper,
|
||||
const ParameterWrapper* newValues,
|
||||
uint16_t startAtIndex);
|
||||
|
||||
ReturnValue_t handleDoubleParamUpdate(std::string key,
|
||||
ParameterWrapper* parameterWrapper,
|
||||
const ParameterWrapper* newValues);
|
||||
ReturnValue_t handleIntParamUpdate(std::string key,
|
||||
ParameterWrapper* parameterWrapper,
|
||||
const ParameterWrapper* newValues) ;
|
||||
MessageQueueId_t getCommandQueue() const override;
|
||||
ReturnValue_t executeAction(ActionId_t actionId,
|
||||
MessageQueueId_t commandedBy, const uint8_t* data,
|
||||
size_t size) override;
|
||||
private:
|
||||
static MutexIF* configLock ;
|
||||
|
||||
ParameterHelper parameterHelper;
|
||||
MessageQueueIF* commandQueue;
|
||||
ActionHelper actionHelper;
|
||||
|
||||
double doubleDummy = 0.0;
|
||||
int intDummy = 0;
|
||||
};
|
||||
|
||||
#endif /* BSP_LINUX_GLOBALCONFIGHANDLER_H_ */
|
@ -131,6 +131,7 @@ void initmission::initTasks() {
|
||||
|
||||
PeriodicTaskIF* testTask = factory->createPeriodicTask(
|
||||
"TEST_TASK", 40, PeriodicTaskIF::MINIMUM_STACK_SIZE, 2.0, missedDeadlineFunc);
|
||||
static_cast<void>(testTask);
|
||||
#if OBSW_ADD_TEST_CODE == 1
|
||||
result = testTask->addComponent(objects::TEST_TASK);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
|
122
bsp_hosted/OBSWConfig.h.in
Normal file
122
bsp_hosted/OBSWConfig.h.in
Normal file
@ -0,0 +1,122 @@
|
||||
/**
|
||||
* @brief This file can be used to add preprocessor define for conditional
|
||||
* code inclusion exclusion or various other project constants and
|
||||
* properties in one place.
|
||||
*/
|
||||
#ifndef FSFWCONFIG_OBSWCONFIG_H_
|
||||
#define FSFWCONFIG_OBSWCONFIG_H_
|
||||
|
||||
#include "commonConfig.h"
|
||||
#include "OBSWVersion.h"
|
||||
|
||||
/*******************************************************************/
|
||||
/** All of the following flags should be enabled for mission code */
|
||||
/*******************************************************************/
|
||||
|
||||
#define OBSW_ENABLE_TIMERS 1
|
||||
#define OBSW_ADD_STAR_TRACKER 0
|
||||
#define OBSW_ADD_PLOC_SUPERVISOR 0
|
||||
#define OBSW_ADD_PLOC_MPSOC 0
|
||||
#define OBSW_ADD_SUN_SENSORS 0
|
||||
#define OBSW_ADD_MGT 0
|
||||
#define OBSW_ADD_ACS_BOARD 0
|
||||
#define OBSW_ADD_ACS_HANDLERS 0
|
||||
#define OBSW_ADD_GPS_0 0
|
||||
#define OBSW_ADD_GPS_1 0
|
||||
#define OBSW_ADD_RW 0
|
||||
#define OBSW_ADD_BPX_BATTERY_HANDLER 0
|
||||
#define OBSW_ADD_RTD_DEVICES 0
|
||||
#define OBSW_ADD_PL_PCDU 0
|
||||
#define OBSW_ADD_TMP_DEVICES 0
|
||||
#define OBSW_ADD_RAD_SENSORS 0
|
||||
#define OBSW_ADD_SYRLINKS 0
|
||||
#define OBSW_STAR_TRACKER_GROUND_CONFIG 1
|
||||
|
||||
// This is a really tricky switch.. It initializes the PCDU switches to their default states
|
||||
// at powerup. I think it would be better
|
||||
// to leave it off for now. It makes testing a lot more difficult and it might mess with
|
||||
// something the operators might want to do by giving the software too much intelligence
|
||||
// at the wrong place. The system component might command all the Switches accordingly anyway
|
||||
#define OBSW_INITIALIZE_SWITCHES 0
|
||||
#define OBSW_ENABLE_PERIODIC_HK 0
|
||||
|
||||
/*******************************************************************/
|
||||
/** All of the following flags should be disabled for mission code */
|
||||
/*******************************************************************/
|
||||
|
||||
// Can be used to switch device to NORMAL mode immediately
|
||||
#define OBSW_SWITCH_TO_NORMAL_MODE_AFTER_STARTUP 1
|
||||
#define OBSW_PRINT_MISSED_DEADLINES 1
|
||||
|
||||
#define OBSW_SYRLINKS_SIMULATED 1
|
||||
#define OBSW_ADD_TEST_CODE 0
|
||||
#define OBSW_ADD_TEST_TASK 0
|
||||
#define OBSW_ADD_TEST_PST 0
|
||||
// If this is enabled, all other SPI code should be disabled
|
||||
#define OBSW_ADD_SPI_TEST_CODE 0
|
||||
// If this is enabled, all other I2C code should be disabled
|
||||
#define OBSW_ADD_I2C_TEST_CODE 0
|
||||
#define OBSW_ADD_UART_TEST_CODE 0
|
||||
|
||||
#define OBSW_TEST_ACS 0
|
||||
#define OBSW_DEBUG_ACS 0
|
||||
#define OBSW_TEST_SUS 0
|
||||
#define OBSW_DEBUG_SUS 0
|
||||
#define OBSW_TEST_RTD 0
|
||||
#define OBSW_DEBUG_RTD 0
|
||||
#define OBSW_TEST_RAD_SENSOR 0
|
||||
#define OBSW_DEBUG_RAD_SENSOR 0
|
||||
#define OBSW_TEST_PL_PCDU 0
|
||||
#define OBSW_DEBUG_PL_PCDU 0
|
||||
#define OBSW_TEST_BPX_BATT 0
|
||||
#define OBSW_DEBUG_BPX_BATT 0
|
||||
#define OBSW_TEST_IMTQ 0
|
||||
#define OBSW_DEBUG_IMTQ 0
|
||||
#define OBSW_TEST_RW 0
|
||||
#define OBSW_DEBUG_RW 0
|
||||
|
||||
#define OBSW_TEST_LIBGPIOD 0
|
||||
#define OBSW_TEST_PLOC_HANDLER 0
|
||||
#define OBSW_TEST_CCSDS_BRIDGE 0
|
||||
#define OBSW_TEST_CCSDS_PTME 0
|
||||
#define OBSW_TEST_TE7020_HEATER 0
|
||||
#define OBSW_TEST_GPIO_OPEN_BY_LABEL 0
|
||||
#define OBSW_TEST_GPIO_OPEN_BY_LINE_NAME 0
|
||||
#define OBSW_DEBUG_P60DOCK 0
|
||||
|
||||
#define OBSW_PRINT_CORE_HK 0
|
||||
#define OBSW_DEBUG_PDU1 0
|
||||
#define OBSW_DEBUG_PDU2 0
|
||||
#define OBSW_DEBUG_GPS 0
|
||||
#define OBSW_DEBUG_ACU 0
|
||||
#define OBSW_DEBUG_SYRLINKS 0
|
||||
|
||||
#define OBSW_DEBUG_PDEC_HANDLER 0
|
||||
#define OBSW_DEBUG_PLOC_SUPERVISOR 0
|
||||
#define OBSW_DEBUG_PLOC_MPSOC 0
|
||||
#define OBSW_DEBUG_STARTRACKER 0
|
||||
#define OBSW_TCP_SERVER_WIRETAPPING 0
|
||||
|
||||
/*******************************************************************/
|
||||
/** CMake Defines */
|
||||
/*******************************************************************/
|
||||
#cmakedefine EIVE_BUILD_GPSD_GPS_HANDLER
|
||||
|
||||
#cmakedefine LIBGPS_VERSION_MAJOR @LIBGPS_VERSION_MAJOR@
|
||||
#cmakedefine LIBGPS_VERSION_MINOR @LIBGPS_VERSION_MINOR@
|
||||
|
||||
#ifdef RASPBERRY_PI
|
||||
#include "rpiConfig.h"
|
||||
#elif defined(XIPHOS_Q7S)
|
||||
#include "q7sConfig.h"
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
#include "objects/systemObjectList.h"
|
||||
#include "events/subsystemIdRanges.h"
|
||||
#include "returnvalues/classIds.h"
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* FSFWCONFIG_OBSWCONFIG_H_ */
|
@ -9,6 +9,7 @@
|
||||
#include <tmtc/pusIds.h>
|
||||
|
||||
#include "OBSWConfig.h"
|
||||
#include "fsfw_tests/integration/task/TestTask.h"
|
||||
|
||||
#if OBSW_USE_TMTC_TCP_BRIDGE == 0
|
||||
#include "fsfw/osal/common/UdpTcPollingTask.h"
|
||||
@ -24,7 +25,7 @@
|
||||
#include <test/testtasks/TestTask.h>
|
||||
#endif
|
||||
|
||||
#include "GlobalConfigHandler.h"
|
||||
#include <mission/utility/GlobalConfigHandler.h>
|
||||
|
||||
void Factory::setStaticFrameworkObjectIds() {
|
||||
PusServiceBase::packetSource = objects::PUS_PACKET_DISTRIBUTOR;
|
||||
|
@ -1,10 +1,3 @@
|
||||
target_sources(${OBSW_NAME} PRIVATE
|
||||
print.c
|
||||
)
|
||||
|
||||
target_include_directories(${OBSW_NAME} PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
)
|
||||
|
||||
|
||||
target_sources(${OBSW_NAME} PRIVATE print.c)
|
||||
|
||||
target_include_directories(${OBSW_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
|
@ -1,11 +0,0 @@
|
||||
# add main and others
|
||||
CXXSRC += $(wildcard $(CURRENTPATH)/*.cpp)
|
||||
CSRC += $(wildcard $(CURRENTPATH)/*.c)
|
||||
|
||||
CSRC += $(wildcard $(CURRENTPATH)/boardconfig/*.c)
|
||||
|
||||
CXXSRC += $(wildcard $(CURRENTPATH)/comIF/*.cpp)
|
||||
CSRC += $(wildcard $(CURRENTPATH)/comIF/*.c)
|
||||
|
||||
INCLUDES += $(CURRENTPATH)/boardconfig
|
||||
INCLUDES += $(CURRENTPATH)/fsfwconfig
|
@ -1,8 +1 @@
|
||||
target_sources(${TARGET_NAME} PUBLIC
|
||||
ArduinoComIF.cpp
|
||||
ArduinoCookie.cpp
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
target_sources(${TARGET_NAME} PUBLIC ArduinoComIF.cpp ArduinoCookie.cpp)
|
||||
|
@ -1,27 +1,15 @@
|
||||
target_sources(${OBSW_NAME} PRIVATE
|
||||
ipc/MissionMessageTypes.cpp
|
||||
)
|
||||
target_sources(${OBSW_NAME} PRIVATE ipc/MissionMessageTypes.cpp)
|
||||
|
||||
target_include_directories(${OBSW_NAME} PUBLIC
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
)
|
||||
target_include_directories(${OBSW_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
|
||||
# If a special translation file for object IDs exists, compile it.
|
||||
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/objects/translateObjects.cpp")
|
||||
target_sources(${OBSW_NAME} PRIVATE
|
||||
objects/translateObjects.cpp
|
||||
)
|
||||
target_sources(${UNITTEST_NAME} PRIVATE
|
||||
objects/translateObjects.cpp
|
||||
)
|
||||
target_sources(${OBSW_NAME} PRIVATE objects/translateObjects.cpp)
|
||||
target_sources(${UNITTEST_NAME} PRIVATE objects/translateObjects.cpp)
|
||||
endif()
|
||||
|
||||
# If a special translation file for events exists, compile it.
|
||||
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/objects/translateObjects.cpp")
|
||||
target_sources(${OBSW_NAME} PRIVATE
|
||||
events/translateEvents.cpp
|
||||
)
|
||||
target_sources(${UNITTEST_NAME} PRIVATE
|
||||
events/translateEvents.cpp
|
||||
)
|
||||
target_sources(${OBSW_NAME} PRIVATE events/translateEvents.cpp)
|
||||
target_sources(${UNITTEST_NAME} PRIVATE events/translateEvents.cpp)
|
||||
endif()
|
||||
|
@ -1,18 +0,0 @@
|
||||
#ifndef FSFWCONFIG_TMTC_APID_H_
|
||||
#define FSFWCONFIG_TMTC_APID_H_
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
/**
|
||||
* Application Process Definition: entity, uniquely identified by an
|
||||
* application process ID (APID), capable of generating telemetry source
|
||||
* packets and receiving telecommand packets
|
||||
*
|
||||
* SOURCE APID: 0x73 / 115 / s
|
||||
* APID is a 11 bit number
|
||||
*/
|
||||
namespace apid {
|
||||
static const uint16_t EIVE_OBSW = 0x65;
|
||||
}
|
||||
|
||||
#endif /* FSFWCONFIG_TMTC_APID_H_ */
|
@ -1,23 +0,0 @@
|
||||
#ifndef CONFIG_TMTC_PUSIDS_HPP_
|
||||
#define CONFIG_TMTC_PUSIDS_HPP_
|
||||
|
||||
namespace pus {
|
||||
enum Ids {
|
||||
PUS_SERVICE_1 = 1,
|
||||
PUS_SERVICE_2 = 2,
|
||||
PUS_SERVICE_3 = 3,
|
||||
PUS_SERVICE_3_PSB = 3,
|
||||
PUS_SERVICE_5 = 5,
|
||||
PUS_SERVICE_6 = 6,
|
||||
PUS_SERVICE_8 = 8,
|
||||
PUS_SERVICE_9 = 9,
|
||||
PUS_SERVICE_17 = 17,
|
||||
PUS_SERVICE_19 = 19,
|
||||
PUS_SERVICE_20 = 20,
|
||||
PUS_SERVICE_23 = 23,
|
||||
PUS_SERVICE_200 = 200,
|
||||
PUS_SERVICE_201 = 201,
|
||||
};
|
||||
};
|
||||
|
||||
#endif /* CONFIG_TMTC_PUSIDS_HPP_ */
|
@ -20,7 +20,7 @@ int main(void) {
|
||||
std::cout << "-- EIVE OBSW --" << std::endl;
|
||||
std::cout << "-- Compiled for " << COMPILE_PRINTOUT << " --" << std::endl;
|
||||
std::cout << "-- OBSW "
|
||||
<< " v" << common::OBSW_VERSION << " | FSFW v" << fsfw::FSFW_VERSION << " --"
|
||||
<< "v" << common::OBSW_VERSION << " | FSFW v" << fsfw::FSFW_VERSION << " --"
|
||||
<< std::endl;
|
||||
std::cout << "-- " << __DATE__ << " " << __TIME__ << " --" << std::endl;
|
||||
std::cout << "-- " <<" BSP HOSTED"<< " --" << std::endl;
|
||||
|
Reference in New Issue
Block a user