changes for updated TMTC API

This commit is contained in:
Robin Müller 2022-07-27 11:33:40 +02:00
parent a76b0ae56c
commit 43060b3be7
No known key found for this signature in database
GPG Key ID: 71B58F8A3CDFA9AC
3 changed files with 28 additions and 24 deletions

View File

@ -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

View File

@ -21,7 +21,7 @@
#include "fsfw/pus/Service8FunctionManagement.h"
#include "fsfw/pus/Service9TimeManagement.h"
#include "fsfw/tcdistribution/CCSDSDistributor.h"
#include "fsfw/tcdistribution/PUSDistributor.h"
#include "fsfw/tcdistribution/PusDistributor.h"
#include "fsfw/timemanager/CdsShortTimeStamper.h"
#include "fsfw/tmtcpacket/pus/tm.h"
#include "fsfw_tests/integration/assemblies/TestAssembly.h"
@ -39,10 +39,10 @@ void ObjectFactory::produceGenericObjects() {
new EventManager(objects::EVENT_MANAGER);
new HealthTable(objects::HEALTH_TABLE);
new InternalErrorReporter(objects::INTERNAL_ERROR_REPORTER);
new TimeStamper(objects::TIME_STAMPER);
new CdsShortTimeStamper(objects::TIME_STAMPER);
auto *ccsdsDistrib =
new CCSDSDistributor(apid::APID, objects::CCSDS_DISTRIBUTOR);
new PUSDistributor(apid::APID, objects::PUS_DISTRIBUTOR,
new PusDistributor(apid::APID, objects::PUS_DISTRIBUTOR,
objects::CCSDS_DISTRIBUTOR);
new TmFunnel(objects::TM_FUNNEL);
#endif /* OBSW_ADD_CORE_COMPONENTS == 1 */
@ -56,19 +56,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 +151,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;
}

View File

@ -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>
@ -48,12 +49,14 @@ 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(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) {