#include <PUSMemoryDump.h>
Inheritance diagram for PUSMemoryDump:
This class defines an internal memory structure where the characteristics of the memory blocks to be dumped (start address, length, and checksum) are stored. Additionally, it defines dump buffer to be used to store the telemetry packet image. The data acqusition service (defined by the super class TelemetryPacket
) is implemented to flush this buffer. Since the amount of data in a memory packet may be large, this class implements both the safe and fast versions of the data acquisition service. Finally, this class defines a checksum flag) that can be set to indicate whether checksum should be computed and included in the telemetry packet data. the checksum flag is defined as a static variable and is initialized to false. The data update service depends on the data subtype and must therefore be defined by the subclasses. All the internal data structures defined by this class are declared protected
to allow easy access to them by the subclasses that implement the two forms of the memory dump service.
The initial configuration of this class is performed as follows:<ul> Method setMaxNumberOfBlocks
must be called to set the maximum number of memory blocks that can be managed by this telemetry packet Method setDumpBufferSize
must be called to set the maximum size of the dump buffer. The checksum flag is set with method setChecksumFlag
. Note that this is a static method and that the checksum flag applies globally to all memory dump telemetry blocks. The dynamic configuration of the telemetry packet is performed as follows:<ul> The number of blocks to be dumped is set with method setNumberOfBlocks
The blocks are defined with a sequence of calls to method defineBlock
The PUS leaves some leeway in the definition of the structure of the application data for memory load telecommands. This implementation makes the following assumptions:
TD_PUSMemId
. TD_PUSNumberMemBlocks
. TD_PUSMemData
. This type defines the single addressable unit (or SAU). TD_PUSMemOffset
. TD_PUSMemLength
.
Definition at line 65 of file PUSMemoryDump.h.
Public Member Functions | |
PUSMemoryDump (void) | |
Instantiate a PUS memory dump telemetry packet. | |
void | setMaxNumberBlocks (TD_PUSNumberMemBlocks max) |
Set the maximum number of memory blocks that can be managed by this telemetry packet. | |
TD_PUSNumberMemBlocks | getMaxNumberBlocks () const |
Get the maximum number of memory blocks that can be managed by this telemetry packet. | |
void | setNumberBlocks (TD_PUSNumberMemBlocks max) |
Set the number of memory blocks that must be managed by this telemetry packet. | |
TD_PUSNumberMemBlocks | getNumberBlocks () const |
Get the number of memory blocks that are managed by this telemetry packet. | |
void | setDumpBufferSize (unsigned int max) |
Set the size (in number of bytes) of the dump buffer. | |
unsigned int | getDumpBufferSize () const |
Get the size (in number of bytes) of the dump buffer. | |
void | defineBlock (TD_PUSNumberMemBlocks i, TD_PUSMemData *start, TD_PUSMemLength length) |
Define the characteristics of the i-th memory block to be dumped. | |
virtual unsigned int | getNumberOfBytes (void) |
Return the number of bytes in this telemetry packet. | |
virtual unsigned char | getUnsignedByte (unsigned int n) |
Implement the data acquisition service for the PUS telemetry memory dump packet. | |
virtual unsigned char * | getStartAddress (void) |
Implement the fast version of the data acquisition service. | |
virtual bool | isFastAcquisitionImplemented (void) |
Return true to signify that the the fast version of the data acquisition service is implemented. | |
TD_PUSMemData * | getStartAddress (TD_PUSNumberMemBlocks i) const |
Get the start address of the i-th currently loaded block. | |
TD_PUSMemLength | getLength (TD_PUSNumberMemBlocks i) const |
Get the length of the i-th currently loaded block. | |
unsigned short | getChecksum (TD_PUSNumberMemBlocks i) const |
Get the value of the checksum field for the i-th currently loaded block. | |
void | setMemoryId (TD_PUSMemId memId) |
Set the memory block identifier for the dump packet. | |
TD_PUSMemId | getMemoryId () |
Get the memory block identifier for the dump packet. | |
virtual bool | isObjectConfigured (void) |
Perform a class-specific configuration check on the telecommand: check that the maximum number of blocks and the maximum number of data have been defind. | |
Static Public Member Functions | |
void | setChecksumFlag (bool checksumFlag) |
Set the checksum flag. | |
bool | isChecksumFlagSet () |
Return the value of the checksum flag. | |
Protected Attributes | |
MemBlockType * | block |
The i-th item of this array holds the descriptor for the i-th memory block to be dumped. | |
TD_PUSNumberMemBlocks | maxNumberBlocks |
The maximum number of memory dump blocks. | |
TD_PUSNumberMemBlocks | numberBlocks |
The number of memory dump blocks that must be dumped by this telemetry packet. | |
unsigned char * | data |
Dump buffer. | |
unsigned int | tmPacketSize |
The size of the telemetry packet in number of bytes. | |
unsigned int | maxNumberData |
The size of the dump buffer. | |
TD_PUSMemId | memId |
Identifier of the memory block. | |
Static Protected Attributes | |
bool | isChecksumRequired = false |
Flag indicating whether checksum data are required. |
|
Instantiate a PUS memory dump telemetry packet.
The values of the internal data structures that are used to hold the telecommand application data are initialized to illegal values to signify that the telecommand is not yet configured. The checksum flag is set to Definition at line 20 of file PUSMemoryDump.cpp. |
|
Define the characteristics of the i-th memory block to be dumped.
This method would normally be called as part of the dynamic telemetry packet configuration. The index i must lie in the range [0,N-1] where N is the number of blocks set with method
Definition at line 102 of file PUSMemoryDump.cpp. |
|
Get the value of the checksum field for the i-th currently loaded block.
The block index i must lie in the interval [0,N-1] where N is the number of currently loaded blocks (the value returned by method
|
|
Get the size (in number of bytes) of the dump buffer.
Definition at line 77 of file PUSMemoryDump.cpp. |
|
Get the length of the i-th currently loaded block.
The block index i must lie in the interval [0,N-1] where N is the number of currently loaded blocks (the value returned by method
Definition at line 88 of file PUSMemoryDump.cpp. |
|
Get the maximum number of memory blocks that can be managed by this telemetry packet.
Definition at line 46 of file PUSMemoryDump.cpp. |
|
Get the memory block identifier for the dump packet.
Definition at line 143 of file PUSMemoryDump.cpp. |
|
Get the number of memory blocks that are managed by this telemetry packet.
Definition at line 51 of file PUSMemoryDump.cpp. |
|
Return the number of bytes in this telemetry packet.
This is the number of bytes of the application data part of the telemetry packet holding the memory dump data. The number of bytes in the telemetry packet is computed as part of the data update service. This method will only return a valid value after method
Implements TelemetryPacket. Definition at line 115 of file PUSMemoryDump.cpp. |
|
Get the start address of the i-th currently loaded block.
The block index i must lie in the interval [0,N-1] where N is the number of currently loaded blocks (the value returned by method
Definition at line 82 of file PUSMemoryDump.cpp. |
|
Implement the fast version of the data acquisition service. This method returns the address of the first location of the dump buffer.
Reimplemented from TelemetryPacket. Definition at line 130 of file PUSMemoryDump.cpp. |
|
Implement the data acquisition service for the PUS telemetry memory dump packet.
This method assumes the telemetry packet data to be already loaded in the dump buffer. A pseudo-code implementation for this method is as follows:<PRE> return data[n]; where
Implements TelemetryPacket. Definition at line 122 of file PUSMemoryDump.cpp. |
|
Return the value of the checksum flag.
Definition at line 98 of file PUSMemoryDump.cpp. |
|
Return
Reimplemented from TelemetryPacket. Definition at line 134 of file PUSMemoryDump.cpp. |
|
Perform a class-specific configuration check on the telecommand: check that the maximum number of blocks and the maximum number of data have been defind.
Reimplemented from PUSTelemetryPacket. Definition at line 147 of file PUSMemoryDump.cpp. |
|
Set the checksum flag. If this flag is set to true, then the checksum is computed for each memory block to be dumped. Otherwise, the checksum field is set to zero. Note that the checksum field is always included in the telemetry packet.
Definition at line 94 of file PUSMemoryDump.cpp. |
|
Set the size (in number of bytes) of the dump buffer. This is an initialization method that should only be called once. A call to this method causes the memory for the dump buffer to be allocated and initialized. Only positive values of the method argument are legal.
Definition at line 66 of file PUSMemoryDump.cpp. |
|
Set the maximum number of memory blocks that can be managed by this telemetry packet. This is an initialization method that should only be called once. A call to this method causes the internal data structures where the blocks are held to be allocated and initialized. Only positive values of the method argument are legal.
Definition at line 33 of file PUSMemoryDump.cpp. |
|
Set the memory block identifier for the dump packet. Only values greater than zero are legal.
Definition at line 138 of file PUSMemoryDump.cpp. |
|
Set the number of memory blocks that must be managed by this telemetry packet.
This method is normally called when the telemetry packet is dynamically configured. The value of the argument N must lie in the range [1,N] where N is the maximum number of blocks set with method
Definition at line 56 of file PUSMemoryDump.cpp. |