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

DC_DummyTelemetryPacket Class Reference

#include <DC_DummyTelemetryPacket.h>

Inheritance diagram for DC_DummyTelemetryPacket:

TelemetryPacket CC_RootObject List of all members.

Detailed Description

Dummy implementation of the TelemetryPacket interface useful for testing purposes.

This telemetry packet encapsulates N settable bytes. The value of N is a configuration parameter. The update service is implemented to increment the value of each telemetry byte by one (with a wrap-around to zero when the value of 255 is reached). The validity check can be dynamically set up to return either "data valid" or "data not valid".

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

Definition at line 30 of file DC_DummyTelemetryPacket.h.

Public Member Functions

 DC_DummyTelemetryPacket (void)
 Instantiate a telemetry packet component.

virtual unsigned int getNumberOfBytes (void)
 This method always returns the number of telemetry bytes.

virtual unsigned char getUnsignedByte (unsigned int n)
 Return the n-th encapsulated byte.

virtual void update (void)
 Increment the value of each encapsulated byte by one.

void setValidStatus (bool validStatus)
 Set the validity status.

void setValue (unsigned int n, unsigned char value)
 Set the value of the n-th encapsulated byte.

void setNumberOfBytes (unsigned int n)
 Set the number of bytes encapsulated by this telemetry packet.

virtual bool isValid (void)
 Return the validity status set with method setValidStatus.

virtual bool isObjectConfigured (void)
 Perform a class-specific configuration check on the component: verify that the number of encapsulated bytes has been set.


Constructor & Destructor Documentation

DC_DummyTelemetryPacket::DC_DummyTelemetryPacket void   ) 
 

Instantiate a telemetry packet component.

The class identifier is set, and the return value of the validity check is set to "data valid". The number of encapsulated bytes is set to an illegal value tosignify that the component is not yet configured. The constructor also calls the methods to set the telemetry packet time tag, the type, the subtype, and the destination. These calls are unnecessary from a functional point of view because none of these attributes is implemented by the TelemetryPacket class. However the calls are useful during testing to achieve full statement coverage of the the base class.

Definition at line 16 of file DC_DummyTelemetryPacket.cpp.


Member Function Documentation

unsigned int DC_DummyTelemetryPacket::getNumberOfBytes void   )  [virtual]
 

This method always returns the number of telemetry bytes.

Returns:
the number of telemetry bytes

Implements TelemetryPacket.

Definition at line 42 of file DC_DummyTelemetryPacket.cpp.

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

Return the n-th encapsulated byte.

Returns:
the value of the n-th encapsulated byte
Parameters:
n the byte index

Implements TelemetryPacket.

Definition at line 29 of file DC_DummyTelemetryPacket.cpp.

bool DC_DummyTelemetryPacket::isObjectConfigured void   )  [virtual]
 

Perform a class-specific configuration check on the component: verify that the number of encapsulated bytes has been set.

Returns:
true if the component is configured, false otherwise.

Reimplemented from CC_RootObject.

Definition at line 69 of file DC_DummyTelemetryPacket.cpp.

bool DC_DummyTelemetryPacket::isValid void   )  [virtual]
 

Return the validity status set with method setValidStatus.

See also:
setValidStatus
Returns:
the validity status

Reimplemented from TelemetryPacket.

Definition at line 38 of file DC_DummyTelemetryPacket.cpp.

void DC_DummyTelemetryPacket::setNumberOfBytes unsigned int  n  ) 
 

Set the number of bytes encapsulated by this telemetry packet.

This is an initialization method. It should only be called once. Only positive values of the argument n are legal. The telemetry bytes are initialized to zero.

See also:
#getUnsignedByteUnchecked
Parameters:
n the number of bytes encapsulated in this telemetry packet

Definition at line 61 of file DC_DummyTelemetryPacket.cpp.

void DC_DummyTelemetryPacket::setValidStatus bool  validStatus  ) 
 

Set the validity status.

This is the value returned by the validity check (method isValid.

See also:
isValid
Parameters:
validStatus the validity status

Definition at line 34 of file DC_DummyTelemetryPacket.cpp.

void DC_DummyTelemetryPacket::setValue unsigned int  n,
unsigned char  value
 

Set the value of the n-th encapsulated byte.

This is the value returned by method getUnsignedByteUnchecked. The value of n must lie in the range [0,N-1] where N is the total number of telemetry bytes encapsulated in the telemetry packet. Calls with out-of-range values of n have no effect.

See also:
#getUnsignedByteUnchecked
Parameters:
value the value of the encapsulated byte
n the index of the encapsulated byte

Definition at line 56 of file DC_DummyTelemetryPacket.cpp.

void DC_DummyTelemetryPacket::update void   )  [virtual]
 

Increment the value of each encapsulated byte by one.

Wrap around to 0 when the value of 255 is reached.

Implements TelemetryPacket.

Definition at line 46 of file DC_DummyTelemetryPacket.cpp.


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