F´ Flight Software - C/C++ Documentation  NASA-v2.0.1
A framework for building embedded system applications to NASA flight quality standards.
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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 
77  void framedIn_handler(const NATIVE_INT_TYPE portNum,
78  Fw::Buffer& recvBuffer,
79  Drv::RecvStatus recvStatus
80  );
81 
84  void schedIn_handler(const NATIVE_INT_TYPE portNum,
85  NATIVE_UINT_TYPE context
86  );
87  DeframingProtocol* m_protocol;
88  Types::CircularBuffer m_in_ring;
89  U8 m_ring_buffer[1024];
90  U8 m_poll_buffer[1024];
91 };
92 
93 } // end namespace Svc
94 
95 #endif
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
CircularBuffer.hpp
NATIVE_UINT_TYPE
unsigned int NATIVE_UINT_TYPE
native unsigned integer type declaration
Definition: BasicTypes.hpp:30
Svc::DeframerComponentImpl::~DeframerComponentImpl
~DeframerComponentImpl(void)
Definition: DeframerComponentImpl.cpp:32
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