F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
FprimeRouter.hpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title FprimeRouter.hpp
3 // \author thomas-bc
4 // \brief hpp file for FprimeRouter component implementation class
5 // ======================================================================
6 
7 #ifndef Svc_FprimeRouter_HPP
8 #define Svc_FprimeRouter_HPP
9 
14 
15 namespace Svc {
16 
18  public:
19  // ----------------------------------------------------------------------
20  // Component construction and destruction
21  // ----------------------------------------------------------------------
22 
24  FprimeRouter(const char* const compName
25  );
26 
28  ~FprimeRouter();
29 
30  private:
31  // ----------------------------------------------------------------------
32  // Handler implementations for user-defined typed input ports
33  // ----------------------------------------------------------------------
34 
37  void dataIn_handler(FwIndexType portNum,
38  Fw::Buffer& packetBuffer,
39  const ComCfg::FrameContext& context
40  ) override;
41 
42  // ! Handler for input port cmdResponseIn
43  // ! This is a no-op because FprimeRouter does not need to handle command responses
44  // ! but the port must be connected
45  void cmdResponseIn_handler(FwIndexType portNum,
46  FwOpcodeType opcode,
47  U32 cmdSeq,
48  const Fw::CmdResponse& response
49  ) override;
50 
54  void fileBufferReturnIn_handler(FwIndexType portNum,
55  Fw::Buffer& fwBuffer
56  ) override;
57 
58  private:
59  // ----------------------------------------------------------------------
60  // Buffer-to-context association table
61  // ----------------------------------------------------------------------
62 
64  struct BufferContextEntry {
65  Fw::Active state;
66  const U8* key;
67  ComCfg::FrameContext context;
68  };
69 
72  Fw::Success insertContext(const Fw::Buffer& buffer, const ComCfg::FrameContext& context);
73 
76  Fw::Success takeContext(const Fw::Buffer& buffer, ComCfg::FrameContext& context);
77 
79  BufferContextEntry m_bufferContextTable[FprimeRouterCfg::BufferContextTableSize];
80 };
81 } // namespace Svc
82 
83 #endif
FwIdType FwOpcodeType
The type of a command opcode.
Enum representing a command response.
FprimeRouter(const char *const compName)
Construct FprimeRouter object.
~FprimeRouter()
Destroy FprimeRouter object.
Auto-generated base for FprimeRouter component.
uint8_t U8
8-bit unsigned integer
Definition: BasicTypes.h:54
PlatformIndexType FwIndexType
Type used to pass context info between components during framing/deframing.
RateGroupDivider component implementation.
Active and inactive states.
Success/Failure.