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

PUSDumpMemory Class Reference

#include <PUSDumpMemory.h>

Inheritance diagram for PUSDumpMemory:

PUSTelecommand Telecommand PunctualAction CC_RootObject DC_PUSDumpMemoryAbsolute DC_PUSDumpMemoryOffset List of all members.

Detailed Description

Base class for PUS telecommands to set up a memory dump either with base plus offset or absolute address.

This class encapsulates the commonalities for the following subtypes of PUS service number 6:

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). This and other internal data structured are declared protected in order to facilitate the implementation of concrete subclasses.

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.

No implementation for the execution action of this telecommand is provided. This depends on whether the memory dump is of the "absolute address" or the "base address plus offset" type and must therefore be provided by the concrete subclasses.

The PUS leaves some leeway in the definition of the structure of the application data for memory dump telecommands. This implementation makes the same assumptions as defined in the class comment of class PUS_MemoryDump.

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

Definition at line 49 of file PUSDumpMemory.h.

Public Member Functions

 PUSDumpMemory (void)
 Instantiate a memory dump 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 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 setTelemetryManager (CC_TelemetryManager *pTmManager)
 Load the telemetry manager.

CC_TelemetryManagergetTelemetryManager () const
 Getter method for the telemetry 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 telemetry manager has been loaded.


Protected Attributes

unsigned char * data
 The buffer where the application data are stored.

unsigned int maxNumberData
 The size in number of bytes of the data buffer.

unsigned int numberData
 The size in the number of bytes of the currently loaded application data.

CC_TelemetryManagerpTmManager
 The telemetry manager.


Constructor & Destructor Documentation

PUSDumpMemory::PUSDumpMemory void   ) 
 

Instantiate a memory dump PUS telecommand.

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_MEM.

Definition at line 21 of file PUSDumpMemory.cpp.


Member Function Documentation

unsigned int PUSDumpMemory::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 60 of file PUSDumpMemory.cpp.

unsigned int PUSDumpMemory::getNumberOfRawData void   )  [virtual]
 

Get the maximum size of the application data array.

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

Definition at line 40 of file PUSDumpMemory.cpp.

CC_TelemetryManager * PUSDumpMemory::getTelemetryManager  )  const
 

Getter method for the telemetry manager.

See also:
setTelemetryManager
Returns:
the telemetry manager

Definition at line 69 of file PUSDumpMemory.cpp.

bool PUSDumpMemory::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 telemetry manager has been loaded.

Returns:
true if the telecommand is configured, false otherwise

Reimplemented from PUSTelecommand.

Definition at line 73 of file PUSDumpMemory.cpp.

void PUSDumpMemory::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 30 of file PUSDumpMemory.cpp.

void PUSDumpMemory::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 44 of file PUSDumpMemory.cpp.

void PUSDumpMemory::setTelemetryManager CC_TelemetryManager pTmManager  ) 
 

Load the telemetry manager.

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

Definition at line 64 of file PUSDumpMemory.cpp.


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