Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| a523f4ab91 | |||
| 3acc72470d | |||
| c483202852 | |||
| 43060b3be7 | |||
| a76b0ae56c |
@@ -137,7 +137,7 @@ void FsfwTestController::handleChangedDataset(sid_t sid,
|
||||
|
||||
if (verboseLevel >= 1) {
|
||||
char const *printout = nullptr;
|
||||
if (storeId == storeId::INVALID_STORE_ADDRESS) {
|
||||
if (storeId == store_address_t::invalid()) {
|
||||
printout = "Notification";
|
||||
} else {
|
||||
printout = "Snapshot";
|
||||
@@ -156,7 +156,7 @@ void FsfwTestController::handleChangedDataset(sid_t sid,
|
||||
printout, sid.objectId, sid.ownerSetId);
|
||||
#endif
|
||||
|
||||
if (storeId == storeId::INVALID_STORE_ADDRESS) {
|
||||
if (storeId == store_address_t::invalid()) {
|
||||
if (sid.objectId == device0Id) {
|
||||
PoolReadGuard readHelper(&deviceDataset0.testFloat3Vec);
|
||||
float floatVec[3];
|
||||
@@ -189,7 +189,7 @@ void FsfwTestController::handleChangedPoolVariable(gp_id_t globPoolId,
|
||||
|
||||
if (verboseLevel >= 1) {
|
||||
char const *printout = nullptr;
|
||||
if (storeId == storeId::INVALID_STORE_ADDRESS) {
|
||||
if (storeId == store_address_t::invalid()) {
|
||||
printout = "Notification";
|
||||
} else {
|
||||
printout = "Snapshot";
|
||||
@@ -209,7 +209,7 @@ void FsfwTestController::handleChangedPoolVariable(gp_id_t globPoolId,
|
||||
printout, globPoolId.objectId, globPoolId.localPoolId);
|
||||
#endif /* FSFW_CPP_OSTREAM_ENABLED == 1 */
|
||||
|
||||
if (storeId == storeId::INVALID_STORE_ADDRESS) {
|
||||
if (storeId == store_address_t::invalid()) {
|
||||
if (globPoolId.objectId == device0Id) {
|
||||
PoolReadGuard readHelper(&deviceDataset0.testUint8Var);
|
||||
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
||||
|
||||
@@ -21,9 +21,10 @@
|
||||
#include "fsfw/pus/Service8FunctionManagement.h"
|
||||
#include "fsfw/pus/Service9TimeManagement.h"
|
||||
#include "fsfw/tcdistribution/CCSDSDistributor.h"
|
||||
#include "fsfw/tcdistribution/PUSDistributor.h"
|
||||
#include "fsfw/timemanager/TimeStamper.h"
|
||||
#include "fsfw/tcdistribution/PusDistributor.h"
|
||||
#include "fsfw/timemanager/CdsShortTimeStamper.h"
|
||||
#include "fsfw/tmtcpacket/pus/tm.h"
|
||||
#include "fsfw/tmtcservices/VerificationReporter.h"
|
||||
#include "fsfw_tests/integration/assemblies/TestAssembly.h"
|
||||
#include "fsfw_tests/integration/controller/TestController.h"
|
||||
#include "fsfw_tests/integration/devices/TestCookie.h"
|
||||
@@ -39,12 +40,13 @@ void ObjectFactory::produceGenericObjects() {
|
||||
new EventManager(objects::EVENT_MANAGER);
|
||||
new HealthTable(objects::HEALTH_TABLE);
|
||||
new InternalErrorReporter(objects::INTERNAL_ERROR_REPORTER);
|
||||
new TimeStamper(objects::TIME_STAMPER);
|
||||
auto* stamperAndReader = new CdsShortTimeStamper(objects::TIME_STAMPER);
|
||||
new VerificationReporter(nullptr);
|
||||
auto *ccsdsDistrib =
|
||||
new CCSDSDistributor(apid::APID, objects::CCSDS_DISTRIBUTOR);
|
||||
new PUSDistributor(apid::APID, objects::PUS_DISTRIBUTOR,
|
||||
objects::CCSDS_DISTRIBUTOR);
|
||||
new TmFunnel(objects::TM_FUNNEL);
|
||||
new PusDistributor(apid::APID, objects::PUS_DISTRIBUTOR,
|
||||
ccsdsDistrib);
|
||||
new TmFunnel(*stamperAndReader, objects::TM_FUNNEL);
|
||||
#endif /* OBSW_ADD_CORE_COMPONENTS == 1 */
|
||||
|
||||
/* PUS stack */
|
||||
@@ -56,19 +58,19 @@ void ObjectFactory::produceGenericObjects() {
|
||||
pus::PUS_SERVICE_2, 3, 10);
|
||||
new Service3Housekeeping(objects::PUS_SERVICE_3_HOUSEKEEPING, apid::APID,
|
||||
pus::PUS_SERVICE_3);
|
||||
new Service5EventReporting(objects::PUS_SERVICE_5_EVENT_REPORTING, apid::APID,
|
||||
pus::PUS_SERVICE_5, 50);
|
||||
new Service5EventReporting(PsbParams(objects::PUS_SERVICE_5_EVENT_REPORTING, apid::APID,
|
||||
pus::PUS_SERVICE_5), 20 , 40);
|
||||
new Service8FunctionManagement(objects::PUS_SERVICE_8_FUNCTION_MGMT,
|
||||
apid::APID, pus::PUS_SERVICE_8, 3, 10);
|
||||
new Service9TimeManagement(objects::PUS_SERVICE_9_TIME_MGMT, apid::APID,
|
||||
pus::PUS_SERVICE_9);
|
||||
new Service17Test(objects::PUS_SERVICE_17_TEST, apid::APID,
|
||||
pus::PUS_SERVICE_17);
|
||||
new Service9TimeManagement(PsbParams(objects::PUS_SERVICE_9_TIME_MGMT, apid::APID,
|
||||
pus::PUS_SERVICE_9));
|
||||
new Service17Test(PsbParams(objects::PUS_SERVICE_17_TEST, apid::APID,
|
||||
pus::PUS_SERVICE_17));
|
||||
new Service20ParameterManagement(objects::PUS_SERVICE_20_PARAMETERS,
|
||||
apid::APID, pus::PUS_SERVICE_20);
|
||||
#if OBSW_ADD_CORE_COMPONENTS == 1
|
||||
new Service11TelecommandScheduling<cfg::OBSW_MAX_SCHEDULED_TCS>(
|
||||
objects::PUS_SERVICE_11_TC_SCHEDULER, apid::APID, pus::PUS_SERVICE_11,
|
||||
PsbParams(objects::PUS_SERVICE_11_TC_SCHEDULER, apid::APID, pus::PUS_SERVICE_11),
|
||||
ccsdsDistrib);
|
||||
#endif
|
||||
new CService200ModeCommanding(objects::PUS_SERVICE_200_MODE_MGMT, apid::APID,
|
||||
@@ -151,13 +153,14 @@ void Factory::setStaticFrameworkObjectIds() {
|
||||
// No storage object for now.
|
||||
TmFunnel::storageDestination = objects::NO_OBJECT;
|
||||
|
||||
PusServiceBase::packetSource = objects::PUS_DISTRIBUTOR;
|
||||
PusServiceBase::packetDestination = objects::TM_FUNNEL;
|
||||
PusServiceBase::PUS_DISTRIBUTOR = objects::PUS_DISTRIBUTOR;
|
||||
PusServiceBase::PACKET_DESTINATION = objects::TM_FUNNEL;
|
||||
|
||||
CommandingServiceBase::defaultPacketSource = objects::PUS_DISTRIBUTOR;
|
||||
CommandingServiceBase::defaultPacketDestination = objects::TM_FUNNEL;
|
||||
|
||||
VerificationReporter::messageReceiver = objects::PUS_SERVICE_1_VERIFICATION;
|
||||
VerificationReporter::DEFAULT_REPORTER = objects::TC_VERIFICATOR;
|
||||
VerificationReporter::DEFAULT_RECEIVER = objects::PUS_SERVICE_1_VERIFICATION;
|
||||
|
||||
TmPacketBase::timeStamperId = objects::TIME_STAMPER;
|
||||
// TmPacketBase::timeStamperId = objects::TIME_STAMPER;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#include "TmFunnel.h"
|
||||
|
||||
#include <fsfw/ipc/QueueFactory.h>
|
||||
#include "fsfw/tmtcpacket/pus/tm.h"
|
||||
#include <fsfw/objectmanager/ObjectManager.h>
|
||||
#include <fsfw/serviceinterface/ServiceInterface.h>
|
||||
#include <fsfw/tmtcpacket/pus/tm.h>
|
||||
@@ -8,15 +9,15 @@
|
||||
object_id_t TmFunnel::downlinkDestination = objects::NO_OBJECT;
|
||||
object_id_t TmFunnel::storageDestination = objects::NO_OBJECT;
|
||||
|
||||
TmFunnel::TmFunnel(object_id_t objectId, uint32_t messageDepth)
|
||||
: SystemObject(objectId), messageDepth(messageDepth) {
|
||||
TmFunnel::TmFunnel(TimeReaderIF& timeReader, object_id_t objectId, uint32_t messageDepth)
|
||||
: SystemObject(objectId), timeReader(timeReader), messageDepth(messageDepth) {
|
||||
tmQueue = QueueFactory::instance()->createMessageQueue(
|
||||
messageDepth, MessageQueueMessage::MAX_MESSAGE_SIZE);
|
||||
storageQueue = QueueFactory::instance()->createMessageQueue(
|
||||
messageDepth, MessageQueueMessage::MAX_MESSAGE_SIZE);
|
||||
}
|
||||
|
||||
TmFunnel::~TmFunnel() {}
|
||||
TmFunnel::~TmFunnel() = default;
|
||||
|
||||
MessageQueueId_t TmFunnel::getReportReceptionQueue(uint8_t virtualChannel) {
|
||||
return tmQueue->getId();
|
||||
@@ -28,6 +29,7 @@ ReturnValue_t TmFunnel::performOperation(uint8_t operationCode) {
|
||||
while (status == HasReturnvaluesIF::RETURN_OK) {
|
||||
status = handlePacket(¤tMessage);
|
||||
if (status != HasReturnvaluesIF::RETURN_OK) {
|
||||
sif::warning << "TmFunnel packet handling failed" << std::endl;
|
||||
break;
|
||||
}
|
||||
status = tmQueue->receiveMessage(¤tMessage);
|
||||
@@ -48,19 +50,20 @@ ReturnValue_t TmFunnel::handlePacket(TmTcMessage *message) {
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
TmPacketPusC packet(packetData);
|
||||
packet.setPacketSequenceCount(this->sourceSequenceCount);
|
||||
sourceSequenceCount++;
|
||||
sourceSequenceCount =
|
||||
sourceSequenceCount % SpacePacketBase::LIMIT_SEQUENCE_COUNT;
|
||||
packet.setErrorControl();
|
||||
PusTmZeroCopyWriter packet(&timeReader, packetData, size);
|
||||
result = packet.parseDataWithoutCrcCheck();
|
||||
if(result != HasReturnvaluesIF::RETURN_OK) {
|
||||
return result;
|
||||
}
|
||||
packet.setSequenceCount(sourceSequenceCount++);
|
||||
sourceSequenceCount = sourceSequenceCount % ccsds::LIMIT_SEQUENCE_COUNT;
|
||||
packet.updateErrorControl();
|
||||
|
||||
result = tmQueue->sendToDefault(message);
|
||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||
tmPool->deleteData(message->getStorageId());
|
||||
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
||||
sif::error << "TmFunnel::handlePacket: Error sending to downlink handler"
|
||||
<< std::endl;
|
||||
sif::error << "TmFunnel::handlePacket: Error sending TM to downlink handler" << std::endl;
|
||||
#endif
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
#include <fsfw/tmtcservices/AcceptsTelemetryIF.h>
|
||||
#include <fsfw/tmtcservices/TmTcMessage.h>
|
||||
|
||||
#include "fsfw/timemanager/TimeReaderIF.h"
|
||||
|
||||
namespace Factory {
|
||||
void setStaticFrameworkObjectIds();
|
||||
}
|
||||
@@ -25,13 +27,12 @@ class TmFunnel : public AcceptsTelemetryIF,
|
||||
friend void(Factory::setStaticFrameworkObjectIds)();
|
||||
|
||||
public:
|
||||
TmFunnel(object_id_t objectId, uint32_t messageDepth = 20);
|
||||
virtual ~TmFunnel();
|
||||
explicit TmFunnel(TimeReaderIF& timeReader, object_id_t objectId, uint32_t messageDepth = 20);
|
||||
~TmFunnel() override;
|
||||
|
||||
virtual MessageQueueId_t
|
||||
getReportReceptionQueue(uint8_t virtualChannel = 0) override;
|
||||
virtual ReturnValue_t performOperation(uint8_t operationCode = 0) override;
|
||||
virtual ReturnValue_t initialize() override;
|
||||
MessageQueueId_t getReportReceptionQueue(uint8_t virtualChannel) override;
|
||||
ReturnValue_t performOperation(uint8_t operationCode) override;
|
||||
ReturnValue_t initialize() override;
|
||||
|
||||
protected:
|
||||
static object_id_t downlinkDestination;
|
||||
@@ -39,6 +40,7 @@ protected:
|
||||
|
||||
private:
|
||||
uint16_t sourceSequenceCount = 0;
|
||||
TimeReaderIF& timeReader;
|
||||
MessageQueueIF *tmQueue = nullptr;
|
||||
MessageQueueIF *storageQueue = nullptr;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user