#include <DC_BasicPUSTmStream.h>
Inheritance diagram for DC_BasicPUSTmStream:

This component can write several packets to the telemetry write area in sequence, up to the point where there is no space left in the telemetry write area. The telemetry write area is characterized by a starting address and by a size. The starting address and the size are settable configuration parameters. They can be changed dynamically. The first byte of the telemetry write area holds the number of packets that have been written to it since the last time the stream was reset. Following bytes hold the images of the the telemetry packets in the order in which they are written.
This component maintains a write counter and a packet counter. Both counters are reset to 0 by a call to operation reset or flush. The write counter is incremented every time a byte is written to the telemetry write array. If its value is smaller than the size of the telemetry write area, then the write counter points to the location in the write area where the next telemetry data byte will be written. The packet counter is equal to the number of packets that have been written to the telemetry write area since the stream was last reset. The value of the packet counter is the same as the value of the first byte of the telemetry write area.
Write requests that cannot be processed because there is not enough space in the telemetry write area have no effect other than the generation of event EVT_TM_STREAM_END. It is the responsibility of the user to perform reset or flush operations when the byte array has been completely filled.
This telemetry stream adds the header data to the packet data that it retrieves from the packet itself. The format of the packet header is in accordance with the PUS with the following qualifications:
getPacketId TD_ObsTime.
Definition at line 69 of file DC_BasicPUSTmStream.h.
Public Member Functions | |
| DC_BasicPUSTmStream (void) | |
| Instantiate the component. | |
| virtual void | reset (void) |
| Reset the telemetry stream. | |
| virtual void | flush (void) |
| The flush operation is equivalent to a reset operation. | |
| virtual unsigned int | getCapacity (void) |
| Return the capacity of the telemetry stream. | |
| void | setCapacity (unsigned int n) |
| Set the capacity of the telemetry stream. | |
| void | setStartAddress (unsigned char *pAddress) |
| Set the starting address of the telemetry write area. | |
| unsigned char * | getStartAddress (void) const |
| Get the starting address of the telemetry write area. | |
| unsigned int | getPacketCounter (void) const |
| Get the current value of the packet counter. | |
| unsigned int | getWriteCounter (void) const |
| Get the current value of the write counter. | |
| unsigned int | getSequenceCounter (void) const |
| Get the value of the packet sequence count. | |
| virtual bool | doesPacketFit (TelemetryPacket *pPacket) |
| Return true if there is enough space in the telemetry write area to write the argument telemetry packet. | |
| virtual void | write (TelemetryPacket *pItem) |
| Write one telemetry packet to the telemetry write area. | |
| virtual bool | isObjectConfigured (void) |
| Perform a class-specific configuration check on the telemetry stream: verify that the size and starting address of the telemetry write area have been loaded. | |
|
|
Instantiate the component. The class identifier is set. The size and starting address of the byte array are set to illegal values to signify that the component is not yet configured. The write counter is set to zero. Definition at line 23 of file DC_BasicPUSTmStream.cpp. |
|
|
Return true if there is enough space in the telemetry write area to write the argument telemetry packet. A pseudo-code implementation for this method is as follows:
if ( pItem->getNumberOfBytes()==0 )
return true;
if ( (pItem->getNumberOfBytes()+headerSize) greater than (N-writeCounter) )
return false;
else
return true; where N is the size of the telemetry write area, writeCounter is the value of the write counter, and headerSize is the size of the PUS header that method write adds to the application data returned by the packet.
Reimplemented from TelemetryStream. Definition at line 76 of file DC_BasicPUSTmStream.cpp. |
|
|
The flush operation is equivalent to a reset operation.
Reimplemented from TelemetryStream. Definition at line 38 of file DC_BasicPUSTmStream.cpp. |
|
|
Return the capacity of the telemetry stream. The capacity of this telemetry stream is equal to the size in bytes of the telemetry write area.
Reimplemented from TelemetryStream. Definition at line 42 of file DC_BasicPUSTmStream.cpp. |
|
|
Get the current value of the packet counter.
Definition at line 63 of file DC_BasicPUSTmStream.cpp. |
|
|
Get the value of the packet sequence count. This is equal to the number of packets for which write requests have been made since the telemetry stream component was instantiated.
Definition at line 72 of file DC_BasicPUSTmStream.cpp. |
|
|
Get the starting address of the telemetry write area.
Definition at line 58 of file DC_BasicPUSTmStream.cpp. |
|
|
Get the current value of the write counter.
Definition at line 68 of file DC_BasicPUSTmStream.cpp. |
|
|
Perform a class-specific configuration check on the telemetry stream: verify that the size and starting address of the telemetry write area have been loaded.
Reimplemented from CC_RootObject. Definition at line 143 of file DC_BasicPUSTmStream.cpp. |
|
|
Reset the telemetry stream. The write counter is set to 1 and the packet counter is set to 0. The next packet will be written at the beginning of the telemetry write area (starting at location 1, location 0 is reserved for the packet counter). Reimplemented from TelemetryStream. Definition at line 32 of file DC_BasicPUSTmStream.cpp. |
|
|
Set the capacity of the telemetry stream.
The capacity of this telemetry stream is equal to the size in bytes of the telemetry write area. If s is the staring address of the telemetry write area (loaded with method
Definition at line 47 of file DC_BasicPUSTmStream.cpp. |
|
|
Set the starting address of the telemetry write area. This component does not perform any memory allocation operation. It assumes that the memory for the telemetry write area has already been allocated by the caller. The telemetry stream is reset when a new start address is loaded.
Definition at line 52 of file DC_BasicPUSTmStream.cpp. |
|
|
Write one telemetry packet to the telemetry write area. First the PUS header is written to the telemetry write area. Then the telemetry bytes read from the telemetry packet are written in sequence. The write operation begins at location wc in the telemetry write area where wc is the value of the write counter. Before beginning to write the packet data, a check is made to verify that there is enough space in the telemetry write area. If this is not the case, then an event of type EVT_TM_STREAM_END is generated and the method returns. After successful completion of a write operation, the packet counter is incremented by 1. The sequence count is incremented by one for each write request regardless of whether or not it was successful There is no check on an overflow of either the write or packet counter.
The telemetry packet data are extracted from the telemetry packet component through its data acquisition service. If the packet provides it, then the fast version of the service is used. Otherwise the safe version is used. Method
Implements TelemetryStream. Definition at line 85 of file DC_BasicPUSTmStream.cpp. |