F´ Flight Software - C/C++ Documentation  devel
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 <DpCfg.hpp>
11 
12 #include "Fw/Dp/DpContainer.hpp"
14 #include "Fw/Types/String.hpp"
17 
18 namespace Svc {
19 
21  public:
22  // ----------------------------------------------------------------------
23  // Construction, initialization, and destruction
24  // ----------------------------------------------------------------------
25 
28  DpWriter(const char* const compName
29  );
30 
33  ~DpWriter();
34 
36  void configure(const Fw::StringBase& dpFileNamePrefix
37  );
38 
39  PRIVATE:
40  // ----------------------------------------------------------------------
41  // Handler implementations for user-defined typed input ports
42  // ----------------------------------------------------------------------
43 
46  void bufferSendIn_handler(const NATIVE_INT_TYPE portNum,
47  Fw::Buffer& fwBuffer
48  ) final;
49 
52  void schedIn_handler(const NATIVE_INT_TYPE portNum,
53  U32 context
54  ) final;
55 
56  PRIVATE:
57  // ----------------------------------------------------------------------
58  // Handler implementations for commands
59  // ----------------------------------------------------------------------
60 
64  void CLEAR_EVENT_THROTTLE_cmdHandler(FwOpcodeType opCode,
65  U32 cmdSeq
66  ) final;
67 
68  PRIVATE:
69  // ----------------------------------------------------------------------
70  // Private helper functions
71  // ----------------------------------------------------------------------
72 
75  Fw::Success::T deserializePacketHeader(Fw::Buffer& buffer,
76  Fw::DpContainer& container
77  );
78 
80  void performProcessing(const Fw::DpContainer& container
81  );
82 
85  Fw::Success::T writeFile(const Fw::DpContainer& container,
86  const Fw::FileNameString& fileName,
87  FwSizeType& fileSize
88  );
89 
91  void sendNotification(const Fw::DpContainer& container,
92  const Fw::FileNameString& fileName,
93  FwSizeType packetSize
94  );
95 
96  PRIVATE:
97  // ----------------------------------------------------------------------
98  // Private member variables
99  // ----------------------------------------------------------------------
100 
102  U32 m_numBuffersReceived = 0;
103 
105  U64 m_numBytesWritten = 0;
106 
108  U32 m_numSuccessfulWrites = 0;
109 
111  U32 m_numFailedWrites = 0;
112 
114  U32 m_numErrors = 0;
115 
119  Fw::FileNameString m_dpFileNamePrefix;
120 };
121 
122 } // end namespace Svc
123 
124 #endif
PlatformIntType NATIVE_INT_TYPE
Definition: BasicTypes.h:51
U32 FwOpcodeType
Definition: FpConfig.h:78
PlatformSizeType FwSizeType
Definition: FpConfig.h:30
A data product Container.
Definition: DpContainer.hpp:21
T
The raw enum type.
Auto-generated base for DpWriter component.
void configure(const Fw::StringBase &dpFileNamePrefix)
Configure writer.
Definition: DpWriter.cpp:26
DpWriter(const char *const compName)
Definition: DpWriter.cpp:22
#define U64(C)
Definition: sha.h:176