more similar to example now
This commit is contained in:
@ -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,
|
||||
|
Reference in New Issue
Block a user