F´ Flight Software - C/C++ Documentation  devel
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/ComPacket.hpp>
12 #include <Fw/Tlm/TlmBuffer.hpp>
13 #include <Fw/Com/ComBuffer.hpp>
14 #include <Fw/Time/Time.hpp>
15 
16 namespace Fw {
17 
18  class TlmPacket : public ComPacket {
19  public:
20 
22  TlmPacket();
24  virtual ~TlmPacket();
25 
31  SerializeStatus addValue(FwChanIdType id, Time& timeTag, TlmBuffer& buffer);
34  SerializeStatus extractValue(FwChanIdType &id, Time& timeTag, TlmBuffer& buffer, NATIVE_UINT_TYPE bufferSize);
35 
43  void setBuffer(Fw::ComBuffer& buffer);
46 
47  PRIVATE:
48  ComBuffer m_tlmBuffer;
49  NATIVE_UINT_TYPE m_numEntries;
50  };
51 
52 } /* namespace Fw */
53 
54 #endif /* TLMPACKET_HPP_ */
PlatformUIntType NATIVE_UINT_TYPE
Definition: BasicTypes.h:52
U32 FwChanIdType
Definition: FpConfig.h:82
Definition: Time.hpp:9
void setBuffer(Fw::ComBuffer &buffer)
set the internal buffer for deserializing values
Definition: TlmPacket.cpp:60
virtual ~TlmPacket()
Destructor.
Definition: TlmPacket.cpp:18
TlmPacket()
Constructor.
Definition: TlmPacket.cpp:13
SerializeStatus extractValue(FwChanIdType &id, Time &timeTag, TlmBuffer &buffer, NATIVE_UINT_TYPE bufferSize)
Definition: TlmPacket.cpp:100
SerializeStatus resetPktDeser()
Reset deserialization. This should be done before extracting values.
Definition: TlmPacket.cpp:34
SerializeStatus deserialize(SerializeBufferBase &buffer)
Deserialize the packet. For use internally in software. To extract channels, use setBuffer() and extr...
Definition: TlmPacket.cpp:142
NATIVE_UINT_TYPE getNumEntries()
get the number of packets added via addValue()
Definition: TlmPacket.cpp:52
SerializeStatus resetPktSer()
Reset serialization of values. This should be done when starting to accumulate a new set of values.
Definition: TlmPacket.cpp:21
Fw::ComBuffer & getBuffer()
get buffer to send to the ground
Definition: TlmPacket.cpp:56
SerializeStatus serialize(SerializeBufferBase &buffer) const
Serialize the packet before sending. For use internally in software. To send to the ground,...
Definition: TlmPacket.cpp:132
SerializeStatus addValue(FwChanIdType id, Time &timeTag, TlmBuffer &buffer)
Add telemetry value to buffer.
Definition: TlmPacket.cpp:64
SerializeStatus
forward declaration for string