#include <TelemetryPacket.h>
Inheritance diagram for TelemetryPacket:
The Telemetry Item concept is implemented here to represent a group of ordered bytes that are intended to be sent to the telemetry stream and that constitute one single logical unit in the sense that they are collected together. This group of ordered bytes is referred to in what follows as the telemetry bytes.
This class defines five attributes, two services, and one check. The attributes allow the telemetry bytes to be characterized. They are:
Two implementations of the data acquisition service are provided: a safe implementation and a fast implementation. The safe implementation is built upon methods getUnsignedByte
and getNumberOfBytes
. It allows the most recently acquired telemetry bytes to be transfered one by one to the caller. This implementation is safe because it complies with all coding rules defined for the OBS Framework. However, it may not be fast because the transfer of each byte requires a call to a virtual method. The alternative implementation is built on methods getStartAddress
and getNumberOfBytes
. The former method returns a pointer to the internal data area where the telemetry bytes are stored. The latter returns the number of telemetry bytes. This implementation is fast because the caller can copy the telemetry bytes using a fast memory copy algorithm. It is potentially unsafe because it gives the caller access to an internal data structure of the telemetry packet component. The safe implementation of the data update service must always be provided by all concrete subclasses. The fast version may be provided by subclasses that manage large amounts of telemetry data. Method isFastAcquisitionImplemented
is provided to allow a caller to check whether the fast implementation is provided. The fast version of the data acquisition service should be used only when necessary for performance reasons. By default, the safe version should be used.
Telemetry item instances are intended to be used by a component that collects telemetry data and forwards them to a telemetry channel (in the OBS Framework, this telemetry data collecting component is the telemetry manager instantiated from class CC_TelemetryManager
). The telemetry packet class assumes that the collection of the telemetry data from one of its instances is performed in three steps as follows:<ol> The data update service is called The validity check is performed on the newly updated data The data acquisition service is called to acquire the telemetry data This class does not make any assumptions about the data structure that is used internally to store the telemetry bytes. It is an abstract class that is intended to provide a general interface capable of modeling telemetry packet concepts of varying complexity but it only provides minimal default implementations for its attributes, services and for the validity check. Applications should provide subclasses that implement their particular telemetry concept.
Definition at line 95 of file TelemetryPacket.h.
Public Member Functions | |
TelemetryPacket (void) | |
Instantiate a telemetry packet component. | |
virtual void | setType (TD_TelemetryType tmType) |
Setter method for the telemetry packet type. | |
virtual void | setSubType (TD_TelemetrySubType tmSubType) |
Setter method for the telemetry packet sub-type. | |
virtual void | setTimeTag (TD_ObsTime timeTag) |
Setter method for the telemetry packet time tag. | |
virtual void | setDestination (TD_TelemetryDestination tmDest) |
Setter method for the telemetry packet destination. | |
virtual unsigned int | getNumberOfBytes (void)=0 |
Return the number of bytes managed by this telemetry packet. | |
virtual void | update (void)=0 |
Implement the data update service. | |
virtual bool | isValid (void) |
Execute the validity check on the most recently updated telemetry bytes. | |
virtual unsigned char | getUnsignedByte (unsigned int n)=0 |
Implement the safe version of the data acquisition service. | |
virtual unsigned char * | getStartAddress (void) |
Implement the fast version of the data acquisition service. | |
virtual bool | isFastAcquisitionImplemented (void) |
Return true if the fast version of the data acquisition service is implemented. | |
virtual TD_TelemetryType | getType (void) const |
Getter method for the telemetry packet type. | |
virtual TD_TelemetrySubType | getSubType (void) const |
Getter method for the telemetry sub-type. | |
virtual TD_ObsTime | getTimeTag (void) const |
Getter method for the telemetry packet time tag. | |
virtual TD_TelemetryDestination | getDestination (void) const |
Getter method for the telemetry packet destination. | |
void | setInUse (bool newInUse) |
Set the value of the "in use" attribute. | |
bool | isInUse (void) const |
Return the value of the "in use" attribute. |
|
Instantiate a telemetry packet component. The "in use" flag is set to: "packet is not in use". Definition at line 16 of file TelemetryPacket.cpp. |
|
Getter method for the telemetry packet destination. This class does not model the telemetry packet destination. This method always returns zero.
Reimplemented in PUSTelemetryPacket. Definition at line 48 of file TelemetryPacket.cpp. |
|
Return the number of bytes managed by this telemetry packet. Each telemetry packet is responsible for generating a fixed number of telemetry bytes. This method returns this fixed number.
Implemented in DC_DummyPUSTelemetryPacket, DC_DummyTelemetryPacket, DC_PUSDataReportingPacket, DC_PUSTcVerificationPacket, PUSMemoryDump, and StructuredTelemetryPacket. |
|
Implement the fast version of the data acquisition service.
If this version of the service is implemented, then this method returns a pointer to start address of an internal data structure that holds all telemetry data as a linear sequence of bytes. The size of the internal data structure is given by method
Reimplemented in DC_PUSDataReportingPacket, and PUSMemoryDump. Definition at line 64 of file TelemetryPacket.cpp. |
|
Getter method for the telemetry sub-type. This class does not model the telemetry sub-type. This method always returns zero.
Reimplemented in PUSTelemetryPacket. Definition at line 32 of file TelemetryPacket.cpp. |
|
Getter method for the telemetry packet time tag. This class does not model the telemetry packet time tag. This method always returns zero.
Reimplemented in PUSTelemetryPacket. Definition at line 40 of file TelemetryPacket.cpp. |
|
Getter method for the telemetry packet type.
This class implements the the type to coincide with the lest significant byte of the class identifier. A pseudo-code implementation of this method therefore is:<PRE> return (TD_TelemetryType)(getClassId()256); The modulo operation ensures that there is no overflow even if there is a type mismatch between type
Reimplemented in PUSTelemetryPacket. Definition at line 24 of file TelemetryPacket.cpp. |
|
Implement the safe version of the data acquisition service.
The telemetry data provided by this class are treated as a sequence of bytes. The method returns the n-th telemetry byte. The parameter n must lie in the interval [0, N-1] where N is the number of telemetry bytes (the return value of method
Implemented in DC_DummyPUSTelemetryPacket, DC_DummyTelemetryPacket, DC_PUSDataReportingPacket, DC_PUSTcVerificationPacket, PUSMemoryDump, and StructuredTelemetryPacket. |
|
Return
This class provides a default implementation that returns
Reimplemented in DC_PUSDataReportingPacket, and PUSMemoryDump. Definition at line 68 of file TelemetryPacket.cpp. |
|
Return the value of the "in use" attribute. If the method returns true, then the packet is already in use, otherwise it is free and can be configured.
Definition at line 60 of file TelemetryPacket.cpp. |
|
Execute the validity check on the most recently updated telemetry bytes. This class provides a default implementation that always return "data valid".
Reimplemented in DC_DummyTelemetryPacket. Definition at line 20 of file TelemetryPacket.cpp. |
|
Setter method for the telemetry packet destination. Since this class does not model the telemetry packet destination, this method is implemented as a dummy method that returns without taking any action.
Reimplemented in PUSTelemetryPacket. Definition at line 52 of file TelemetryPacket.cpp. |
|
Set the value of the "in use" attribute.
Definition at line 56 of file TelemetryPacket.cpp. |
|
Setter method for the telemetry packet sub-type. Since this class does not model the telemetry packet sub-type, this method is implemented as a dummy method that returns without taking any action.
Reimplemented in PUSTelemetryPacket. Definition at line 36 of file TelemetryPacket.cpp. |
|
Setter method for the telemetry packet time tag. Since this class does not model the telemetry packet time tag, this method is implemented as a dummy method that returns without taking any action.
Reimplemented in PUSTelemetryPacket. Definition at line 44 of file TelemetryPacket.cpp. |
|
Setter method for the telemetry packet type.
Since this class identifies the telemetry packet type with the class identifier (see
Reimplemented in PUSTelemetryPacket. Definition at line 28 of file TelemetryPacket.cpp. |
|
Implement the data update service.
A call to this method should normally be followed by a call to method Implemented in DC_DataItem16TmWord, DC_DummyPUSTelemetryPacket, DC_DummyTelemetryPacket, DC_PUSDataReportingPacket, DC_PUSMemoryDumpAbsolute, DC_PUSMemoryDumpOffset, DC_PUSTcVerificationPacket, and StructuredTelemetryPacket. |