F´ Flight Software - C/C++ Documentation  NASA-v1.6.0
A framework for building embedded system applications to NASA flight quality standards.
DeframerComponentImpl.hpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title DeframerComponentImpl.hpp
3 // \author mstarch
4 // \brief hpp file for Deframer component implementation class
5 //
6 // \copyright
7 // Copyright 2009-2021, by the California Institute of Technology.
8 // ALL RIGHTS RESERVED. United States Government Sponsorship
9 // acknowledged.
10 //
11 // ======================================================================
12 
13 #ifndef Deframer_HPP
14 #define Deframer_HPP
15 
16 #include "Svc/Deframer/DeframerComponentAc.hpp"
20 
21 namespace Svc {
35 class DeframerComponentImpl : public DeframerComponentBase, public DeframingProtocolInterface {
36  public:
37  // ----------------------------------------------------------------------
38  // Construction, initialization, and destruction
39  // ----------------------------------------------------------------------
40 
43  DeframerComponentImpl(const char* const compName
44  );
45 
48  void init(const NATIVE_INT_TYPE instance = 0
49  );
50 
54 
57  void setup(DeframingProtocol& protocol
58  );
59 
60 
61  PRIVATE:
62  // ----------------------------------------------------------------------
63  // Handler implementations for user-defined typed input ports
64  // ----------------------------------------------------------------------
65 
66  void route(Fw::Buffer& data);
67 
68  void processRing();
69 
70  void processBuffer(Fw::Buffer& buffer);
71 
72  Fw::Buffer allocate(const U32 size);
73 
74 
78  void cmdResponseIn_handler(
79  NATIVE_INT_TYPE portNum,
80  FwOpcodeType opcode,
81  U32 cmdSeq,
82  const Fw::CmdResponse& response
83  );
84  void framedIn_handler(const NATIVE_INT_TYPE portNum,
85  Fw::Buffer& recvBuffer,
86  const Drv::RecvStatus& recvStatus
87  );
88 
91  void schedIn_handler(const NATIVE_INT_TYPE portNum,
92  NATIVE_UINT_TYPE context
93  );
94  DeframingProtocol* m_protocol;
95  Types::CircularBuffer m_in_ring;
96  U8 m_ring_buffer[1024];
97  U8 m_poll_buffer[1024];
98 };
99 
100 } // end namespace Svc
101 
102 #endif
Svc::DeframerComponentImpl::~DeframerComponentImpl
~DeframerComponentImpl()
Definition: DeframerComponentImpl.cpp:32
Svc::DeframerComponentImpl::setup
void setup(DeframingProtocol &protocol)
Definition: DeframerComponentImpl.cpp:34
Svc::DeframerComponentImpl::init
void init(const NATIVE_INT_TYPE instance=0)
Definition: DeframerComponentImpl.cpp:28
Svc::DeframerComponentImpl::DeframerComponentImpl
DeframerComponentImpl(const char *const compName)
Definition: DeframerComponentImpl.cpp:24
U8
uint8_t U8
8-bit unsigned integer
Definition: BasicTypes.hpp:76
DeframingProtocol.hpp
DeframingProtocolInterface
interface supplied to the deframing protocol
Definition: DeframingProtocolInterface.hpp:26
Fw::Buffer
Definition: Buffer.hpp:43
FwOpcodeType
#define FwOpcodeType
Type representation for a command opcode.
Definition: FpConfig.hpp:58
CircularBuffer.hpp
NATIVE_UINT_TYPE
unsigned int NATIVE_UINT_TYPE
native unsigned integer type declaration
Definition: BasicTypes.hpp:30
Svc::DeframerComponentImpl
Generic deframing component using DeframingProtocol implementation for actual deframing.
Definition: DeframerComponentImpl.hpp:35
DeframingProtocolInterface.hpp
Svc
Definition: ActiveRateGroupImplCfg.hpp:18
Svc::DeframingProtocol
Abstract base class representing a deframing protocol.
Definition: DeframingProtocol.hpp:33
Types::CircularBuffer
Definition: CircularBuffer.hpp:31
NATIVE_INT_TYPE
int NATIVE_INT_TYPE
native integer type declaration
Definition: BasicTypes.hpp:29