Merge remote-tracking branch 'upstream/development' into mueller/local-pool-update-remove-ignore-fault-arg

This commit is contained in:
Robin Müller 2022-10-28 10:06:04 +02:00
commit f715b65d6e
No known key found for this signature in database
GPG Key ID: 71B58F8A3CDFA9AC
31 changed files with 103 additions and 70 deletions

View File

@ -61,6 +61,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
interface itself so it can be re-used more easily. Also add new interface itself so it can be re-used more easily. Also add new
abstract function `bool hasDataAtId(store_address_t storeId) const`. abstract function `bool hasDataAtId(store_address_t storeId) const`.
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/685 PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/685
- Improvements for `AcceptsTelemetryIF` and `AcceptsTelecommandsIF`:
- Make functions `const` where it makes sense
- Add `const char* getName const` abstract function
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/684
# [v5.0.0] 25.07.2022 # [v5.0.0] 25.07.2022

View File

@ -51,6 +51,6 @@ ReturnValue_t CfdpHandler::performOperation(uint8_t opCode) {
return returnvalue::OK; return returnvalue::OK;
} }
uint16_t CfdpHandler::getIdentifier() { return 0; } uint32_t CfdpHandler::getIdentifier() const { return 0; }
MessageQueueId_t CfdpHandler::getRequestQueue() { return this->requestQueue->getId(); } MessageQueueId_t CfdpHandler::getRequestQueue() const { return this->requestQueue->getId(); }

View File

@ -25,8 +25,8 @@ class CfdpHandler : public ExecutableObjectIF, public AcceptsTelecommandsIF, pub
virtual ReturnValue_t handleRequest(store_address_t storeId); virtual ReturnValue_t handleRequest(store_address_t storeId);
virtual ReturnValue_t initialize() override; virtual ReturnValue_t initialize() override;
virtual uint16_t getIdentifier() override; uint32_t getIdentifier() const override;
MessageQueueId_t getRequestQueue() override; MessageQueueId_t getRequestQueue() const override;
ReturnValue_t performOperation(uint8_t opCode) override; ReturnValue_t performOperation(uint8_t opCode) override;
protected: protected:

View File

