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 
22  friend class DpWriterTester;
23 
24  public:
25  // ----------------------------------------------------------------------
26  // Construction, initialization, and destruction
27  // ----------------------------------------------------------------------
28 
31  DpWriter(const char* const compName
32  );
33 
36  ~DpWriter();
37 
39  void configure(const Fw::StringBase& dpFileNamePrefix
40  );
41 
42  private:
43  // ----------------------------------------------------------------------
44  // Handler implementations for user-defined typed input ports
45  // ----------------------------------------------------------------------
46 
49  void bufferSendIn_handler(const FwIndexType portNum,
50  Fw::Buffer& fwBuffer
51  ) final;
52 
55  void schedIn_handler(const FwIndexType portNum,
56  U32 context
57  ) final;
58 
59  private:
60  // ----------------------------------------------------------------------
61  // Handler implementations for commands
62  // ----------------------------------------------------------------------
63 
67  void CLEAR_EVENT_THROTTLE_cmdHandler(FwOpcodeType opCode,
68  U32 cmdSeq
69  ) final;
70 
71  private:
72  // ----------------------------------------------------------------------
73  // Private helper functions
74  // ----------------------------------------------------------------------
75 
78  Fw::Success::T deserializePacketHeader(Fw::Buffer& buffer,
79  Fw::DpContainer& container
80  );
81 
83  void performProcessing(const Fw::DpContainer& container
84  );
85 
88  Fw::Success::T writeFile(const Fw::DpContainer& container,
89  const Fw::FileNameString& fileName,
90  FwSizeType& fileSize
91  );
92 
94  void sendNotification(const Fw::DpContainer& container,
95  const Fw::FileNameString& fileName,
96  FwSizeType packetSize
97  );
98 
99  private:
100  // ----------------------------------------------------------------------
101  // Private member variables
102  // ----------------------------------------------------------------------
103 
105  U32 m_numBuffersReceived = 0;
106 
108  U64 m_numBytesWritten = 0;
109 
111  U32 m_numSuccessfulWrites = 0;
112 
114  U32 m_numFailedWrites = 0;
115 
117  U32 m_numErrors = 0;
118 
122  Fw::FileNameString m_dpFileNamePrefix;
123 };
124 
125 } // end namespace Svc
126 
127 #endif
A data product Container.
Definition: DpContainer.hpp:24
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:22
Auto-generated base for DpWriter component.
#define U64(C)
Definition: sha.h:180