Main Page | Modules | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

DC_PUSDefineDataReporting Class Reference

#include <DC_PUSDefineDataReporting.h>

Inheritance diagram for DC_PUSDefineDataReporting:

PUSTelecommand Telecommand PunctualAction CC_RootObject List of all members.

Detailed Description

PUS telecommand to define the housekeeping and diagnostic data reporting telemetry packets.

This class encapsulates the following subtypes of PUS service number 3:

This class defines an internal buffer to store the application data that define the telemetry packet. The maximum size of this buffer is a configuration parameter that must be set at application initialization time (method 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:

. No event reports are generated in case of failure as it is assumed that this is done by the calling client.

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.

Author:
Alessandro Pasetti (P&P Software GmbH)
Version:
1.0

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_PUSTelemetryModeManagergetPUSTelemetryModeManager () 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.


Constructor & Destructor Documentation

DC_PUSDefineDataReporting::DC_PUSDefineDataReporting void   ) 
 

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.


Member Function Documentation

TD_ActionOutcome DC_PUSDefineDataReporting::doAction void   )  [protected, virtual]
 

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:

  • The number of fixed-length arrays
  • The size of the packet value buffer
The above figures are computed by processing the content of the application data. The computation makes certain assumptions about the structure of the application data. The assumptions are the same as are made in class 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.
See also:
PunctualAction::execute
Returns:
action outcome code (see class comment)

Implements PunctualAction.

Definition at line 28 of file DC_PUSDefineDataReporting.cpp.

unsigned int DC_PUSDefineDataReporting::getNumberOfApplicationData void   )  const [virtual]
 

Return the number of application data bytes that were loaded with the last call to method setRawData.

The number returned by this method is the same as the value of the argument n in the call to method setRawData.

See also:
setRawData
Returns:
the number of application data bytes in the currently loaded packet

Definition at line 129 of file DC_PUSDefineDataReporting.cpp.

unsigned int DC_PUSDefineDataReporting::getNumberOfRawData void   )  [virtual]
 

Get the maximum size (in number of bytes) of the application data array.

See also:
setNumberOfRawData
Returns:
the maximum size of the application data in number of bytes

Definition at line 109 of file DC_PUSDefineDataReporting.cpp.

DC_PUSTelemetryModeManager * DC_PUSDefineDataReporting::getPUSTelemetryModeManager  )  const
 

Getter method for the PUS telemetry mode manager.

See also:
setPUSTelemetryModeManager
Returns:
the PUS telemetry mode manager

Definition at line 139 of file DC_PUSDefineDataReporting.cpp.

bool DC_PUSDefineDataReporting::isObjectConfigured void   )  [virtual]
 

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.

Returns:
true if the telecommand is configured, false otherwise

Reimplemented from PUSTelecommand.

Definition at line 143 of file DC_PUSDefineDataReporting.cpp.

void DC_PUSDefineDataReporting::setNumberOfRawData unsigned int  max  ) 
 

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.

Parameters:
max the maximum size of the application data in number of bytes

Definition at line 99 of file DC_PUSDefineDataReporting.cpp.

void DC_PUSDefineDataReporting::setPUSTelemetryModeManager DC_PUSTelemetryModeManager pTmModeManager  ) 
 

Load the PUS telemetry mode manager.

See also:
doAction
Parameters:
pTmModeManager the PUS telemetry mode manager

Definition at line 133 of file DC_PUSDefineDataReporting.cpp.

void DC_PUSDefineDataReporting::setRawData unsigned char *  d,
unsigned int  n
[virtual]
 

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 setNumberOfRawData. If an attempt is made to load a greater number of raw data, then the telecommand is declared to be invalid with validity check code equal to VC_TOO_MANY_RAW_DATA.

Parameters:
d the array holding the raw data
n the number of items in array d

Reimplemented from Telecommand.

Definition at line 113 of file DC_PUSDefineDataReporting.cpp.


The documentation for this class was generated from the following files:
Copyright 2003 P&P Software GmbH - All Rights Reserved