distrinction between default settings

and individual settings for service
This commit is contained in:
Robin Müller 2020-07-09 20:04:49 +02:00
parent ad049cc634
commit 57418eb877
3 changed files with 15 additions and 4 deletions

View File

@ -1048,6 +1048,7 @@ private:
/** Cached for initialize() */
static object_id_t defaultHkDestination;
/** HK destination can also be set individually */
object_id_t hkDestination = objects::NO_OBJECT;
/**

View File

@ -8,8 +8,8 @@
#include <framework/tmtcpacket/pus/TcPacketStored.h>
#include <framework/tmtcpacket/pus/TmPacketStored.h>
object_id_t CommandingServiceBase::packetSource = objects::NO_OBJECT;
object_id_t CommandingServiceBase::packetDestination = objects::NO_OBJECT;
object_id_t CommandingServiceBase::defaultPacketSource = objects::NO_OBJECT;
object_id_t CommandingServiceBase::defaultPacketDestination = objects::NO_OBJECT;
CommandingServiceBase::CommandingServiceBase(object_id_t setObjectId,
uint16_t apid, uint8_t service, uint8_t numberOfParallelCommands,
@ -62,10 +62,18 @@ ReturnValue_t CommandingServiceBase::initialize() {
return result;
}
if(packetDestination == objects::NO_OBJECT) {
packetDestination = defaultPacketDestination;
}
AcceptsTelemetryIF* packetForwarding =
objectManager->get<AcceptsTelemetryIF>(packetDestination);
if(packetSource == objects::NO_OBJECT) {
packetSource = defaultPacketSource;
}
PUSDistributorIF* distributor = objectManager->get<PUSDistributorIF>(
packetSource);
if (packetForwarding == nullptr or distributor == nullptr) {
sif::error << "CommandingServiceBase::intialize: Packet source or "
"packet destination invalid!" << std::endl;

View File

@ -248,8 +248,10 @@ protected:
uint32_t failureParameter1 = 0;
uint32_t failureParameter2 = 0;
static object_id_t packetSource;
static object_id_t packetDestination;
static object_id_t defaultPacketSource;
object_id_t packetSource = objects::NO_OBJECT;
static object_id_t defaultPacketDestination;
object_id_t packetDestination = objects::NO_OBJECT;
/**
* Pointer to the task which executes this component,