F´ Flight Software - C/C++ Documentation NASA-v1.6.0
A framework for building embedded system applications to NASA flight quality standards.
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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>
17#include <Svc/TlmChan/TlmChanComponentAc.hpp>
18#include <TlmChanImplCfg.hpp>
19
20namespace Svc {
21
22class TlmChan : public TlmChanComponentBase {
23 public:
24 TlmChan(const char* compName);
25 virtual ~TlmChan();
26 void init(NATIVE_INT_TYPE queueDepth,
27 NATIVE_INT_TYPE instance
28 );
29
30 PROTECTED:
31 // can be overridden for alternate algorithms
33
34 PRIVATE:
35 // Port functions
36 void TlmRecv_handler(NATIVE_INT_TYPE portNum, FwChanIdType id, Fw::Time& timeTag, Fw::TlmBuffer& val);
37 void TlmGet_handler(NATIVE_INT_TYPE portNum, FwChanIdType id, Fw::Time& timeTag, Fw::TlmBuffer& val);
38 void Run_handler(NATIVE_INT_TYPE portNum, NATIVE_UINT_TYPE context);
41 void pingIn_handler(const NATIVE_INT_TYPE 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 NATIVE_UINT_TYPE bucketNo;
53 } TlmEntry;
54
55 struct TlmSet {
56 TlmEntry* slots[TLMCHAN_NUM_TLM_HASH_SLOTS];
57 TlmEntry buckets[TLMCHAN_HASH_BUCKETS];
58 NATIVE_INT_TYPE 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_ */
PlatformIntType NATIVE_INT_TYPE
Definition BasicTypes.h:51
PlatformUIntType NATIVE_UINT_TYPE
Definition BasicTypes.h:52
U32 FwChanIdType
Definition FpConfig.h:59
Configuration file for Telemetry Channel component.
virtual NATIVE_UINT_TYPE doHash(FwChanIdType id)
Definition TlmChan.cpp:51
void init(NATIVE_INT_TYPE queueDepth, NATIVE_INT_TYPE instance)
Definition TlmChan.cpp:45
virtual ~TlmChan()
Definition TlmChan.cpp:43