F´ Flight Software - C/C++ Documentation  devel
A framework for building embedded system applications to NASA flight quality standards.
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 {
79  };
80 
82  enum {
87  };
88 
90  enum {
94  };
95 
96  public:
97 
98  // ----------------------------------------------------------------------
99  // Component initialization
100  // ----------------------------------------------------------------------
101 
103  void init(
104  FwSizeType queueDepth,
105  FwEnumStoreType instance = 0
106  );
107 
108  public:
109 
110  // ----------------------------------------------------------------------
111  // Getters for typed input ports
112  // ----------------------------------------------------------------------
113 
118  FwIndexType portNum
119  );
120 
125  FwIndexType portNum
126  );
127 
128  public:
129 
130  // ----------------------------------------------------------------------
131  // Connect input ports to special output ports
132  // ----------------------------------------------------------------------
133 
134 #if FW_ENABLE_TEXT_LOGGING == 1
135 
137  void set_LogText_OutputPort(
138  FwIndexType portNum,
139  Fw::InputLogTextPort* port
140  );
141 
142 #endif
143 
146  FwIndexType portNum,
147  Fw::InputLogPort* port
148  );
149 
152  FwIndexType portNum,
153  Fw::InputTimePort* port
154  );
155 
158  FwIndexType portNum,
159  Fw::InputTlmPort* port
160  );
161 
162  public:
163 
164  // ----------------------------------------------------------------------
165  // Connect typed input ports to typed output ports
166  // ----------------------------------------------------------------------
167 
170  FwIndexType portNum,
172  );
173 
176  FwIndexType portNum,
177  Svc::InputPingPort* port
178  );
179 
180 #if FW_PORT_SERIALIZATION
181 
182  public:
183 
184  // ----------------------------------------------------------------------
185  // Connect serial input ports to special output ports
186  // ----------------------------------------------------------------------
187 
188 #if FW_ENABLE_TEXT_LOGGING == 1
189 
191  void set_LogText_OutputPort(
192  FwIndexType portNum,
193  Fw::InputSerializePort* port
194  );
195 
196 #endif
197 
200  FwIndexType portNum,
201  Fw::InputSerializePort* port
202  );
203 
206  FwIndexType portNum,
207  Fw::InputSerializePort* port
208  );
209 
212  FwIndexType portNum,
213  Fw::InputSerializePort* port
214  );
215 
216 #endif
217 
218 #if FW_PORT_SERIALIZATION
219 
220  public:
221 
222  // ----------------------------------------------------------------------
223  // Connect serial input ports to typed output ports
224  // ----------------------------------------------------------------------
225 
228  FwIndexType portNum,
229  Fw::InputSerializePort* port
230  );
231 
234  FwIndexType portNum,
235  Fw::InputSerializePort* port
236  );
237 
238 #endif
239 
240  PROTECTED:
241 
242  // ----------------------------------------------------------------------
243  // Component construction and destruction
244  // ----------------------------------------------------------------------
245 
248  const char* compName = ""
249  );
250 
252  virtual ~FileUplinkComponentBase();
253 
254  PROTECTED:
255 
256  // ----------------------------------------------------------------------
257  // Getters for numbers of typed input ports
258  // ----------------------------------------------------------------------
259 
264 
269 
270  PROTECTED:
271 
272  // ----------------------------------------------------------------------
273  // Getters for numbers of special output ports
274  // ----------------------------------------------------------------------
275 
276 #if FW_ENABLE_TEXT_LOGGING == 1
277 
281  FwIndexType getNum_LogText_OutputPorts() const;
282 
283 #endif
284 
289 
294 
299 
300  PROTECTED:
301 
302  // ----------------------------------------------------------------------
303  // Getters for numbers of typed output ports
304  // ----------------------------------------------------------------------
305 
310 
315 
316  PROTECTED:
317 
318  // ----------------------------------------------------------------------
319  // Connection status queries for special output ports
320  // ----------------------------------------------------------------------
321 
322 #if FW_ENABLE_TEXT_LOGGING == 1
323 
327  bool isConnected_LogText_OutputPort(
328  FwIndexType portNum
329  );
330 
331 #endif
332 
337  FwIndexType portNum
338  );
339 
344  FwIndexType portNum
345  );
346 
351  FwIndexType portNum
352  );
353 
354  PROTECTED:
355 
356  // ----------------------------------------------------------------------
357  // Connection status queries for typed output ports
358  // ----------------------------------------------------------------------
359 
364  FwIndexType portNum
365  );
366 
371  FwIndexType portNum
372  );
373 
374  PROTECTED:
375 
376  // ----------------------------------------------------------------------
377  // Handlers to implement for typed input ports
378  // ----------------------------------------------------------------------
379 
381  virtual void bufferSendIn_handler(
382  FwIndexType portNum,
383  Fw::Buffer& fwBuffer
384  ) = 0;
385 
387  virtual void pingIn_handler(
388  FwIndexType portNum,
389  U32 key
390  ) = 0;
391 
392  PROTECTED:
393 
394  // ----------------------------------------------------------------------
395  // Port handler base-class functions for typed input ports
396  //
397  // Call these functions directly to bypass the corresponding ports
398  // ----------------------------------------------------------------------
399 
402  FwIndexType portNum,
403  Fw::Buffer& fwBuffer
404  );
405 
407  void pingIn_handlerBase(
408  FwIndexType portNum,
409  U32 key
410  );
411 
412  PROTECTED:
413 
414  // ----------------------------------------------------------------------
415  // Pre-message hooks for typed async input ports
416  //
417  // Each of these functions is invoked just before processing a message
418  // on the corresponding port. By default, they do nothing. You can
419  // override them to provide specific pre-message behavior.
420  // ----------------------------------------------------------------------
421 
423  virtual void bufferSendIn_preMsgHook(
424  FwIndexType portNum,
425  Fw::Buffer& fwBuffer
426  );
427 
429  virtual void pingIn_preMsgHook(
430  FwIndexType portNum,
431  U32 key
432  );
433 
434  PROTECTED:
435 
436  // ----------------------------------------------------------------------
437  // Invocation functions for typed output ports
438  // ----------------------------------------------------------------------
439 
441  void bufferSendOut_out(
442  FwIndexType portNum,
443  Fw::Buffer& fwBuffer
444  );
445 
447  void pingOut_out(
448  FwIndexType portNum,
449  U32 key
450  );
451 
452  PROTECTED:
453 
454  // ----------------------------------------------------------------------
455  // Event logging functions
456  // ----------------------------------------------------------------------
457 
462  const Fw::StringBase& fileName,
463  U32 computed,
464  U32 read
465  );
466 
471  const Fw::StringBase& fileName
472  );
473 
478  const Fw::StringBase& fileName
479  );
480 
485  const Fw::StringBase& fileName
486  );
487 
492  U32 packetType,
493  U32 mode
494  );
495 
500  U32 packetIndex,
501  const Fw::StringBase& fileName
502  );
503 
508  U32 packetIndex,
509  U32 lastPacketIndex
510  );
511 
516 
521  I32 status
522  );
523 
524  PROTECTED:
525 
526  // ----------------------------------------------------------------------
527  // Event throttle reset functions
528  // ----------------------------------------------------------------------
529 
532 
535 
538 
541 
542  PROTECTED:
543 
544  // ----------------------------------------------------------------------
545  // Telemetry write functions
546  // ----------------------------------------------------------------------
547 
552  U32 arg,
553  Fw::Time _tlmTime = Fw::Time()
554  );
555 
560  U32 arg,
561  Fw::Time _tlmTime = Fw::Time()
562  );
563 
567  void tlmWrite_Warnings(
568  U32 arg,
569  Fw::Time _tlmTime = Fw::Time()
570  );
571 
572  PROTECTED:
573 
574  // ----------------------------------------------------------------------
575  // Time
576  // ----------------------------------------------------------------------
577 
581  Fw::Time getTime();
582 
583  PRIVATE:
584 
585  // ----------------------------------------------------------------------
586  // Message dispatch functions
587  // ----------------------------------------------------------------------
588 
590  virtual MsgDispatchStatus doDispatch();
591 
592  PRIVATE:
593 
594  // ----------------------------------------------------------------------
595  // Calls for messages received on typed input ports
596  // ----------------------------------------------------------------------
597 
599  static void m_p_bufferSendIn_in(
600  Fw::PassiveComponentBase* callComp,
601  FwIndexType portNum,
602  Fw::Buffer& fwBuffer
603  );
604 
606  static void m_p_pingIn_in(
607  Fw::PassiveComponentBase* callComp,
608  FwIndexType portNum,
609  U32 key
610  );
611 
612  PRIVATE:
613 
614  // ----------------------------------------------------------------------
615  // Typed input ports
616  // ----------------------------------------------------------------------
617 
619  Fw::InputBufferSendPort m_bufferSendIn_InputPort[NUM_BUFFERSENDIN_INPUT_PORTS];
620 
622  Svc::InputPingPort m_pingIn_InputPort[NUM_PINGIN_INPUT_PORTS];
623 
624  PRIVATE:
625 
626  // ----------------------------------------------------------------------
627  // Special output ports
628  // ----------------------------------------------------------------------
629 
630 #if FW_ENABLE_TEXT_LOGGING == 1
631 
633  Fw::OutputLogTextPort m_LogText_OutputPort[NUM_LOGTEXT_OUTPUT_PORTS];
634 
635 #endif
636 
638  Fw::OutputLogPort m_eventOut_OutputPort[NUM_EVENTOUT_OUTPUT_PORTS];
639 
641  Fw::OutputTimePort m_timeCaller_OutputPort[NUM_TIMECALLER_OUTPUT_PORTS];
642 
644  Fw::OutputTlmPort m_tlmOut_OutputPort[NUM_TLMOUT_OUTPUT_PORTS];
645 
646  PRIVATE:
647 
648  // ----------------------------------------------------------------------
649  // Typed output ports
650  // ----------------------------------------------------------------------
651 
653  Fw::OutputBufferSendPort m_bufferSendOut_OutputPort[NUM_BUFFERSENDOUT_OUTPUT_PORTS];
654 
656  Svc::OutputPingPort m_pingOut_OutputPort[NUM_PINGOUT_OUTPUT_PORTS];
657 
658  PRIVATE:
659 
660  // ----------------------------------------------------------------------
661  // Counter values for event throttling
662  // ----------------------------------------------------------------------
663 
665  FwIndexType m_FileWriteErrorThrottle;
666 
668  FwIndexType m_InvalidReceiveModeThrottle;
669 
671  FwIndexType m_PacketOutOfBoundsThrottle;
672 
674  FwIndexType m_PacketOutOfOrderThrottle;
675 
676  };
677 
678 }
679 
680 #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