F´ Flight Software - C/C++ Documentation  devel
A framework for building embedded system applications to NASA flight quality standards.
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
FileUplinkComponentAc.hpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title FileUplinkComponentAc.hpp
3 // \author Generated by fpp-to-cpp
4 // \brief hpp file for FileUplink component base class
5 // ======================================================================
6 
7 #ifndef Svc_FileUplinkComponentAc_HPP
8 #define Svc_FileUplinkComponentAc_HPP
9 
10 #include "FpConfig.hpp"
13 #include "Fw/Log/LogPortAc.hpp"
14 #include "Fw/Log/LogString.hpp"
15 #if FW_ENABLE_TEXT_LOGGING == 1
16 #include "Fw/Log/LogTextPortAc.hpp"
17 #endif
20 #include "Fw/Time/TimePortAc.hpp"
21 #include "Fw/Tlm/TlmPortAc.hpp"
22 #include "Fw/Tlm/TlmString.hpp"
23 #include "Svc/Ping/PingPortAc.hpp"
24 
25 namespace Svc {
26 
33  {
34 
35  // ----------------------------------------------------------------------
36  // Friend classes
37  // ----------------------------------------------------------------------
38 
41 
42  PROTECTED:
43 
44  // ----------------------------------------------------------------------
45  // Constants
46  // ----------------------------------------------------------------------
47 
49  enum {
52  };
53 
55  enum {
60  };
61 
63  enum {
66  };
67 
69  enum {
80  };
81 
83  enum {
89  };
90 
92  enum {
96  };
97 
98  public:
99 
100  // ----------------------------------------------------------------------
101  // Component initialization
102  // ----------------------------------------------------------------------
103 
105  void init(
106  FwSizeType queueDepth,
107  FwEnumStoreType instance = 0
108  );
109 
110  public:
111 
112  // ----------------------------------------------------------------------
113  // Getters for typed input ports
114  // ----------------------------------------------------------------------
115 
120  FwIndexType portNum
121  );
122 
127  FwIndexType portNum
128  );
129 
130  public:
131 
132  // ----------------------------------------------------------------------
133  // Connect input ports to special output ports
134  // ----------------------------------------------------------------------
135 
136 #if FW_ENABLE_TEXT_LOGGING == 1
137 
139  void set_LogText_OutputPort(
140  FwIndexType portNum,
141  Fw::InputLogTextPort* port
142  );
143 
144 #endif
145 
148  FwIndexType portNum,
149  Fw::InputLogPort* port
150  );
151 
154  FwIndexType portNum,
155  Fw::InputTimePort* port
156  );
157 
160  FwIndexType portNum,
161  Fw::InputTlmPort* port
162  );
163 
164  public:
165 
166  // ----------------------------------------------------------------------
167  // Connect typed input ports to typed output ports
168  // ----------------------------------------------------------------------
169 
172  FwIndexType portNum,
174  );
175 
178  FwIndexType portNum,
179  Svc::InputPingPort* port
180  );
181 
182 #if FW_PORT_SERIALIZATION
183 
184  public:
185 
186  // ----------------------------------------------------------------------
187  // Connect serial input ports to special output ports
188  // ----------------------------------------------------------------------
189 
190 #if FW_ENABLE_TEXT_LOGGING == 1
191 
193  void set_LogText_OutputPort(
194  FwIndexType portNum,
195  Fw::InputSerializePort* port
196  );
197 
198 #endif
199 
202  FwIndexType portNum,
203  Fw::InputSerializePort* port
204  );
205 
208  FwIndexType portNum,
209  Fw::InputSerializePort* port
210  );
211 
214  FwIndexType portNum,
215  Fw::InputSerializePort* port
216  );
217 
218 #endif
219 
220 #if FW_PORT_SERIALIZATION
221 
222  public:
223 
224  // ----------------------------------------------------------------------
225  // Connect serial input ports to typed output ports
226  // ----------------------------------------------------------------------
227 
230  FwIndexType portNum,
231  Fw::InputSerializePort* port
232  );
233 
236  FwIndexType portNum,
237  Fw::InputSerializePort* port
238  );
239 
240 #endif
241 
242  PROTECTED:
243 
244  // ----------------------------------------------------------------------
245  // Component construction and destruction
246  // ----------------------------------------------------------------------
247 
250  const char* compName = ""
251  );
252 
254  virtual ~FileUplinkComponentBase();
255 
256  PROTECTED:
257 
258  // ----------------------------------------------------------------------
259  // Getters for numbers of typed input ports
260  // ----------------------------------------------------------------------
261 
266 
271 
272  PROTECTED:
273 
274  // ----------------------------------------------------------------------
275  // Getters for numbers of special output ports
276  // ----------------------------------------------------------------------
277 
278 #if FW_ENABLE_TEXT_LOGGING == 1
279 
283  FwIndexType getNum_LogText_OutputPorts() const;
284 
285 #endif
286 
291 
296 
301 
302  PROTECTED:
303 
304  // ----------------------------------------------------------------------
305  // Getters for numbers of typed output ports
306  // ----------------------------------------------------------------------
307 
312 
317 
318  PROTECTED:
319 
320  // ----------------------------------------------------------------------
321  // Connection status queries for special output ports
322  // ----------------------------------------------------------------------
323 
324 #if FW_ENABLE_TEXT_LOGGING == 1
325 
329  bool isConnected_LogText_OutputPort(
330  FwIndexType portNum
331  );
332 
333 #endif
334 
339  FwIndexType portNum
340  );
341 
346  FwIndexType portNum
347  );
348 
353  FwIndexType portNum
354  );
355 
356  PROTECTED:
357 
358  // ----------------------------------------------------------------------
359  // Connection status queries for typed output ports
360  // ----------------------------------------------------------------------
361 
366  FwIndexType portNum
367  );
368 
373  FwIndexType portNum
374  );
375 
376  PROTECTED:
377 
378  // ----------------------------------------------------------------------
379  // Handlers to implement for typed input ports
380  // ----------------------------------------------------------------------
381 
383  virtual void bufferSendIn_handler(
384  FwIndexType portNum,
385  Fw::Buffer& fwBuffer
386  ) = 0;
387 
389  virtual void pingIn_handler(
390  FwIndexType portNum,
391  U32 key
392  ) = 0;
393 
394  PROTECTED:
395 
396  // ----------------------------------------------------------------------
397  // Port handler base-class functions for typed input ports
398  //
399  // Call these functions directly to bypass the corresponding ports
400  // ----------------------------------------------------------------------
401 
404  FwIndexType portNum,
405  Fw::Buffer& fwBuffer
406  );
407 
409  void pingIn_handlerBase(
410  FwIndexType portNum,
411  U32 key
412  );
413 
414  PROTECTED:
415 
416  // ----------------------------------------------------------------------
417  // Pre-message hooks for typed async input ports
418  //
419  // Each of these functions is invoked just before processing a message
420  // on the corresponding port. By default, they do nothing. You can
421  // override them to provide specific pre-message behavior.
422  // ----------------------------------------------------------------------
423 
425  virtual void bufferSendIn_preMsgHook(
426  FwIndexType portNum,
427  Fw::Buffer& fwBuffer
428  );
429 
431  virtual void pingIn_preMsgHook(
432  FwIndexType portNum,
433  U32 key
434  );
435 
436  PROTECTED:
437 
438  // ----------------------------------------------------------------------
439  // Invocation functions for typed output ports
440  // ----------------------------------------------------------------------
441 
443  void bufferSendOut_out(
444  FwIndexType portNum,
445  Fw::Buffer& fwBuffer
446  );
447 
449  void pingOut_out(
450  FwIndexType portNum,
451  U32 key
452  );
453 
454  PROTECTED:
455 
456  // ----------------------------------------------------------------------
457  // Event logging functions
458  // ----------------------------------------------------------------------
459 
464  const Fw::StringBase& fileName,
465  U32 computed,
466  U32 read
467  );
468 
473  const Fw::StringBase& fileName
474  );
475 
480  const Fw::StringBase& fileName
481  );
482 
487  const Fw::StringBase& fileName
488  );
489 
494  U32 packetType,
495  U32 mode
496  );
497 
502  U32 packetIndex,
503  const Fw::StringBase& fileName
504  );
505 
510  U32 packetIndex,
511  U32 lastPacketIndex
512  );
513 
518  U32 packetIndex
519  );
520 
525 
530  I32 status
531  );
532 
533  PROTECTED:
534 
535  // ----------------------------------------------------------------------
536  // Event throttle reset functions
537  // ----------------------------------------------------------------------
538 
541 
544 
547 
550 
553 
554  PROTECTED:
555 
556  // ----------------------------------------------------------------------
557  // Telemetry write functions
558  // ----------------------------------------------------------------------
559 
564  U32 arg,
565  Fw::Time _tlmTime = Fw::Time()
566  );
567 
572  U32 arg,
573  Fw::Time _tlmTime = Fw::Time()
574  );
575 
579  void tlmWrite_Warnings(
580  U32 arg,
581  Fw::Time _tlmTime = Fw::Time()
582  );
583 
584  PROTECTED:
585 
586  // ----------------------------------------------------------------------
587  // Time
588  // ----------------------------------------------------------------------
589 
593  Fw::Time getTime();
594 
595  PRIVATE:
596 
597  // ----------------------------------------------------------------------
598  // Message dispatch functions
599  // ----------------------------------------------------------------------
600 
602  virtual MsgDispatchStatus doDispatch();
603 
604  PRIVATE:
605 
606  // ----------------------------------------------------------------------
607  // Calls for messages received on typed input ports
608  // ----------------------------------------------------------------------
609 
611  static void m_p_bufferSendIn_in(
612  Fw::PassiveComponentBase* callComp,
613  FwIndexType portNum,
614  Fw::Buffer& fwBuffer
615  );
616 
618  static void m_p_pingIn_in(
619  Fw::PassiveComponentBase* callComp,
620  FwIndexType portNum,
621  U32 key
622  );
623 
624  PRIVATE:
625 
626  // ----------------------------------------------------------------------
627  // Typed input ports
628  // ----------------------------------------------------------------------
629 
631  Fw::InputBufferSendPort m_bufferSendIn_InputPort[NUM_BUFFERSENDIN_INPUT_PORTS];
632 
634  Svc::InputPingPort m_pingIn_InputPort[NUM_PINGIN_INPUT_PORTS];
635 
636  PRIVATE:
637 
638  // ----------------------------------------------------------------------
639  // Special output ports
640  // ----------------------------------------------------------------------
641 
642 #if FW_ENABLE_TEXT_LOGGING == 1
643 
645  Fw::OutputLogTextPort m_LogText_OutputPort[NUM_LOGTEXT_OUTPUT_PORTS];
646 
647 #endif
648 
650  Fw::OutputLogPort m_eventOut_OutputPort[NUM_EVENTOUT_OUTPUT_PORTS];
651 
653  Fw::OutputTimePort m_timeCaller_OutputPort[NUM_TIMECALLER_OUTPUT_PORTS];
654 
656  Fw::OutputTlmPort m_tlmOut_OutputPort[NUM_TLMOUT_OUTPUT_PORTS];
657 
658  PRIVATE:
659 
660  // ----------------------------------------------------------------------
661  // Typed output ports
662  // ----------------------------------------------------------------------
663 
665  Fw::OutputBufferSendPort m_bufferSendOut_OutputPort[NUM_BUFFERSENDOUT_OUTPUT_PORTS];
666 
668  Svc::OutputPingPort m_pingOut_OutputPort[NUM_PINGOUT_OUTPUT_PORTS];
669 
670  PRIVATE:
671 
672  // ----------------------------------------------------------------------
673  // Counter values for event throttling
674  // ----------------------------------------------------------------------
675 
677  FwIndexType m_FileWriteErrorThrottle;
678 
680  FwIndexType m_InvalidReceiveModeThrottle;
681 
683  FwIndexType m_PacketOutOfBoundsThrottle;
684 
686  FwIndexType m_PacketOutOfOrderThrottle;
687 
689  FwIndexType m_PacketDuplicateThrottle;
690 
691  };
692 
693 }
694 
695 #endif
I32 FwEnumStoreType
Definition: FpConfig.h:64
PlatformSizeType FwSizeType
Definition: FpConfig.h:35
PlatformIndexType FwIndexType
Definition: FpConfig.h:25
C++-compatible configuration header for fprime configuration.
void init()
Object initializer.
Definition: ObjBase.cpp:27
Definition: Time.hpp:9