F´ Flight Software - C/C++ Documentation
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 <atomic>
11 
14 #include "Fw/FPrimeBasicTypes.hpp"
15 #include "Fw/Log/LogPortAc.hpp"
16 #include "Fw/Log/LogString.hpp"
17 #if FW_ENABLE_TEXT_LOGGING == 1
18 #include "Fw/Log/LogTextPortAc.hpp"
19 #endif
22 #include "Fw/Time/TimePortAc.hpp"
23 #include "Fw/Tlm/TlmPortAc.hpp"
24 #include "Fw/Tlm/TlmString.hpp"
25 #include "Svc/Ping/PingPortAc.hpp"
26 
27 namespace Svc {
28 
35  {
36 
37  // ----------------------------------------------------------------------
38  // Friend classes
39  // ----------------------------------------------------------------------
40 
42  friend class FileUplinkTesterBase;
44  friend class FileUplinkTester;
45 
46  PROTECTED:
47 
48  // ----------------------------------------------------------------------
49  // Constants
50  // ----------------------------------------------------------------------
51 
53  enum {
56  };
57 
59  enum {
64  };
65 
67  enum {
70  };
71 
73  enum {
85  };
86 
88  enum {
94  };
95 
97  enum {
101  };
102 
103  public:
104 
105  // ----------------------------------------------------------------------
106  // Component initialization
107  // ----------------------------------------------------------------------
108 
110  void init(
111  FwSizeType queueDepth,
112  FwEnumStoreType instance = 0
113  );
114 
115  public:
116 
117  // ----------------------------------------------------------------------
118  // Getters for typed input ports
119  // ----------------------------------------------------------------------
120 
125  FwIndexType portNum
126  );
127 
132  FwIndexType portNum
133  );
134 
135  public:
136 
137  // ----------------------------------------------------------------------
138  // Connect input ports to special output ports
139  // ----------------------------------------------------------------------
140 
141 #if FW_ENABLE_TEXT_LOGGING == 1
142 
144  void set_LogText_OutputPort(
145  FwIndexType portNum,
146  Fw::InputLogTextPort* port
147  );
148 
149 #endif
150 
153  FwIndexType portNum,
154  Fw::InputLogPort* port
155  );
156 
159  FwIndexType portNum,
160  Fw::InputTimePort* port
161  );
162 
165  FwIndexType portNum,
166  Fw::InputTlmPort* port
167  );
168 
169  public:
170 
171  // ----------------------------------------------------------------------
172  // Connect typed input ports to typed output ports
173  // ----------------------------------------------------------------------
174 
177  FwIndexType portNum,
179  );
180 
183  FwIndexType portNum,
184  Svc::InputPingPort* port
185  );
186 
187 #if FW_PORT_SERIALIZATION
188 
189  public:
190 
191  // ----------------------------------------------------------------------
192  // Connect serial input ports to special output ports
193  // ----------------------------------------------------------------------
194 
195 #if FW_ENABLE_TEXT_LOGGING == 1
196 
198  void set_LogText_OutputPort(
199  FwIndexType portNum,
200  Fw::InputSerializePort* port
201  );
202 
203 #endif
204 
207  FwIndexType portNum,
208  Fw::InputSerializePort* port
209  );
210 
213  FwIndexType portNum,
214  Fw::InputSerializePort* port
215  );
216 
219  FwIndexType portNum,
220  Fw::InputSerializePort* port
221  );
222 
223 #endif
224 
225 #if FW_PORT_SERIALIZATION
226 
227  public:
228 
229  // ----------------------------------------------------------------------
230  // Connect serial input ports to typed output ports
231  // ----------------------------------------------------------------------
232 
235  FwIndexType portNum,
236  Fw::InputSerializePort* port
237  );
238 
241  FwIndexType portNum,
242  Fw::InputSerializePort* port
243  );
244 
245 #endif
246 
247  PROTECTED:
248 
249  // ----------------------------------------------------------------------
250  // Component construction and destruction
251  // ----------------------------------------------------------------------
252 
255  const char* compName = ""
256  );
257 
259  virtual ~FileUplinkComponentBase();
260 
261  PROTECTED:
262 
263  // ----------------------------------------------------------------------
264  // Getters for numbers of typed input ports
265  // ----------------------------------------------------------------------
266 
271 
276 
277  PROTECTED:
278 
279  // ----------------------------------------------------------------------
280  // Getters for numbers of special output ports
281  // ----------------------------------------------------------------------
282 
283 #if FW_ENABLE_TEXT_LOGGING == 1
284 
288  FwIndexType getNum_LogText_OutputPorts() const;
289 
290 #endif
291 
296 
301 
306 
307  PROTECTED:
308 
309  // ----------------------------------------------------------------------
310  // Getters for numbers of typed output ports
311  // ----------------------------------------------------------------------
312 
317 
322 
323  PROTECTED:
324 
325  // ----------------------------------------------------------------------
326  // Connection status queries for special output ports
327  // ----------------------------------------------------------------------
328 
329 #if FW_ENABLE_TEXT_LOGGING == 1
330 
334  bool isConnected_LogText_OutputPort(
335  FwIndexType portNum
336  );
337 
338 #endif
339 
344  FwIndexType portNum
345  );
346 
351  FwIndexType portNum
352  );
353 
358  FwIndexType portNum
359  );
360 
361  PROTECTED:
362 
363  // ----------------------------------------------------------------------
364  // Connection status queries for typed output ports
365  // ----------------------------------------------------------------------
366 
371  FwIndexType portNum
372  );
373 
378  FwIndexType portNum
379  );
380 
381  PROTECTED:
382 
383  // ----------------------------------------------------------------------
384  // Handlers to implement for typed input ports
385  // ----------------------------------------------------------------------
386 
388  virtual void bufferSendIn_handler(
389  FwIndexType portNum,
390  Fw::Buffer& fwBuffer
391  ) = 0;
392 
394  virtual void pingIn_handler(
395  FwIndexType portNum,
396  U32 key
397  ) = 0;
398 
399  PROTECTED:
400 
401  // ----------------------------------------------------------------------
402  // Port handler base-class functions for typed input ports
403  //
404  // Call these functions directly to bypass the corresponding ports
405  // ----------------------------------------------------------------------
406 
409  FwIndexType portNum,
410  Fw::Buffer& fwBuffer
411  );
412 
414  void pingIn_handlerBase(
415  FwIndexType portNum,
416  U32 key
417  );
418 
419  PROTECTED:
420 
421  // ----------------------------------------------------------------------
422  // Pre-message hooks for typed async input ports
423  //
424  // Each of these functions is invoked just before processing a message
425  // on the corresponding port. By default, they do nothing. You can
426  // override them to provide specific pre-message behavior.
427  // ----------------------------------------------------------------------
428 
430  virtual void bufferSendIn_preMsgHook(
431  FwIndexType portNum,
432  Fw::Buffer& fwBuffer
433  );
434 
436  virtual void pingIn_preMsgHook(
437  FwIndexType portNum,
438  U32 key
439  );
440 
441  PROTECTED:
442 
443  // ----------------------------------------------------------------------
444  // Invocation functions for typed output ports
445  // ----------------------------------------------------------------------
446 
448  void bufferSendOut_out(
449  FwIndexType portNum,
450  Fw::Buffer& fwBuffer
451  );
452 
454  void pingOut_out(
455  FwIndexType portNum,
456  U32 key
457  );
458 
459  PROTECTED:
460 
461  // ----------------------------------------------------------------------
462  // Event logging functions
463  // ----------------------------------------------------------------------
464 
469  const Fw::StringBase& fileName,
470  U32 computed,
471  U32 read
472  ) const;
473 
478  const Fw::StringBase& fileName
479  ) const;
480 
485  const Fw::StringBase& fileName
486  ) const;
487 
492  const Fw::StringBase& fileName
493  );
494 
499  U32 packetType,
500  U32 mode
501  );
502 
507  U32 packetIndex,
508  const Fw::StringBase& fileName
509  );
510 
515  U32 packetIndex,
516  U32 lastPacketIndex
517  );
518 
523  U32 packetIndex
524  );
525 
529  void log_ACTIVITY_HI_UplinkCanceled() const;
530 
535  I32 status
536  ) const;
537 
542  U32 packetType
543  ) const;
544 
545  PROTECTED:
546 
547  // ----------------------------------------------------------------------
548  // Event throttle reset functions
549  // ----------------------------------------------------------------------
550 
553 
556 
559 
562 
565 
566  PROTECTED:
567 
568  // ----------------------------------------------------------------------
569  // Telemetry write functions
570  // ----------------------------------------------------------------------
571 
576  U32 arg,
577  Fw::Time _tlmTime = Fw::Time()
578  ) const;
579 
584  U32 arg,
585  Fw::Time _tlmTime = Fw::Time()
586  ) const;
587 
591  void tlmWrite_Warnings(
592  U32 arg,
593  Fw::Time _tlmTime = Fw::Time()
594  ) const;
595 
596  PROTECTED:
597 
598  // ----------------------------------------------------------------------
599  // Time
600  // ----------------------------------------------------------------------
601 
605  Fw::Time getTime() const;
606 
607  PRIVATE:
608 
609  // ----------------------------------------------------------------------
610  // Message dispatch functions
611  // ----------------------------------------------------------------------
612 
614  virtual MsgDispatchStatus doDispatch();
615 
616  PRIVATE:
617 
618  // ----------------------------------------------------------------------
619  // Calls for messages received on typed input ports
620  // ----------------------------------------------------------------------
621 
623  static void m_p_bufferSendIn_in(
624  Fw::PassiveComponentBase* callComp,
625  FwIndexType portNum,
626  Fw::Buffer& fwBuffer
627  );
628 
630  static void m_p_pingIn_in(
631  Fw::PassiveComponentBase* callComp,
632  FwIndexType portNum,
633  U32 key
634  );
635 
636  PRIVATE:
637 
638  // ----------------------------------------------------------------------
639  // Typed input ports
640  // ----------------------------------------------------------------------
641 
643  Fw::InputBufferSendPort m_bufferSendIn_InputPort[NUM_BUFFERSENDIN_INPUT_PORTS];
644 
646  Svc::InputPingPort m_pingIn_InputPort[NUM_PINGIN_INPUT_PORTS];
647 
648  PRIVATE:
649 
650  // ----------------------------------------------------------------------
651  // Special output ports
652  // ----------------------------------------------------------------------
653 
654 #if FW_ENABLE_TEXT_LOGGING == 1
655 
657  Fw::OutputLogTextPort m_LogText_OutputPort[NUM_LOGTEXT_OUTPUT_PORTS];
658 
659 #endif
660 
662  Fw::OutputLogPort m_eventOut_OutputPort[NUM_EVENTOUT_OUTPUT_PORTS];
663 
665  Fw::OutputTimePort m_timeCaller_OutputPort[NUM_TIMECALLER_OUTPUT_PORTS];
666 
668  Fw::OutputTlmPort m_tlmOut_OutputPort[NUM_TLMOUT_OUTPUT_PORTS];
669 
670  PRIVATE:
671 
672  // ----------------------------------------------------------------------
673  // Typed output ports
674  // ----------------------------------------------------------------------
675 
677  Fw::OutputBufferSendPort m_bufferSendOut_OutputPort[NUM_BUFFERSENDOUT_OUTPUT_PORTS];
678 
680  Svc::OutputPingPort m_pingOut_OutputPort[NUM_PINGOUT_OUTPUT_PORTS];
681 
682  PRIVATE:
683 
684  // ----------------------------------------------------------------------
685  // Counter values for event throttling
686  // ----------------------------------------------------------------------
687 
689  std::atomic<FwIndexType> m_FileWriteErrorThrottle;
690 
692  std::atomic<FwIndexType> m_InvalidReceiveModeThrottle;
693 
695  std::atomic<FwIndexType> m_PacketOutOfBoundsThrottle;
696 
698  std::atomic<FwIndexType> m_PacketOutOfOrderThrottle;
699 
701  std::atomic<FwIndexType> m_PacketDuplicateThrottle;
702 
703  };
704 
705 }
706 
707 #endif
Definition: Time.hpp:9
PlatformSizeType FwSizeType
I32 FwEnumStoreType
void init()
Object initializer.
Definition: ObjBase.cpp:26
PlatformIndexType FwIndexType
RateGroupDivider component implementation.