F´ Flight Software - C/C++ Documentation  devel
A framework for building embedded system applications to NASA flight quality standards.
Framer.hpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title Framer.hpp
3 // \author mstarch, bocchino
4 // \brief hpp file for Framer component implementation class
5 //
6 // \copyright
7 // Copyright 2009-2022, by the California Institute of Technology.
8 // ALL RIGHTS RESERVED. United States Government Sponsorship
9 // acknowledged.
10 //
11 // ======================================================================
12 
13 #ifndef Svc_Framer_HPP
14 #define Svc_Framer_HPP
15 
19 
20 namespace Svc {
32  public:
33  // ----------------------------------------------------------------------
34  // Construction, initialization, and destruction
35  // ----------------------------------------------------------------------
36 
39  Framer(const char* const compName
40  );
41 
44  void setup(FramingProtocol& protocol );
45 
48  ~Framer();
49 
50  PRIVATE:
51  // ----------------------------------------------------------------------
52  // Handler implementations for user-defined typed input ports
53  // ----------------------------------------------------------------------
54 
57  void comIn_handler(const NATIVE_INT_TYPE portNum,
58  Fw::ComBuffer& data,
59  U32 context
60  );
61 
64  void bufferIn_handler(const NATIVE_INT_TYPE portNum,
65  Fw::Buffer& fwBuffer
66  );
67 
70  void comStatusIn_handler(const NATIVE_INT_TYPE portNum,
71  Fw::Success& condition );
72 
73  // ----------------------------------------------------------------------
74  // Implementation of FramingProtocolInterface
75  // ----------------------------------------------------------------------
76 
85  Fw::Buffer allocate(const U32 size);
86 
89  void send(Fw::Buffer& outgoing
90  );
91 
92  // ----------------------------------------------------------------------
93  // Helper functions
94  // ----------------------------------------------------------------------
95 
98  void handle_framing(const U8* const data, const U32 size, Fw::ComPacket::ComPacketType packet_type);
99 
100  // ----------------------------------------------------------------------
101  // Member variables
102  // ----------------------------------------------------------------------
103 
105  FramingProtocol* m_protocol;
106 
108  bool m_frame_sent;
109 };
110 
111 } // end namespace Svc
112 
113 #endif
PlatformIntType NATIVE_INT_TYPE
Definition: BasicTypes.h:55
uint8_t U8
8-bit unsigned integer
Definition: BasicTypes.h:30
Success/Failure.
Auto-generated base for Framer component.
Generic framing component using FramingProtocol implementation for actual framing.
Definition: Framer.hpp:31
Framer(const char *const compName)
Definition: Framer.cpp:24
void setup(FramingProtocol &protocol)
Setup this component with a supplied framing protocol.
Definition: Framer.cpp:29
abstract class representing a framing protocol
interface supplied to the framing protocol