@ -18,7 +18,7 @@
TcpTmTcBridge::TcpTmTcBridge(object_id_t objectId, object_id_t tcDestination, object_id_t tmStoreId, TcpTmTcBridge::TcpTmTcBridge(object_id_t objectId, object_id_t tcDestination, object_id_t tmStoreId,
object_id_t tcStoreId) object_id_t tcStoreId)
: TmTcBridge(objectId, tcDestination, tmStoreId, tcStoreId) { : TmTcBridge("TCP TMTC Bridge", objectId, tcDestination, tmStoreId, tcStoreId) {
mutex = MutexFactory::instance()->createMutex(); mutex = MutexFactory::instance()->createMutex();
// Connection is always up, TM is requested by connecting to server and receiving packets // Connection is always up, TM is requested by connecting to server and receiving packets
registerCommConnect(); registerCommConnect();

View File

@ -22,7 +22,7 @@ const std::string UdpTmTcBridge::DEFAULT_SERVER_PORT = tcpip::DEFAULT_SERVER_POR
UdpTmTcBridge::UdpTmTcBridge(object_id_t objectId, object_id_t tcDestination, UdpTmTcBridge::UdpTmTcBridge(object_id_t objectId, object_id_t tcDestination,
const std::string &udpServerPort_, object_id_t tmStoreId, const std::string &udpServerPort_, object_id_t tmStoreId,
object_id_t tcStoreId) object_id_t tcStoreId)
: TmTcBridge(objectId, tcDestination, tmStoreId, tcStoreId) { : TmTcBridge("UDP TMTC Bridge", objectId, tcDestination, tmStoreId, tcStoreId) {
if (udpServerPort_.empty()) { if (udpServerPort_.empty()) {
udpServerPort = DEFAULT_SERVER_PORT; udpServerPort = DEFAULT_SERVER_PORT;
} else { } else {

View File

@ -10,8 +10,8 @@
CService200ModeCommanding::CService200ModeCommanding(object_id_t objectId, uint16_t apid, CService200ModeCommanding::CService200ModeCommanding(object_id_t objectId, uint16_t apid,
uint8_t serviceId, uint8_t numParallelCommands, uint8_t serviceId, uint8_t numParallelCommands,
uint16_t commandTimeoutSeconds) uint16_t commandTimeoutSeconds)
: CommandingServiceBase(objectId, apid, serviceId, numParallelCommands, commandTimeoutSeconds) { : CommandingServiceBase(objectId, apid, "PUS 200 Mode MGMT", serviceId, numParallelCommands,
} commandTimeoutSeconds) {}
CService200ModeCommanding::~CService200ModeCommanding() {} CService200ModeCommanding::~CService200ModeCommanding() {}

View File

@ -10,8 +10,8 @@ CService201HealthCommanding::CService201HealthCommanding(object_id_t objectId, u
uint8_t serviceId, uint8_t serviceId,
uint8_t numParallelCommands, uint8_t numParallelCommands,
uint16_t commandTimeoutSeconds) uint16_t commandTimeoutSeconds)
: CommandingServiceBase(objectId, apid, serviceId, numParallelCommands, commandTimeoutSeconds) { : CommandingServiceBase(objectId, apid, "PUS 201 Health MGMT", serviceId, numParallelCommands,
} commandTimeoutSeconds) {}
ReturnValue_t CService201HealthCommanding::isValidSubservice(uint8_t subservice) { ReturnValue_t CService201HealthCommanding::isValidSubservice(uint8_t subservice) {
switch (subservice) { switch (subservice) {

View File

@ -16,7 +16,9 @@ inline Service11TelecommandScheduling<MAX_NUM_TCS>::Service11TelecommandScheduli
: PusServiceBase(params), : PusServiceBase(params),
RELEASE_TIME_MARGIN_SECONDS(releaseTimeMarginSeconds), RELEASE_TIME_MARGIN_SECONDS(releaseTimeMarginSeconds),
debugMode(debugMode), debugMode(debugMode),
tcRecipient(tcRecipient) {} tcRecipient(tcRecipient) {
params.name = "PUS 11 TC Scheduling";
}
template <size_t MAX_NUM_TCS> template <size_t MAX_NUM_TCS>
inline Service11TelecommandScheduling<MAX_NUM_TCS>::~Service11TelecommandScheduling() = default; inline Service11TelecommandScheduling<MAX_NUM_TCS>::~Service11TelecommandScheduling() = default;

View File

@ -8,7 +8,9 @@
Service17Test::Service17Test(PsbParams params) Service17Test::Service17Test(PsbParams params)
: PusServiceBase(params), : PusServiceBase(params),
storeHelper(params.apid), storeHelper(params.apid),
tmHelper(params.serviceId, storeHelper, sendHelper) {} tmHelper(params.serviceId, storeHelper, sendHelper) {
params.name = "PUS 17 Test";
}
Service17Test::~Service17Test() = default; Service17Test::~Service17Test() = default;

View File

@ -11,8 +11,8 @@ Service20ParameterManagement::Service20ParameterManagement(object_id_t objectId,
uint8_t serviceId, uint8_t serviceId,
uint8_t numberOfParallelCommands, uint8_t numberOfParallelCommands,
uint16_t commandTimeoutSeconds) uint16_t commandTimeoutSeconds)
: CommandingServiceBase(objectId, apid, serviceId, numberOfParallelCommands, : CommandingServiceBase(objectId, apid, "PUS 20 Parameter MGMT", serviceId,
commandTimeoutSeconds) {} numberOfParallelCommands, commandTimeoutSeconds) {}
Service20ParameterManagement::~Service20ParameterManagement() = default; Service20ParameterManagement::~Service20ParameterManagement() = default;

View File

@ -14,8 +14,8 @@
Service2DeviceAccess::Service2DeviceAccess(object_id_t objectId, uint16_t apid, uint8_t serviceId, Service2DeviceAccess::Service2DeviceAccess(object_id_t objectId, uint16_t apid, uint8_t serviceId,
uint8_t numberOfParallelCommands, uint8_t numberOfParallelCommands,
uint16_t commandTimeoutSeconds) uint16_t commandTimeoutSeconds)
: CommandingServiceBase(objectId, apid, serviceId, numberOfParallelCommands, : CommandingServiceBase(objectId, apid, "PUS 2 Raw Commanding", serviceId,
commandTimeoutSeconds) {} numberOfParallelCommands, commandTimeoutSeconds) {}
Service2DeviceAccess::~Service2DeviceAccess() {} Service2DeviceAccess::~Service2DeviceAccess() {}

View File

@ -5,7 +5,7 @@
#include "fsfw/pus/servicepackets/Service3Packets.h" #include "fsfw/pus/servicepackets/Service3Packets.h"
Service3Housekeeping::Service3Housekeeping(object_id_t objectId, uint16_t apid, uint8_t serviceId) Service3Housekeeping::Service3Housekeeping(object_id_t objectId, uint16_t apid, uint8_t serviceId)
: CommandingServiceBase(objectId, apid, serviceId, NUM_OF_PARALLEL_COMMANDS, : CommandingServiceBase(objectId, apid, "PUS 3 HK", serviceId, NUM_OF_PARALLEL_COMMANDS,
COMMAND_TIMEOUT_SECONDS) {} COMMAND_TIMEOUT_SECONDS) {}
Service3Housekeeping::~Service3Housekeeping() {} Service3Housekeeping::~Service3Housekeeping() {}

View File

@ -13,6 +13,7 @@ Service5EventReporting::Service5EventReporting(PsbParams params, size_t maxNumbe
storeHelper(params.apid), storeHelper(params.apid),
tmHelper(params.serviceId, storeHelper, sendHelper), tmHelper(params.serviceId, storeHelper, sendHelper),
maxNumberReportsPerCycle(maxNumberReportsPerCycle) { maxNumberReportsPerCycle(maxNumberReportsPerCycle) {
psbParams.name = "PUS 5 Event Reporting";
eventQueue = QueueFactory::instance()->createMessageQueue(messageQueueDepth); eventQueue = QueueFactory::instance()->createMessageQueue(messageQueueDepth);
} }

View File

@ -12,8 +12,8 @@ Service8FunctionManagement::Service8FunctionManagement(object_id_t objectId, uin
uint8_t serviceId, uint8_t serviceId,
uint8_t numParallelCommands, uint8_t numParallelCommands,
uint16_t commandTimeoutSeconds) uint16_t commandTimeoutSeconds)
: CommandingServiceBase(objectId, apid, serviceId, numParallelCommands, commandTimeoutSeconds) { : CommandingServiceBase(objectId, apid, "PUS 8 Functional Commanding", serviceId,
} numParallelCommands, commandTimeoutSeconds) {}
Service8FunctionManagement::~Service8FunctionManagement() {} Service8FunctionManagement::~Service8FunctionManagement() {}

View File

@ -5,7 +5,9 @@
#include "fsfw/serviceinterface/ServiceInterface.h" #include "fsfw/serviceinterface/ServiceInterface.h"
#include "fsfw/timemanager/CCSDSTime.h" #include "fsfw/timemanager/CCSDSTime.h"
Service9TimeManagement::Service9TimeManagement(PsbParams params) : PusServiceBase(params) {} Service9TimeManagement::Service9TimeManagement(PsbParams params) : PusServiceBase(params) {
params.name = "PUS 9 Time MGMT";
}
Service9TimeManagement::~Service9TimeManagement() = default; Service9TimeManagement::~Service9TimeManagement() = default;

View File

@ -59,7 +59,7 @@ TcDistributor::TcMqMapIter CCSDSDistributor::selectDestination() {
} }
} }
MessageQueueId_t CCSDSDistributor::getRequestQueue() { return tcQueue->getId(); } MessageQueueId_t CCSDSDistributor::getRequestQueue() const { return tcQueue->getId(); }
ReturnValue_t CCSDSDistributor::registerApplication(AcceptsTelecommandsIF* application) { ReturnValue_t CCSDSDistributor::registerApplication(AcceptsTelecommandsIF* application) {
ReturnValue_t returnValue = returnvalue::OK; ReturnValue_t returnValue = returnvalue::OK;
@ -80,7 +80,7 @@ ReturnValue_t CCSDSDistributor::registerApplication(uint16_t apid, MessageQueueI
return returnValue; return returnValue;
} }
uint16_t CCSDSDistributor::getIdentifier() { return 0; } uint32_t CCSDSDistributor::getIdentifier() const { return 0; }
ReturnValue_t CCSDSDistributor::initialize() { ReturnValue_t CCSDSDistributor::initialize() {
if (packetChecker == nullptr) { if (packetChecker == nullptr) {

View File

@ -35,10 +35,10 @@ class CCSDSDistributor : public TcDistributor,
*/ */
~CCSDSDistributor() override; ~CCSDSDistributor() override;
MessageQueueId_t getRequestQueue() override; MessageQueueId_t getRequestQueue() const override;
ReturnValue_t registerApplication(uint16_t apid, MessageQueueId_t id) override; ReturnValue_t registerApplication(uint16_t apid, MessageQueueId_t id) override;
ReturnValue_t registerApplication(AcceptsTelecommandsIF* application) override; ReturnValue_t registerApplication(AcceptsTelecommandsIF* application) override;
uint16_t getIdentifier() override; uint32_t getIdentifier() const override;
ReturnValue_t initialize() override; ReturnValue_t initialize() override;
protected: protected:

View File

@ -33,9 +33,9 @@ class CFDPDistributor : public TcDistributor,
*/ */
~CFDPDistributor() override; ~CFDPDistributor() override;
ReturnValue_t registerHandler(AcceptsTelecommandsIF* handler) override; ReturnValue_t registerHandler(AcceptsTelecommandsIF* handler) override;
MessageQueueId_t getRequestQueue() override; MessageQueueId_t getRequestQueue() const override;
ReturnValue_t initialize() override; ReturnValue_t initialize() override;
uint16_t getIdentifier() override; uint32_t getIdentifier() const override;
protected: protected:
uint16_t apid; uint16_t apid;

View File

@ -1,9 +1,4 @@
target_sources( target_sources(
${LIB_FSFW_NAME} ${LIB_FSFW_NAME}
PRIVATE CCSDSDistributor.cpp PRIVATE CCSDSDistributor.cpp PusDistributor.cpp TcDistributor.cpp
PusDistributor.cpp TcPacketCheckCFDP.cpp CcsdsPacketChecker.cpp)
TcDistributor.cpp
PusPacketChecker.cpp
TcPacketCheckCFDP.cpp
CFDPDistributor.cpp
CcsdsPacketChecker.cpp)

View File

@ -97,7 +97,7 @@ ReturnValue_t PusDistributor::registerService(AcceptsTelecommandsIF* service) {
return returnvalue::OK; return returnvalue::OK;
} }
MessageQueueId_t PusDistributor::getRequestQueue() { return tcQueue->getId(); } MessageQueueId_t PusDistributor::getRequestQueue() const { return tcQueue->getId(); }
ReturnValue_t PusDistributor::callbackAfterSending(ReturnValue_t queueStatus) { ReturnValue_t PusDistributor::callbackAfterSending(ReturnValue_t queueStatus) {
if (queueStatus != returnvalue::OK) { if (queueStatus != returnvalue::OK) {
@ -115,7 +115,7 @@ ReturnValue_t PusDistributor::callbackAfterSending(ReturnValue_t queueStatus) {
} }
} }
uint16_t PusDistributor::getIdentifier() { return checker.getApid(); } uint32_t PusDistributor::getIdentifier() const { return checker.getApid(); }
ReturnValue_t PusDistributor::initialize() { ReturnValue_t PusDistributor::initialize() {
if (store == nullptr) { if (store == nullptr) {

View File

@ -34,9 +34,9 @@ class PusDistributor : public TcDistributor, public PUSDistributorIF, public Acc
*/ */
~PusDistributor() override; ~PusDistributor() override;
ReturnValue_t registerService(AcceptsTelecommandsIF* service) override; ReturnValue_t registerService(AcceptsTelecommandsIF* service) override;
MessageQueueId_t getRequestQueue() override; MessageQueueId_t getRequestQueue() const override;
ReturnValue_t initialize() override; ReturnValue_t initialize() override;
uint16_t getIdentifier() override; uint32_t getIdentifier() const override;
protected: protected:
StorageManagerIF* store; StorageManagerIF* store;

View File

@ -21,20 +21,22 @@ class AcceptsTelecommandsIF {
* @brief The virtual destructor as it is mandatory for C++ interfaces. * @brief The virtual destructor as it is mandatory for C++ interfaces.
*/ */
virtual ~AcceptsTelecommandsIF() = default; virtual ~AcceptsTelecommandsIF() = default;
[[nodiscard]] virtual const char* getName() const = 0;
/** /**
* @brief Getter for the service id. * @brief Getter for a generic identifier ID.
* @details Any receiving service (at least any PUS service) shall have a * @details Any receiving service (at least any PUS service) shall have an identifier. For
* service ID. If the receiver can handle Telecommands, but for * example, this could be the APID for a receiver expecting generic PUS packets, or a PUS
* some reason has no service id, it shall return 0. * service for a component expecting specific PUS service packets.
* @return The service ID or 0. * @return The identifier.
*/ */
virtual uint16_t getIdentifier() = 0; [[nodiscard]] virtual uint32_t getIdentifier() const = 0;
/** /**
* @brief This method returns the message queue id of the telecommand * @brief This method returns the message queue id of the telecommand
* receiving message queue. * receiving message queue.
* @return The telecommand reception message queue id. * @return The telecommand reception message queue id.
*/ */
virtual MessageQueueId_t getRequestQueue() = 0; [[nodiscard]] virtual MessageQueueId_t getRequestQueue() const = 0;
}; };
#endif /* FRAMEWORK_TMTCSERVICES_ACCEPTSTELECOMMANDSIF_H_ */ #endif /* FRAMEWORK_TMTCSERVICES_ACCEPTSTELECOMMANDSIF_H_ */

View File

@ -14,6 +14,8 @@ class AcceptsTelemetryIF {
* @brief The virtual destructor as it is mandatory for C++ interfaces. * @brief The virtual destructor as it is mandatory for C++ interfaces.
*/ */
virtual ~AcceptsTelemetryIF() = default; virtual ~AcceptsTelemetryIF() = default;
[[nodiscard]] virtual const char* getName() const = 0;
/** /**
* @brief This method returns the message queue id of the telemetry * @brief This method returns the message queue id of the telemetry
* receiving message queue. * receiving message queue.

View File

@ -14,7 +14,8 @@ object_id_t CommandingServiceBase::defaultPacketSource = objects::NO_OBJECT;
object_id_t CommandingServiceBase::defaultPacketDestination = objects::NO_OBJECT; object_id_t CommandingServiceBase::defaultPacketDestination = objects::NO_OBJECT;
CommandingServiceBase::CommandingServiceBase(object_id_t setObjectId, uint16_t apid, CommandingServiceBase::CommandingServiceBase(object_id_t setObjectId, uint16_t apid,
uint8_t service, uint8_t numberOfParallelCommands, const char* name, uint8_t service,
uint8_t numberOfParallelCommands,
uint16_t commandTimeoutSeconds, size_t queueDepth, uint16_t commandTimeoutSeconds, size_t queueDepth,
VerificationReporterIF* verificationReporter) VerificationReporterIF* verificationReporter)
: SystemObject(setObjectId), : SystemObject(setObjectId),
@ -24,7 +25,8 @@ CommandingServiceBase::CommandingServiceBase(object_id_t setObjectId, uint16_t a
tmStoreHelper(apid), tmStoreHelper(apid),
tmHelper(service, tmStoreHelper, tmSendHelper), tmHelper(service, tmStoreHelper, tmSendHelper),
verificationReporter(verificationReporter), verificationReporter(verificationReporter),
commandMap(numberOfParallelCommands) { commandMap(numberOfParallelCommands),
name(name) {
commandQueue = QueueFactory::instance()->createMessageQueue(queueDepth); commandQueue = QueueFactory::instance()->createMessageQueue(queueDepth);
requestQueue = QueueFactory::instance()->createMessageQueue(queueDepth); requestQueue = QueueFactory::instance()->createMessageQueue(queueDepth);
} }
@ -50,9 +52,9 @@ ReturnValue_t CommandingServiceBase::performOperation(uint8_t opCode) {
return returnvalue::OK; return returnvalue::OK;
} }
uint16_t CommandingServiceBase::getIdentifier() { return service; } uint32_t CommandingServiceBase::getIdentifier() const { return service; }
MessageQueueId_t CommandingServiceBase::getRequestQueue() { return requestQueue->getId(); } MessageQueueId_t CommandingServiceBase::getRequestQueue() const { return requestQueue->getId(); }
ReturnValue_t CommandingServiceBase::initialize() { ReturnValue_t CommandingServiceBase::initialize() {
ReturnValue_t result = SystemObject::initialize(); ReturnValue_t result = SystemObject::initialize();
@ -489,3 +491,5 @@ void CommandingServiceBase::prepareVerificationSuccessWithFullInfo(
successParams.tcPsc = tcInfo.tcSequenceControl; successParams.tcPsc = tcInfo.tcSequenceControl;
successParams.ackFlags = tcInfo.ackFlags; successParams.ackFlags = tcInfo.ackFlags;
} }
const char* CommandingServiceBase::getName() const { return name; }

View File

@ -75,7 +75,7 @@ class CommandingServiceBase : public SystemObject,
* @param setPacketDestination * @param setPacketDestination
* @param queueDepth * @param queueDepth
*/ */
CommandingServiceBase(object_id_t setObjectId, uint16_t apid, uint8_t service, CommandingServiceBase(object_id_t setObjectId, uint16_t apid, const char* name, uint8_t service,
uint8_t numberOfParallelCommands, uint16_t commandTimeoutSeconds, uint8_t numberOfParallelCommands, uint16_t commandTimeoutSeconds,
size_t queueDepth = 20, VerificationReporterIF* reporter = nullptr); size_t queueDepth = 20, VerificationReporterIF* reporter = nullptr);
~CommandingServiceBase() override; ~CommandingServiceBase() override;
@ -105,7 +105,7 @@ class CommandingServiceBase : public SystemObject,
*/ */
ReturnValue_t performOperation(uint8_t opCode) override; ReturnValue_t performOperation(uint8_t opCode) override;
uint16_t getIdentifier() override; uint32_t getIdentifier() const override;
/** /**
* Returns the requestQueue MessageQueueId_t * Returns the requestQueue MessageQueueId_t
@ -114,7 +114,7 @@ class CommandingServiceBase : public SystemObject,
* *
* @return requestQueue messageQueueId_t * @return requestQueue messageQueueId_t
*/ */
MessageQueueId_t getRequestQueue() override; MessageQueueId_t getRequestQueue() const override;
/** /**
* Returns the commandQueue MessageQueueId_t * Returns the commandQueue MessageQueueId_t
@ -133,6 +133,7 @@ class CommandingServiceBase : public SystemObject,
* @param task Pointer to the taskIF of this task * @param task Pointer to the taskIF of this task
*/ */
void setTaskIF(PeriodicTaskIF* task) override; void setTaskIF(PeriodicTaskIF* task) override;
const char* getName() const override;
protected: protected:
/** /**
@ -283,6 +284,8 @@ class CommandingServiceBase : public SystemObject,
uint32_t failureParameter1 = 0; uint32_t failureParameter1 = 0;
uint32_t failureParameter2 = 0; uint32_t failureParameter2 = 0;
const char* name = "";
static object_id_t defaultPacketSource; static object_id_t defaultPacketSource;
object_id_t packetSource = objects::NO_OBJECT; object_id_t packetSource = objects::NO_OBJECT;
static object_id_t defaultPacketDestination; static object_id_t defaultPacketDestination;

View File

@ -82,9 +82,9 @@ void PusServiceBase::handleRequestQueue() {
} }
} }
uint16_t PusServiceBase::getIdentifier() { return psbParams.serviceId; } uint32_t PusServiceBase::getIdentifier() const { return psbParams.serviceId; }
MessageQueueId_t PusServiceBase::getRequestQueue() { MessageQueueId_t PusServiceBase::getRequestQueue() const {
if (psbParams.reqQueue == nullptr) { if (psbParams.reqQueue == nullptr) {
return MessageQueueIF::NO_QUEUE; return MessageQueueIF::NO_QUEUE;
} }
@ -202,3 +202,5 @@ void PusServiceBase::setTmReceiver(AcceptsTelemetryIF& tmReceiver_) {
} }
void PusServiceBase::setRequestQueue(MessageQueueIF& reqQueue) { psbParams.reqQueue = &reqQueue; } void PusServiceBase::setRequestQueue(MessageQueueIF& reqQueue) { psbParams.reqQueue = &reqQueue; }
const char* PusServiceBase::getName() const { return psbParams.name; }

View File

@ -22,9 +22,13 @@ class StorageManagerIF;
struct PsbParams { struct PsbParams {
PsbParams() = default; PsbParams() = default;
PsbParams(uint16_t apid, AcceptsTelemetryIF* tmReceiver) : apid(apid), tmReceiver(tmReceiver) {} PsbParams(uint16_t apid, AcceptsTelemetryIF* tmReceiver) : apid(apid), tmReceiver(tmReceiver) {}
PsbParams(const char* name, uint16_t apid, AcceptsTelemetryIF* tmReceiver)
: name(name), apid(apid), tmReceiver(tmReceiver) {}
PsbParams(object_id_t objectId, uint16_t apid, uint8_t serviceId) PsbParams(object_id_t objectId, uint16_t apid, uint8_t serviceId)
: objectId(objectId), apid(apid), serviceId(serviceId) {} : objectId(objectId), apid(apid), serviceId(serviceId) {}
PsbParams(const char* name, object_id_t objectId, uint16_t apid, uint8_t serviceId)
: name(name), objectId(objectId), apid(apid), serviceId(serviceId) {}
const char* name = "";
object_id_t objectId = objects::NO_OBJECT; object_id_t objectId = objects::NO_OBJECT;
uint16_t apid = 0; uint16_t apid = 0;
uint8_t serviceId = 0; uint8_t serviceId = 0;
@ -187,11 +191,12 @@ class PusServiceBase : public ExecutableObjectIF,
* @c returnvalue::FAILED else. * @c returnvalue::FAILED else.
*/ */
ReturnValue_t performOperation(uint8_t opCode) override; ReturnValue_t performOperation(uint8_t opCode) override;
uint16_t getIdentifier() override; uint32_t getIdentifier() const override;
MessageQueueId_t getRequestQueue() override; MessageQueueId_t getRequestQueue() const override;
ReturnValue_t initialize() override; ReturnValue_t initialize() override;
void setTaskIF(PeriodicTaskIF* taskHandle) override; void setTaskIF(PeriodicTaskIF* taskHandle) override;
[[nodiscard]] const char* getName() const override;
protected: protected:
/** /**
@ -200,6 +205,7 @@ class PusServiceBase : public ExecutableObjectIF,
* Will be set by setTaskIF(), which is called on task creation. * Will be set by setTaskIF(), which is called on task creation.
*/ */
PeriodicTaskIF* taskHandle = nullptr; PeriodicTaskIF* taskHandle = nullptr;
/** /**
* One of two error parameters for additional error information. * One of two error parameters for additional error information.
*/ */

View File

@ -7,9 +7,10 @@
#define TMTCBRIDGE_WIRETAPPING 0 #define TMTCBRIDGE_WIRETAPPING 0
TmTcBridge::TmTcBridge(object_id_t objectId, object_id_t tcDestination, object_id_t tmStoreId, TmTcBridge::TmTcBridge(const char* name, object_id_t objectId, object_id_t tcDestination,
object_id_t tcStoreId) object_id_t tmStoreId, object_id_t tcStoreId)
: SystemObject(objectId), : SystemObject(objectId),
name(name),
tmStoreId(tmStoreId), tmStoreId(tmStoreId),
tcStoreId(tcStoreId), tcStoreId(tcStoreId),
tcDestination(tcDestination) tcDestination(tcDestination)
@ -67,8 +68,7 @@ ReturnValue_t TmTcBridge::initialize() {
#endif #endif
return ObjectManagerIF::CHILD_INIT_FAILED; return ObjectManagerIF::CHILD_INIT_FAILED;
} }
AcceptsTelecommandsIF* tcDistributor = auto* tcDistributor = ObjectManager::instance()->get<AcceptsTelecommandsIF>(tcDestination);
ObjectManager::instance()->get<AcceptsTelecommandsIF>(tcDestination);
if (tcDistributor == nullptr) { if (tcDistributor == nullptr) {
#if FSFW_CPP_OSTREAM_ENABLED == 1 #if FSFW_CPP_OSTREAM_ENABLED == 1
sif::error << "TmTcBridge::initialize: TC Distributor invalid" << std::endl; sif::error << "TmTcBridge::initialize: TC Distributor invalid" << std::endl;
@ -246,14 +246,16 @@ MessageQueueId_t TmTcBridge::getReportReceptionQueue(uint8_t virtualChannel) {
void TmTcBridge::printData(uint8_t* data, size_t dataLen) { arrayprinter::print(data, dataLen); } void TmTcBridge::printData(uint8_t* data, size_t dataLen) { arrayprinter::print(data, dataLen); }
uint16_t TmTcBridge::getIdentifier() { uint32_t TmTcBridge::getIdentifier() const {
// This is no PUS service, so we just return 0 // This is no PUS service, so we just return 0
return 0; return 0;
} }
MessageQueueId_t TmTcBridge::getRequestQueue() { MessageQueueId_t TmTcBridge::getRequestQueue() const {
// Default implementation: Relay TC messages to TC distributor directly. // Default implementation: Relay TC messages to TC distributor directly.
return tmTcReceptionQueue->getDefaultDestination(); return tmTcReceptionQueue->getDefaultDestination();
} }
void TmTcBridge::setFifoToOverwriteOldData(bool overwriteOld) { this->overwriteOld = overwriteOld; } void TmTcBridge::setFifoToOverwriteOldData(bool overwriteOld) { this->overwriteOld = overwriteOld; }
const char* TmTcBridge::getName() const { return name; }

View File

@ -22,9 +22,9 @@ class TmTcBridge : public AcceptsTelemetryIF,
static constexpr uint8_t DEFAULT_STORED_DATA_SENT_PER_CYCLE = 5; static constexpr uint8_t DEFAULT_STORED_DATA_SENT_PER_CYCLE = 5;
static constexpr uint8_t DEFAULT_DOWNLINK_PACKETS_STORED = 10; static constexpr uint8_t DEFAULT_DOWNLINK_PACKETS_STORED = 10;
TmTcBridge(object_id_t objectId, object_id_t tcDestination, object_id_t tmStoreId, TmTcBridge(const char* name, object_id_t objectId, object_id_t tcDestination,
object_id_t tcStoreId); object_id_t tmStoreId, object_id_t tcStoreId);
virtual ~TmTcBridge(); ~TmTcBridge() override;
/** /**
* Set number of packets sent per performOperation().Please note that this * Set number of packets sent per performOperation().Please note that this
@ -57,21 +57,24 @@ class TmTcBridge : public AcceptsTelemetryIF,
* Initializes necessary FSFW components for the TMTC Bridge * Initializes necessary FSFW components for the TMTC Bridge
* @return * @return
*/ */
virtual ReturnValue_t initialize() override; ReturnValue_t initialize() override;
/** /**
* @brief Handles TMTC reception * @brief Handles TMTC reception
*/ */
virtual ReturnValue_t performOperation(uint8_t operationCode = 0) override; ReturnValue_t performOperation(uint8_t operationCode = 0) override;
/** AcceptsTelemetryIF override */ /** AcceptsTelemetryIF override */
virtual MessageQueueId_t getReportReceptionQueue(uint8_t virtualChannel = 0) override; MessageQueueId_t getReportReceptionQueue(uint8_t virtualChannel = 0) override;
/** AcceptsTelecommandsIF override */ /** AcceptsTelecommandsIF override */
virtual uint16_t getIdentifier() override; uint32_t getIdentifier() const override;
virtual MessageQueueId_t getRequestQueue() override; MessageQueueId_t getRequestQueue() const override;
const char* getName() const override;
protected: protected:
const char* name = "";
//! Cached for initialize function. //! Cached for initialize function.
object_id_t tmStoreId = objects::NO_OBJECT; object_id_t tmStoreId = objects::NO_OBJECT;
object_id_t tcStoreId = objects::NO_OBJECT; object_id_t tcStoreId = objects::NO_OBJECT;

View File

@ -9,3 +9,5 @@ AcceptsTmMock::AcceptsTmMock(MessageQueueId_t queueToReturn)
MessageQueueId_t AcceptsTmMock::getReportReceptionQueue(uint8_t virtualChannel) { MessageQueueId_t AcceptsTmMock::getReportReceptionQueue(uint8_t virtualChannel) {
return returnedQueue; return returnedQueue;
} }
const char* AcceptsTmMock::getName() const { return "TM Acceptor Mock"; }

View File

@ -10,6 +10,7 @@ class AcceptsTmMock : public SystemObject, public AcceptsTelemetryIF {
explicit AcceptsTmMock(MessageQueueId_t queueToReturn); explicit AcceptsTmMock(MessageQueueId_t queueToReturn);
MessageQueueId_t getReportReceptionQueue(uint8_t virtualChannel) override; MessageQueueId_t getReportReceptionQueue(uint8_t virtualChannel) override;
const char* getName() const override;
MessageQueueId_t returnedQueue; MessageQueueId_t returnedQueue;
}; };