F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
CcsdsSdlsDeframerComponentAc.hpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title CcsdsSdlsDeframerComponentAc.hpp
3 // \author Generated by fpp-to-cpp
4 // \brief hpp file for CcsdsSdlsDeframer component base class
5 // ======================================================================
6 
7 #ifndef Svc_Ccsds_CcsdsSdlsDeframerComponentAc_HPP
8 #define Svc_Ccsds_CcsdsSdlsDeframerComponentAc_HPP
9 
10 #include <atomic>
11 
13 #include "Fw/FPrimeBasicTypes.hpp"
14 #include "Fw/Log/LogPortAc.hpp"
15 #include "Fw/Log/LogString.hpp"
16 #include "Fw/Log/LogTextPortAc.hpp"
17 #if !FW_DIRECT_PORT_CALLS
19 #endif
20 #if !FW_DIRECT_PORT_CALLS
22 #endif
23 #include "Fw/Time/TimePortAc.hpp"
24 #include "Os/Mutex.hpp"
30 
31 namespace Svc {
32 
33  namespace Ccsds {
34 
47  {
48 
49  // ----------------------------------------------------------------------
50  // Friend classes
51  // ----------------------------------------------------------------------
52 
57 
58  protected:
59 
60  // ----------------------------------------------------------------------
61  // Constants
62  // ----------------------------------------------------------------------
63 
65  enum {
70  };
71 
73  enum {
77  };
78 
80  enum {
86  };
87 
89  enum {
92  };
93 
94  public:
95 
96  // ----------------------------------------------------------------------
97  // Component initialization
98  // ----------------------------------------------------------------------
99 
101  void init(
102  FwEnumStoreType instance = 0
103  );
104 
105 #if !FW_DIRECT_PORT_CALLS
106 
107  public:
108 
109  // ----------------------------------------------------------------------
110  // Getters for typed input ports
111  // ----------------------------------------------------------------------
112 
117  FwIndexType portNum
118  );
119 
124  FwIndexType portNum
125  );
126 
131  FwIndexType portNum
132  );
133 
138  FwIndexType portNum
139  );
140 
141 #endif
142 
143 #if !FW_DIRECT_PORT_CALLS
144 
145  public:
146 
147  // ----------------------------------------------------------------------
148  // Connect input ports to special output ports
149  // ----------------------------------------------------------------------
150 
153  FwIndexType portNum,
154  Fw::InputLogPort* port
155  );
156 
157 #if FW_ENABLE_TEXT_LOGGING == 1
158 
160  void set_logTextOut_OutputPort(
161  FwIndexType portNum,
162  Fw::InputLogTextPort* port
163  );
164 
165 #endif
166 
169  FwIndexType portNum,
170  Fw::InputTimePort* port
171  );
172 
173 #endif
174 
175 #if !FW_DIRECT_PORT_CALLS
176 
177  public:
178 
179  // ----------------------------------------------------------------------
180  // Connect typed input ports to typed output ports
181  // ----------------------------------------------------------------------
182 
185  FwIndexType portNum,
187  );
188 
191  FwIndexType portNum,
193  );
194 
197  FwIndexType portNum,
199  );
200 
203  FwIndexType portNum,
205  );
206 
209  FwIndexType portNum,
211  );
212 
213 #endif
214 
215 #if !FW_DIRECT_PORT_CALLS && FW_PORT_SERIALIZATION
216 
217  public:
218 
219  // ----------------------------------------------------------------------
220  // Connect serial input ports to special output ports
221  // ----------------------------------------------------------------------
222 
225  FwIndexType portNum,
226  Fw::InputSerializePort* port
227  );
228 
229 #if FW_ENABLE_TEXT_LOGGING == 1
230 
232  void set_logTextOut_OutputPort(
233  FwIndexType portNum,
234  Fw::InputSerializePort* port
235  );
236 
237 #endif
238 
241  FwIndexType portNum,
242  Fw::InputSerializePort* port
243  );
244 
245 #endif
246 
247 #if !FW_DIRECT_PORT_CALLS && FW_PORT_SERIALIZATION
248 
249  public:
250 
251  // ----------------------------------------------------------------------
252  // Connect serial input ports to typed output ports
253  // ----------------------------------------------------------------------
254 
257  FwIndexType portNum,
258  Fw::InputSerializePort* port
259  );
260 
263  FwIndexType portNum,
264  Fw::InputSerializePort* port
265  );
266 
269  FwIndexType portNum,
270  Fw::InputSerializePort* port
271  );
272 
275  FwIndexType portNum,
276  Fw::InputSerializePort* port
277  );
278 
281  FwIndexType portNum,
282  Fw::InputSerializePort* port
283  );
284 
285 #endif
286 
287  protected:
288 
289  // ----------------------------------------------------------------------
290  // Component construction and destruction
291  // ----------------------------------------------------------------------
292 
295  const char* compName = ""
296  );
297 
300 
301  protected:
302 
303  // ----------------------------------------------------------------------
304  // Getters for numbers of typed input ports
305  // ----------------------------------------------------------------------
306 
312  }
313 
318  return NUM_DATAIN_INPUT_PORTS;
319  }
320 
326  }
327 
333  }
334 
335  protected:
336 
337  // ----------------------------------------------------------------------
338  // Getters for numbers of special output ports
339  // ----------------------------------------------------------------------
340 
346  }
347 
348 #if FW_ENABLE_TEXT_LOGGING == 1
349 
353  static constexpr FwIndexType getNum_logTextOut_OutputPorts() {
355  }
356 
357 #endif
358 
364  }
365 
366  protected:
367 
368  // ----------------------------------------------------------------------
369  // Getters for numbers of typed output ports
370  // ----------------------------------------------------------------------
371 
377  }
378 
384  }
385 
391  }
392 
398  }
399 
405  }
406 
407  protected:
408 
409  // ----------------------------------------------------------------------
410  // Connection status queries for special output ports
411  // ----------------------------------------------------------------------
412 
417  FwIndexType portNum
418  ) const;
419 
420 #if FW_ENABLE_TEXT_LOGGING == 1
421 
425  bool isConnected_logTextOut_OutputPort(
426  FwIndexType portNum
427  ) const;
428 
429 #endif
430 
435  FwIndexType portNum
436  ) const;
437 
438  protected:
439 
440  // ----------------------------------------------------------------------
441  // Connection status queries for typed output ports
442  // ----------------------------------------------------------------------
443 
448  FwIndexType portNum
449  ) const;
450 
455  FwIndexType portNum
456  ) const;
457 
462  FwIndexType portNum
463  ) const;
464 
469  FwIndexType portNum
470  ) const;
471 
476  FwIndexType portNum
477  ) const;
478 
479  protected:
480 
481  // ----------------------------------------------------------------------
482  // Handlers to implement for typed input ports
483  // ----------------------------------------------------------------------
484 
486  virtual void bufferReturnIn_handler(
487  FwIndexType portNum,
488  Fw::Buffer& data,
489  const ComCfg::FrameContext& context
490  ) = 0;
491 
493  virtual void dataIn_handler(
494  FwIndexType portNum,
495  Fw::Buffer& data,
496  const ComCfg::FrameContext& context
497  ) = 0;
498 
500  virtual void dataReturnIn_handler(
501  FwIndexType portNum,
502  Fw::Buffer& data,
503  const ComCfg::FrameContext& context
504  ) = 0;
505 
507  virtual void decryptIn_handler(
508  FwIndexType portNum,
509  const Svc::Ccsds::SdlsStatus& status,
510  Fw::Buffer& data,
511  const ComCfg::FrameContext& context
512  ) = 0;
513 
514 #if FW_DIRECT_PORT_CALLS
515  public:
516 #else
517  protected:
518 #endif
519 
520  // ----------------------------------------------------------------------
521  // Port handler base-class functions for typed input ports
522  //
523  // Call these functions directly to bypass the corresponding ports
524  // ----------------------------------------------------------------------
525 
528  FwIndexType portNum,
529  Fw::Buffer& data,
530  const ComCfg::FrameContext& context
531  );
532 
534  void dataIn_handlerBase(
535  FwIndexType portNum,
536  Fw::Buffer& data,
537  const ComCfg::FrameContext& context
538  );
539 
542  FwIndexType portNum,
543  Fw::Buffer& data,
544  const ComCfg::FrameContext& context
545  );
546 
549  FwIndexType portNum,
550  const Svc::Ccsds::SdlsStatus& status,
551  Fw::Buffer& data,
552  const ComCfg::FrameContext& context
553  );
554 
555  protected:
556 
557  // ----------------------------------------------------------------------
558  // Invocation functions for typed output ports
559  // ----------------------------------------------------------------------
560 
562  void dataOut_out(
563  FwIndexType portNum,
564  Fw::Buffer& data,
565  const ComCfg::FrameContext& context
566  ) const;
567 
569  void dataReturnOut_out(
570  FwIndexType portNum,
571  Fw::Buffer& data,
572  const ComCfg::FrameContext& context
573  ) const;
574 
576  void decryptOut_out(
577  FwIndexType portNum,
578  U16 securityAssociationIndex,
579  Fw::Buffer& data,
580  const ComCfg::FrameContext& context
581  ) const;
582 
585  FwIndexType portNum,
586  Fw::Buffer& data,
587  const ComCfg::FrameContext& context
588  ) const;
589 
591  void errorNotify_out(
592  FwIndexType portNum,
593  const Svc::Ccsds::FrameError& errorCode
594  ) const;
595 
596  protected:
597 
598  // ----------------------------------------------------------------------
599  // Event logging functions
600  // ----------------------------------------------------------------------
601 
606 
611 
612  protected:
613 
614  // ----------------------------------------------------------------------
615  // Time
616  // ----------------------------------------------------------------------
617 
621  Fw::Time getTime() const;
622 
623  protected:
624 
625  // ----------------------------------------------------------------------
626  // Mutex operations for guarded ports
627  //
628  // You can override these operations to provide more sophisticated
629  // synchronization
630  // ----------------------------------------------------------------------
631 
633  virtual void lock();
634 
636  virtual void unLock();
637 
638  private:
639 
640  // ----------------------------------------------------------------------
641  // Calls for messages received on typed input ports
642  // ----------------------------------------------------------------------
643 
645  static void m_p_bufferReturnIn_in(
646  Fw::PassiveComponentBase* callComp,
647  FwIndexType portNum,
648  Fw::Buffer& data,
649  const ComCfg::FrameContext& context
650  );
651 
653  static void m_p_dataIn_in(
654  Fw::PassiveComponentBase* callComp,
655  FwIndexType portNum,
656  Fw::Buffer& data,
657  const ComCfg::FrameContext& context
658  );
659 
661  static void m_p_dataReturnIn_in(
662  Fw::PassiveComponentBase* callComp,
663  FwIndexType portNum,
664  Fw::Buffer& data,
665  const ComCfg::FrameContext& context
666  );
667 
669  static void m_p_decryptIn_in(
670  Fw::PassiveComponentBase* callComp,
671  FwIndexType portNum,
672  const Svc::Ccsds::SdlsStatus& status,
673  Fw::Buffer& data,
674  const ComCfg::FrameContext& context
675  );
676 
677  private:
678 
679  // ----------------------------------------------------------------------
680  // Invocation functions for special output ports
681  // ----------------------------------------------------------------------
682 
684  void logOut_out(
685  FwIndexType portNum,
686  FwEventIdType id,
687  Fw::Time& timeTag,
688  const Fw::LogSeverity& severity,
689  Fw::LogBuffer& args
690  ) const;
691 
692 #if FW_ENABLE_TEXT_LOGGING
693 
695  void logTextOut_out(
696  FwIndexType portNum,
697  FwEventIdType id,
698  Fw::Time& timeTag,
699  const Fw::LogSeverity& severity,
700  Fw::TextLogString& text
701  ) const;
702 
703 #endif
704 
706  void timeCaller_out(
707  FwIndexType portNum,
708  Fw::Time& time
709  ) const;
710 
711 #if !FW_DIRECT_PORT_CALLS
712 
713  private:
714 
715  // ----------------------------------------------------------------------
716  // Typed input ports
717  // ----------------------------------------------------------------------
718 
721 
724 
727 
730 
731 #endif
732 
733 #if !FW_DIRECT_PORT_CALLS
734 
735  private:
736 
737  // ----------------------------------------------------------------------
738  // Special output ports
739  // ----------------------------------------------------------------------
740 
742  Fw::OutputLogPort m_logOut_OutputPort[NUM_LOGOUT_OUTPUT_PORTS];
743 
744 #if FW_ENABLE_TEXT_LOGGING == 1
745 
747  Fw::OutputLogTextPort m_logTextOut_OutputPort[NUM_LOGTEXTOUT_OUTPUT_PORTS];
748 
749 #endif
750 
752  Fw::OutputTimePort m_timeCaller_OutputPort[NUM_TIMECALLER_OUTPUT_PORTS];
753 
754 #endif
755 
756 #if !FW_DIRECT_PORT_CALLS
757 
758  private:
759 
760  // ----------------------------------------------------------------------
761  // Typed output ports
762  // ----------------------------------------------------------------------
763 
766 
769 
772 
775 
778 
779 #endif
780 
781  private:
782 
783  // ----------------------------------------------------------------------
784  // Mutexes
785  // ----------------------------------------------------------------------
786 
788  Os::Mutex m_guardedPortMutex;
789 
790  };
791 
792  }
793 
794 }
795 
796 #endif
static constexpr FwIndexType getNum_decryptReturnOut_OutputPorts()
bool isConnected_errorNotify_OutputPort(FwIndexType portNum) const
bool isConnected_decryptOut_OutputPort(FwIndexType portNum) const
friend class CcsdsSdlsDeframerTesterBase
Friend class tester to support autocoded test harness.
bool isConnected_dataOut_OutputPort(FwIndexType portNum) const
I32 FwEnumStoreType
void set_timeCaller_OutputPort(FwIndexType portNum, Fw::InputTimePort *port)
Connect port to timeCaller[portNum].
void dataIn_handlerBase(FwIndexType portNum, Fw::Buffer &data, const ComCfg::FrameContext &context)
Handler base-class function for input port dataIn.
Svc::InputComDataWithContextPort * get_dataIn_InputPort(FwIndexType portNum)
virtual void bufferReturnIn_handler(FwIndexType portNum, Fw::Buffer &data, const ComCfg::FrameContext &context)=0
Handler for input port bufferReturnIn.
virtual void decryptIn_handler(FwIndexType portNum, const Svc::Ccsds::SdlsStatus &status, Fw::Buffer &data, const ComCfg::FrameContext &context)=0
Handler for input port decryptIn.
void set_logOut_OutputPort(FwIndexType portNum, Fw::InputLogPort *port)
Connect port to logOut[portNum].
void set_decryptOut_OutputPort(FwIndexType portNum, Svc::Ccsds::InputCcsdsSdlsEncryptionPort *port)
Connect port to decryptOut[portNum].
bool isConnected_timeCaller_OutputPort(FwIndexType portNum) const
Link-time delegating Mutex implementation.
Svc::InputComDataWithContextPort * get_dataReturnIn_InputPort(FwIndexType portNum)
void dataOut_out(FwIndexType portNum, Fw::Buffer &data, const ComCfg::FrameContext &context) const
Invoke output port dataOut.
void set_dataOut_OutputPort(FwIndexType portNum, Svc::InputComDataWithContextPort *port)
Connect port to dataOut[portNum].
void decryptIn_handlerBase(FwIndexType portNum, const Svc::Ccsds::SdlsStatus &status, Fw::Buffer &data, const ComCfg::FrameContext &context)
Handler base-class function for input port decryptIn.
virtual void dataReturnIn_handler(FwIndexType portNum, Fw::Buffer &data, const ComCfg::FrameContext &context)=0
Handler for input port dataReturnIn.
void decryptReturnOut_out(FwIndexType portNum, Fw::Buffer &data, const ComCfg::FrameContext &context) const
Invoke output port decryptReturnOut.
void set_decryptReturnOut_OutputPort(FwIndexType portNum, Svc::InputComDataWithContextPort *port)
Connect port to decryptReturnOut[portNum].
Auto-generated base for CcsdsSdlsDeframer component.
void init()
Object initializer.
Definition: ObjBase.cpp:24
Status of an SDLS (Space Data Link Security) encryption/decryption request.
void decryptOut_out(FwIndexType portNum, U16 securityAssociationIndex, Fw::Buffer &data, const ComCfg::FrameContext &context) const
Invoke output port decryptOut.
FwIdType FwEventIdType
The type of an event identifier.
bool isConnected_dataReturnOut_OutputPort(FwIndexType portNum) const
Svc::InputComDataWithContextPort * get_bufferReturnIn_InputPort(FwIndexType portNum)
virtual ~CcsdsSdlsDeframerComponentBase()
Destroy CcsdsSdlsDeframerComponentBase object.
void errorNotify_out(FwIndexType portNum, const Svc::Ccsds::FrameError &errorCode) const
Invoke output port errorNotify.
Enum representing event severity.
void set_errorNotify_OutputPort(FwIndexType portNum, Svc::Ccsds::InputErrorNotifyPort *port)
Connect port to errorNotify[portNum].
void dataReturnOut_out(FwIndexType portNum, Fw::Buffer &data, const ComCfg::FrameContext &context) const
Invoke output port dataReturnOut.
PlatformIndexType FwIndexType
void set_dataReturnOut_OutputPort(FwIndexType portNum, Svc::InputComDataWithContextPort *port)
Connect port to dataReturnOut[portNum].
Type used to pass context info between components during framing/deframing.
static constexpr FwIndexType getNum_bufferReturnIn_InputPorts()
RateGroupDivider component implementation.
bool isConnected_logOut_OutputPort(FwIndexType portNum) const
CcsdsSdlsDeframerComponentBase(const char *compName="")
Construct CcsdsSdlsDeframerComponentBase object.
void bufferReturnIn_handlerBase(FwIndexType portNum, Fw::Buffer &data, const ComCfg::FrameContext &context)
Handler base-class function for input port bufferReturnIn.
virtual void dataIn_handler(FwIndexType portNum, Fw::Buffer &data, const ComCfg::FrameContext &context)=0
Handler for input port dataIn.
virtual void unLock()
Unlock the guarded mutex.
void dataReturnIn_handlerBase(FwIndexType portNum, Fw::Buffer &data, const ComCfg::FrameContext &context)
Handler base-class function for input port dataReturnIn.
void log_WARNING_HI_DecryptionFailed(const Svc::Ccsds::SdlsStatus &status) const
static constexpr FwIndexType getNum_dataReturnOut_OutputPorts()
bool isConnected_decryptReturnOut_OutputPort(FwIndexType portNum) const
Svc::Ccsds::InputCcsdsSdlsDataPort * get_decryptIn_InputPort(FwIndexType portNum)
Event raised when the frame is not long enough for the security association index of 16bits...
friend class CcsdsSdlsDeframerTester
Friend class tester implementation to support white-box testing.