reapply clang format

This commit is contained in:
2022-02-02 10:29:30 +01:00
parent 70b593df65
commit ddcac2bbac
809 changed files with 52010 additions and 56052 deletions

View File

@ -4,15 +4,14 @@
#include "AcceptsTelecommandsIF.h"
#include "VerificationCodes.h"
#include "VerificationReporter.h"
#include "fsfw/ipc/MessageQueueIF.h"
#include "fsfw/objectmanager/ObjectManagerIF.h"
#include "fsfw/objectmanager/SystemObject.h"
#include "fsfw/returnvalues/HasReturnvaluesIF.h"
#include "fsfw/tasks/ExecutableObjectIF.h"
#include "fsfw/tmtcpacket/pus/tc.h"
#include "fsfw/ipc/MessageQueueIF.h"
namespace Factory{
namespace Factory {
void setStaticFrameworkObjectIds();
}
@ -35,126 +34,128 @@ void setStaticFrameworkObjectIds();
* @ingroup pus_services
*/
class PusServiceBase : public ExecutableObjectIF,
public AcceptsTelecommandsIF,
public SystemObject,
public HasReturnvaluesIF {
friend void (Factory::setStaticFrameworkObjectIds)();
public:
/**
* @brief The passed values are set, but inter-object initialization is
* done in the initialize method.
* @param setObjectId
* The system object identifier of this Service instance.
* @param setApid
* The APID the Service is instantiated for.
* @param setServiceId
* The Service Identifier as specified in ECSS PUS.
*/
PusServiceBase( object_id_t setObjectId, uint16_t setApid,
uint8_t setServiceId);
/**
* The destructor is empty.
*/
virtual ~PusServiceBase();
/**
* @brief The handleRequest method shall handle any kind of Telecommand
* Request immediately.
* @details
* Implemetations can take the Telecommand in currentPacket and perform
* any kind of operation.
* They may send additional "Start Success (1,3)" messages with the
* verifyReporter, but Completion Success or Failure Reports are generated
* automatically after execution of this method.
*
* If a Telecommand can not be executed within one call cycle,
* this Base class is not the right parent.
*
* The child class may add additional error information by setting
* #errorParameters which aren attached to the generated verification
* message.
*
* Subservice checking should be implemented in this method.
*
* @return The returned status_code is directly taken as main error code
* in the Verification Report.
* On success, RETURN_OK shall be returned.
*/
virtual ReturnValue_t handleRequest(uint8_t subservice) = 0;
/**
* In performService, implementations can handle periodic,
* non-TC-triggered activities.
* The performService method is always called.
* @return Currently, everything other that RETURN_OK only triggers
* diagnostic output.
*/
virtual ReturnValue_t performService() = 0;
/**
* This method implements the typical activity of a simple PUS Service.
* It checks for new requests, and, if found, calls handleRequest, sends
* completion verification messages and deletes
* the TC requests afterwards.
* performService is always executed afterwards.
* @return @c RETURN_OK if the periodic performService was successful.
* @c RETURN_FAILED else.
*/
ReturnValue_t performOperation(uint8_t opCode) override;
virtual uint16_t getIdentifier() override;
MessageQueueId_t getRequestQueue() override;
virtual ReturnValue_t initialize() override;
public AcceptsTelecommandsIF,
public SystemObject,
public HasReturnvaluesIF {
friend void(Factory::setStaticFrameworkObjectIds)();
virtual void setTaskIF(PeriodicTaskIF* taskHandle) override;
virtual ReturnValue_t initializeAfterTaskCreation() override;
protected:
/**
* @brief Handle to the underlying task
* @details
* Will be set by setTaskIF(), which is called on task creation.
*/
PeriodicTaskIF* taskHandle = nullptr;
/**
* The APID of this instance of the Service.
*/
uint16_t apid;
/**
* The Service Identifier.
*/
uint8_t serviceId;
/**
* One of two error parameters for additional error information.
*/
uint32_t errorParameter1 = 0;
/**
* One of two error parameters for additional error information.
*/
uint32_t errorParameter2 = 0;
/**
* This is a complete instance of the telecommand reception queue
* of the class. It is initialized on construction of the class.
*/
MessageQueueIF* requestQueue = nullptr;
/**
* An instance of the VerificationReporter class, that simplifies
* sending any kind of verification message to the TC Verification Service.
*/
VerificationReporter verifyReporter;
/**
* The current Telecommand to be processed.
* It is deleted after handleRequest was executed.
*/
TcPacketStoredPus currentPacket;
public:
/**
* @brief The passed values are set, but inter-object initialization is
* done in the initialize method.
* @param setObjectId
* The system object identifier of this Service instance.
* @param setApid
* The APID the Service is instantiated for.
* @param setServiceId
* The Service Identifier as specified in ECSS PUS.
*/
PusServiceBase(object_id_t setObjectId, uint16_t setApid, uint8_t setServiceId);
/**
* The destructor is empty.
*/
virtual ~PusServiceBase();
/**
* @brief The handleRequest method shall handle any kind of Telecommand
* Request immediately.
* @details
* Implemetations can take the Telecommand in currentPacket and perform
* any kind of operation.
* They may send additional "Start Success (1,3)" messages with the
* verifyReporter, but Completion Success or Failure Reports are generated
* automatically after execution of this method.
*
* If a Telecommand can not be executed within one call cycle,
* this Base class is not the right parent.
*
* The child class may add additional error information by setting
* #errorParameters which aren attached to the generated verification
* message.
*
* Subservice checking should be implemented in this method.
*
* @return The returned status_code is directly taken as main error code
* in the Verification Report.
* On success, RETURN_OK shall be returned.
*/
virtual ReturnValue_t handleRequest(uint8_t subservice) = 0;
/**
* In performService, implementations can handle periodic,
* non-TC-triggered activities.
* The performService method is always called.
* @return Currently, everything other that RETURN_OK only triggers
* diagnostic output.
*/
virtual ReturnValue_t performService() = 0;
/**
* This method implements the typical activity of a simple PUS Service.
* It checks for new requests, and, if found, calls handleRequest, sends
* completion verification messages and deletes
* the TC requests afterwards.
* performService is always executed afterwards.
* @return @c RETURN_OK if the periodic performService was successful.
* @c RETURN_FAILED else.
*/
ReturnValue_t performOperation(uint8_t opCode) override;
virtual uint16_t getIdentifier() override;
MessageQueueId_t getRequestQueue() override;
virtual ReturnValue_t initialize() override;
static object_id_t packetSource;
virtual void setTaskIF(PeriodicTaskIF* taskHandle) override;
virtual ReturnValue_t initializeAfterTaskCreation() override;
static object_id_t packetDestination;
private:
/**
* This constant sets the maximum number of packets accepted per call.
* Remember that one packet must be completely handled in one
* #handleRequest call.
*/
static const uint8_t PUS_SERVICE_MAX_RECEPTION = 10;
protected:
/**
* @brief Handle to the underlying task
* @details
* Will be set by setTaskIF(), which is called on task creation.
*/
PeriodicTaskIF* taskHandle = nullptr;
/**
* The APID of this instance of the Service.
*/
uint16_t apid;
/**
* The Service Identifier.
*/
uint8_t serviceId;
/**
* One of two error parameters for additional error information.
*/
uint32_t errorParameter1 = 0;
/**
* One of two error parameters for additional error information.
*/
uint32_t errorParameter2 = 0;
/**
* This is a complete instance of the telecommand reception queue
* of the class. It is initialized on construction of the class.
*/
MessageQueueIF* requestQueue = nullptr;
/**
* An instance of the VerificationReporter class, that simplifies
* sending any kind of verification message to the TC Verification Service.
*/
VerificationReporter verifyReporter;
/**
* The current Telecommand to be processed.
* It is deleted after handleRequest was executed.
*/
TcPacketStoredPus currentPacket;
void handleRequestQueue();
static object_id_t packetSource;
static object_id_t packetDestination;
private:
/**
* This constant sets the maximum number of packets accepted per call.
* Remember that one packet must be completely handled in one
* #handleRequest call.
*/
static const uint8_t PUS_SERVICE_MAX_RECEPTION = 10;
void handleRequestQueue();
};
#endif /* FSFW_TMTCSERVICES_PUSSERVICEBASE_H_ */