#include <DC_PUSClearDataReporting.h>
Inheritance diagram for DC_PUSClearDataReporting:
This class encapsulates the following subtypes of PUS service number 3:
setMaxNumberSID
. A call to this method initializes the internal data structures that are used to hold the application data of the telecommand. 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 or in case the application data are internally inconsistent.
Execution of this telecommand can have two outcomes. The telecommand can either have a successful outcome (the return value of doAction
is ACTION_SUCCESS) or it can fail (the return value of doAction
is ACTION_FAILURE). A failure is declared if any of the SIDs provided to the telecommand do not correspond to a data reporting packet that is currently in use.
The PUS specifies that the first item in the application data of this telecommand is the NSID field. The type of this field is not mandated by the standard. This class assumes it to be of type unsigned char
. The standard also allows this field to be omitted. This class however requires this field to be always present.
Definition at line 66 of file DC_PUSClearDataReporting.h.
Public Member Functions | |
DC_PUSClearDataReporting (void) | |
Instantiate a clear data reporting PUS telecommand. | |
void | setMaxNumberSID (unsigned char max) |
Set the maximum number of SIDs that can be processed by this telecommand. | |
virtual void | setRawData (unsigned int i, unsigned char d) |
Implementation of the raw data load service. | |
virtual unsigned int | getNumberOfRawData (void) const |
Return the number of raw data bytes that can be loaded with the raw telecommand data load service. | |
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 SIDs that can be processed by the telecommand has been set and that the telemetry manager and telemetry mode manager have been loaded. | |
Protected Member Functions | |
virtual TD_ActionOutcome | doAction (void) |
Clear the data reporting packets. |
|
Instantiate a clear 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_PUSClearDataReporting.cpp. |
|
Clear the data reporting packets.
A data reporting packet is cleared by setting its "in use" status to "packet not in use" and by unloading it from the PUS telemetry mode manager (if it is loaded). This deactivates the telemetry packet and allows the telemetry packet factory to reclaim it and make it available to other clients. A pseudo-code implementation for this method is as follows:<PRE> for (all SIDs stored in the telecommand) { retrieve data reporting packet from telemetry packet factory; if (no packet is returned by the factory ) outcome=FAIL; set status of packet to "not in use" if (packet is loaded in PUS telemetry mode manager) unload packet from PUS telemetry mode manager } if (outcome==FAIL) return ACTION_FAILURE; else return ACTION_SUCCESS; The telecommand is configured with a list of SIDs. The data reporting packets are retrieved from the telemetry packet factory (instance of class
Implements PunctualAction. Definition at line 77 of file DC_PUSClearDataReporting.cpp. |
|
Return the number of raw data bytes that can be loaded with the raw telecommand data load service.
The value returned by this class is equal to:
Reimplemented from Telecommand. Definition at line 73 of file DC_PUSClearDataReporting.cpp. |
|
Getter method for the PUS telemetry mode manager.
Definition at line 104 of file DC_PUSClearDataReporting.cpp. |
|
Perform a class-specific configuration check on the telecommand: check that the maximum number of SIDs that can be processed by the telecommand has been set and that the telemetry manager and telemetry mode manager have been loaded.
Reimplemented from PUSTelecommand. Definition at line 108 of file DC_PUSClearDataReporting.cpp. |
|
Set the maximum number of SIDs that can be processed by this telecommand. This is an initialization method that should only be called once. A call to this method causes the internal data structures where the SIDs are held to be allocated and initialized. Only positive values of the method argument are legal.
Definition at line 31 of file DC_PUSClearDataReporting.cpp. |
|
Load the PUS telemetry mode manager.
Definition at line 98 of file DC_PUSClearDataReporting.cpp. |
|
Implementation of the raw data load service. This method would normally be called by a telecommand loader to load the application data into the the telecommand component. This method interprets the raw data as they are loaded and uses them to construct the sequence of SIDs of the data reporting packets that have to be cleared. This method assumes that the raw data are loaded in sequence starting from the first one (i.e. the value of i in the first call is zero and succesive calls use values of i that are incremented by one at each call). The value of i is also constrained to lie in the range [0,N] where N is computed as follows: N = M*sizeof(TD_SID)where M is the maximum number of SIDs defined by method setMaxNumberSID . If the number of SIDs in the telecommand packet exceeds the maximum defined with method setMaxNumberSID , the telecommand is declared to be invalid with validity check code equal to VC_TOO_MANY_SIDS. If an attempt is made to load a greater number of raw data, the telecommand is declared to be invalid with validity check code equal to VC_TOO_MANY_RAW_DATA. Finally, the total number of loaded raw data T must be consistent with the number of SIDs (the first byte in the telecommand packet). If this is not the case, then the telecommand is declared invalid with validity check code equal to VC_INCONSISTENT_RAW_DATA.
Reimplemented from Telecommand. Definition at line 42 of file DC_PUSClearDataReporting.cpp. |