F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
GenericHub.hpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title GenericHub.hpp
3 // \author mstarch
4 // \brief hpp file for GenericHub component implementation class
5 //
6 // \copyright
7 // Copyright 2009-2015, by the California Institute of Technology.
8 // ALL RIGHTS RESERVED. United States Government Sponsorship
9 // acknowledged.
10 //
11 // ======================================================================
12 
13 #ifndef Svc_GenericHub_HPP
14 #define Svc_GenericHub_HPP
15 
16 #include "Svc/GenericHub/GenericHubComponentAc.hpp"
17 
18 namespace Svc {
19 
20 class GenericHub final : public GenericHubComponentBase {
21  public:
27  enum HubType {
35  };
36 
37  // ----------------------------------------------------------------------
38  // Construction, initialization, and destruction
39  // ----------------------------------------------------------------------
40 
43  GenericHub(const char* const compName
44  );
45 
48  ~GenericHub();
49 
50  private:
51  // ----------------------------------------------------------------------
52  // Handler implementations for user-defined typed input ports
53  // ----------------------------------------------------------------------
54 
57  void bufferIn_handler(const FwIndexType portNum,
58  Fw::Buffer& fwBuffer) override;
59 
63  void bufferOutReturn_handler(FwIndexType portNum,
64  Fw::Buffer& fwBuffer
65  ) override;
66 
70  void cmdDispIn_handler(FwIndexType portNum,
71  Fw::ComBuffer& data,
72  U32 context
73  ) override;
74 
78  void cmdRespIn_handler(FwIndexType portNum,
79  FwOpcodeType opCode,
80  U32 cmdSeq,
81  const Fw::CmdResponse& response
82  ) override;
83 
86  void fromBufferDriver_handler(const FwIndexType portNum,
87  Fw::Buffer& fwBuffer) override;
88 
92  void toBufferDriverReturn_handler(FwIndexType portNum,
93  Fw::Buffer& fwBuffer
94  ) override;
95 
98  void eventIn_handler(const FwIndexType portNum,
99  FwEventIdType id,
100  Fw::Time& timeTag,
101  const Fw::LogSeverity& severity,
102  Fw::LogBuffer& args
103  ) override;
104 
107  void tlmIn_handler(const FwIndexType portNum,
108  FwChanIdType id,
109  Fw::Time& timeTag,
110  Fw::TlmBuffer& val
111  ) override;
112 
113  // ----------------------------------------------------------------------
114  // Handler implementations for user-defined serial input ports
115  // ----------------------------------------------------------------------
116 
119  void serialIn_handler(FwIndexType portNum,
120  Fw::SerializeBufferBase& Buffer
121  ) override;
122 
123  // Helpers and members
124  void send_data(const HubType type, const FwIndexType port, const U8* data, const FwSizeType size);
125 };
126 
127 } // end namespace Svc
128 
129 #endif
FwIdType FwOpcodeType
The type of a command opcode.
PlatformSizeType FwSizeType
Command response type.
Definition: GenericHub.hpp:33
Enum representing a command response.
FwIdType FwEventIdType
The type of an event identifier.
Buffer type transmission.
Definition: GenericHub.hpp:29
FwIdType FwChanIdType
The type of a telemetry channel identifier.
Enum representing event severity.
uint8_t U8
8-bit unsigned integer
Definition: BasicTypes.h:53
PlatformIndexType FwIndexType
Telemetry channel type.
Definition: GenericHub.hpp:31
Port type transmission.
Definition: GenericHub.hpp:28
RateGroupDivider component implementation.
Command dispatch type.
Definition: GenericHub.hpp:32
GenericHub(const char *const compName)
Definition: GenericHub.cpp:27
Event transmission.
Definition: GenericHub.hpp:30