F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
Version.hpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title Version.hpp
3 // \author sreddy
4 // \brief hpp file for Version component implementation class
5 // ======================================================================
6 
7 #ifndef Svc_Version_HPP
8 #define Svc_Version_HPP
9 
11 
12 namespace Svc {
13 
14 class Version final : public VersionComponentBase {
15  public:
16  // ----------------------------------------------------------------------
17  // Component construction and destruction
18  // ----------------------------------------------------------------------
19 
21  explicit Version(const char* const compName
22  );
23 
25  ~Version();
26 
28  void config(bool enable);
29 
31  void start();
32 
33  private:
34  // ----------------------------------------------------------------------
35  // Handler implementations for user-defined typed input ports
36  // ----------------------------------------------------------------------
37 
41  void getVersion_handler(FwIndexType portNum,
42  const Svc::VersionCfg::VersionEnum& version_id,
43  Fw::StringBase& version_string,
44  Svc::VersionStatus& status
45  ) override;
46 
50  void setVersion_handler(FwIndexType portNum,
51  const Svc::VersionCfg::VersionEnum& version_id,
52  Fw::StringBase& version_string,
53  Svc::VersionStatus& status
54  ) override;
55 
59  void schedIn_handler(FwIndexType portNum,
60  U32 context
61  ) override;
62 
70 
71  private:
72  // ----------------------------------------------------------------------
73  // Handler implementations for commands
74  // ----------------------------------------------------------------------
75 
79  void ENABLE_cmdHandler(FwOpcodeType opCode,
80  U32 cmdSeq,
81  const Svc::VersionEnabled& enable
82  ) override;
83 
87  void VERSION_cmdHandler(FwOpcodeType opCode,
88  U32 cmdSeq,
89  const Svc::VersionType& version_type
90  ) override;
91 
92  private:
93  // An enumeration for TLM slot access
94  enum VersionSlot {
95  VER_SLOT_00 = 0,
96  VER_SLOT_01 = 1,
97  VER_SLOT_02 = 2,
98  VER_SLOT_03 = 3,
99  VER_SLOT_04 = 4,
100  VER_SLOT_05 = 5,
101  VER_SLOT_06 = 6,
102  VER_SLOT_07 = 7,
103  VER_SLOT_08 = 8,
104  VER_SLOT_09 = 9
105  };
106 
107  // function to log framework version channel, and event when sendEvent is true
108  void fwVersion_tlm(bool sendEvent = true);
109  // function to log project version channel, and event when sendEvent is true
110  void projectVersion_tlm(bool sendEvent = true);
111  // function to log library version channels, and events when sendEvent is true
112  void libraryVersion_tlm(bool sendEvent = true);
113  // function to log custom version channels (if verbosity is enabled), and events when sendEvent is true
114  void customVersion_tlm(VersionSlot custom_slot, bool sendEvent = true);
115  void customVersion_tlm_all(bool sendEvent = true);
116  bool m_enable;
117  U8 m_num_custom_elements; // number of custom versions
118 };
119 
120 } // namespace Svc
121 
122 #endif
FwIdType FwOpcodeType
The type of a command opcode.
void start()
send initial version tlm and events
Definition: Version.cpp:36
Auto-generated base for Version component.
An enumeration for version status.
Data Structure for custom version Tlm.
uint8_t U8
8-bit unsigned integer
Definition: BasicTypes.h:54
The number of enumerated constants.
Version(const char *const compName)
Construct Version object.
Definition: Version.cpp:18
void config(bool enable)
configure version's verbosity
Definition: Version.cpp:31
PlatformIndexType FwIndexType
~Version()
Destroy Version object.
Definition: Version.cpp:29
RateGroupDivider component implementation.
An enumeration for Version Type.
Tracks versions for project, framework and user defined versions etc.