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  friend class TlmChanTester;
24 
25  public:
26  TlmChan(const char* compName);
27  virtual ~TlmChan();
28 
29  protected:
30  // can be overridden for alternate algorithms
31  virtual FwChanIdType doHash(FwChanIdType id);
32 
33  private:
34  // Port functions
35  void TlmRecv_handler(FwIndexType portNum, FwChanIdType id, Fw::Time& timeTag, Fw::TlmBuffer& val);
36  Fw::TlmValid TlmGet_handler(FwIndexType portNum, FwChanIdType id, Fw::Time& timeTag, Fw::TlmBuffer& val);
37  void Run_handler(FwIndexType portNum, U32 context);
40  void pingIn_handler(const FwIndexType portNum,
41  U32 key
42  );
43 
44  typedef struct tlmEntry {
45  FwChanIdType id;
46  bool updated;
47  Fw::Time lastUpdate;
48  Fw::TlmBuffer buffer;
49  tlmEntry* next;
50  bool used;
51  FwChanIdType bucketNo;
52  } TlmEntry;
53 
54  struct TlmSet {
55  TlmEntry* slots[TLMCHAN_NUM_TLM_HASH_SLOTS];
56  TlmEntry buckets[TLMCHAN_HASH_BUCKETS];
57  FwChanIdType free;
58  } m_tlmEntries[2];
59 
60  U32 m_activeBuffer; // !< which buffer is active for storing telemetry
61 };
62 
63 } // namespace Svc
64 
65 #endif /* TELEMCHANIMPL_HPP_ */
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:23
FwIdType FwChanIdType
The type of a telemetry channel identifier.
virtual FwChanIdType doHash(FwChanIdType id)
Definition: TlmChan.cpp:52
PlatformIndexType FwIndexType
RateGroupDivider component implementation.