F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
DpWriter.hpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title DpWriter.hpp
3 // \author bocchino
4 // \brief hpp file for DpWriter component implementation class
5 // ======================================================================
6 
7 #ifndef Svc_DpWriter_HPP
8 #define Svc_DpWriter_HPP
9 
10 #include <config/DpCfg.hpp>
11 
12 #include "Fw/Dp/DpContainer.hpp"
14 #include "Fw/Types/String.hpp"
17 
18 namespace Svc {
19 
20 class DpWriter final : public DpWriterComponentBase {
21  friend class DpWriterTester;
22 
23  public:
24  // ----------------------------------------------------------------------
25  // Construction, initialization, and destruction
26  // ----------------------------------------------------------------------
27 
30  DpWriter(const char* const compName
31  );
32 
35  ~DpWriter();
36 
38  void configure(const Fw::StringBase& dpFileNamePrefix
39  );
40 
41  private:
42  // ----------------------------------------------------------------------
43  // Handler implementations for user-defined typed input ports
44  // ----------------------------------------------------------------------
45 
48  void bufferSendIn_handler(const FwIndexType portNum,
49  Fw::Buffer& fwBuffer
50  ) final;
51 
54  void schedIn_handler(const FwIndexType portNum,
55  U32 context
56  ) final;
57 
58  private:
59  // ----------------------------------------------------------------------
60  // Handler implementations for commands
61  // ----------------------------------------------------------------------
62 
66  void CLEAR_EVENT_THROTTLE_cmdHandler(FwOpcodeType opCode,
67  U32 cmdSeq
68  ) final;
69 
70  private:
71  // ----------------------------------------------------------------------
72  // Private helper functions
73  // ----------------------------------------------------------------------
74 
77  Fw::Success::T deserializePacketHeader(Fw::Buffer& buffer,
78  Fw::DpContainer& container
79  );
80 
82  void performProcessing(const Fw::DpContainer& container
83  );
84 
87  Fw::Success::T writeFile(const Fw::DpContainer& container,
88  const Fw::FileNameString& fileName,
89  FwSizeType& fileSize
90  );
91 
93  void sendNotification(const Fw::DpContainer& container,
94  const Fw::FileNameString& fileName,
95  FwSizeType packetSize
96  );
97 
98  private:
99  // ----------------------------------------------------------------------
100  // Private member variables
101  // ----------------------------------------------------------------------
102 
104  U32 m_numBuffersReceived = 0;
105 
107  U64 m_numBytesWritten = 0;
108 
110  U32 m_numSuccessfulWrites = 0;
111 
113  U32 m_numFailedWrites = 0;
114 
116  U32 m_numErrors = 0;
117 
121  Fw::FileNameString m_dpFileNamePrefix;
122 };
123 
124 } // end namespace Svc
125 
126 #endif
A data product Container.
Definition: DpContainer.hpp:26
FwIdType FwOpcodeType
The type of a command opcode.
PlatformSizeType FwSizeType
T
The raw enum type.
void configure(const Fw::StringBase &dpFileNamePrefix)
Configure writer.
Definition: DpWriter.cpp:26
PlatformIndexType FwIndexType
RateGroupDivider component implementation.
DpWriter(const char *const compName)
Definition: DpWriter.cpp:22
friend class DpWriterTester
Definition: DpWriter.hpp:21
Auto-generated base for DpWriter component.
#define U64(C)
Definition: sha.h:180