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

DC_PUSControlDataReporting Class Reference

#include <DC_PUSControlDataReporting.h>

Inheritance diagram for DC_PUSControlDataReporting:

PUSTelecommand Telecommand PunctualAction CC_RootObject List of all members.

Detailed Description

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

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

This class is configured at initialization time by setting the maximum number of SIDs that can be handled by a single instance of the telecommand. This is done through method setMaxNumberSID. A call to this method initializes the internal data structures that are used to hold the application data of the telecommand.

During normal operation, configuration is performed using the raw data load service.

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.

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

Definition at line 55 of file DC_PUSControlDataReporting.h.

Public Member Functions

 DC_PUSControlDataReporting (void)
 Instantiate a control data reporting PUS telecommand.

void setMaxNumberSID (unsigned char max)
 Set the maximum number of SIDs that can be processed by this telecommand.

unsigned int getMaxNumberSID ()
 Get 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.

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.


Protected Member Functions

virtual TD_ActionOutcome doAction (void)
 Depending on the subtype of the telecommand, enable or disable the data reporting packets.


Constructor & Destructor Documentation

DC_PUSControlDataReporting::DC_PUSControlDataReporting void   ) 
 

Instantiate a control 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 17 of file DC_PUSControlDataReporting.cpp.


Member Function Documentation

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

Depending on the subtype of the telecommand, enable or disable the data reporting packets.

A pseudo-code implementation for this method is as follows:<PRE> outcome = ACTION_SUCCESS; for (all SIDs stored in the telecommand) { retrieve data reporting packet from telemetry packet factory; if (no packet is returned by the factory ) outcome = ACTION_FAILURE: if ( (telecommand subtype==PUS_ST_DATA_REP_ENB_HK) || (telecommand subtype==PUS_ST_DATA_REP_ENB_DG) ) enable the data reporting packet returned by the factory; else disable the data reporting packet returned by the factory; } return outcome; The telecommand is configured with a list of SIDs and with a telecommand subtype. Depending on the subtype, the telecommand will either enable or disable the data reporting packets identified by the SIDs. The data reporting packets are retrieved from the telemetry packet factory (instance of class CC_TelemetryPacketFactory). Enabling and disabling of the data reporting packets is done through method setEnabled declared by class DC_PUSDataReportingPacket.

See also:
DC_PUSDataReportingPacket::setEnabled

CC_TelemetryPacketFactory

PunctualAction::execute

Returns:
the execution outcome of the telecommand

Implements PunctualAction.

Definition at line 77 of file DC_PUSControlDataReporting.cpp.

unsigned int DC_PUSControlDataReporting::getMaxNumberSID  ) 
 

Get the maximum number of SIDs that can be processed by this telecommand.

See also:
setMaxNumberSID
Returns:
the maximum number of SIDs

Definition at line 38 of file DC_PUSControlDataReporting.cpp.

unsigned int DC_PUSControlDataReporting::getNumberOfRawData void   )  const [virtual]
 

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: M*sizeof(TD_SID)+1 where M is the maximum number of SIDs defined by method setMaxNumberSID.

See also:
setRawData
Returns:
the number of raw data bytes to be loaded with the raw data load service

Reimplemented from Telecommand.

Definition at line 73 of file DC_PUSControlDataReporting.cpp.

bool DC_PUSControlDataReporting::isObjectConfigured void   )  [virtual]
 

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.

Returns:
true if the telecommand is configured, false otherwise

Reimplemented from PUSTelecommand.

Definition at line 102 of file DC_PUSControlDataReporting.cpp.

void DC_PUSControlDataReporting::setMaxNumberSID unsigned char  max  ) 
 

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.

Parameters:
max the maximum number of SIDs

Definition at line 27 of file DC_PUSControlDataReporting.cpp.

void DC_PUSControlDataReporting::setRawData unsigned int  i,
unsigned char  d
[virtual]
 

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 enabled or disabled. 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.
See also:
getNumberOfRawData
Parameters:
i the index of the raw telecommand data
d the raw data

Reimplemented from Telecommand.

Definition at line 42 of file DC_PUSControlDataReporting.cpp.


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