From a38c3e5005eb96ea7dd3be1e50896f9e1fd5329f Mon Sep 17 00:00:00 2001 From: "Robin.Mueller" Date: Thu, 29 Oct 2020 11:47:03 +0100 Subject: [PATCH] config folder renamed --- unittest/config/cdatapool/dataPoolInit.cpp | 48 ------------------- unittest/config/cdatapool/dataPoolInit.h | 29 ----------- unittest/config/events/translateEvents.cpp | 20 -------- unittest/config/events/translateEvents.h | 16 ------- unittest/config/objects/systemObjectList.h | 30 ------------ .../PollingSequenceFactory.cpp | 31 ------------ unittest/config/returnvalues/classIds.h | 28 ----------- unittest/config/tmtc/PusIds.hpp | 29 ----------- unittest/config/tmtc/subsystemIdRanges.h | 34 ------------- unittest/config/tmtc/tmTcSize.h | 10 ---- unittest/{config => testcfg}/FSFWConfig.h | 0 unittest/{config => testcfg}/TestsConfig.h | 0 unittest/testcfg/cdatapool/dataPoolInit.cpp | 5 ++ unittest/testcfg/cdatapool/dataPoolInit.h | 17 +++++++ .../devices/logicalAddresses.cpp | 0 .../devices/logicalAddresses.h | 0 .../devices/powerSwitcherList.cpp | 0 .../devices/powerSwitcherList.h | 0 unittest/testcfg/events/subsystemIdRanges.h | 18 +++++++ .../ipc/MissionMessageTypes.cpp | 2 +- .../ipc/MissionMessageTypes.h | 0 .../{config => testcfg}/objects/Factory.cpp | 0 .../{config => testcfg}/objects/Factory.h | 0 unittest/testcfg/objects/systemObjectList.h | 16 +++++++ .../objects/translateObjects.cpp | 0 .../objects/translateObjects.h | 0 .../PollingSequenceFactory.cpp | 23 +++++++++ .../pollingsequence/PollingSequenceFactory.h | 13 ++--- unittest/testcfg/returnvalues/classIds.h | 16 +++++++ .../{config/config.mk => testcfg/testcfg.mk} | 0 unittest/{config => testcfg}/tmtc/apid.h | 9 ++-- unittest/{config => testcfg}/tmtc/pusIds.h | 6 ++- unittest/{config => testcfg}/version.h | 0 33 files changed, 111 insertions(+), 289 deletions(-) delete mode 100644 unittest/config/cdatapool/dataPoolInit.cpp delete mode 100644 unittest/config/cdatapool/dataPoolInit.h delete mode 100644 unittest/config/events/translateEvents.cpp delete mode 100644 unittest/config/events/translateEvents.h delete mode 100644 unittest/config/objects/systemObjectList.h delete mode 100644 unittest/config/pollingsequence/PollingSequenceFactory.cpp delete mode 100644 unittest/config/returnvalues/classIds.h delete mode 100644 unittest/config/tmtc/PusIds.hpp delete mode 100644 unittest/config/tmtc/subsystemIdRanges.h delete mode 100644 unittest/config/tmtc/tmTcSize.h rename unittest/{config => testcfg}/FSFWConfig.h (100%) rename unittest/{config => testcfg}/TestsConfig.h (100%) create mode 100644 unittest/testcfg/cdatapool/dataPoolInit.cpp create mode 100644 unittest/testcfg/cdatapool/dataPoolInit.h rename unittest/{config => testcfg}/devices/logicalAddresses.cpp (100%) rename unittest/{config => testcfg}/devices/logicalAddresses.h (100%) rename unittest/{config => testcfg}/devices/powerSwitcherList.cpp (100%) rename unittest/{config => testcfg}/devices/powerSwitcherList.h (100%) create mode 100644 unittest/testcfg/events/subsystemIdRanges.h rename unittest/{config => testcfg}/ipc/MissionMessageTypes.cpp (80%) rename unittest/{config => testcfg}/ipc/MissionMessageTypes.h (100%) rename unittest/{config => testcfg}/objects/Factory.cpp (100%) rename unittest/{config => testcfg}/objects/Factory.h (100%) create mode 100644 unittest/testcfg/objects/systemObjectList.h rename unittest/{config => testcfg}/objects/translateObjects.cpp (100%) rename unittest/{config => testcfg}/objects/translateObjects.h (100%) create mode 100644 unittest/testcfg/pollingsequence/PollingSequenceFactory.cpp rename unittest/{config => testcfg}/pollingsequence/PollingSequenceFactory.h (74%) create mode 100644 unittest/testcfg/returnvalues/classIds.h rename unittest/{config/config.mk => testcfg/testcfg.mk} (100%) rename unittest/{config => testcfg}/tmtc/apid.h (61%) rename unittest/{config => testcfg}/tmtc/pusIds.h (86%) rename unittest/{config => testcfg}/version.h (100%) diff --git a/unittest/config/cdatapool/dataPoolInit.cpp b/unittest/config/cdatapool/dataPoolInit.cpp deleted file mode 100644 index f24d6cc5..00000000 --- a/unittest/config/cdatapool/dataPoolInit.cpp +++ /dev/null @@ -1,48 +0,0 @@ -#include "dataPoolInit.h" - -void datapool::dataPoolInit(std::map * poolMap) { - uint8_t UINT8T_INIT[1] = {0}; - uint16_t UINT16T_INIT[1] = {0}; - uint32_t UINT32T_INIT[1] = {0}; - float FLOAT_INIT[2] = {0.0, 0.0}; - /* FSFW */ - poolMap->emplace(datapool::INTERNAL_ERROR_STORE_FULL, - new PoolEntry(UINT32T_INIT,1)); - poolMap->emplace(datapool::INTERNAL_ERROR_MISSED_LIVE_TM, - new PoolEntry(UINT32T_INIT,1)); - poolMap->emplace(datapool::INTERNAL_ERROR_FULL_MSG_QUEUES, - new PoolEntry(UINT32T_INIT,1)); - - /* TEST */ - poolMap->emplace(datapool::TEST_UINT8, - new PoolEntry(UINT8T_INIT,1)); - poolMap->emplace(datapool::TEST_UINT16, - new PoolEntry(UINT16T_INIT,1)); - poolMap->emplace(datapool::TEST_UINT32, - new PoolEntry(UINT32T_INIT,1)); - poolMap->emplace(datapool::TEST_FLOAT_VECTOR, - new PoolEntry(FLOAT_INIT,2)); - - // With new initializer list feature and boolean entries. - -// /* FSFW */ -// poolMap->emplace(datapool::INTERNAL_ERROR_STORE_FULL, -// new PoolEntry({0},1)); -// poolMap->emplace(datapool::INTERNAL_ERROR_MISSED_LIVE_TM, -// new PoolEntry({0},1)); -// poolMap->emplace(datapool::INTERNAL_ERROR_FULL_MSG_QUEUES, -// new PoolEntry({0},1)); -// -// /* TEST */ -// poolMap->emplace(datapool::TEST_BOOLEAN, -// new PoolEntry({0},1)); -// poolMap->emplace(datapool::TEST_UINT8, -// new PoolEntry({0},1)); -// poolMap->emplace(datapool::TEST_UINT16, -// new PoolEntry({0},1)); -// poolMap->emplace(datapool::TEST_UINT32, -// new PoolEntry({0},1)); -// poolMap->emplace(datapool::TEST_FLOAT_VECTOR, -// new PoolEntry({0, 0},2)); - -} diff --git a/unittest/config/cdatapool/dataPoolInit.h b/unittest/config/cdatapool/dataPoolInit.h deleted file mode 100644 index 6fd32371..00000000 --- a/unittest/config/cdatapool/dataPoolInit.h +++ /dev/null @@ -1,29 +0,0 @@ -#ifndef HOSTED_CONFIG_CDATAPOOL_DATAPOOLINIT_H_ -#define HOSTED_CONFIG_CDATAPOOL_DATAPOOLINIT_H_ - -#include -#include -#include -#include - - -namespace datapool { - void dataPoolInit(std::map * poolMap); - - enum datapoolvariables { - NO_PARAMETER = 0, - - /** [EXPORT] : [GROUP] FSFW */ - INTERNAL_ERROR_STORE_FULL = 0xEE000001, //!< [EXPORT] : [NAME] Internal Error Store Entry [UNIT] (-) [SIZE] 1 [TYPE] uint32_t - INTERNAL_ERROR_MISSED_LIVE_TM = 0xEE000001, //!< [EXPORT] : [NAME] Internal Error Missed Live Tm [UNIT] (-) [SIZE] 1 [TYPE] uint32_t - INTERNAL_ERROR_FULL_MSG_QUEUES = 0xEE000001, //!< [EXPORT] : [NAME] Internal Error Full Msg Queue [UNIT] (-) [SIZE] 1 [TYPE] uint32_t - - /** [EXPORT] : [GROUP] TEST */ - TEST_BOOLEAN = 0x01010102, //!< [EXPORT] : [NAME] Test Boolean [UNIT] (-) [SIZE] 1 [TYPE] bool - TEST_UINT8 = 0x02020204, //!< [EXPORT] : [NAME] Test Byte [UNIT] (-) [SIZE] 1 [TYPE] uint8_t - TEST_UINT16 = 0x03030306, //!< [EXPORT] : [NAME] Test UINT16 [UNIT] (-) [SIZE] 1 [TYPE] uint16_t - TEST_UINT32 = 0x04040408, //!< [EXPORT] : [NAME] Test UINT32 [UNIT] (-) [SIZE] 1 [TYPE] uint32_t - TEST_FLOAT_VECTOR = 0x05050510, //!< [EXPORT] : [NAME] Test Float [UNIT] (-) [SIZE] 2 [TYPE] float - }; -} -#endif /* CONFIG_CDATAPOOL_DATAPOOLINIT_H_ */ diff --git a/unittest/config/events/translateEvents.cpp b/unittest/config/events/translateEvents.cpp deleted file mode 100644 index bfcbe2bc..00000000 --- a/unittest/config/events/translateEvents.cpp +++ /dev/null @@ -1,20 +0,0 @@ -/** - * @brief Auto-generated event translation file. Contains 80 translations. - * Generated on: 2020-05-02 20:13:41 - */ -#include - -const char *TEST_EVENT_SERVICE_1_STRING = "TEST_EVENT_SERVICE_1"; -const char *TEST2_STRING = "TEST2"; - -const char * translateEvents(Event event){ - switch((event&0xFFFF)){ - case 8000: - return TEST_EVENT_SERVICE_1_STRING; - case 9100: - return TEST2_STRING; - default: - return "UNKNOWN_EVENT"; - } - return 0; -} diff --git a/unittest/config/events/translateEvents.h b/unittest/config/events/translateEvents.h deleted file mode 100644 index 0e40ef8b..00000000 --- a/unittest/config/events/translateEvents.h +++ /dev/null @@ -1,16 +0,0 @@ -/* - * translateEvent.h - * - * Created on: 28 May 2019 - * Author: Robin - */ - -#ifndef CONFIG_EVENTS_TRANSLATEEVENTS_H_ -#define CONFIG_EVENTS_TRANSLATEEVENTS_H_ - -#include - -const char * translateEvents(Event event); - - -#endif /* CONFIG_EVENTS_TRANSLATEEVENTS_H_ */ diff --git a/unittest/config/objects/systemObjectList.h b/unittest/config/objects/systemObjectList.h deleted file mode 100644 index 9793305e..00000000 --- a/unittest/config/objects/systemObjectList.h +++ /dev/null @@ -1,30 +0,0 @@ -#ifndef HOSTED_CONFIG_OBJECTS_SYSTEMOBJECTLIST_H_ -#define HOSTED_CONFIG_OBJECTS_SYSTEMOBJECTLIST_H_ - -#include - -// The objects will be instantiated in the ID order -namespace objects { - enum sourceObjects: uint32_t { - /* First Byte 0x50-0x52 reserved for PUS Services **/ - CCSDS_PACKET_DISTRIBUTOR = 0x50000100, - PUS_PACKET_DISTRIBUTOR = 0x50000200, - UDP_BRIDGE = 0x50000300, - UDP_POLLING_TASK = 0x50000400, - - PUS_SERVICE_3 = 0x51000300, - PUS_SERVICE_6_MEM_MGMT = 0x51000500, - PUS_SERVICE_23 = 0x51002300, - PUS_SERVICE_201_HEALTH = 0x51020100, - - PUS_TIME = 0x52000001, - PUS_FUNNEL = 0x52000002, - - /* Test Task */ - TEST_TASK = 0x42694269, - DUMMY_INTERFACE = 0xCAFECAFE, - DUMMY_HANDLER = 0x4400AFFE, - }; -} - -#endif /* BSP_CONFIG_OBJECTS_SYSTEMOBJECTLIST_H_ */ diff --git a/unittest/config/pollingsequence/PollingSequenceFactory.cpp b/unittest/config/pollingsequence/PollingSequenceFactory.cpp deleted file mode 100644 index dbe13add..00000000 --- a/unittest/config/pollingsequence/PollingSequenceFactory.cpp +++ /dev/null @@ -1,31 +0,0 @@ -#include -#include - -#include -#include -#include -#include - -ReturnValue_t pst::pollingSequenceInitDefault(FixedTimeslotTaskIF *thisSequence) -{ - /* Length of a communication cycle */ - uint32_t length = thisSequence->getPeriodMs(); - - thisSequence->addSlot(objects::DUMMY_HANDLER, - length * 0, DeviceHandlerIF::SEND_WRITE); - thisSequence->addSlot(objects::DUMMY_HANDLER, - length * 0.25, DeviceHandlerIF::GET_WRITE); - thisSequence->addSlot(objects::DUMMY_HANDLER, - length * 0.5, DeviceHandlerIF::SEND_READ); - thisSequence->addSlot(objects::DUMMY_HANDLER, - length * 0.75, DeviceHandlerIF::GET_READ); - - if (thisSequence->checkSequence() == HasReturnvaluesIF::RETURN_OK) { - return HasReturnvaluesIF::RETURN_OK; - } - else { - sif::error << "PollingSequence::initialize has errors!" << std::endl; - return HasReturnvaluesIF::RETURN_FAILED; - } -} - diff --git a/unittest/config/returnvalues/classIds.h b/unittest/config/returnvalues/classIds.h deleted file mode 100644 index a024e3d7..00000000 --- a/unittest/config/returnvalues/classIds.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - * classIds.h - * - * Created on: 16.07.2018 - * Author: mohr - */ - -#ifndef CONFIG_RETURNVALUES_CLASSIDS_H_ -#define CONFIG_RETURNVALUES_CLASSIDS_H_ - -/** - * Source IDs starts at 73 for now - * Framework IDs for ReturnValues run from 0 to 56 - * and are located inside - */ -namespace CLASS_ID { -enum { - MISSION_CLASS_ID_START = FW_CLASS_ID_COUNT, - RS232_CHANNEL, //!< RS232 - I2C_CHANNEL, //!< I2C - SPI_CHANNEL, //!< SPI - GPS_HANDLER, //!< GPS - PUS_SERVICE_3 //!< HKS -}; -} - - -#endif /* CONFIG_RETURNVALUES_CLASSIDS_H_ */ diff --git a/unittest/config/tmtc/PusIds.hpp b/unittest/config/tmtc/PusIds.hpp deleted file mode 100644 index fd37c7f4..00000000 --- a/unittest/config/tmtc/PusIds.hpp +++ /dev/null @@ -1,29 +0,0 @@ -/* - * PusIds.hpp - * - * Created on: 27.02.2019 - * Author: jakob - */ - -#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_5 = 5, - PUS_SERVICE_6 = 6, - PUS_SERVICE_8 = 8, - PUS_SERVICE_9 = 9, - PUS_SERVICE_17 = 17, - PUS_SERVICE_23 = 23, - PUS_SERVICE_200 = 200, - PUS_SERVICE_201 = 201, -}; -}; - - - -#endif /* CONFIG_TMTC_PUSIDS_HPP_ */ diff --git a/unittest/config/tmtc/subsystemIdRanges.h b/unittest/config/tmtc/subsystemIdRanges.h deleted file mode 100644 index e32de74c..00000000 --- a/unittest/config/tmtc/subsystemIdRanges.h +++ /dev/null @@ -1,34 +0,0 @@ -#ifndef CONFIG_TMTC_SUBSYSTEMIDRANGES_H_ -#define CONFIG_TMTC_SUBSYSTEMIDRANGES_H_ - -#include -#include - -/** - * These IDs are part of the ID for an event thrown by a subsystem. - * Numbers 0-80 are reserved for FSFW Subsystem IDs (framework/events/) - */ -namespace SUBSYSTEM_ID { -enum: uint8_t { - SUBSYSTE_ID_START = FW_SUBSYSTEM_ID_RANGE, - /** - * 80-105: PUS Services - */ - PUS_SERVICE_2 = 82, - PUS_SERVICE_3 = 83, - PUS_SERVICE_5 = 85, - PUS_SERVICE_6 = 86, - PUS_SERVICE_8 = 88, - PUS_SERVICE_23 = 91, - DUMMY_DEVICE = 100, - /** - * 105-115: AOCS - */ - GPS_DEVICE = 105, - - SPI_COM_IF = 128, - I2C_COM_IF = 138 -}; -} - -#endif /* CONFIG_TMTC_SUBSYSTEMIDRANGES_H_ */ diff --git a/unittest/config/tmtc/tmTcSize.h b/unittest/config/tmtc/tmTcSize.h deleted file mode 100644 index de7f4adc..00000000 --- a/unittest/config/tmtc/tmTcSize.h +++ /dev/null @@ -1,10 +0,0 @@ -#ifndef CONFIG_TMTC_TMTCSIZE_H_ -#define CONFIG_TMTC_TMTCSIZE_H_ - -#include - -namespace tmtcsize { -static const uint32_t MAX_TM_PACKET = 50; -} - -#endif /* CONFIG_TMTC_TMTCSIZE_H_ */ diff --git a/unittest/config/FSFWConfig.h b/unittest/testcfg/FSFWConfig.h similarity index 100% rename from unittest/config/FSFWConfig.h rename to unittest/testcfg/FSFWConfig.h diff --git a/unittest/config/TestsConfig.h b/unittest/testcfg/TestsConfig.h similarity index 100% rename from unittest/config/TestsConfig.h rename to unittest/testcfg/TestsConfig.h diff --git a/unittest/testcfg/cdatapool/dataPoolInit.cpp b/unittest/testcfg/cdatapool/dataPoolInit.cpp new file mode 100644 index 00000000..ad2dc4ef --- /dev/null +++ b/unittest/testcfg/cdatapool/dataPoolInit.cpp @@ -0,0 +1,5 @@ +#include "dataPoolInit.h" + +void datapool::dataPoolInit(std::map * poolMap) { + +} diff --git a/unittest/testcfg/cdatapool/dataPoolInit.h b/unittest/testcfg/cdatapool/dataPoolInit.h new file mode 100644 index 00000000..23a3d01f --- /dev/null +++ b/unittest/testcfg/cdatapool/dataPoolInit.h @@ -0,0 +1,17 @@ +#ifndef HOSTED_CONFIG_CDATAPOOL_DATAPOOLINIT_H_ +#define HOSTED_CONFIG_CDATAPOOL_DATAPOOLINIT_H_ + +#include +#include +#include +#include + + +namespace datapool { + void dataPoolInit(std::map * poolMap); + + enum datapoolvariables { + NO_PARAMETER = 0, + }; +} +#endif /* CONFIG_CDATAPOOL_DATAPOOLINIT_H_ */ diff --git a/unittest/config/devices/logicalAddresses.cpp b/unittest/testcfg/devices/logicalAddresses.cpp similarity index 100% rename from unittest/config/devices/logicalAddresses.cpp rename to unittest/testcfg/devices/logicalAddresses.cpp diff --git a/unittest/config/devices/logicalAddresses.h b/unittest/testcfg/devices/logicalAddresses.h similarity index 100% rename from unittest/config/devices/logicalAddresses.h rename to unittest/testcfg/devices/logicalAddresses.h diff --git a/unittest/config/devices/powerSwitcherList.cpp b/unittest/testcfg/devices/powerSwitcherList.cpp similarity index 100% rename from unittest/config/devices/powerSwitcherList.cpp rename to unittest/testcfg/devices/powerSwitcherList.cpp diff --git a/unittest/config/devices/powerSwitcherList.h b/unittest/testcfg/devices/powerSwitcherList.h similarity index 100% rename from unittest/config/devices/powerSwitcherList.h rename to unittest/testcfg/devices/powerSwitcherList.h diff --git a/unittest/testcfg/events/subsystemIdRanges.h b/unittest/testcfg/events/subsystemIdRanges.h new file mode 100644 index 00000000..24eee819 --- /dev/null +++ b/unittest/testcfg/events/subsystemIdRanges.h @@ -0,0 +1,18 @@ +#ifndef CONFIG_EVENTS_SUBSYSTEMIDRANGES_H_ +#define CONFIG_EVENTS_SUBSYSTEMIDRANGES_H_ + +#include +#include + +/** + * @brief Custom subsystem IDs can be added here + * @details + * Subsystem IDs are used to create unique events. + */ +namespace SUBSYSTEM_ID { +enum: uint8_t { + SUBSYSTEM_ID_START = FW_SUBSYSTEM_ID_RANGE, +}; +} + +#endif /* CONFIG_EVENTS_SUBSYSTEMIDRANGES_H_ */ diff --git a/unittest/config/ipc/MissionMessageTypes.cpp b/unittest/testcfg/ipc/MissionMessageTypes.cpp similarity index 80% rename from unittest/config/ipc/MissionMessageTypes.cpp rename to unittest/testcfg/ipc/MissionMessageTypes.cpp index 304ca439..0ac8debe 100644 --- a/unittest/config/ipc/MissionMessageTypes.cpp +++ b/unittest/testcfg/ipc/MissionMessageTypes.cpp @@ -2,7 +2,7 @@ #include void messagetypes::clearMissionMessage(CommandMessage* message) { - switch((message->getCommand()>>8) & 0xff) { + switch(message->getMessageType()) { default: break; } diff --git a/unittest/config/ipc/MissionMessageTypes.h b/unittest/testcfg/ipc/MissionMessageTypes.h similarity index 100% rename from unittest/config/ipc/MissionMessageTypes.h rename to unittest/testcfg/ipc/MissionMessageTypes.h diff --git a/unittest/config/objects/Factory.cpp b/unittest/testcfg/objects/Factory.cpp similarity index 100% rename from unittest/config/objects/Factory.cpp rename to unittest/testcfg/objects/Factory.cpp diff --git a/unittest/config/objects/Factory.h b/unittest/testcfg/objects/Factory.h similarity index 100% rename from unittest/config/objects/Factory.h rename to unittest/testcfg/objects/Factory.h diff --git a/unittest/testcfg/objects/systemObjectList.h b/unittest/testcfg/objects/systemObjectList.h new file mode 100644 index 00000000..0e034aff --- /dev/null +++ b/unittest/testcfg/objects/systemObjectList.h @@ -0,0 +1,16 @@ +#ifndef HOSTED_CONFIG_OBJECTS_SYSTEMOBJECTLIST_H_ +#define HOSTED_CONFIG_OBJECTS_SYSTEMOBJECTLIST_H_ + +#include +#include + +// The objects will be instantiated in the ID order +namespace objects { + enum sourceObjects: uint32_t { + /* All addresses between start and end are reserved for the FSFW */ + FSFW_CONFIG_RESERVED_START = PUS_SERVICE_1_VERIFICATION, + FSFW_CONFIG_RESERVED_END = TM_STORE + }; +} + +#endif /* BSP_CONFIG_OBJECTS_SYSTEMOBJECTLIST_H_ */ diff --git a/unittest/config/objects/translateObjects.cpp b/unittest/testcfg/objects/translateObjects.cpp similarity index 100% rename from unittest/config/objects/translateObjects.cpp rename to unittest/testcfg/objects/translateObjects.cpp diff --git a/unittest/config/objects/translateObjects.h b/unittest/testcfg/objects/translateObjects.h similarity index 100% rename from unittest/config/objects/translateObjects.h rename to unittest/testcfg/objects/translateObjects.h diff --git a/unittest/testcfg/pollingsequence/PollingSequenceFactory.cpp b/unittest/testcfg/pollingsequence/PollingSequenceFactory.cpp new file mode 100644 index 00000000..f836a746 --- /dev/null +++ b/unittest/testcfg/pollingsequence/PollingSequenceFactory.cpp @@ -0,0 +1,23 @@ +#include "PollingSequenceFactory.h" + +#include +#include +#include + +ReturnValue_t pst::pollingSequenceInitDefault( + FixedTimeslotTaskIF *thisSequence) { + /* Length of a communication cycle */ + uint32_t length = thisSequence->getPeriodMs(); + + /* Add polling sequence table here */ + + if (thisSequence->checkSequence() == HasReturnvaluesIF::RETURN_OK) { + return HasReturnvaluesIF::RETURN_OK; + } + else { + sif::error << "pst::pollingSequenceInitDefault: Sequence invalid!" + << std::endl; + return HasReturnvaluesIF::RETURN_FAILED; + } +} + diff --git a/unittest/config/pollingsequence/PollingSequenceFactory.h b/unittest/testcfg/pollingsequence/PollingSequenceFactory.h similarity index 74% rename from unittest/config/pollingsequence/PollingSequenceFactory.h rename to unittest/testcfg/pollingsequence/PollingSequenceFactory.h index b6cc2f1e..c5d41b7d 100644 --- a/unittest/config/pollingsequence/PollingSequenceFactory.h +++ b/unittest/testcfg/pollingsequence/PollingSequenceFactory.h @@ -1,13 +1,14 @@ #ifndef POLLINGSEQUENCEFACTORY_H_ #define POLLINGSEQUENCEFACTORY_H_ + #include class FixedTimeslotTaskIF; /** - * All device handlers are scheduled by adding them into - * Polling Sequence Tables (PST) to satisfy stricter timing requirements of - * device communication, a device handler has four different communication steps: + * All device handlers are scheduled by adding them into Polling Sequence Tables (PST) + * to satisfy stricter timing requirements of device communication, + * A device handler has four different communication steps: * 1. DeviceHandlerIF::SEND_WRITE -> Send write via interface * 2. DeviceHandlerIF::GET_WRITE -> Get confirmation for write * 3. DeviceHandlerIF::SEND_READ -> Send read request @@ -17,15 +18,15 @@ class FixedTimeslotTaskIF; * The task is created using the FixedTimeslotTaskIF, * which utilises the underlying Operating System Abstraction Layer (OSAL) * - * @param thisSequence FixedTimeslotTaskIF * object is passed inside the - * Factory class when creating the PST + * @param thisSequence FixedTimeslotTaskIF * object is passed inside the Factory class when creating the PST * @return */ namespace pst { -/* 0.4 second period init*/ +/* Default PST */ ReturnValue_t pollingSequenceInitDefault(FixedTimeslotTaskIF *thisSequence); + } #endif /* POLLINGSEQUENCEINIT_H_ */ diff --git a/unittest/testcfg/returnvalues/classIds.h b/unittest/testcfg/returnvalues/classIds.h new file mode 100644 index 00000000..606cc60b --- /dev/null +++ b/unittest/testcfg/returnvalues/classIds.h @@ -0,0 +1,16 @@ +#ifndef CONFIG_RETURNVALUES_CLASSIDS_H_ +#define CONFIG_RETURNVALUES_CLASSIDS_H_ + +#include + +/** + * @brief CLASS_ID defintions which are required for custom returnvalues. + */ +namespace CLASS_ID { +enum { + MISSION_CLASS_ID_START = FW_CLASS_ID_COUNT, +}; +} + + +#endif /* CONFIG_RETURNVALUES_CLASSIDS_H_ */ diff --git a/unittest/config/config.mk b/unittest/testcfg/testcfg.mk similarity index 100% rename from unittest/config/config.mk rename to unittest/testcfg/testcfg.mk diff --git a/unittest/config/tmtc/apid.h b/unittest/testcfg/tmtc/apid.h similarity index 61% rename from unittest/config/tmtc/apid.h rename to unittest/testcfg/tmtc/apid.h index 77e55952..c0231bca 100644 --- a/unittest/config/tmtc/apid.h +++ b/unittest/testcfg/tmtc/apid.h @@ -1,18 +1,17 @@ #ifndef CONFIG_TMTC_APID_H_ #define CONFIG_TMTC_APID_H_ -#include +#include /** * Application Process Definition: entity, uniquely identified by an * application process ID (APID), capable of generating telemetry source - * packets and receiving telecommand packets + * packets and receiving telecommand packets. * - * SOURCE APID: 0x73 / 115 / s - * APID is a 11 bit number + * Chose APID(s) for mission and define it here. */ namespace apid { - static const uint16_t SOURCE_OBSW = 0x73; + static const uint16_t DEFAULT_APID = 0x00; } diff --git a/unittest/config/tmtc/pusIds.h b/unittest/testcfg/tmtc/pusIds.h similarity index 86% rename from unittest/config/tmtc/pusIds.h rename to unittest/testcfg/tmtc/pusIds.h index a2dd7575..821a9982 100644 --- a/unittest/config/tmtc/pusIds.h +++ b/unittest/testcfg/tmtc/pusIds.h @@ -1,16 +1,18 @@ #ifndef CONFIG_TMTC_PUSIDS_HPP_ #define CONFIG_TMTC_PUSIDS_HPP_ +#include + namespace pus { -enum Ids{ +enum Ids: uint8_t { 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_11 = 11, PUS_SERVICE_17 = 17, PUS_SERVICE_19 = 19, PUS_SERVICE_20 = 20, diff --git a/unittest/config/version.h b/unittest/testcfg/version.h similarity index 100% rename from unittest/config/version.h rename to unittest/testcfg/version.h