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 
63 
64  private:
65  // ----------------------------------------------------------------------
66  // Handler implementations for commands
67  // ----------------------------------------------------------------------
68 
72  void ENABLE_cmdHandler(FwOpcodeType opCode,
73  U32 cmdSeq,
74  const Svc::VersionEnabled& enable
75  ) override;
76 
80  void VERSION_cmdHandler(FwOpcodeType opCode,
81  U32 cmdSeq,
82  const Svc::VersionType& version_type
83  ) override;
84 
85  private:
86  // An enumeration for TLM slot access
87  enum VersionSlot {
88  VER_SLOT_00 = 0,
89  VER_SLOT_01 = 1,
90  VER_SLOT_02 = 2,
91  VER_SLOT_03 = 3,
92  VER_SLOT_04 = 4,
93  VER_SLOT_05 = 5,
94  VER_SLOT_06 = 6,
95  VER_SLOT_07 = 7,
96  VER_SLOT_08 = 8,
97  VER_SLOT_09 = 9
98  };
99 
100  // function to log framework version events and channels
101  void fwVersion_tlm();
102  // function to log project version events and channels
103  void projectVersion_tlm();
104  // function to log library version events and channels
105  void libraryVersion_tlm();
106  // function to log custom version events and channels
107  void customVersion_tlm(VersionSlot custom_slot);
108  void customVersion_tlm_all();
109  bool m_enable;
110  U8 m_num_custom_elements; // number of custom versions
111 };
112 
113 } // namespace Svc
114 
115 #endif
FwIdType FwOpcodeType
The type of a command opcode.
void start()
send initial version tlm and events
Definition: Version.cpp:36
The number of enumerated constants.
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
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.