forked from ROMEO/obsw
73 lines
2.4 KiB
C++
73 lines
2.4 KiB
C++
#include "ObjectFactory.h"
|
|
|
|
#include <fsfw/objectmanager/frameworkObjects.h>
|
|
#include <fsfw/storagemanager/PoolManager.h>
|
|
#include <fsfw/tmtc/TmManager.h>
|
|
#include <fsfw/tmtc/UdpTmTcBridge.h>
|
|
#include <mission/controllers/SteeringController.h>
|
|
#include <mission/devicehandlers/RoboclawHandler.h>
|
|
#include <mission/devicehandlers/ServoHandler.h>
|
|
|
|
#include "fsfw/events/EventManager.h"
|
|
#include "fsfw/health/HealthTable.h"
|
|
#include "fsfw/internalerror/InternalErrorReporter.h"
|
|
#include "objects/communication/SerialTCPCookie.h"
|
|
#include "objects/communication/ServoCommInterface.h"
|
|
#include "systemObjects.h"
|
|
|
|
namespace objects {
|
|
enum commonObjects : object_id_t {
|
|
|
|
/* 0x63 ('C') for core objects */
|
|
CCSDS_DISTRIBUTOR = 0x63000000,
|
|
PUS_DISTRIBUTOR = 0x63000001,
|
|
TM_FUNNEL = 0x63000002,
|
|
CFDP_DISTRIBUTOR = 0x63000003,
|
|
CFDP_HANDLER = 0x63000004,
|
|
PUS_TM_FUNNEL = 0x63000005,
|
|
CFDP_TM_FUNNEL = 0x64000006,
|
|
};
|
|
}
|
|
|
|
namespace ObjectFactory {
|
|
uint16_t listeningPort = 0;
|
|
socklen_t defaultDestinationLen = 0;
|
|
const sockaddr *defaultDestination = nullptr;
|
|
const char *simString = nullptr;
|
|
} // namespace ObjectFactory
|
|
|
|
void Factory::setStaticFrameworkObjectIds() {
|
|
// MonitoringReportContent<float>::timeStamperId = objects::TIME_STAMPER;
|
|
// MonitoringReportContent<double>::timeStamperId = objects::TIME_STAMPER;
|
|
// MonitoringReportContent<uint32_t>::timeStamperId = objects::TIME_STAMPER;
|
|
// MonitoringReportContent<int32_t>::timeStamperId = objects::TIME_STAMPER;
|
|
// MonitoringReportContent<int16_t>::timeStamperId = objects::TIME_STAMPER;
|
|
// MonitoringReportContent<uint16_t>::timeStamperId = objects::TIME_STAMPER;
|
|
|
|
// PusServiceBase::PUS_DISTRIBUTOR = objects::PUS_DISTRIBUTOR;
|
|
// PusServiceBase::PACKET_DESTINATION = objects::PUS_TM_FUNNEL;
|
|
|
|
// CommandingServiceBase::defaultPacketSource = objects::PUS_DISTRIBUTOR;
|
|
// CommandingServiceBase::defaultPacketDestination = objects::PUS_TM_FUNNEL;
|
|
|
|
// VerificationReporter::DEFAULT_RECEIVER = objects::PUS_SERVICE_1_VERIFICATION;
|
|
}
|
|
|
|
void ObjectFactory::produce(void *args) {
|
|
Factory::setStaticFrameworkObjectIds();
|
|
|
|
|
|
|
|
{
|
|
LocalPool::LocalPoolConfig poolCfg = {{100, 16}, {50, 32}, {40, 64},
|
|
{30, 128}, {20, 1024}, {10, 2048}};
|
|
new PoolManager(objects::IPC_STORE, poolCfg);
|
|
}
|
|
|
|
new EventManager(objects::EVENT_MANAGER, 20);
|
|
new HealthTable(objects::HEALTH_TABLE);
|
|
new InternalErrorReporter(objects::INTERNAL_ERROR_REPORTER);
|
|
|
|
new TmManager(objects::TM_MANAGER);
|
|
}
|