F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
TlmChan.hpp
Go to the documentation of this file.
1 
13 #ifndef TELEMCHANIMPL_HPP_
14 #define TELEMCHANIMPL_HPP_
15 
16 #include <Fw/Tlm/TlmPacket.hpp>
18 #include <config/TlmChanImplCfg.hpp>
19 
20 namespace Svc {
21 
22 class TlmChan final : public TlmChanComponentBase {
23 
24  friend class TlmChanTester;
25 
26  public:
27  TlmChan(const char* compName);
28  virtual ~TlmChan();
29 
30  protected:
31  // can be overridden for alternate algorithms
32  virtual FwChanIdType doHash(FwChanIdType id);
33 
34  private:
35  // Port functions
36  void TlmRecv_handler(FwIndexType portNum, FwChanIdType id, Fw::Time& timeTag, Fw::TlmBuffer& val);
37  Fw::TlmValid TlmGet_handler(FwIndexType portNum, FwChanIdType id, Fw::Time& timeTag, Fw::TlmBuffer& val);
38  void Run_handler(FwIndexType portNum, U32 context);
41  void pingIn_handler(const FwIndexType portNum,
42  U32 key
43  );
44 
45  typedef struct tlmEntry {
46  FwChanIdType id;
47  bool updated;
48  Fw::Time lastUpdate;
49  Fw::TlmBuffer buffer;
50  tlmEntry* next;
51  bool used;
52  FwChanIdType bucketNo;
53  } TlmEntry;
54 
55  struct TlmSet {
56  TlmEntry* slots[TLMCHAN_NUM_TLM_HASH_SLOTS];
57  TlmEntry buckets[TLMCHAN_HASH_BUCKETS];
58  FwChanIdType free;
59  } m_tlmEntries[2];
60 
61  U32 m_activeBuffer; // !< which buffer is active for storing telemetry
62 };
63 
64 } // namespace Svc
65 
66 #endif /* TELEMCHANIMPL_HPP_ */
Definition: Time.hpp:9
TlmChan(const char *compName)
Definition: TlmChan.cpp:26
Auto-generated base for TlmChan component.
virtual ~TlmChan()
Definition: TlmChan.cpp:50
friend class TlmChanTester
Definition: TlmChan.hpp:24
FwIdType FwChanIdType
The type of a telemetry channel identifier.
virtual FwChanIdType doHash(FwChanIdType id)
Definition: TlmChan.cpp:52
PlatformIndexType FwIndexType
RateGroupDivider component implementation.