F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
TlmPacket.hpp
Go to the documentation of this file.
1 /*
2  * TlmPacket.hpp
3  *
4  * Created on: May 24, 2014
5  * Author: Timothy Canham
6  */
7 
8 #ifndef TLMPACKET_HPP_
9 #define TLMPACKET_HPP_
10 
11 #include <Fw/Com/ComBuffer.hpp>
12 #include <Fw/Com/ComPacket.hpp>
13 #include <Fw/Time/Time.hpp>
14 #include <Fw/Tlm/TlmBuffer.hpp>
15 
16 namespace Fw {
17 
18 class TlmPacket : public ComPacket {
19  public:
21  TlmPacket();
23  virtual ~TlmPacket();
24 
25  SerializeStatus serializeTo(SerializeBufferBase& buffer) const override;
28  SerializeStatus addValue(FwChanIdType id, Time& timeTag, TlmBuffer& buffer);
31  SerializeStatus extractValue(FwChanIdType& id, Time& timeTag, TlmBuffer& buffer, FwSizeType bufferSize);
32 
40  void setBuffer(Fw::ComBuffer& buffer);
43 
44  private:
45  ComBuffer m_tlmBuffer;
46  FwSizeType m_numEntries;
47 };
48 
49 } /* namespace Fw */
50 
51 #endif /* TLMPACKET_HPP_ */
void setBuffer(Fw::ComBuffer &buffer)
set the internal buffer for deserializing values
Definition: TlmPacket.cpp:59
PlatformSizeType FwSizeType
SerializeStatus serializeTo(SerializeBufferBase &buffer) const override
serialize contents
Definition: TlmPacket.cpp:128
Fw::ComBuffer & getBuffer()
get buffer to send to the ground
Definition: TlmPacket.cpp:55
FwSizeType getNumEntries()
get the number of packets added via addValue()
Definition: TlmPacket.cpp:51
SerializeStatus
forward declaration for string
SerializeStatus addValue(FwChanIdType id, Time &timeTag, TlmBuffer &buffer)
Add telemetry value to buffer.
Definition: TlmPacket.cpp:63
SerializeStatus deserializeFrom(SerializeBufferBase &buffer) override
deserialize contents from buffer
Definition: TlmPacket.cpp:139
FwIdType FwChanIdType
The type of a telemetry channel identifier.
SerializeStatus resetPktSer()
Reset serialization of values. This should be done when starting to accumulate a new set of values...
Definition: TlmPacket.cpp:20
virtual ~TlmPacket()
Destructor.
Definition: TlmPacket.cpp:18
TlmPacket()
Constructor.
Definition: TlmPacket.cpp:13
SerializeStatus resetPktDeser()
Reset deserialization. This should be done before extracting values.
Definition: TlmPacket.cpp:33
SerializeStatus extractValue(FwChanIdType &id, Time &timeTag, TlmBuffer &buffer, FwSizeType bufferSize)
Definition: TlmPacket.cpp:98