diff --git a/CHANGELOG.md b/CHANGELOG.md index 57750b77..22c80f4e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,8 @@ list yields a list of all related PRs for each release. ## Added +- PUS11 TC scheduler + PR: https://egit.irs.uni-stuttgart.de/eive/eive-obsw/pulls/259 - Regular reboot command PR: https://egit.irs.uni-stuttgart.de/eive/eive-obsw/pulls/242 - Commands for individual RTD devices diff --git a/CMakeLists.txt b/CMakeLists.txt index eb44bd41..ef87352e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -64,6 +64,8 @@ include(EiveHelpers) option(EIVE_ADD_ETL_LIB "Add ETL library" ON) option(EIVE_ADD_JSON_LIB "Add JSON library" ON) +set(OBSW_MAX_SCHEDULED_TCS 500) + if(EIVE_Q7S_EM) set(OBSW_Q7S_EM 1 diff --git a/bsp_hosted/fsfwconfig/tmtc/apid.h b/bsp_hosted/fsfwconfig/tmtc/apid.h deleted file mode 100644 index 9d5c9ed5..00000000 --- a/bsp_hosted/fsfwconfig/tmtc/apid.h +++ /dev/null @@ -1,18 +0,0 @@ -#ifndef FSFWCONFIG_TMTC_APID_H_ -#define FSFWCONFIG_TMTC_APID_H_ - -#include - -/** - * 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_ */ diff --git a/bsp_q7s/core/InitMission.cpp b/bsp_q7s/core/InitMission.cpp index 1b9cc374..d824bb95 100644 --- a/bsp_q7s/core/InitMission.cpp +++ b/bsp_q7s/core/InitMission.cpp @@ -424,13 +424,22 @@ void initmission::createPusTasks(TaskFactory& factory, PeriodicTaskIF* pusMedPrio = factory.createPeriodicTask( "PUS_MED_PRIO", 40, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.8, missedDeadlineFunc); + + result = pusMedPrio->addComponent(objects::PUS_SERVICE_3_HOUSEKEEPING); + if (result != HasReturnvaluesIF::RETURN_OK) { + initmission::printAddObjectError("PUS_3", objects::PUS_SERVICE_3_HOUSEKEEPING); + } result = pusMedPrio->addComponent(objects::PUS_SERVICE_8_FUNCTION_MGMT); if (result != HasReturnvaluesIF::RETURN_OK) { initmission::printAddObjectError("PUS_8", objects::PUS_SERVICE_8_FUNCTION_MGMT); } - result = pusMedPrio->addComponent(objects::PUS_SERVICE_3_HOUSEKEEPING); + result = pusMedPrio->addComponent(objects::PUS_SERVICE_11_TC_SCHEDULER); if (result != HasReturnvaluesIF::RETURN_OK) { - sif::error << "Object add component failed" << std::endl; + initmission::printAddObjectError("PUS_11", objects::PUS_SERVICE_11_TC_SCHEDULER); + } + result = pusMedPrio->addComponent(objects::PUS_SERVICE_20_PARAMETERS); + if (result != HasReturnvaluesIF::RETURN_OK) { + initmission::printAddObjectError("PUS_20", objects::PUS_SERVICE_20_PARAMETERS); } result = pusMedPrio->addComponent(objects::PUS_SERVICE_200_MODE_MGMT); if (result != HasReturnvaluesIF::RETURN_OK) { @@ -440,10 +449,6 @@ void initmission::createPusTasks(TaskFactory& factory, if (result != HasReturnvaluesIF::RETURN_OK) { initmission::printAddObjectError("PUS_201", objects::PUS_SERVICE_201_HEALTH); } - result = pusMedPrio->addComponent(objects::PUS_SERVICE_20_PARAMETERS); - if (result != HasReturnvaluesIF::RETURN_OK) { - initmission::printAddObjectError("PUS_20", objects::PUS_SERVICE_20_PARAMETERS); - } taskVec.push_back(pusMedPrio); PeriodicTaskIF* pusLowPrio = factory.createPeriodicTask( diff --git a/common/config/commonConfig.h.in b/common/config/commonConfig.h.in index ad19e135..9581e751 100644 --- a/common/config/commonConfig.h.in +++ b/common/config/commonConfig.h.in @@ -33,6 +33,9 @@ static constexpr uint8_t OBSW_VERSION_REVISION = @OBSW_VERSION_REVISION@; // CST: Commits since tag static const char OBSW_VERSION_CST_GIT_SHA1[] = "@OBSW_VERSION_CST_GIT_SHA1@"; + +static constexpr uint32_t OBSW_MAX_SCHEDULED_TCS = @OBSW_MAX_SCHEDULED_TCS@; + extern const fsfw::Version OBSW_VERSION; extern const uint16_t PUS_PACKET_ID; diff --git a/bsp_hosted/fsfwconfig/tmtc/pusIds.h b/common/config/tmtc/pusIds.h similarity index 71% rename from bsp_hosted/fsfwconfig/tmtc/pusIds.h rename to common/config/tmtc/pusIds.h index 37503786..0891992d 100644 --- a/bsp_hosted/fsfwconfig/tmtc/pusIds.h +++ b/common/config/tmtc/pusIds.h @@ -1,5 +1,5 @@ -#ifndef CONFIG_TMTC_PUSIDS_HPP_ -#define CONFIG_TMTC_PUSIDS_HPP_ +#ifndef COMMON_CONFIG_TMTC_PUSIDS_H_ +#define COMMON_CONFIG_TMTC_PUSIDS_H_ namespace pus { enum Ids { @@ -11,6 +11,7 @@ enum Ids { PUS_SERVICE_6 = 6, PUS_SERVICE_8 = 8, PUS_SERVICE_9 = 9, + PUS_SERVICE_11 = 11, PUS_SERVICE_17 = 17, PUS_SERVICE_19 = 19, PUS_SERVICE_20 = 20, @@ -20,4 +21,4 @@ enum Ids { }; }; -#endif /* CONFIG_TMTC_PUSIDS_HPP_ */ +#endif /* COMMON_CONFIG_TMTC_PUSIDS_H_ */ diff --git a/linux/fsfwconfig/tmtc/pusIds.h b/linux/fsfwconfig/tmtc/pusIds.h deleted file mode 100644 index 37503786..00000000 --- a/linux/fsfwconfig/tmtc/pusIds.h +++ /dev/null @@ -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_ */ diff --git a/mission/core/GenericFactory.cpp b/mission/core/GenericFactory.cpp index 1a57a502..06e1fa29 100644 --- a/mission/core/GenericFactory.cpp +++ b/mission/core/GenericFactory.cpp @@ -13,6 +13,7 @@ #include #include #include +#include "fsfw/pus/Service11TelecommandScheduling.h" #include #include #include @@ -73,7 +74,7 @@ void ObjectFactory::produceGenericObjects(HealthTableIF** healthTable_) { new PoolManager(objects::IPC_STORE, poolCfg); } - new CCSDSDistributor(apid::EIVE_OBSW, objects::CCSDS_PACKET_DISTRIBUTOR); + auto* ccsdsDistrib = new CCSDSDistributor(apid::EIVE_OBSW, objects::CCSDS_PACKET_DISTRIBUTOR); new PUSDistributor(apid::EIVE_OBSW, objects::PUS_PACKET_DISTRIBUTOR, objects::CCSDS_PACKET_DISTRIBUTOR); @@ -96,6 +97,9 @@ void ObjectFactory::produceGenericObjects(HealthTableIF** healthTable_) { new Service8FunctionManagement(objects::PUS_SERVICE_8_FUNCTION_MGMT, apid::EIVE_OBSW, pus::PUS_SERVICE_8, 3, 60); new Service9TimeManagement(objects::PUS_SERVICE_9_TIME_MGMT, apid::EIVE_OBSW, pus::PUS_SERVICE_9); + + new Service11TelecommandScheduling(objects::PUS_SERVICE_11_TC_SCHEDULER, + apid::EIVE_OBSW, pus::PUS_SERVICE_11, ccsdsDistrib); new Service17Test(objects::PUS_SERVICE_17_TEST, apid::EIVE_OBSW, pus::PUS_SERVICE_17); new Service20ParameterManagement(objects::PUS_SERVICE_20_PARAMETERS, apid::EIVE_OBSW, pus::PUS_SERVICE_20);