#include <DC_PUSDefineDataReporting.h>
Inheritance diagram for DC_PUSDefineDataReporting:
This class encapsulates the following subtypes of PUS service number 3:
setNumberOfRawData
). During normal operation, configuration is performed using the raw data load service. Since in most cases the amount of data to be loaded can be large, the more efficient (but less safe) implementation of this service is used.
This telecommand implements a validity check that returns "telecommand not valid" in case an attempt is made to load more application data than fit into the telecommand component.
Execution of this telecommand consists in retrieving a free data reporting telemetry packet from the telemetry packet factory, configuring it with the application data and loading it in the PUS telemetry mode manager. The PUS telemetry mode manager is loaded as a plug-in component at configuration time. Execution can have two outcomes. The telecommand can have a successful outcome (the return value of doAction
is ACTION_SUCCESS) or it can fail for the following reasons:
doAction
is PACKET_NOT_FOUND) doAction
is PUS_MODE_MAN_FULL) doAction
is APP_DATA_INCONSISTENT) Note that this class does not try to interpret its application data. It simply passes them on as unformatted raw data to the data reporting telemetry packet.
Definition at line 65 of file DC_PUSDefineDataReporting.h.
Public Member Functions | |
DC_PUSDefineDataReporting (void) | |
Instantiate a define data reporting PUS telecommand. | |
void | setNumberOfRawData (unsigned int max) |
Set the maximum size of the application data array. | |
virtual unsigned int | getNumberOfRawData (void) |
Get the maximum size (in number of bytes) of the application data array. | |
virtual void | setRawData (unsigned char *d, unsigned int n) |
Implementation of the raw data load service. | |
virtual unsigned int | getNumberOfApplicationData (void) const |
Return the number of application data bytes that were loaded with the last call to method setRawData . | |
void | setPUSTelemetryModeManager (DC_PUSTelemetryModeManager *pTmModeManager) |
Load the PUS telemetry mode manager. | |
DC_PUSTelemetryModeManager * | getPUSTelemetryModeManager () const |
Getter method for the PUS telemetry mode manager. | |
virtual bool | isObjectConfigured (void) |
Perform a class-specific configuration check on the telecommand: check that the maximum number of raw data has been set and that the PUS telemetry mode manager has been loaded. | |
Protected Member Functions | |
virtual TD_ActionOutcome | doAction (void) |
Use the application data to configure and load a data reporting telemetry packet. |
|
Instantiate a define data reporting PUS telecommand. The class identifier is set. The values of the internal data structure that is used to hold the telecommand application data is initialized to illegal values to signify that the telecommand is not yet configured. The telecommand type is set to PUS_TYPE_DATA_REP. Definition at line 19 of file DC_PUSDefineDataReporting.cpp. |
|
Use the application data to configure and load a data reporting telemetry packet. This method queries the dynamic telemetry packet factory for a new data reporting packet. If it obtains it, it loads it with the application data and then loads it in the PUS telemetry mode manager. If either of these two operations fails, the method returns with a failure code (see class comment). In order to retrieve a free packet from the telemetry packet factory with the appropriate characteristics, this method has to extract the following data from the application data:
DC_PUSDataReportingPacket . Some consistency checks are performed during the processing of the application data. If these fail, then the method returns with a failure code (see class comment). The consistency check will catch situations where the number of fixed-length arrays or the number of parameters defined by the application data is not consistent with the length of the application data as defined when calling method setRawData .
Implements PunctualAction. Definition at line 28 of file DC_PUSDefineDataReporting.cpp. |
|
Return the number of application data bytes that were loaded with the last call to method
The number returned by this method is the same as the value of the argument n in the call to method
Definition at line 129 of file DC_PUSDefineDataReporting.cpp. |
|
Get the maximum size (in number of bytes) of the application data array.
Definition at line 109 of file DC_PUSDefineDataReporting.cpp. |
|
Getter method for the PUS telemetry mode manager.
Definition at line 139 of file DC_PUSDefineDataReporting.cpp. |
|
Perform a class-specific configuration check on the telecommand: check that the maximum number of raw data has been set and that the PUS telemetry mode manager has been loaded.
Reimplemented from PUSTelecommand. Definition at line 143 of file DC_PUSDefineDataReporting.cpp. |
|
Set the maximum size of the application data array. The maximum size is specified as the maximum number of bytes of the application data. This is an initialization method that should only be called once. A call to this method causes the internal data structures of the telecommand to be allocated and initialized. Only positive values of the method argument are legal.
Definition at line 99 of file DC_PUSDefineDataReporting.cpp. |
|
Load the PUS telemetry mode manager.
Definition at line 133 of file DC_PUSDefineDataReporting.cpp. |
|
Implementation of the raw data load service.
This method copies the argument array into an internal array. The number of bytes n in the argument array must be less than the maximum value set with method
Reimplemented from Telecommand. Definition at line 113 of file DC_PUSDefineDataReporting.cpp. |