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

DC_PUSTcVerificationPacket Class Reference

#include <DC_PUSTcVerificationPacket.h>

Inheritance diagram for DC_PUSTcVerificationPacket:

PUSTelemetryPacket TelemetryPacket CC_RootObject List of all members.

Detailed Description

PUS telemetry packet implementing the telecommand verification service.

This class can model any of the telecommand verification service packets. The value of the subtype attribute determines which packet is being modeled.

This class is intended to be used by a component that monitors the execution status of a telecommand. Upon detecting a change in the execution status of a telecommand, this component configures an instance of PUSTcVerificationPacket in accordance with the detected state of the telecommand execution. The PUSTcVerificationPacket instance should then be loaded into the telementry manager for immediate dispatch to the telemetry channel.

A telemetry packet of type PUSTcVerificationPacket can contain two or three fields. It contains two fields if it reports a telecommand success. It contains three fields if it reports a telecommand failure. The two fields that are always present are the packet identifier of the telecommand and the packet sequence control of the telecommand. The third field is a single error code that conveys information about the reason of the telecommand failure.

Todo:
construct a test case for this class.
Author:
Alessandro Pasetti (P&P Software GmbH)
Version:
1.0

Definition at line 41 of file DC_PUSTcVerificationPacket.h.

Public Member Functions

 DC_PUSTcVerificationPacket (void)
 Instantiate a PUS Telecommand Verification telemetry packet.

virtual unsigned int getNumberOfBytes (void)
 Return the number of bytes managed by this telemetry packet.

virtual unsigned char getUnsignedByte (unsigned int n)
 Implement the data acquisition service for the PUS telecommand verification packet.

TD_CheckCode getErrorCode ()
 Return the error code that describes the reason for the telecommand failure.

void setErrorCode (TD_CheckCode errCode)
 Set the error code that describes the reason for the telecommand failure.

TD_TelecommandId getTelecommandId ()
 Return the identifier of the telecommand for which the execution verification report is constructed.

void setTelecommandId (TD_TelecommandId tcId)
 Set the identifier of the telecommand for which the execution verification report is constructed.

virtual void update (void)
 Implement the data update service for the PUS telecommand verification packet.


Constructor & Destructor Documentation

DC_PUSTcVerificationPacket::DC_PUSTcVerificationPacket void   ) 
 

Instantiate a PUS Telecommand Verification telemetry packet.

The class identifier is set. The telemetry type attributes is set to PUS_TYPE_TC_VER. The error code is set to zero.

Definition at line 21 of file DC_PUSTcVerificationPacket.cpp.


Member Function Documentation

TD_CheckCode DC_PUSTcVerificationPacket::getErrorCode  ) 
 

Return the error code that describes the reason for the telecommand failure.

This field is only meaningful when the telemetry packet is being used to describe a telecommand failure. The default value of the error code is zero.

Returns:
the error code

Definition at line 57 of file DC_PUSTcVerificationPacket.cpp.

unsigned int DC_PUSTcVerificationPacket::getNumberOfBytes void   )  [virtual]
 

Return the number of bytes managed by this telemetry packet.

The number of bytes is computed as follows. If the telemetry packet is being used to report a successful telecommand execution, then its number of bytes is given by:

      sizeof(TD_PUSPacketId)+sizeof(TD_TelecommandId) 
If the telemetry packet is being used to report a successful telecommand execution, then its number of bytes is given by:
      sizeof(TD_PUSPacketId)+sizeof(TD_TelecommandId)+sizeof(TD_CheckCode) 
Note that TD_CheckCode is the type of the error code field.
See also:
setErrorCode
Returns:
number of bytes in this telemetry packet

Implements TelemetryPacket.

Definition at line 44 of file DC_PUSTcVerificationPacket.cpp.

TD_TelecommandId DC_PUSTcVerificationPacket::getTelecommandId  ) 
 

Return the identifier of the telecommand for which the execution verification report is constructed.

Returns:
the telecommand identifier

Definition at line 68 of file DC_PUSTcVerificationPacket.cpp.

unsigned char DC_PUSTcVerificationPacket::getUnsignedByte unsigned int  n  )  [virtual]
 

Implement the data acquisition service for the PUS telecommand verification packet.

The bytes associated to this telemetry packet are returned according to the following algorithm:

      if ( (subtype == PUS_ST_TC_VER_ACC_SC) ||
           (subtype == PUS_ST_TC_EXE_STR_SC) ||
           (subtype == PUS_ST_TC_EXE_PRO_SC) ||
           (subtype == PUS_ST_TC_EXE_END_SC) ) {
          return TC packet ID;
          return TC packet sequence control;
       } else {
          return TC packet ID;
          return TC packet sequence control;
          return error code;
       } 
The TC packet ID, TC packet sequence control, and the error code are transferred byte by byte starting from the byte with the highest address.
Returns:
value of n-th telemetry byte
Parameters:
n the telemetry byte to be returned (starting with byte 0)

Implements TelemetryPacket.

Definition at line 83 of file DC_PUSTcVerificationPacket.cpp.

void DC_PUSTcVerificationPacket::setErrorCode TD_CheckCode  errCode  ) 
 

Set the error code that describes the reason for the telecommand failure.

See also:
getErrorCode
Parameters:
errCode the error code

Definition at line 63 of file DC_PUSTcVerificationPacket.cpp.

void DC_PUSTcVerificationPacket::setTelecommandId TD_TelecommandId  tcId  ) 
 

Set the identifier of the telecommand for which the execution verification report is constructed.

Parameters:
tcId the telecommand identifier

Definition at line 74 of file DC_PUSTcVerificationPacket.cpp.

void DC_PUSTcVerificationPacket::update void   )  [virtual]
 

Implement the data update service for the PUS telecommand verification packet.

This type of packet is configured dynamically by the component that monitors the execution status of the telecommands. Its update service is therefore implemented as a dummy method that returns without taking any action.

Implements TelemetryPacket.

Definition at line 79 of file DC_PUSTcVerificationPacket.cpp.


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