F´ Flight Software - C/C++ Documentation  NASA-v2.0.1
A framework for building embedded system applications to NASA flight quality standards.
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
TlmChanImpl.hpp
Go to the documentation of this file.
1 
13 #ifndef TELEMCHANIMPL_HPP_
14 #define TELEMCHANIMPL_HPP_
15 
16 #include <Svc/TlmChan/TlmChanComponentAc.hpp>
17 #include <TlmChanImplCfg.hpp>
18 #include <Os/Mutex.hpp>
19 #include <Fw/Tlm/TlmPacket.hpp>
20 
21 namespace Svc {
22 
23  class TlmChanImpl: public TlmChanComponentBase {
24  public:
25  friend class TlmChanImplTester;
26  TlmChanImpl(const char* compName);
27  virtual ~TlmChanImpl();
28  void init(
29  NATIVE_INT_TYPE queueDepth,
30  NATIVE_INT_TYPE instance
31  );
32  PROTECTED:
33 
34  // can be overridden for alternate algorithms
36 
37  PRIVATE:
38 
39  // Port functions
40  void TlmRecv_handler(NATIVE_INT_TYPE portNum, FwChanIdType id, Fw::Time &timeTag, Fw::TlmBuffer &val);
41  void TlmGet_handler(NATIVE_INT_TYPE portNum, FwChanIdType id, Fw::Time &timeTag, Fw::TlmBuffer &val);
42  void Run_handler(NATIVE_INT_TYPE portNum, NATIVE_UINT_TYPE context);
45  void pingIn_handler(
46  const NATIVE_INT_TYPE portNum,
47  U32 key
48  );
49 
50  typedef struct tlmEntry {
51  FwChanIdType id;
52  bool updated;
53  Fw::Time lastUpdate;
54  Fw::TlmBuffer buffer;
55  tlmEntry* next;
56  bool used;
57  NATIVE_UINT_TYPE bucketNo;
58  } TlmEntry;
59 
60  struct TlmSet {
61  TlmEntry* slots[TLMCHAN_NUM_TLM_HASH_SLOTS];
62  TlmEntry buckets[TLMCHAN_HASH_BUCKETS];
63  NATIVE_INT_TYPE free;
64  } m_tlmEntries[2];
65 
66  U32 m_activeBuffer; // !< which buffer is active for storing telemetry
67 
68  // work variables
69  Fw::ComBuffer m_comBuffer;
70  Fw::TlmPacket m_tlmPacket;
71 
72  };
73 
74 }
75 
76 #endif /* TELEMCHANIMPL_HPP_ */
Fw::Time
Definition: Time.hpp:10
Fw::TlmBuffer
Definition: TlmBuffer.hpp:21
FwChanIdType
#define FwChanIdType
Type representation for a channel id.
Definition: FpConfig.hpp:66
Svc::TlmChanImpl::init
void init(NATIVE_INT_TYPE queueDepth, NATIVE_INT_TYPE instance)
Definition: TlmChanImpl.cpp:54
Svc::TlmChanImpl
Definition: TlmChanImpl.hpp:23
TlmChanImplCfg.hpp
Configuration file for Telemetry Channel component.
Svc::TlmChanImpl::TlmChanImplTester
friend class TlmChanImplTester
Definition: TlmChanImpl.hpp:25
NATIVE_UINT_TYPE
unsigned int NATIVE_UINT_TYPE
native unsigned integer type declaration
Definition: BasicTypes.hpp:30
TlmPacket.hpp
Svc::TlmChanImpl::TlmChanImpl
TlmChanImpl(const char *compName)
Definition: TlmChanImpl.cpp:22
Svc
Definition: ActiveRateGroupImplCfg.hpp:18
Fw::TlmPacket
Definition: TlmPacket.hpp:17
Svc::TlmChanImpl::~TlmChanImpl
virtual ~TlmChanImpl()
Definition: TlmChanImpl.cpp:51
Mutex.hpp
NATIVE_INT_TYPE
int NATIVE_INT_TYPE
native integer type declaration
Definition: BasicTypes.hpp:29
Fw::ComBuffer
Definition: ComBuffer.hpp:21
Svc::TlmChanImpl::doHash
virtual NATIVE_UINT_TYPE doHash(FwChanIdType id)
Definition: TlmChanImpl.cpp:61