F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
CcsdsSdlsDeframerComponentAc.cpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title CcsdsSdlsDeframerComponentAc.cpp
3 // \author Generated by fpp-to-cpp
4 // \brief cpp file for CcsdsSdlsDeframer component base class
5 // ======================================================================
6 
7 #include "Fw/Types/Assert.hpp"
9 #if FW_ENABLE_TEXT_LOGGING
10 #include "Fw/Types/String.hpp"
11 #endif
13 
14 namespace Svc {
15 
16  namespace Ccsds {
17 
18  // ----------------------------------------------------------------------
19  // Component initialization
20  // ----------------------------------------------------------------------
21 
24  {
25  // Initialize base class
27 
28 #if !FW_DIRECT_PORT_CALLS
29  // Connect input port bufferReturnIn
30  for (
31  FwIndexType port = 0;
32  port < static_cast<FwIndexType>(this->getNum_bufferReturnIn_InputPorts());
33  port++
34  ) {
35  this->m_bufferReturnIn_InputPort[port].init();
36  this->m_bufferReturnIn_InputPort[port].addCallComp(
37  this,
38  m_p_bufferReturnIn_in
39  );
40  this->m_bufferReturnIn_InputPort[port].setPortNum(port);
41 
42 #if FW_OBJECT_NAMES == 1
43  Fw::ObjectName portName;
44  portName.format(
45  "%s_bufferReturnIn_InputPort[%" PRI_FwIndexType "]",
46  this->m_objName.toChar(),
47  port
48  );
49  this->m_bufferReturnIn_InputPort[port].setObjName(portName.toChar());
50 #endif
51  }
52 #endif
53 
54 #if !FW_DIRECT_PORT_CALLS
55  // Connect input port dataIn
56  for (
57  FwIndexType port = 0;
58  port < static_cast<FwIndexType>(this->getNum_dataIn_InputPorts());
59  port++
60  ) {
61  this->m_dataIn_InputPort[port].init();
62  this->m_dataIn_InputPort[port].addCallComp(
63  this,
64  m_p_dataIn_in
65  );
66  this->m_dataIn_InputPort[port].setPortNum(port);
67 
68 #if FW_OBJECT_NAMES == 1
69  Fw::ObjectName portName;
70  portName.format(
71  "%s_dataIn_InputPort[%" PRI_FwIndexType "]",
72  this->m_objName.toChar(),
73  port
74  );
75  this->m_dataIn_InputPort[port].setObjName(portName.toChar());
76 #endif
77  }
78 #endif
79 
80 #if !FW_DIRECT_PORT_CALLS
81  // Connect input port dataReturnIn
82  for (
83  FwIndexType port = 0;
84  port < static_cast<FwIndexType>(this->getNum_dataReturnIn_InputPorts());
85  port++
86  ) {
87  this->m_dataReturnIn_InputPort[port].init();
88  this->m_dataReturnIn_InputPort[port].addCallComp(
89  this,
90  m_p_dataReturnIn_in
91  );
92  this->m_dataReturnIn_InputPort[port].setPortNum(port);
93 
94 #if FW_OBJECT_NAMES == 1
95  Fw::ObjectName portName;
96  portName.format(
97  "%s_dataReturnIn_InputPort[%" PRI_FwIndexType "]",
98  this->m_objName.toChar(),
99  port
100  );
101  this->m_dataReturnIn_InputPort[port].setObjName(portName.toChar());
102 #endif
103  }
104 #endif
105 
106 #if !FW_DIRECT_PORT_CALLS
107  // Connect input port decryptIn
108  for (
109  FwIndexType port = 0;
110  port < static_cast<FwIndexType>(this->getNum_decryptIn_InputPorts());
111  port++
112  ) {
113  this->m_decryptIn_InputPort[port].init();
114  this->m_decryptIn_InputPort[port].addCallComp(
115  this,
116  m_p_decryptIn_in
117  );
118  this->m_decryptIn_InputPort[port].setPortNum(port);
119 
120 #if FW_OBJECT_NAMES == 1
121  Fw::ObjectName portName;
122  portName.format(
123  "%s_decryptIn_InputPort[%" PRI_FwIndexType "]",
124  this->m_objName.toChar(),
125  port
126  );
127  this->m_decryptIn_InputPort[port].setObjName(portName.toChar());
128 #endif
129  }
130 #endif
131 
132 #if !FW_DIRECT_PORT_CALLS
133  // Connect output port logOut
134  for (
135  FwIndexType port = 0;
136  port < static_cast<FwIndexType>(this->getNum_logOut_OutputPorts());
137  port++
138  ) {
139  this->m_logOut_OutputPort[port].init();
140 
141 #if FW_OBJECT_NAMES == 1
142  Fw::ObjectName portName;
143  portName.format(
144  "%s_logOut_OutputPort[%" PRI_FwIndexType "]",
145  this->m_objName.toChar(),
146  port
147  );
148  this->m_logOut_OutputPort[port].setObjName(portName.toChar());
149 #endif
150  }
151 #endif
152 
153 #if !FW_DIRECT_PORT_CALLS && FW_ENABLE_TEXT_LOGGING
154  // Connect output port logTextOut
155  for (
156  FwIndexType port = 0;
157  port < static_cast<FwIndexType>(this->getNum_logTextOut_OutputPorts());
158  port++
159  ) {
160  this->m_logTextOut_OutputPort[port].init();
161 
162 #if FW_OBJECT_NAMES == 1
163  Fw::ObjectName portName;
164  portName.format(
165  "%s_logTextOut_OutputPort[%" PRI_FwIndexType "]",
166  this->m_objName.toChar(),
167  port
168  );
169  this->m_logTextOut_OutputPort[port].setObjName(portName.toChar());
170 #endif
171  }
172 #endif
173 
174 #if !FW_DIRECT_PORT_CALLS
175  // Connect output port timeCaller
176  for (
177  FwIndexType port = 0;
178  port < static_cast<FwIndexType>(this->getNum_timeCaller_OutputPorts());
179  port++
180  ) {
181  this->m_timeCaller_OutputPort[port].init();
182 
183 #if FW_OBJECT_NAMES == 1
184  Fw::ObjectName portName;
185  portName.format(
186  "%s_timeCaller_OutputPort[%" PRI_FwIndexType "]",
187  this->m_objName.toChar(),
188  port
189  );
190  this->m_timeCaller_OutputPort[port].setObjName(portName.toChar());
191 #endif
192  }
193 #endif
194 
195 #if !FW_DIRECT_PORT_CALLS
196  // Connect output port dataOut
197  for (
198  FwIndexType port = 0;
199  port < static_cast<FwIndexType>(this->getNum_dataOut_OutputPorts());
200  port++
201  ) {
202  this->m_dataOut_OutputPort[port].init();
203 
204 #if FW_OBJECT_NAMES == 1
205  Fw::ObjectName portName;
206  portName.format(
207  "%s_dataOut_OutputPort[%" PRI_FwIndexType "]",
208  this->m_objName.toChar(),
209  port
210  );
211  this->m_dataOut_OutputPort[port].setObjName(portName.toChar());
212 #endif
213  }
214 #endif
215 
216 #if !FW_DIRECT_PORT_CALLS
217  // Connect output port dataReturnOut
218  for (
219  FwIndexType port = 0;
220  port < static_cast<FwIndexType>(this->getNum_dataReturnOut_OutputPorts());
221  port++
222  ) {
223  this->m_dataReturnOut_OutputPort[port].init();
224 
225 #if FW_OBJECT_NAMES == 1
226  Fw::ObjectName portName;
227  portName.format(
228  "%s_dataReturnOut_OutputPort[%" PRI_FwIndexType "]",
229  this->m_objName.toChar(),
230  port
231  );
232  this->m_dataReturnOut_OutputPort[port].setObjName(portName.toChar());
233 #endif
234  }
235 #endif
236 
237 #if !FW_DIRECT_PORT_CALLS
238  // Connect output port decryptOut
239  for (
240  FwIndexType port = 0;
241  port < static_cast<FwIndexType>(this->getNum_decryptOut_OutputPorts());
242  port++
243  ) {
244  this->m_decryptOut_OutputPort[port].init();
245 
246 #if FW_OBJECT_NAMES == 1
247  Fw::ObjectName portName;
248  portName.format(
249  "%s_decryptOut_OutputPort[%" PRI_FwIndexType "]",
250  this->m_objName.toChar(),
251  port
252  );
253  this->m_decryptOut_OutputPort[port].setObjName(portName.toChar());
254 #endif
255  }
256 #endif
257 
258 #if !FW_DIRECT_PORT_CALLS
259  // Connect output port decryptReturnOut
260  for (
261  FwIndexType port = 0;
262  port < static_cast<FwIndexType>(this->getNum_decryptReturnOut_OutputPorts());
263  port++
264  ) {
265  this->m_decryptReturnOut_OutputPort[port].init();
266 
267 #if FW_OBJECT_NAMES == 1
268  Fw::ObjectName portName;
269  portName.format(
270  "%s_decryptReturnOut_OutputPort[%" PRI_FwIndexType "]",
271  this->m_objName.toChar(),
272  port
273  );
274  this->m_decryptReturnOut_OutputPort[port].setObjName(portName.toChar());
275 #endif
276  }
277 #endif
278 
279 #if !FW_DIRECT_PORT_CALLS
280  // Connect output port errorNotify
281  for (
282  FwIndexType port = 0;
283  port < static_cast<FwIndexType>(this->getNum_errorNotify_OutputPorts());
284  port++
285  ) {
286  this->m_errorNotify_OutputPort[port].init();
287 
288 #if FW_OBJECT_NAMES == 1
289  Fw::ObjectName portName;
290  portName.format(
291  "%s_errorNotify_OutputPort[%" PRI_FwIndexType "]",
292  this->m_objName.toChar(),
293  port
294  );
295  this->m_errorNotify_OutputPort[port].setObjName(portName.toChar());
296 #endif
297  }
298 #endif
299  }
300 
301 #if !FW_DIRECT_PORT_CALLS
302 
303  // ----------------------------------------------------------------------
304  // Getters for typed input ports
305  // ----------------------------------------------------------------------
306 
309  {
310  FW_ASSERT(
311  (0 <= portNum) && (portNum < this->getNum_bufferReturnIn_InputPorts()),
312  static_cast<FwAssertArgType>(portNum)
313  );
314 
315  return &this->m_bufferReturnIn_InputPort[portNum];
316  }
317 
320  {
321  FW_ASSERT(
322  (0 <= portNum) && (portNum < this->getNum_dataIn_InputPorts()),
323  static_cast<FwAssertArgType>(portNum)
324  );
325 
326  return &this->m_dataIn_InputPort[portNum];
327  }
328 
331  {
332  FW_ASSERT(
333  (0 <= portNum) && (portNum < this->getNum_dataReturnIn_InputPorts()),
334  static_cast<FwAssertArgType>(portNum)
335  );
336 
337  return &this->m_dataReturnIn_InputPort[portNum];
338  }
339 
342  {
343  FW_ASSERT(
344  (0 <= portNum) && (portNum < this->getNum_decryptIn_InputPorts()),
345  static_cast<FwAssertArgType>(portNum)
346  );
347 
348  return &this->m_decryptIn_InputPort[portNum];
349  }
350 
351 #endif
352 
353 #if !FW_DIRECT_PORT_CALLS
354 
355  // ----------------------------------------------------------------------
356  // Connect input ports to special output ports
357  // ----------------------------------------------------------------------
358 
361  FwIndexType portNum,
362  Fw::InputLogPort* port
363  )
364  {
365  FW_ASSERT(
366  (0 <= portNum) && (portNum < this->getNum_logOut_OutputPorts()),
367  static_cast<FwAssertArgType>(portNum)
368  );
369 
370  this->m_logOut_OutputPort[portNum].addCallPort(port);
371  }
372 
373 #if FW_ENABLE_TEXT_LOGGING == 1
374 
375  void CcsdsSdlsDeframerComponentBase ::
376  set_logTextOut_OutputPort(
377  FwIndexType portNum,
379  )
380  {
381  FW_ASSERT(
382  (0 <= portNum) && (portNum < this->getNum_logTextOut_OutputPorts()),
383  static_cast<FwAssertArgType>(portNum)
384  );
385 
386  this->m_logTextOut_OutputPort[portNum].addCallPort(port);
387  }
388 
389 #endif
390 
393  FwIndexType portNum,
394  Fw::InputTimePort* port
395  )
396  {
397  FW_ASSERT(
398  (0 <= portNum) && (portNum < this->getNum_timeCaller_OutputPorts()),
399  static_cast<FwAssertArgType>(portNum)
400  );
401 
402  this->m_timeCaller_OutputPort[portNum].addCallPort(port);
403  }
404 
405 #endif
406 
407 #if !FW_DIRECT_PORT_CALLS
408 
409  // ----------------------------------------------------------------------
410  // Connect typed input ports to typed output ports
411  // ----------------------------------------------------------------------
412 
415  FwIndexType portNum,
417  )
418  {
419  FW_ASSERT(
420  (0 <= portNum) && (portNum < this->getNum_dataOut_OutputPorts()),
421  static_cast<FwAssertArgType>(portNum)
422  );
423 
424  this->m_dataOut_OutputPort[portNum].addCallPort(port);
425  }
426 
429  FwIndexType portNum,
431  )
432  {
433  FW_ASSERT(
434  (0 <= portNum) && (portNum < this->getNum_dataReturnOut_OutputPorts()),
435  static_cast<FwAssertArgType>(portNum)
436  );
437 
438  this->m_dataReturnOut_OutputPort[portNum].addCallPort(port);
439  }
440 
443  FwIndexType portNum,
445  )
446  {
447  FW_ASSERT(
448  (0 <= portNum) && (portNum < this->getNum_decryptOut_OutputPorts()),
449  static_cast<FwAssertArgType>(portNum)
450  );
451 
452  this->m_decryptOut_OutputPort[portNum].addCallPort(port);
453  }
454 
457  FwIndexType portNum,
459  )
460  {
461  FW_ASSERT(
462  (0 <= portNum) && (portNum < this->getNum_decryptReturnOut_OutputPorts()),
463  static_cast<FwAssertArgType>(portNum)
464  );
465 
466  this->m_decryptReturnOut_OutputPort[portNum].addCallPort(port);
467  }
468 
471  FwIndexType portNum,
473  )
474  {
475  FW_ASSERT(
476  (0 <= portNum) && (portNum < this->getNum_errorNotify_OutputPorts()),
477  static_cast<FwAssertArgType>(portNum)
478  );
479 
480  this->m_errorNotify_OutputPort[portNum].addCallPort(port);
481  }
482 
483 #endif
484 
485 #if !FW_DIRECT_PORT_CALLS && FW_PORT_SERIALIZATION
486 
487  // ----------------------------------------------------------------------
488  // Connect serial input ports to special output ports
489  // ----------------------------------------------------------------------
490 
493  FwIndexType portNum,
494  Fw::InputSerializePort* port
495  )
496  {
497  FW_ASSERT(
498  (0 <= portNum) && (portNum < this->getNum_logOut_OutputPorts()),
499  static_cast<FwAssertArgType>(portNum)
500  );
501 
502  this->m_logOut_OutputPort[portNum].registerSerialPort(port);
503  }
504 
505 #if FW_ENABLE_TEXT_LOGGING == 1
506 
507  void CcsdsSdlsDeframerComponentBase ::
508  set_logTextOut_OutputPort(
509  FwIndexType portNum,
510  Fw::InputSerializePort* port
511  )
512  {
513  FW_ASSERT(
514  (0 <= portNum) && (portNum < this->getNum_logTextOut_OutputPorts()),
515  static_cast<FwAssertArgType>(portNum)
516  );
517 
518  this->m_logTextOut_OutputPort[portNum].registerSerialPort(port);
519  }
520 
521 #endif
522 
525  FwIndexType portNum,
526  Fw::InputSerializePort* port
527  )
528  {
529  FW_ASSERT(
530  (0 <= portNum) && (portNum < this->getNum_timeCaller_OutputPorts()),
531  static_cast<FwAssertArgType>(portNum)
532  );
533 
534  this->m_timeCaller_OutputPort[portNum].registerSerialPort(port);
535  }
536 
537 #endif
538 
539 #if !FW_DIRECT_PORT_CALLS && FW_PORT_SERIALIZATION
540 
541  // ----------------------------------------------------------------------
542  // Connect serial input ports to typed output ports
543  // ----------------------------------------------------------------------
544 
547  FwIndexType portNum,
548  Fw::InputSerializePort* port
549  )
550  {
551  FW_ASSERT(
552  (0 <= portNum) && (portNum < this->getNum_dataOut_OutputPorts()),
553  static_cast<FwAssertArgType>(portNum)
554  );
555 
556  this->m_dataOut_OutputPort[portNum].registerSerialPort(port);
557  }
558 
561  FwIndexType portNum,
562  Fw::InputSerializePort* port
563  )
564  {
565  FW_ASSERT(
566  (0 <= portNum) && (portNum < this->getNum_dataReturnOut_OutputPorts()),
567  static_cast<FwAssertArgType>(portNum)
568  );
569 
570  this->m_dataReturnOut_OutputPort[portNum].registerSerialPort(port);
571  }
572 
575  FwIndexType portNum,
576  Fw::InputSerializePort* port
577  )
578  {
579  FW_ASSERT(
580  (0 <= portNum) && (portNum < this->getNum_decryptOut_OutputPorts()),
581  static_cast<FwAssertArgType>(portNum)
582  );
583 
584  this->m_decryptOut_OutputPort[portNum].registerSerialPort(port);
585  }
586 
589  FwIndexType portNum,
590  Fw::InputSerializePort* port
591  )
592  {
593  FW_ASSERT(
594  (0 <= portNum) && (portNum < this->getNum_decryptReturnOut_OutputPorts()),
595  static_cast<FwAssertArgType>(portNum)
596  );
597 
598  this->m_decryptReturnOut_OutputPort[portNum].registerSerialPort(port);
599  }
600 
603  FwIndexType portNum,
604  Fw::InputSerializePort* port
605  )
606  {
607  FW_ASSERT(
608  (0 <= portNum) && (portNum < this->getNum_errorNotify_OutputPorts()),
609  static_cast<FwAssertArgType>(portNum)
610  );
611 
612  this->m_errorNotify_OutputPort[portNum].registerSerialPort(port);
613  }
614 
615 #endif
616 
617  // ----------------------------------------------------------------------
618  // Component construction and destruction
619  // ----------------------------------------------------------------------
620 
622  CcsdsSdlsDeframerComponentBase(const char* compName) :
623  Fw::PassiveComponentBase(compName)
624  {
625 
626  }
627 
630  {
631 
632  }
633 
634 #if !FW_DIRECT_PORT_CALLS
635 
636  // ----------------------------------------------------------------------
637  // Connection status queries for special output ports
638  // ----------------------------------------------------------------------
639 
642  {
643  FW_ASSERT(
644  (0 <= portNum) && (portNum < this->getNum_logOut_OutputPorts()),
645  static_cast<FwAssertArgType>(portNum)
646  );
647 
648  return this->m_logOut_OutputPort[portNum].isConnected();
649  }
650 
651 #if FW_ENABLE_TEXT_LOGGING == 1
652 
653  bool CcsdsSdlsDeframerComponentBase ::
654  isConnected_logTextOut_OutputPort(FwIndexType portNum) const
655  {
656  FW_ASSERT(
657  (0 <= portNum) && (portNum < this->getNum_logTextOut_OutputPorts()),
658  static_cast<FwAssertArgType>(portNum)
659  );
660 
661  return this->m_logTextOut_OutputPort[portNum].isConnected();
662  }
663 
664 #endif
665 
668  {
669  FW_ASSERT(
670  (0 <= portNum) && (portNum < this->getNum_timeCaller_OutputPorts()),
671  static_cast<FwAssertArgType>(portNum)
672  );
673 
674  return this->m_timeCaller_OutputPort[portNum].isConnected();
675  }
676 
677 #endif
678 
679 #if !FW_DIRECT_PORT_CALLS
680 
681  // ----------------------------------------------------------------------
682  // Connection status queries for typed output ports
683  // ----------------------------------------------------------------------
684 
687  {
688  FW_ASSERT(
689  (0 <= portNum) && (portNum < this->getNum_dataOut_OutputPorts()),
690  static_cast<FwAssertArgType>(portNum)
691  );
692 
693  return this->m_dataOut_OutputPort[portNum].isConnected();
694  }
695 
698  {
699  FW_ASSERT(
700  (0 <= portNum) && (portNum < this->getNum_dataReturnOut_OutputPorts()),
701  static_cast<FwAssertArgType>(portNum)
702  );
703 
704  return this->m_dataReturnOut_OutputPort[portNum].isConnected();
705  }
706 
709  {
710  FW_ASSERT(
711  (0 <= portNum) && (portNum < this->getNum_decryptOut_OutputPorts()),
712  static_cast<FwAssertArgType>(portNum)
713  );
714 
715  return this->m_decryptOut_OutputPort[portNum].isConnected();
716  }
717 
720  {
721  FW_ASSERT(
722  (0 <= portNum) && (portNum < this->getNum_decryptReturnOut_OutputPorts()),
723  static_cast<FwAssertArgType>(portNum)
724  );
725 
726  return this->m_decryptReturnOut_OutputPort[portNum].isConnected();
727  }
728 
731  {
732  FW_ASSERT(
733  (0 <= portNum) && (portNum < this->getNum_errorNotify_OutputPorts()),
734  static_cast<FwAssertArgType>(portNum)
735  );
736 
737  return this->m_errorNotify_OutputPort[portNum].isConnected();
738  }
739 
740 #endif
741 
742  // ----------------------------------------------------------------------
743  // Port handler base-class functions for typed input ports
744  //
745  // Call these functions directly to bypass the corresponding ports
746  // ----------------------------------------------------------------------
747 
750  FwIndexType portNum,
751  Fw::Buffer& data,
752  const ComCfg::FrameContext& context
753  )
754  {
755  // Make sure port number is valid
756  FW_ASSERT(
757  (0 <= portNum) && (portNum < this->getNum_bufferReturnIn_InputPorts()),
758  static_cast<FwAssertArgType>(portNum)
759  );
760 
761  // Call handler function
763  portNum,
764  data,
765  context
766  );
767  }
768 
771  FwIndexType portNum,
772  Fw::Buffer& data,
773  const ComCfg::FrameContext& context
774  )
775  {
776  // Make sure port number is valid
777  FW_ASSERT(
778  (0 <= portNum) && (portNum < this->getNum_dataIn_InputPorts()),
779  static_cast<FwAssertArgType>(portNum)
780  );
781 
782  // Lock guard mutex before calling
783  this->lock();
784 
785  // Call handler function
786  this->dataIn_handler(
787  portNum,
788  data,
789  context
790  );
791 
792  // Unlock guard mutex
793  this->unLock();
794  }
795 
798  FwIndexType portNum,
799  Fw::Buffer& data,
800  const ComCfg::FrameContext& context
801  )
802  {
803  // Make sure port number is valid
804  FW_ASSERT(
805  (0 <= portNum) && (portNum < this->getNum_dataReturnIn_InputPorts()),
806  static_cast<FwAssertArgType>(portNum)
807  );
808 
809  // Call handler function
810  this->dataReturnIn_handler(
811  portNum,
812  data,
813  context
814  );
815  }
816 
819  FwIndexType portNum,
820  const Svc::Ccsds::SdlsStatus& status,
821  Fw::Buffer& data,
822  const ComCfg::FrameContext& context
823  )
824  {
825  // Make sure port number is valid
826  FW_ASSERT(
827  (0 <= portNum) && (portNum < this->getNum_decryptIn_InputPorts()),
828  static_cast<FwAssertArgType>(portNum)
829  );
830 
831  // Call handler function
832  this->decryptIn_handler(
833  portNum,
834  status,
835  data,
836  context
837  );
838  }
839 
840 #if !FW_DIRECT_PORT_CALLS
841 
842  // ----------------------------------------------------------------------
843  // Invocation functions for typed output ports
844  // ----------------------------------------------------------------------
845 
848  FwIndexType portNum,
849  Fw::Buffer& data,
850  const ComCfg::FrameContext& context
851  ) const
852  {
853  FW_ASSERT(
854  (0 <= portNum) && (portNum < this->getNum_dataOut_OutputPorts()),
855  static_cast<FwAssertArgType>(portNum)
856  );
857 
858  FW_ASSERT(
859  this->m_dataOut_OutputPort[portNum].isConnected(),
860  static_cast<FwAssertArgType>(portNum)
861  );
862  this->m_dataOut_OutputPort[portNum].invoke(
863  data,
864  context
865  );
866  }
867 
870  FwIndexType portNum,
871  Fw::Buffer& data,
872  const ComCfg::FrameContext& context
873  ) const
874  {
875  FW_ASSERT(
876  (0 <= portNum) && (portNum < this->getNum_dataReturnOut_OutputPorts()),
877  static_cast<FwAssertArgType>(portNum)
878  );
879 
880  FW_ASSERT(
881  this->m_dataReturnOut_OutputPort[portNum].isConnected(),
882  static_cast<FwAssertArgType>(portNum)
883  );
884  this->m_dataReturnOut_OutputPort[portNum].invoke(
885  data,
886  context
887  );
888  }
889 
892  FwIndexType portNum,
893  U16 securityAssociationIndex,
894  Fw::Buffer& data,
895  const ComCfg::FrameContext& context
896  ) const
897  {
898  FW_ASSERT(
899  (0 <= portNum) && (portNum < this->getNum_decryptOut_OutputPorts()),
900  static_cast<FwAssertArgType>(portNum)
901  );
902 
903  FW_ASSERT(
904  this->m_decryptOut_OutputPort[portNum].isConnected(),
905  static_cast<FwAssertArgType>(portNum)
906  );
907  this->m_decryptOut_OutputPort[portNum].invoke(
908  securityAssociationIndex,
909  data,
910  context
911  );
912  }
913 
916  FwIndexType portNum,
917  Fw::Buffer& data,
918  const ComCfg::FrameContext& context
919  ) const
920  {
921  FW_ASSERT(
922  (0 <= portNum) && (portNum < this->getNum_decryptReturnOut_OutputPorts()),
923  static_cast<FwAssertArgType>(portNum)
924  );
925 
926  FW_ASSERT(
927  this->m_decryptReturnOut_OutputPort[portNum].isConnected(),
928  static_cast<FwAssertArgType>(portNum)
929  );
930  this->m_decryptReturnOut_OutputPort[portNum].invoke(
931  data,
932  context
933  );
934  }
935 
938  FwIndexType portNum,
939  const Svc::Ccsds::FrameError& errorCode
940  ) const
941  {
942  FW_ASSERT(
943  (0 <= portNum) && (portNum < this->getNum_errorNotify_OutputPorts()),
944  static_cast<FwAssertArgType>(portNum)
945  );
946 
947  FW_ASSERT(
948  this->m_errorNotify_OutputPort[portNum].isConnected(),
949  static_cast<FwAssertArgType>(portNum)
950  );
951  this->m_errorNotify_OutputPort[portNum].invoke(
952  errorCode
953  );
954  }
955 
956 #endif
957 
958  // ----------------------------------------------------------------------
959  // Event logging functions
960  // ----------------------------------------------------------------------
961 
964  {
965  // Get the time
966  Fw::Time _logTime;
967  if (this->isConnected_timeCaller_OutputPort(0)) {
968  this->timeCaller_out(0, _logTime);
969  }
970 
971  const FwEventIdType _id = this->getIdBase() + EVENTID_INSUFFICIENTLENGTH;
972 
973  // Emit the event on the log port
974  if (this->isConnected_logOut_OutputPort(0)) {
975  Fw::LogBuffer _logBuff;
976 
977 #if FW_AMPCS_COMPATIBLE
979  // Serialize the number of arguments
980  _status = _logBuff.serializeFrom(static_cast<U8>(0));
981  FW_ASSERT(
982  _status == Fw::FW_SERIALIZE_OK,
983  static_cast<FwAssertArgType>(_status)
984  );
985 #endif
986 
987  this->logOut_out(
988  0,
989  _id,
990  _logTime,
992  _logBuff
993  );
994  }
995 
996  // Emit the event on the text log port
997 #if FW_ENABLE_TEXT_LOGGING
998  if (this->isConnected_logTextOut_OutputPort(0)) {
999 #if FW_OBJECT_NAMES == 1
1000  const char* _formatString =
1001  "(%s) %s: Failed to deframe security association index: insufficient length";
1002 #else
1003  const char* _formatString =
1004  "%s: Failed to deframe security association index: insufficient length";
1005 #endif
1006 
1007  Fw::TextLogString _logString;
1008  (void) _logString.format(
1009  _formatString,
1010 #if FW_OBJECT_NAMES == 1
1011  this->m_objName.toChar(),
1012 #endif
1013  "InsufficientLength "
1014  );
1015 
1016  this->logTextOut_out(
1017  0,
1018  _id,
1019  _logTime,
1021  _logString
1022  );
1023  }
1024 #endif
1025  }
1026 
1029  {
1030  // Get the time
1031  Fw::Time _logTime;
1032  if (this->isConnected_timeCaller_OutputPort(0)) {
1033  this->timeCaller_out(0, _logTime);
1034  }
1035 
1036  const FwEventIdType _id = this->getIdBase() + EVENTID_DECRYPTIONFAILED;
1037 
1038  // Emit the event on the log port
1039  if (this->isConnected_logOut_OutputPort(0)) {
1040  Fw::LogBuffer _logBuff;
1042 
1043 #if FW_AMPCS_COMPATIBLE
1044  // Serialize the number of arguments
1045  _status = _logBuff.serializeFrom(static_cast<U8>(1));
1046  FW_ASSERT(
1047  _status == Fw::FW_SERIALIZE_OK,
1048  static_cast<FwAssertArgType>(_status)
1049  );
1050 #endif
1051 
1052 #if FW_AMPCS_COMPATIBLE
1053  // Serialize the argument size
1054  _status = _logBuff.serializeFrom(
1056  );
1057  FW_ASSERT(
1058  _status == Fw::FW_SERIALIZE_OK,
1059  static_cast<FwAssertArgType>(_status)
1060  );
1061 #endif
1062  _status = _logBuff.serializeFrom(status);
1063  FW_ASSERT(
1064  _status == Fw::FW_SERIALIZE_OK,
1065  static_cast<FwAssertArgType>(_status)
1066  );
1067 
1068  this->logOut_out(
1069  0,
1070  _id,
1071  _logTime,
1073  _logBuff
1074  );
1075  }
1076 
1077  // Emit the event on the text log port
1078 #if FW_ENABLE_TEXT_LOGGING
1079  if (this->isConnected_logTextOut_OutputPort(0)) {
1080 #if FW_OBJECT_NAMES == 1
1081  const char* _formatString =
1082  "(%s) %s: Failed to decrypt frame: %s";
1083 #else
1084  const char* _formatString =
1085  "%s: Failed to decrypt frame: %s";
1086 #endif
1087 
1088  Fw::String statusStr;
1089  status.toString(statusStr);
1090 
1091  Fw::TextLogString _logString;
1092  (void) _logString.format(
1093  _formatString,
1094 #if FW_OBJECT_NAMES == 1
1095  this->m_objName.toChar(),
1096 #endif
1097  "DecryptionFailed ",
1098  statusStr.toChar()
1099  );
1100 
1101  this->logTextOut_out(
1102  0,
1103  _id,
1104  _logTime,
1106  _logString
1107  );
1108  }
1109 #endif
1110  }
1111 
1112  // ----------------------------------------------------------------------
1113  // Time
1114  // ----------------------------------------------------------------------
1115 
1117  getTime() const
1118  {
1119  if (this->isConnected_timeCaller_OutputPort(0)) {
1120  Fw::Time _time;
1121  this->timeCaller_out(0, _time);
1122  return _time;
1123  }
1124  else {
1125  return Fw::Time(TimeBase::TB_NONE, 0, 0);
1126  }
1127  }
1128 
1129  // ----------------------------------------------------------------------
1130  // Mutex operations for guarded ports
1131  //
1132  // You can override these operations to provide more sophisticated
1133  // synchronization
1134  // ----------------------------------------------------------------------
1135 
1138  {
1139  this->m_guardedPortMutex.lock();
1140  }
1141 
1144  {
1145  this->m_guardedPortMutex.unLock();
1146  }
1147 
1148  // ----------------------------------------------------------------------
1149  // Calls for messages received on typed input ports
1150  // ----------------------------------------------------------------------
1151 
1152  void CcsdsSdlsDeframerComponentBase ::
1153  m_p_bufferReturnIn_in(
1154  Fw::PassiveComponentBase* callComp,
1155  FwIndexType portNum,
1156  Fw::Buffer& data,
1157  const ComCfg::FrameContext& context
1158  )
1159  {
1160  FW_ASSERT(callComp != nullptr);
1161  CcsdsSdlsDeframerComponentBase* compPtr = static_cast<CcsdsSdlsDeframerComponentBase*>(callComp);
1162  compPtr->bufferReturnIn_handlerBase(
1163  portNum,
1164  data,
1165  context
1166  );
1167  }
1168 
1169  void CcsdsSdlsDeframerComponentBase ::
1170  m_p_dataIn_in(
1171  Fw::PassiveComponentBase* callComp,
1172  FwIndexType portNum,
1173  Fw::Buffer& data,
1174  const ComCfg::FrameContext& context
1175  )
1176  {
1177  FW_ASSERT(callComp != nullptr);
1178  CcsdsSdlsDeframerComponentBase* compPtr = static_cast<CcsdsSdlsDeframerComponentBase*>(callComp);
1179  compPtr->dataIn_handlerBase(
1180  portNum,
1181  data,
1182  context
1183  );
1184  }
1185 
1186  void CcsdsSdlsDeframerComponentBase ::
1187  m_p_dataReturnIn_in(
1188  Fw::PassiveComponentBase* callComp,
1189  FwIndexType portNum,
1190  Fw::Buffer& data,
1191  const ComCfg::FrameContext& context
1192  )
1193  {
1194  FW_ASSERT(callComp != nullptr);
1195  CcsdsSdlsDeframerComponentBase* compPtr = static_cast<CcsdsSdlsDeframerComponentBase*>(callComp);
1196  compPtr->dataReturnIn_handlerBase(
1197  portNum,
1198  data,
1199  context
1200  );
1201  }
1202 
1203  void CcsdsSdlsDeframerComponentBase ::
1204  m_p_decryptIn_in(
1205  Fw::PassiveComponentBase* callComp,
1206  FwIndexType portNum,
1207  const Svc::Ccsds::SdlsStatus& status,
1208  Fw::Buffer& data,
1209  const ComCfg::FrameContext& context
1210  )
1211  {
1212  FW_ASSERT(callComp != nullptr);
1213  CcsdsSdlsDeframerComponentBase* compPtr = static_cast<CcsdsSdlsDeframerComponentBase*>(callComp);
1214  compPtr->decryptIn_handlerBase(
1215  portNum,
1216  status,
1217  data,
1218  context
1219  );
1220  }
1221 
1222 #if !FW_DIRECT_PORT_CALLS
1223 
1224  // ----------------------------------------------------------------------
1225  // Invocation functions for special output ports
1226  // ----------------------------------------------------------------------
1227 
1228  void CcsdsSdlsDeframerComponentBase ::
1229  logOut_out(
1230  FwIndexType portNum,
1231  FwEventIdType id,
1232  Fw::Time& timeTag,
1233  const Fw::LogSeverity& severity,
1234  Fw::LogBuffer& args
1235  ) const
1236  {
1237  FW_ASSERT(
1238  (0 <= portNum) && (portNum < this->getNum_logOut_OutputPorts()),
1239  static_cast<FwAssertArgType>(portNum)
1240  );
1241 
1242  FW_ASSERT(
1243  this->m_logOut_OutputPort[portNum].isConnected(),
1244  static_cast<FwAssertArgType>(portNum)
1245  );
1246  this->m_logOut_OutputPort[portNum].invoke(
1247  id,
1248  timeTag,
1249  severity,
1250  args
1251  );
1252  }
1253 
1254 #if FW_ENABLE_TEXT_LOGGING
1255 
1256  void CcsdsSdlsDeframerComponentBase ::
1257  logTextOut_out(
1258  FwIndexType portNum,
1259  FwEventIdType id,
1260  Fw::Time& timeTag,
1261  const Fw::LogSeverity& severity,
1262  Fw::TextLogString& text
1263  ) const
1264  {
1265  FW_ASSERT(
1266  (0 <= portNum) && (portNum < this->getNum_logTextOut_OutputPorts()),
1267  static_cast<FwAssertArgType>(portNum)
1268  );
1269 
1270  FW_ASSERT(
1271  this->m_logTextOut_OutputPort[portNum].isConnected(),
1272  static_cast<FwAssertArgType>(portNum)
1273  );
1274  this->m_logTextOut_OutputPort[portNum].invoke(
1275  id,
1276  timeTag,
1277  severity,
1278  text
1279  );
1280  }
1281 
1282 #endif
1283 
1284  void CcsdsSdlsDeframerComponentBase ::
1285  timeCaller_out(
1286  FwIndexType portNum,
1287  Fw::Time& time
1288  ) const
1289  {
1290  FW_ASSERT(
1291  (0 <= portNum) && (portNum < this->getNum_timeCaller_OutputPorts()),
1292  static_cast<FwAssertArgType>(portNum)
1293  );
1294 
1295  FW_ASSERT(
1296  this->m_timeCaller_OutputPort[portNum].isConnected(),
1297  static_cast<FwAssertArgType>(portNum)
1298  );
1299  this->m_timeCaller_OutputPort[portNum].invoke(
1300  time
1301  );
1302  }
1303 
1304 #endif
1305 
1306  }
1307 
1308 }
Serialization/Deserialization operation was successful.
void addCallPort(InputTimePort *callPort)
Register an input port.
Definition: TimePortAc.cpp:157
static constexpr FwIndexType getNum_decryptReturnOut_OutputPorts()
bool isConnected_errorNotify_OutputPort(FwIndexType portNum) const
bool isConnected_decryptOut_OutputPort(FwIndexType portNum) const
bool isConnected_dataOut_OutputPort(FwIndexType portNum) const
I32 FwEnumStoreType
void init()
Initialization function.
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.
void invoke(U16 securityAssociationIndex, Fw::Buffer &data, const ComCfg::FrameContext &context) const
Invoke a port connection.
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
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
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 addCallPort(InputCcsdsSdlsEncryptionPort *callPort)
Register an input port.
No time base has been established (Required)
SerializeStatus serializeFrom(U8 val, Endianness mode=Endianness::BIG) override
Serialize an 8-bit unsigned integer value.
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].
void addCallPort(InputComDataWithContextPort *callPort)
Register an input port.
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.
SerializeStatus
forward declaration for string
void decryptOut_out(FwIndexType portNum, U16 securityAssociationIndex, Fw::Buffer &data, const ComCfg::FrameContext &context) const
Invoke output port decryptOut.
void addCallPort(InputErrorNotifyPort *callPort)
Register an input port.
void init()
Initialization function.
FwIdType FwEventIdType
The type of an event identifier.
#define FW_OBJECT_NAMES
Indicates whether or not object names are stored (more memory, can be used for tracking objects) ...
Definition: FpConfig.h:40
bool isConnected_dataReturnOut_OutputPort(FwIndexType portNum) const
void init()
Initialization function.
Definition: TimePortAc.cpp:151
void invoke(const Svc::Ccsds::FrameError &errorCode) const
Invoke a port connection.
Svc::InputComDataWithContextPort * get_bufferReturnIn_InputPort(FwIndexType portNum)
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
void invoke(Fw::Time &time) const
Invoke a port connection.
Definition: TimePortAc.cpp:170
void unLock()
unlock the mutex and assert success
virtual ~CcsdsSdlsDeframerComponentBase()
Destroy CcsdsSdlsDeframerComponentBase object.
void invoke(Fw::Buffer &data, const ComCfg::FrameContext &context) const
Invoke a port connection.
void errorNotify_out(FwIndexType portNum, const Svc::Ccsds::FrameError &errorCode) const
Invoke output port errorNotify.
A serious but recoverable event.
void init()
Initialization function.
const char * toChar() const
Convert to a C-style char*.
bool isConnected() const
Definition: PortBase.cpp:38
Enum representing event severity.
#define PRI_FwIndexType
FormatStatus format(const CHAR *formatString,...)
write formatted string to buffer
Definition: StringBase.cpp:58
void init()
Initialization function.
Definition: LogPortAc.cpp:180
void setPortNum(FwIndexType portNum)
void lock()
lock the mutex and assert success
void init()
Initialization function.
void set_errorNotify_OutputPort(FwIndexType portNum, Svc::Ccsds::InputErrorNotifyPort *port)
Connect port to errorNotify[portNum].
void invoke(FwEventIdType id, Fw::Time &timeTag, const Fw::LogSeverity &severity, Fw::LogBuffer &args) const
Invoke a port connection.
Definition: LogPortAc.cpp:199
void dataReturnOut_out(FwIndexType portNum, Fw::Buffer &data, const ComCfg::FrameContext &context) const
Invoke output port dataReturnOut.
PlatformIndexType FwIndexType
void addCallPort(InputLogPort *callPort)
Register an input port.
Definition: LogPortAc.cpp:186
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.
The size of the serial representation.
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.
Implementation of malloc based allocator.
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)
#define FW_ASSERT(...)
Definition: Assert.hpp:14
Event raised when the frame is not long enough for the security association index of 16bits...