more similar to example now
This commit is contained in:
14
config/OBSWConfig.h
Normal file
14
config/OBSWConfig.h
Normal file
@ -0,0 +1,14 @@
|
||||
/**
|
||||
* @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 CONFIG_OBSWCONFIG_H_
|
||||
#define CONFIG_OBSWCONFIG_H_
|
||||
|
||||
#define ADD_TEST_FOLDER 1
|
||||
|
||||
// Define not used yet, PUS stack and TMTC tasks are always started
|
||||
#define ADD_PUS_STACK 1
|
||||
|
||||
#endif /* CONFIG_OBSWCONFIG_H_ */
|
@ -1,48 +0,0 @@
|
||||
#include "dataPoolInit.h"
|
||||
|
||||
void datapool::dataPoolInit(std::map<uint32_t, PoolEntryIF*>* 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<uint32_t>(UINT32T_INIT,1));
|
||||
poolMap->emplace(datapool::INTERNAL_ERROR_MISSED_LIVE_TM,
|
||||
new PoolEntry<uint32_t>(UINT32T_INIT,1));
|
||||
poolMap->emplace(datapool::INTERNAL_ERROR_FULL_MSG_QUEUES,
|
||||
new PoolEntry<uint32_t>(UINT32T_INIT,1));
|
||||
|
||||
/* TEST */
|
||||
poolMap->emplace(datapool::TEST_UINT8,
|
||||
new PoolEntry<uint8_t>(UINT8T_INIT,1));
|
||||
poolMap->emplace(datapool::TEST_UINT16,
|
||||
new PoolEntry<uint16_t>(UINT16T_INIT,1));
|
||||
poolMap->emplace(datapool::TEST_UINT32,
|
||||
new PoolEntry<uint32_t>(UINT32T_INIT,1));
|
||||
poolMap->emplace(datapool::TEST_FLOAT_VECTOR,
|
||||
new PoolEntry<float>(FLOAT_INIT,2));
|
||||
|
||||
// With new initializer list feature and boolean entries.
|
||||
|
||||
// /* FSFW */
|
||||
// poolMap->emplace(datapool::INTERNAL_ERROR_STORE_FULL,
|
||||
// new PoolEntry<uint32_t>({0},1));
|
||||
// poolMap->emplace(datapool::INTERNAL_ERROR_MISSED_LIVE_TM,
|
||||
// new PoolEntry<uint32_t>({0},1));
|
||||
// poolMap->emplace(datapool::INTERNAL_ERROR_FULL_MSG_QUEUES,
|
||||
// new PoolEntry<uint32_t>({0},1));
|
||||
//
|
||||
// /* TEST */
|
||||
// poolMap->emplace(datapool::TEST_BOOLEAN,
|
||||
// new PoolEntry<bool>({0},1));
|
||||
// poolMap->emplace(datapool::TEST_UINT8,
|
||||
// new PoolEntry<uint8_t>({0},1));
|
||||
// poolMap->emplace(datapool::TEST_UINT16,
|
||||
// new PoolEntry<uint16_t>({0},1));
|
||||
// poolMap->emplace(datapool::TEST_UINT32,
|
||||
// new PoolEntry<uint32_t>({0},1));
|
||||
// poolMap->emplace(datapool::TEST_FLOAT_VECTOR,
|
||||
// new PoolEntry<float>({0, 0},2));
|
||||
|
||||
}
|
@ -1,29 +0,0 @@
|
||||
#ifndef HOSTED_CONFIG_CDATAPOOL_DATAPOOLINIT_H_
|
||||
#define HOSTED_CONFIG_CDATAPOOL_DATAPOOLINIT_H_
|
||||
|
||||
#include <fsfw/datapool/DataPool.h>
|
||||
#include <fsfw/datapool/PoolEntryIF.h>
|
||||
#include <map>
|
||||
#include <cstdint>
|
||||
|
||||
|
||||
namespace datapool {
|
||||
void dataPoolInit(std::map<uint32_t, PoolEntryIF*>* 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_ */
|
@ -1,116 +0,0 @@
|
||||
#include <Factory.h>
|
||||
#include <systemObjectList.h>
|
||||
#include <dataPoolInit.h>
|
||||
#include <apid.h>
|
||||
#include <pusIds.h>
|
||||
|
||||
#include <mission/utility/TimeStamper.h>
|
||||
#include <mission/utility/TmFunnel.h>
|
||||
|
||||
#include <fsfw/events/EventManager.h>
|
||||
#include <fsfw/health/HealthTable.h>
|
||||
#include <fsfw/internalError/InternalErrorReporter.h>
|
||||
#include <fsfw/objectmanager/frameworkObjects.h>
|
||||
#include <fsfw/storagemanager/PoolManager.h>
|
||||
#include <fsfw/tcdistribution/CCSDSDistributor.h>
|
||||
#include <fsfw/tcdistribution/PUSDistributor.h>
|
||||
#include <fsfw/tmtcpacket/pus/TmPacketStored.h>
|
||||
#include <fsfw/tmtcservices/PusServiceBase.h>
|
||||
#include <fsfw/pus/Service1TelecommandVerification.h>
|
||||
#include <fsfw/pus/Service2DeviceAccess.h>
|
||||
#include <fsfw/pus/Service5EventReporting.h>
|
||||
#include <fsfw/pus/Service8FunctionManagement.h>
|
||||
#include <fsfw/pus/CService200ModeCommanding.h>
|
||||
#include <fsfw/osal/linux/TmTcUnixUdpBridge.h>
|
||||
#include <fsfw/osal/linux/TcUnixUdpPollingTask.h>
|
||||
#include <fsfw/pus/Service17Test.h>
|
||||
#include <test/testtasks/TestTask.h>
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
/**
|
||||
* @brief Produces system objects.
|
||||
* @details
|
||||
* Build tasks by using SystemObject Interface (Interface).
|
||||
* Header files of all tasks must be included
|
||||
* Please note that an object has to implement the system object interface
|
||||
* if the interface validity is checked or retrieved later by using the
|
||||
* get<TargetInterface>(object_id) function from the ObjectManagerIF.
|
||||
*
|
||||
* Framework objects are created first.
|
||||
*
|
||||
* @ingroup init
|
||||
*/
|
||||
void Factory::produce(void) {
|
||||
setStaticFrameworkObjectIds();
|
||||
new EventManager(objects::EVENT_MANAGER);
|
||||
new HealthTable(objects::HEALTH_TABLE);
|
||||
new InternalErrorReporter(objects::INTERNAL_ERROR_REPORTER,
|
||||
datapool::INTERNAL_ERROR_FULL_MSG_QUEUES,
|
||||
datapool::INTERNAL_ERROR_MISSED_LIVE_TM,
|
||||
datapool::INTERNAL_ERROR_STORE_FULL);
|
||||
|
||||
/* Pool manager handles storage und mutexes */
|
||||
/* Data Stores. Currently reserving 9600 bytes of memory */
|
||||
uint16_t numberOfElements[4] = {100, 30, 20, 10};
|
||||
uint16_t sizeOfElements[4] = {32, 64, 128, 256};
|
||||
new PoolManager<4>(objects::IPC_STORE, sizeOfElements, numberOfElements);
|
||||
new PoolManager<4>(objects::TM_STORE, sizeOfElements, numberOfElements);
|
||||
new PoolManager<4>(objects::TC_STORE, sizeOfElements, numberOfElements);
|
||||
|
||||
new TimeStamper(objects::PUS_TIME);
|
||||
|
||||
/* Distributor Tasks */
|
||||
new CCSDSDistributor(apid::EIVE_OBSW, objects::CCSDS_PACKET_DISTRIBUTOR);
|
||||
new PUSDistributor(apid::EIVE_OBSW, objects::PUS_PACKET_DISTRIBUTOR,
|
||||
objects::CCSDS_PACKET_DISTRIBUTOR);
|
||||
|
||||
/* TM Destination */
|
||||
new TmFunnel(objects::PUS_FUNNEL);
|
||||
|
||||
new TmTcUnixUdpBridge(objects::UDP_BRIDGE,
|
||||
objects::CCSDS_PACKET_DISTRIBUTOR, objects::TM_STORE,
|
||||
objects::TC_STORE);
|
||||
new TcUnixUdpPollingTask(objects::UDP_POLLING_TASK,
|
||||
objects::UDP_BRIDGE);
|
||||
|
||||
/* PUS Service Base Services */
|
||||
new Service1TelecommandVerification(objects::PUS_SERVICE_1,
|
||||
apid::EIVE_OBSW, pus::PUS_SERVICE_1, objects::PUS_FUNNEL);
|
||||
new Service5EventReporting(objects::PUS_SERVICE_5, apid::EIVE_OBSW,
|
||||
pus::PUS_SERVICE_5);
|
||||
new Service17Test(objects::PUS_SERVICE_17, apid::EIVE_OBSW,
|
||||
pus::PUS_SERVICE_17);
|
||||
|
||||
/* Commanding Service Base Services */
|
||||
new Service2DeviceAccess(objects::PUS_SERVICE_2, apid::EIVE_OBSW,
|
||||
pus::PUS_SERVICE_2);
|
||||
new Service8FunctionManagement(objects::PUS_SERVICE_8, apid::EIVE_OBSW,
|
||||
pus::PUS_SERVICE_8);
|
||||
new CService200ModeCommanding(objects::PUS_SERVICE_200, apid::EIVE_OBSW,
|
||||
pus::PUS_SERVICE_200);
|
||||
|
||||
/* Test Tasks */
|
||||
// CookieIF* dummyCookie = new DummyCookie(0);
|
||||
// new DummyEchoComIF(objects::DUMMY_INTERFACE);
|
||||
// new TestDevice(objects::DUMMY_HANDLER, objects::DUMMY_INTERFACE,
|
||||
// dummyCookie, true);
|
||||
new TestTask(objects::TEST_TASK);
|
||||
}
|
||||
|
||||
void Factory::setStaticFrameworkObjectIds() {
|
||||
PusServiceBase::packetSource = objects::PUS_PACKET_DISTRIBUTOR;
|
||||
PusServiceBase::packetDestination = objects::PUS_FUNNEL;
|
||||
|
||||
CommandingServiceBase::defaultPacketSource = objects::PUS_PACKET_DISTRIBUTOR;
|
||||
CommandingServiceBase::defaultPacketDestination = objects::PUS_FUNNEL;
|
||||
|
||||
VerificationReporter::messageReceiver = objects::PUS_SERVICE_1;
|
||||
//DeviceHandlerBase::rawDataReceiverId = objects::PUS_SERVICE_2;
|
||||
//DeviceHandlerBase::powerSwitcherId = objects::NO_OBJECT;
|
||||
|
||||
TmPacketStored::timeStamperId = objects::PUS_TIME;
|
||||
TmFunnel::downlinkDestination = objects::UDP_BRIDGE;
|
||||
}
|
||||
|
||||
|
@ -1,16 +0,0 @@
|
||||
#ifndef FACTORY_H_
|
||||
#define FACTORY_H_
|
||||
|
||||
#include <fsfw/objectmanager/SystemObjectIF.h>
|
||||
|
||||
namespace Factory {
|
||||
/**
|
||||
* @brief Creates all SystemObject elements which are persistent
|
||||
* during execution.
|
||||
*/
|
||||
void produce();
|
||||
void setStaticFrameworkObjectIds();
|
||||
|
||||
}
|
||||
|
||||
#endif /* FACTORY_H_ */
|
@ -12,20 +12,15 @@ namespace objects {
|
||||
UDP_BRIDGE = 0x50000300,
|
||||
UDP_POLLING_TASK = 0x50000400,
|
||||
|
||||
PUS_SERVICE_1 = 0x51000100,
|
||||
PUS_SERVICE_2 = 0x51000200,
|
||||
PUS_SERVICE_3 = 0x51000300,
|
||||
PUS_SERVICE_5 = 0x51000400,
|
||||
PUS_SERVICE_6 = 0x51000500,
|
||||
PUS_SERVICE_8 = 0x51000800,
|
||||
PUS_SERVICE_9 = 0x51000900,
|
||||
PUS_SERVICE_17 = 0x51001700,
|
||||
PUS_SERVICE_23 = 0x51002300,
|
||||
PUS_SERVICE_200 = 0x51020000,
|
||||
PUS_SERVICE_201 = 0x51020100,
|
||||
|
||||
PUS_TIME = 0x52000001,
|
||||
PUS_FUNNEL = 0x52000002,
|
||||
TIME_STAMPER = 0x52000001,
|
||||
TM_FUNNEL = 0x52000002,
|
||||
|
||||
/* Test Task */
|
||||
TEST_TASK = 0x42694269,
|
||||
|
@ -19,8 +19,6 @@ enum: uint8_t {
|
||||
PUS_SERVICE_5 = 85,
|
||||
PUS_SERVICE_6 = 86,
|
||||
PUS_SERVICE_8 = 88,
|
||||
PUS_SERVICE_9 = 89,
|
||||
PUS_SERVICE_17 = 82,
|
||||
PUS_SERVICE_23 = 91,
|
||||
DUMMY_DEVICE = 90,
|
||||
/**
|
||||
|
Reference in New Issue
Block a user