F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
CcsdsSdlsFramerComponentAc.cpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title CcsdsSdlsFramerComponentAc.cpp
3 // \author Generated by fpp-to-cpp
4 // \brief cpp file for CcsdsSdlsFramer component base class
5 // ======================================================================
6 
7 #include "Fw/Prm/ParamValid.hpp"
8 #include "Fw/Types/Assert.hpp"
10 #if FW_ENABLE_TEXT_LOGGING
11 #include "Fw/Types/String.hpp"
12 #endif
14 
15 namespace Svc {
16 
17  namespace Ccsds {
18 
19  // ----------------------------------------------------------------------
20  // Component initialization
21  // ----------------------------------------------------------------------
22 
25  {
26  // Initialize base class
28 
29 #if !FW_DIRECT_PORT_CALLS
30  // Connect input port cmdIn
31  for (
32  FwIndexType port = 0;
33  port < static_cast<FwIndexType>(this->getNum_cmdIn_InputPorts());
34  port++
35  ) {
36  this->m_cmdIn_InputPort[port].init();
37  this->m_cmdIn_InputPort[port].addCallComp(
38  this,
39  m_p_cmdIn_in
40  );
41  this->m_cmdIn_InputPort[port].setPortNum(port);
42 
43 #if FW_OBJECT_NAMES == 1
44  Fw::ObjectName portName;
45  portName.format(
46  "%s_cmdIn_InputPort[%" PRI_FwIndexType "]",
47  this->m_objName.toChar(),
48  port
49  );
50  this->m_cmdIn_InputPort[port].setObjName(portName.toChar());
51 #endif
52  }
53 #endif
54 
55 #if !FW_DIRECT_PORT_CALLS
56  // Connect input port bufferReturnIn
57  for (
58  FwIndexType port = 0;
59  port < static_cast<FwIndexType>(this->getNum_bufferReturnIn_InputPorts());
60  port++
61  ) {
62  this->m_bufferReturnIn_InputPort[port].init();
63  this->m_bufferReturnIn_InputPort[port].addCallComp(
64  this,
65  m_p_bufferReturnIn_in
66  );
67  this->m_bufferReturnIn_InputPort[port].setPortNum(port);
68 
69 #if FW_OBJECT_NAMES == 1
70  Fw::ObjectName portName;
71  portName.format(
72  "%s_bufferReturnIn_InputPort[%" PRI_FwIndexType "]",
73  this->m_objName.toChar(),
74  port
75  );
76  this->m_bufferReturnIn_InputPort[port].setObjName(portName.toChar());
77 #endif
78  }
79 #endif
80 
81 #if !FW_DIRECT_PORT_CALLS
82  // Connect input port comStatusIn
83  for (
84  FwIndexType port = 0;
85  port < static_cast<FwIndexType>(this->getNum_comStatusIn_InputPorts());
86  port++
87  ) {
88  this->m_comStatusIn_InputPort[port].init();
89  this->m_comStatusIn_InputPort[port].addCallComp(
90  this,
91  m_p_comStatusIn_in
92  );
93  this->m_comStatusIn_InputPort[port].setPortNum(port);
94 
95 #if FW_OBJECT_NAMES == 1
96  Fw::ObjectName portName;
97  portName.format(
98  "%s_comStatusIn_InputPort[%" PRI_FwIndexType "]",
99  this->m_objName.toChar(),
100  port
101  );
102  this->m_comStatusIn_InputPort[port].setObjName(portName.toChar());
103 #endif
104  }
105 #endif
106 
107 #if !FW_DIRECT_PORT_CALLS
108  // Connect input port dataIn
109  for (
110  FwIndexType port = 0;
111  port < static_cast<FwIndexType>(this->getNum_dataIn_InputPorts());
112  port++
113  ) {
114  this->m_dataIn_InputPort[port].init();
115  this->m_dataIn_InputPort[port].addCallComp(
116  this,
117  m_p_dataIn_in
118  );
119  this->m_dataIn_InputPort[port].setPortNum(port);
120 
121 #if FW_OBJECT_NAMES == 1
122  Fw::ObjectName portName;
123  portName.format(
124  "%s_dataIn_InputPort[%" PRI_FwIndexType "]",
125  this->m_objName.toChar(),
126  port
127  );
128  this->m_dataIn_InputPort[port].setObjName(portName.toChar());
129 #endif
130  }
131 #endif
132 
133 #if !FW_DIRECT_PORT_CALLS
134  // Connect input port dataReturnIn
135  for (
136  FwIndexType port = 0;
137  port < static_cast<FwIndexType>(this->getNum_dataReturnIn_InputPorts());
138  port++
139  ) {
140  this->m_dataReturnIn_InputPort[port].init();
141  this->m_dataReturnIn_InputPort[port].addCallComp(
142  this,
143  m_p_dataReturnIn_in
144  );
145  this->m_dataReturnIn_InputPort[port].setPortNum(port);
146 
147 #if FW_OBJECT_NAMES == 1
148  Fw::ObjectName portName;
149  portName.format(
150  "%s_dataReturnIn_InputPort[%" PRI_FwIndexType "]",
151  this->m_objName.toChar(),
152  port
153  );
154  this->m_dataReturnIn_InputPort[port].setObjName(portName.toChar());
155 #endif
156  }
157 #endif
158 
159 #if !FW_DIRECT_PORT_CALLS
160  // Connect input port encryptIn
161  for (
162  FwIndexType port = 0;
163  port < static_cast<FwIndexType>(this->getNum_encryptIn_InputPorts());
164  port++
165  ) {
166  this->m_encryptIn_InputPort[port].init();
167  this->m_encryptIn_InputPort[port].addCallComp(
168  this,
169  m_p_encryptIn_in
170  );
171  this->m_encryptIn_InputPort[port].setPortNum(port);
172 
173 #if FW_OBJECT_NAMES == 1
174  Fw::ObjectName portName;
175  portName.format(
176  "%s_encryptIn_InputPort[%" PRI_FwIndexType "]",
177  this->m_objName.toChar(),
178  port
179  );
180  this->m_encryptIn_InputPort[port].setObjName(portName.toChar());
181 #endif
182  }
183 #endif
184 
185 #if !FW_DIRECT_PORT_CALLS
186  // Connect output port cmdRegOut
187  for (
188  FwIndexType port = 0;
189  port < static_cast<FwIndexType>(this->getNum_cmdRegOut_OutputPorts());
190  port++
191  ) {
192  this->m_cmdRegOut_OutputPort[port].init();
193 
194 #if FW_OBJECT_NAMES == 1
195  Fw::ObjectName portName;
196  portName.format(
197  "%s_cmdRegOut_OutputPort[%" PRI_FwIndexType "]",
198  this->m_objName.toChar(),
199  port
200  );
201  this->m_cmdRegOut_OutputPort[port].setObjName(portName.toChar());
202 #endif
203  }
204 #endif
205 
206 #if !FW_DIRECT_PORT_CALLS
207  // Connect output port cmdResponseOut
208  for (
209  FwIndexType port = 0;
210  port < static_cast<FwIndexType>(this->getNum_cmdResponseOut_OutputPorts());
211  port++
212  ) {
213  this->m_cmdResponseOut_OutputPort[port].init();
214 
215 #if FW_OBJECT_NAMES == 1
216  Fw::ObjectName portName;
217  portName.format(
218  "%s_cmdResponseOut_OutputPort[%" PRI_FwIndexType "]",
219  this->m_objName.toChar(),
220  port
221  );
222  this->m_cmdResponseOut_OutputPort[port].setObjName(portName.toChar());
223 #endif
224  }
225 #endif
226 
227 #if !FW_DIRECT_PORT_CALLS
228  // Connect output port logOut
229  for (
230  FwIndexType port = 0;
231  port < static_cast<FwIndexType>(this->getNum_logOut_OutputPorts());
232  port++
233  ) {
234  this->m_logOut_OutputPort[port].init();
235 
236 #if FW_OBJECT_NAMES == 1
237  Fw::ObjectName portName;
238  portName.format(
239  "%s_logOut_OutputPort[%" PRI_FwIndexType "]",
240  this->m_objName.toChar(),
241  port
242  );
243  this->m_logOut_OutputPort[port].setObjName(portName.toChar());
244 #endif
245  }
246 #endif
247 
248 #if !FW_DIRECT_PORT_CALLS && FW_ENABLE_TEXT_LOGGING
249  // Connect output port logTextOut
250  for (
251  FwIndexType port = 0;
252  port < static_cast<FwIndexType>(this->getNum_logTextOut_OutputPorts());
253  port++
254  ) {
255  this->m_logTextOut_OutputPort[port].init();
256 
257 #if FW_OBJECT_NAMES == 1
258  Fw::ObjectName portName;
259  portName.format(
260  "%s_logTextOut_OutputPort[%" PRI_FwIndexType "]",
261  this->m_objName.toChar(),
262  port
263  );
264  this->m_logTextOut_OutputPort[port].setObjName(portName.toChar());
265 #endif
266  }
267 #endif
268 
269 #if !FW_DIRECT_PORT_CALLS
270  // Connect output port prmGetOut
271  for (
272  FwIndexType port = 0;
273  port < static_cast<FwIndexType>(this->getNum_prmGetOut_OutputPorts());
274  port++
275  ) {
276  this->m_prmGetOut_OutputPort[port].init();
277 
278 #if FW_OBJECT_NAMES == 1
279  Fw::ObjectName portName;
280  portName.format(
281  "%s_prmGetOut_OutputPort[%" PRI_FwIndexType "]",
282  this->m_objName.toChar(),
283  port
284  );
285  this->m_prmGetOut_OutputPort[port].setObjName(portName.toChar());
286 #endif
287  }
288 #endif
289 
290 #if !FW_DIRECT_PORT_CALLS
291  // Connect output port prmSetOut
292  for (
293  FwIndexType port = 0;
294  port < static_cast<FwIndexType>(this->getNum_prmSetOut_OutputPorts());
295  port++
296  ) {
297  this->m_prmSetOut_OutputPort[port].init();
298 
299 #if FW_OBJECT_NAMES == 1
300  Fw::ObjectName portName;
301  portName.format(
302  "%s_prmSetOut_OutputPort[%" PRI_FwIndexType "]",
303  this->m_objName.toChar(),
304  port
305  );
306  this->m_prmSetOut_OutputPort[port].setObjName(portName.toChar());
307 #endif
308  }
309 #endif
310 
311 #if !FW_DIRECT_PORT_CALLS
312  // Connect output port timeCaller
313  for (
314  FwIndexType port = 0;
315  port < static_cast<FwIndexType>(this->getNum_timeCaller_OutputPorts());
316  port++
317  ) {
318  this->m_timeCaller_OutputPort[port].init();
319 
320 #if FW_OBJECT_NAMES == 1
321  Fw::ObjectName portName;
322  portName.format(
323  "%s_timeCaller_OutputPort[%" PRI_FwIndexType "]",
324  this->m_objName.toChar(),
325  port
326  );
327  this->m_timeCaller_OutputPort[port].setObjName(portName.toChar());
328 #endif
329  }
330 #endif
331 
332 #if !FW_DIRECT_PORT_CALLS
333  // Connect output port bufferAllocate
334  for (
335  FwIndexType port = 0;
336  port < static_cast<FwIndexType>(this->getNum_bufferAllocate_OutputPorts());
337  port++
338  ) {
339  this->m_bufferAllocate_OutputPort[port].init();
340 
341 #if FW_OBJECT_NAMES == 1
342  Fw::ObjectName portName;
343  portName.format(
344  "%s_bufferAllocate_OutputPort[%" PRI_FwIndexType "]",
345  this->m_objName.toChar(),
346  port
347  );
348  this->m_bufferAllocate_OutputPort[port].setObjName(portName.toChar());
349 #endif
350  }
351 #endif
352 
353 #if !FW_DIRECT_PORT_CALLS
354  // Connect output port bufferDeallocate
355  for (
356  FwIndexType port = 0;
357  port < static_cast<FwIndexType>(this->getNum_bufferDeallocate_OutputPorts());
358  port++
359  ) {
360  this->m_bufferDeallocate_OutputPort[port].init();
361 
362 #if FW_OBJECT_NAMES == 1
363  Fw::ObjectName portName;
364  portName.format(
365  "%s_bufferDeallocate_OutputPort[%" PRI_FwIndexType "]",
366  this->m_objName.toChar(),
367  port
368  );
369  this->m_bufferDeallocate_OutputPort[port].setObjName(portName.toChar());
370 #endif
371  }
372 #endif
373 
374 #if !FW_DIRECT_PORT_CALLS
375  // Connect output port comStatusOut
376  for (
377  FwIndexType port = 0;
378  port < static_cast<FwIndexType>(this->getNum_comStatusOut_OutputPorts());
379  port++
380  ) {
381  this->m_comStatusOut_OutputPort[port].init();
382 
383 #if FW_OBJECT_NAMES == 1
384  Fw::ObjectName portName;
385  portName.format(
386  "%s_comStatusOut_OutputPort[%" PRI_FwIndexType "]",
387  this->m_objName.toChar(),
388  port
389  );
390  this->m_comStatusOut_OutputPort[port].setObjName(portName.toChar());
391 #endif
392  }
393 #endif
394 
395 #if !FW_DIRECT_PORT_CALLS
396  // Connect output port dataOut
397  for (
398  FwIndexType port = 0;
399  port < static_cast<FwIndexType>(this->getNum_dataOut_OutputPorts());
400  port++
401  ) {
402  this->m_dataOut_OutputPort[port].init();
403 
404 #if FW_OBJECT_NAMES == 1
405  Fw::ObjectName portName;
406  portName.format(
407  "%s_dataOut_OutputPort[%" PRI_FwIndexType "]",
408  this->m_objName.toChar(),
409  port
410  );
411  this->m_dataOut_OutputPort[port].setObjName(portName.toChar());
412 #endif
413  }
414 #endif
415 
416 #if !FW_DIRECT_PORT_CALLS
417  // Connect output port dataReturnOut
418  for (
419  FwIndexType port = 0;
420  port < static_cast<FwIndexType>(this->getNum_dataReturnOut_OutputPorts());
421  port++
422  ) {
423  this->m_dataReturnOut_OutputPort[port].init();
424 
425 #if FW_OBJECT_NAMES == 1
426  Fw::ObjectName portName;
427  portName.format(
428  "%s_dataReturnOut_OutputPort[%" PRI_FwIndexType "]",
429  this->m_objName.toChar(),
430  port
431  );
432  this->m_dataReturnOut_OutputPort[port].setObjName(portName.toChar());
433 #endif
434  }
435 #endif
436 
437 #if !FW_DIRECT_PORT_CALLS
438  // Connect output port encryptOut
439  for (
440  FwIndexType port = 0;
441  port < static_cast<FwIndexType>(this->getNum_encryptOut_OutputPorts());
442  port++
443  ) {
444  this->m_encryptOut_OutputPort[port].init();
445 
446 #if FW_OBJECT_NAMES == 1
447  Fw::ObjectName portName;
448  portName.format(
449  "%s_encryptOut_OutputPort[%" PRI_FwIndexType "]",
450  this->m_objName.toChar(),
451  port
452  );
453  this->m_encryptOut_OutputPort[port].setObjName(portName.toChar());
454 #endif
455  }
456 #endif
457 
458 #if !FW_DIRECT_PORT_CALLS
459  // Connect output port encryptReturnOut
460  for (
461  FwIndexType port = 0;
462  port < static_cast<FwIndexType>(this->getNum_encryptReturnOut_OutputPorts());
463  port++
464  ) {
465  this->m_encryptReturnOut_OutputPort[port].init();
466 
467 #if FW_OBJECT_NAMES == 1
468  Fw::ObjectName portName;
469  portName.format(
470  "%s_encryptReturnOut_OutputPort[%" PRI_FwIndexType "]",
471  this->m_objName.toChar(),
472  port
473  );
474  this->m_encryptReturnOut_OutputPort[port].setObjName(portName.toChar());
475 #endif
476  }
477 #endif
478  }
479 
480 #if !FW_DIRECT_PORT_CALLS
481 
482  // ----------------------------------------------------------------------
483  // Getters for special input ports
484  // ----------------------------------------------------------------------
485 
488  {
489  FW_ASSERT(
490  (0 <= portNum) && (portNum < this->getNum_cmdIn_InputPorts()),
491  static_cast<FwAssertArgType>(portNum)
492  );
493 
494  return &this->m_cmdIn_InputPort[portNum];
495  }
496 
497 #endif
498 
499 #if !FW_DIRECT_PORT_CALLS
500 
501  // ----------------------------------------------------------------------
502  // Getters for typed input ports
503  // ----------------------------------------------------------------------
504 
507  {
508  FW_ASSERT(
509  (0 <= portNum) && (portNum < this->getNum_bufferReturnIn_InputPorts()),
510  static_cast<FwAssertArgType>(portNum)
511  );
512 
513  return &this->m_bufferReturnIn_InputPort[portNum];
514  }
515 
518  {
519  FW_ASSERT(
520  (0 <= portNum) && (portNum < this->getNum_comStatusIn_InputPorts()),
521  static_cast<FwAssertArgType>(portNum)
522  );
523 
524  return &this->m_comStatusIn_InputPort[portNum];
525  }
526 
529  {
530  FW_ASSERT(
531  (0 <= portNum) && (portNum < this->getNum_dataIn_InputPorts()),
532  static_cast<FwAssertArgType>(portNum)
533  );
534 
535  return &this->m_dataIn_InputPort[portNum];
536  }
537 
540  {
541  FW_ASSERT(
542  (0 <= portNum) && (portNum < this->getNum_dataReturnIn_InputPorts()),
543  static_cast<FwAssertArgType>(portNum)
544  );
545 
546  return &this->m_dataReturnIn_InputPort[portNum];
547  }
548 
551  {
552  FW_ASSERT(
553  (0 <= portNum) && (portNum < this->getNum_encryptIn_InputPorts()),
554  static_cast<FwAssertArgType>(portNum)
555  );
556 
557  return &this->m_encryptIn_InputPort[portNum];
558  }
559 
560 #endif
561 
562 #if !FW_DIRECT_PORT_CALLS
563 
564  // ----------------------------------------------------------------------
565  // Connect input ports to special output ports
566  // ----------------------------------------------------------------------
567 
570  FwIndexType portNum,
571  Fw::InputCmdRegPort* port
572  )
573  {
574  FW_ASSERT(
575  (0 <= portNum) && (portNum < this->getNum_cmdRegOut_OutputPorts()),
576  static_cast<FwAssertArgType>(portNum)
577  );
578 
579  this->m_cmdRegOut_OutputPort[portNum].addCallPort(port);
580  }
581 
584  FwIndexType portNum,
586  )
587  {
588  FW_ASSERT(
589  (0 <= portNum) && (portNum < this->getNum_cmdResponseOut_OutputPorts()),
590  static_cast<FwAssertArgType>(portNum)
591  );
592 
593  this->m_cmdResponseOut_OutputPort[portNum].addCallPort(port);
594  }
595 
598  FwIndexType portNum,
599  Fw::InputLogPort* port
600  )
601  {
602  FW_ASSERT(
603  (0 <= portNum) && (portNum < this->getNum_logOut_OutputPorts()),
604  static_cast<FwAssertArgType>(portNum)
605  );
606 
607  this->m_logOut_OutputPort[portNum].addCallPort(port);
608  }
609 
610 #if FW_ENABLE_TEXT_LOGGING == 1
611 
612  void CcsdsSdlsFramerComponentBase ::
613  set_logTextOut_OutputPort(
614  FwIndexType portNum,
616  )
617  {
618  FW_ASSERT(
619  (0 <= portNum) && (portNum < this->getNum_logTextOut_OutputPorts()),
620  static_cast<FwAssertArgType>(portNum)
621  );
622 
623  this->m_logTextOut_OutputPort[portNum].addCallPort(port);
624  }
625 
626 #endif
627 
630  FwIndexType portNum,
631  Fw::InputPrmGetPort* port
632  )
633  {
634  FW_ASSERT(
635  (0 <= portNum) && (portNum < this->getNum_prmGetOut_OutputPorts()),
636  static_cast<FwAssertArgType>(portNum)
637  );
638 
639  this->m_prmGetOut_OutputPort[portNum].addCallPort(port);
640  }
641 
644  FwIndexType portNum,
645  Fw::InputPrmSetPort* port
646  )
647  {
648  FW_ASSERT(
649  (0 <= portNum) && (portNum < this->getNum_prmSetOut_OutputPorts()),
650  static_cast<FwAssertArgType>(portNum)
651  );
652 
653  this->m_prmSetOut_OutputPort[portNum].addCallPort(port);
654  }
655 
658  FwIndexType portNum,
659  Fw::InputTimePort* port
660  )
661  {
662  FW_ASSERT(
663  (0 <= portNum) && (portNum < this->getNum_timeCaller_OutputPorts()),
664  static_cast<FwAssertArgType>(portNum)
665  );
666 
667  this->m_timeCaller_OutputPort[portNum].addCallPort(port);
668  }
669 
670 #endif
671 
672 #if !FW_DIRECT_PORT_CALLS
673 
674  // ----------------------------------------------------------------------
675  // Connect typed input ports to typed output ports
676  // ----------------------------------------------------------------------
677 
680  FwIndexType portNum,
682  )
683  {
684  FW_ASSERT(
685  (0 <= portNum) && (portNum < this->getNum_bufferAllocate_OutputPorts()),
686  static_cast<FwAssertArgType>(portNum)
687  );
688 
689  this->m_bufferAllocate_OutputPort[portNum].addCallPort(port);
690  }
691 
694  FwIndexType portNum,
696  )
697  {
698  FW_ASSERT(
699  (0 <= portNum) && (portNum < this->getNum_bufferDeallocate_OutputPorts()),
700  static_cast<FwAssertArgType>(portNum)
701  );
702 
703  this->m_bufferDeallocate_OutputPort[portNum].addCallPort(port);
704  }
705 
708  FwIndexType portNum,
710  )
711  {
712  FW_ASSERT(
713  (0 <= portNum) && (portNum < this->getNum_comStatusOut_OutputPorts()),
714  static_cast<FwAssertArgType>(portNum)
715  );
716 
717  this->m_comStatusOut_OutputPort[portNum].addCallPort(port);
718  }
719 
722  FwIndexType portNum,
724  )
725  {
726  FW_ASSERT(
727  (0 <= portNum) && (portNum < this->getNum_dataOut_OutputPorts()),
728  static_cast<FwAssertArgType>(portNum)
729  );
730 
731  this->m_dataOut_OutputPort[portNum].addCallPort(port);
732  }
733 
736  FwIndexType portNum,
738  )
739  {
740  FW_ASSERT(
741  (0 <= portNum) && (portNum < this->getNum_dataReturnOut_OutputPorts()),
742  static_cast<FwAssertArgType>(portNum)
743  );
744 
745  this->m_dataReturnOut_OutputPort[portNum].addCallPort(port);
746  }
747 
750  FwIndexType portNum,
752  )
753  {
754  FW_ASSERT(
755  (0 <= portNum) && (portNum < this->getNum_encryptOut_OutputPorts()),
756  static_cast<FwAssertArgType>(portNum)
757  );
758 
759  this->m_encryptOut_OutputPort[portNum].addCallPort(port);
760  }
761 
764  FwIndexType portNum,
766  )
767  {
768  FW_ASSERT(
769  (0 <= portNum) && (portNum < this->getNum_encryptReturnOut_OutputPorts()),
770  static_cast<FwAssertArgType>(portNum)
771  );
772 
773  this->m_encryptReturnOut_OutputPort[portNum].addCallPort(port);
774  }
775 
776 #endif
777 
778 #if !FW_DIRECT_PORT_CALLS && FW_PORT_SERIALIZATION
779 
780  // ----------------------------------------------------------------------
781  // Connect serial input ports to special output ports
782  // ----------------------------------------------------------------------
783 
786  FwIndexType portNum,
787  Fw::InputSerializePort* port
788  )
789  {
790  FW_ASSERT(
791  (0 <= portNum) && (portNum < this->getNum_cmdRegOut_OutputPorts()),
792  static_cast<FwAssertArgType>(portNum)
793  );
794 
795  this->m_cmdRegOut_OutputPort[portNum].registerSerialPort(port);
796  }
797 
800  FwIndexType portNum,
801  Fw::InputSerializePort* port
802  )
803  {
804  FW_ASSERT(
805  (0 <= portNum) && (portNum < this->getNum_cmdResponseOut_OutputPorts()),
806  static_cast<FwAssertArgType>(portNum)
807  );
808 
809  this->m_cmdResponseOut_OutputPort[portNum].registerSerialPort(port);
810  }
811 
814  FwIndexType portNum,
815  Fw::InputSerializePort* port
816  )
817  {
818  FW_ASSERT(
819  (0 <= portNum) && (portNum < this->getNum_logOut_OutputPorts()),
820  static_cast<FwAssertArgType>(portNum)
821  );
822 
823  this->m_logOut_OutputPort[portNum].registerSerialPort(port);
824  }
825 
826 #if FW_ENABLE_TEXT_LOGGING == 1
827 
828  void CcsdsSdlsFramerComponentBase ::
829  set_logTextOut_OutputPort(
830  FwIndexType portNum,
831  Fw::InputSerializePort* port
832  )
833  {
834  FW_ASSERT(
835  (0 <= portNum) && (portNum < this->getNum_logTextOut_OutputPorts()),
836  static_cast<FwAssertArgType>(portNum)
837  );
838 
839  this->m_logTextOut_OutputPort[portNum].registerSerialPort(port);
840  }
841 
842 #endif
843 
846  FwIndexType portNum,
847  Fw::InputSerializePort* port
848  )
849  {
850  FW_ASSERT(
851  (0 <= portNum) && (portNum < this->getNum_prmSetOut_OutputPorts()),
852  static_cast<FwAssertArgType>(portNum)
853  );
854 
855  this->m_prmSetOut_OutputPort[portNum].registerSerialPort(port);
856  }
857 
860  FwIndexType portNum,
861  Fw::InputSerializePort* port
862  )
863  {
864  FW_ASSERT(
865  (0 <= portNum) && (portNum < this->getNum_timeCaller_OutputPorts()),
866  static_cast<FwAssertArgType>(portNum)
867  );
868 
869  this->m_timeCaller_OutputPort[portNum].registerSerialPort(port);
870  }
871 
872 #endif
873 
874 #if !FW_DIRECT_PORT_CALLS && FW_PORT_SERIALIZATION
875 
876  // ----------------------------------------------------------------------
877  // Connect serial input ports to typed output ports
878  // ----------------------------------------------------------------------
879 
882  FwIndexType portNum,
883  Fw::InputSerializePort* port
884  )
885  {
886  FW_ASSERT(
887  (0 <= portNum) && (portNum < this->getNum_bufferDeallocate_OutputPorts()),
888  static_cast<FwAssertArgType>(portNum)
889  );
890 
891  this->m_bufferDeallocate_OutputPort[portNum].registerSerialPort(port);
892  }
893 
896  FwIndexType portNum,
897  Fw::InputSerializePort* port
898  )
899  {
900  FW_ASSERT(
901  (0 <= portNum) && (portNum < this->getNum_comStatusOut_OutputPorts()),
902  static_cast<FwAssertArgType>(portNum)
903  );
904 
905  this->m_comStatusOut_OutputPort[portNum].registerSerialPort(port);
906  }
907 
910  FwIndexType portNum,
911  Fw::InputSerializePort* port
912  )
913  {
914  FW_ASSERT(
915  (0 <= portNum) && (portNum < this->getNum_dataOut_OutputPorts()),
916  static_cast<FwAssertArgType>(portNum)
917  );
918 
919  this->m_dataOut_OutputPort[portNum].registerSerialPort(port);
920  }
921 
924  FwIndexType portNum,
925  Fw::InputSerializePort* port
926  )
927  {
928  FW_ASSERT(
929  (0 <= portNum) && (portNum < this->getNum_dataReturnOut_OutputPorts()),
930  static_cast<FwAssertArgType>(portNum)
931  );
932 
933  this->m_dataReturnOut_OutputPort[portNum].registerSerialPort(port);
934  }
935 
938  FwIndexType portNum,
939  Fw::InputSerializePort* port
940  )
941  {
942  FW_ASSERT(
943  (0 <= portNum) && (portNum < this->getNum_encryptOut_OutputPorts()),
944  static_cast<FwAssertArgType>(portNum)
945  );
946 
947  this->m_encryptOut_OutputPort[portNum].registerSerialPort(port);
948  }
949 
952  FwIndexType portNum,
953  Fw::InputSerializePort* port
954  )
955  {
956  FW_ASSERT(
957  (0 <= portNum) && (portNum < this->getNum_encryptReturnOut_OutputPorts()),
958  static_cast<FwAssertArgType>(portNum)
959  );
960 
961  this->m_encryptReturnOut_OutputPort[portNum].registerSerialPort(port);
962  }
963 
964 #endif
965 
966  // ----------------------------------------------------------------------
967  // Command registration
968  // ----------------------------------------------------------------------
969 
972  {
974 
975  this->cmdRegOut_out(
976  0,
978  );
979 
980  this->cmdRegOut_out(
981  0,
983  );
984  }
985 
986  // ----------------------------------------------------------------------
987  // Parameter loading
988  // ----------------------------------------------------------------------
989 
992  {
994  const FwPrmIdType _baseId = static_cast<FwPrmIdType>(this->getIdBase());
996 
997  FwPrmIdType _id{};
998  Fw::ParamBuffer _paramBuffer;
999 
1000  _id = _baseId + PARAMID_SA_INDEX;
1001 
1002  // Get serialized parameter SA_INDEX
1003  this->m_param_SA_INDEX_valid = this->prmGetOut_out(
1004  0,
1005  _id,
1006  _paramBuffer
1007  );
1008 
1009  this->m_paramLock.lock();
1010 
1011  // Deserialize parameter or use default value
1012  if (this->m_param_SA_INDEX_valid == Fw::ParamValid::VALID) {
1013  _stat = _paramBuffer.deserializeTo(this->m_SA_INDEX);
1014  if (_stat != Fw::FW_SERIALIZE_OK) {
1015  this->m_param_SA_INDEX_valid = Fw::ParamValid::DEFAULT;
1016  }
1017  }
1018  else {
1019  this->m_param_SA_INDEX_valid = Fw::ParamValid::DEFAULT;
1020  }
1021  if (this->m_param_SA_INDEX_valid == Fw::ParamValid::DEFAULT) {
1022  this->m_SA_INDEX = 1;
1023  }
1024 
1025  this->m_paramLock.unlock();
1026  this->parameterLoaded(PARAMID_SA_INDEX, this->m_param_SA_INDEX_valid);
1027 
1028  // Call notifier
1029  this->parametersLoaded();
1030  }
1031 
1032  // ----------------------------------------------------------------------
1033  // Component construction and destruction
1034  // ----------------------------------------------------------------------
1035 
1037  CcsdsSdlsFramerComponentBase(const char* compName) :
1038  Fw::PassiveComponentBase(compName)
1039  {
1040  this->m_EncryptionFailedThrottle = 0;
1041  this->m_BufferAllocationFailedThrottle = 0;
1042 
1043  this->m_EncryptionFailedThrottleTime = Fw::Time();
1044  this->m_BufferAllocationFailedThrottleTime = Fw::Time();
1045  }
1046 
1049  {
1050 
1051  }
1052 
1053 #if !FW_DIRECT_PORT_CALLS
1054 
1055  // ----------------------------------------------------------------------
1056  // Connection status queries for special output ports
1057  // ----------------------------------------------------------------------
1058 
1061  {
1062  FW_ASSERT(
1063  (0 <= portNum) && (portNum < this->getNum_cmdRegOut_OutputPorts()),
1064  static_cast<FwAssertArgType>(portNum)
1065  );
1066 
1067  return this->m_cmdRegOut_OutputPort[portNum].isConnected();
1068  }
1069 
1072  {
1073  FW_ASSERT(
1074  (0 <= portNum) && (portNum < this->getNum_cmdResponseOut_OutputPorts()),
1075  static_cast<FwAssertArgType>(portNum)
1076  );
1077 
1078  return this->m_cmdResponseOut_OutputPort[portNum].isConnected();
1079  }
1080 
1083  {
1084  FW_ASSERT(
1085  (0 <= portNum) && (portNum < this->getNum_logOut_OutputPorts()),
1086  static_cast<FwAssertArgType>(portNum)
1087  );
1088 
1089  return this->m_logOut_OutputPort[portNum].isConnected();
1090  }
1091 
1092 #if FW_ENABLE_TEXT_LOGGING == 1
1093 
1094  bool CcsdsSdlsFramerComponentBase ::
1095  isConnected_logTextOut_OutputPort(FwIndexType portNum) const
1096  {
1097  FW_ASSERT(
1098  (0 <= portNum) && (portNum < this->getNum_logTextOut_OutputPorts()),
1099  static_cast<FwAssertArgType>(portNum)
1100  );
1101 
1102  return this->m_logTextOut_OutputPort[portNum].isConnected();
1103  }
1104 
1105 #endif
1106 
1109  {
1110  FW_ASSERT(
1111  (0 <= portNum) && (portNum < this->getNum_prmGetOut_OutputPorts()),
1112  static_cast<FwAssertArgType>(portNum)
1113  );
1114 
1115  return this->m_prmGetOut_OutputPort[portNum].isConnected();
1116  }
1117 
1120  {
1121  FW_ASSERT(
1122  (0 <= portNum) && (portNum < this->getNum_prmSetOut_OutputPorts()),
1123  static_cast<FwAssertArgType>(portNum)
1124  );
1125 
1126  return this->m_prmSetOut_OutputPort[portNum].isConnected();
1127  }
1128 
1131  {
1132  FW_ASSERT(
1133  (0 <= portNum) && (portNum < this->getNum_timeCaller_OutputPorts()),
1134  static_cast<FwAssertArgType>(portNum)
1135  );
1136 
1137  return this->m_timeCaller_OutputPort[portNum].isConnected();
1138  }
1139 
1140 #endif
1141 
1142 #if !FW_DIRECT_PORT_CALLS
1143 
1144  // ----------------------------------------------------------------------
1145  // Connection status queries for typed output ports
1146  // ----------------------------------------------------------------------
1147 
1150  {
1151  FW_ASSERT(
1152  (0 <= portNum) && (portNum < this->getNum_bufferAllocate_OutputPorts()),
1153  static_cast<FwAssertArgType>(portNum)
1154  );
1155 
1156  return this->m_bufferAllocate_OutputPort[portNum].isConnected();
1157  }
1158 
1161  {
1162  FW_ASSERT(
1163  (0 <= portNum) && (portNum < this->getNum_bufferDeallocate_OutputPorts()),
1164  static_cast<FwAssertArgType>(portNum)
1165  );
1166 
1167  return this->m_bufferDeallocate_OutputPort[portNum].isConnected();
1168  }
1169 
1172  {
1173  FW_ASSERT(
1174  (0 <= portNum) && (portNum < this->getNum_comStatusOut_OutputPorts()),
1175  static_cast<FwAssertArgType>(portNum)
1176  );
1177 
1178  return this->m_comStatusOut_OutputPort[portNum].isConnected();
1179  }
1180 
1183  {
1184  FW_ASSERT(
1185  (0 <= portNum) && (portNum < this->getNum_dataOut_OutputPorts()),
1186  static_cast<FwAssertArgType>(portNum)
1187  );
1188 
1189  return this->m_dataOut_OutputPort[portNum].isConnected();
1190  }
1191 
1194  {
1195  FW_ASSERT(
1196  (0 <= portNum) && (portNum < this->getNum_dataReturnOut_OutputPorts()),
1197  static_cast<FwAssertArgType>(portNum)
1198  );
1199 
1200  return this->m_dataReturnOut_OutputPort[portNum].isConnected();
1201  }
1202 
1205  {
1206  FW_ASSERT(
1207  (0 <= portNum) && (portNum < this->getNum_encryptOut_OutputPorts()),
1208  static_cast<FwAssertArgType>(portNum)
1209  );
1210 
1211  return this->m_encryptOut_OutputPort[portNum].isConnected();
1212  }
1213 
1216  {
1217  FW_ASSERT(
1218  (0 <= portNum) && (portNum < this->getNum_encryptReturnOut_OutputPorts()),
1219  static_cast<FwAssertArgType>(portNum)
1220  );
1221 
1222  return this->m_encryptReturnOut_OutputPort[portNum].isConnected();
1223  }
1224 
1225 #endif
1226 
1227  // ----------------------------------------------------------------------
1228  // Port handler base-class functions for special input ports
1229  //
1230  // Call these functions directly to bypass the corresponding ports
1231  // ----------------------------------------------------------------------
1232 
1235  FwIndexType portNum,
1236  FwOpcodeType opCode,
1237  U32 cmdSeq,
1238  Fw::CmdArgBuffer& args
1239  )
1240  {
1241 
1242  const U32 idBase = this->getIdBase();
1243  FW_ASSERT(opCode >= idBase, static_cast<FwAssertArgType>(opCode), static_cast<FwAssertArgType>(idBase));
1244 
1245  // Select base class function based on opcode
1246  switch (opCode - idBase) {
1247  case OPCODE_SA_INDEX_SET: {
1248  Fw::CmdResponse _cstat = this->paramSet_SA_INDEX(args);
1249  this->cmdResponse_out(
1250  opCode,
1251  cmdSeq,
1252  _cstat
1253  );
1254  break;
1255  }
1256 
1257  case OPCODE_SA_INDEX_SAVE: {
1258  Fw::CmdResponse _cstat = this->paramSave_SA_INDEX();
1259  this->cmdResponse_out(
1260  opCode,
1261  cmdSeq,
1262  _cstat
1263  );
1264  break;
1265  }
1266  default:
1267  // Unknown opcode: ignore it
1268  break;
1269  }
1270  }
1271 
1272  // ----------------------------------------------------------------------
1273  // Port handler base-class functions for typed input ports
1274  //
1275  // Call these functions directly to bypass the corresponding ports
1276  // ----------------------------------------------------------------------
1277 
1280  FwIndexType portNum,
1281  Fw::Buffer& data,
1282  const ComCfg::FrameContext& context
1283  )
1284  {
1285  // Make sure port number is valid
1286  FW_ASSERT(
1287  (0 <= portNum) && (portNum < this->getNum_bufferReturnIn_InputPorts()),
1288  static_cast<FwAssertArgType>(portNum)
1289  );
1290 
1291  // Call handler function
1292  this->bufferReturnIn_handler(
1293  portNum,
1294  data,
1295  context
1296  );
1297  }
1298 
1301  FwIndexType portNum,
1302  Fw::Success& condition
1303  )
1304  {
1305  // Make sure port number is valid
1306  FW_ASSERT(
1307  (0 <= portNum) && (portNum < this->getNum_comStatusIn_InputPorts()),
1308  static_cast<FwAssertArgType>(portNum)
1309  );
1310 
1311  // Call handler function
1312  this->comStatusIn_handler(
1313  portNum,
1314  condition
1315  );
1316  }
1317 
1320  FwIndexType portNum,
1321  Fw::Buffer& data,
1322  const ComCfg::FrameContext& context
1323  )
1324  {
1325  // Make sure port number is valid
1326  FW_ASSERT(
1327  (0 <= portNum) && (portNum < this->getNum_dataIn_InputPorts()),
1328  static_cast<FwAssertArgType>(portNum)
1329  );
1330 
1331  // Call handler function
1332  this->dataIn_handler(
1333  portNum,
1334  data,
1335  context
1336  );
1337  }
1338 
1341  FwIndexType portNum,
1342  Fw::Buffer& data,
1343  const ComCfg::FrameContext& context
1344  )
1345  {
1346  // Make sure port number is valid
1347  FW_ASSERT(
1348  (0 <= portNum) && (portNum < this->getNum_dataReturnIn_InputPorts()),
1349  static_cast<FwAssertArgType>(portNum)
1350  );
1351 
1352  // Call handler function
1353  this->dataReturnIn_handler(
1354  portNum,
1355  data,
1356  context
1357  );
1358  }
1359 
1362  FwIndexType portNum,
1363  const Svc::Ccsds::SdlsStatus& status,
1364  Fw::Buffer& data,
1365  const ComCfg::FrameContext& context
1366  )
1367  {
1368  // Make sure port number is valid
1369  FW_ASSERT(
1370  (0 <= portNum) && (portNum < this->getNum_encryptIn_InputPorts()),
1371  static_cast<FwAssertArgType>(portNum)
1372  );
1373 
1374  // Call handler function
1375  this->encryptIn_handler(
1376  portNum,
1377  status,
1378  data,
1379  context
1380  );
1381  }
1382 
1383 #if !FW_DIRECT_PORT_CALLS
1384 
1385  // ----------------------------------------------------------------------
1386  // Invocation functions for typed output ports
1387  // ----------------------------------------------------------------------
1388 
1391  FwIndexType portNum,
1392  FwSizeType size
1393  ) const
1394  {
1395  FW_ASSERT(
1396  (0 <= portNum) && (portNum < this->getNum_bufferAllocate_OutputPorts()),
1397  static_cast<FwAssertArgType>(portNum)
1398  );
1399 
1400  FW_ASSERT(
1401  this->m_bufferAllocate_OutputPort[portNum].isConnected(),
1402  static_cast<FwAssertArgType>(portNum)
1403  );
1404  return this->m_bufferAllocate_OutputPort[portNum].invoke(
1405  size
1406  );
1407  }
1408 
1411  FwIndexType portNum,
1412  Fw::Buffer& fwBuffer
1413  ) const
1414  {
1415  FW_ASSERT(
1416  (0 <= portNum) && (portNum < this->getNum_bufferDeallocate_OutputPorts()),
1417  static_cast<FwAssertArgType>(portNum)
1418  );
1419 
1420  FW_ASSERT(
1421  this->m_bufferDeallocate_OutputPort[portNum].isConnected(),
1422  static_cast<FwAssertArgType>(portNum)
1423  );
1424  this->m_bufferDeallocate_OutputPort[portNum].invoke(
1425  fwBuffer
1426  );
1427  }
1428 
1431  FwIndexType portNum,
1432  Fw::Success& condition
1433  ) const
1434  {
1435  FW_ASSERT(
1436  (0 <= portNum) && (portNum < this->getNum_comStatusOut_OutputPorts()),
1437  static_cast<FwAssertArgType>(portNum)
1438  );
1439 
1440  FW_ASSERT(
1441  this->m_comStatusOut_OutputPort[portNum].isConnected(),
1442  static_cast<FwAssertArgType>(portNum)
1443  );
1444  this->m_comStatusOut_OutputPort[portNum].invoke(
1445  condition
1446  );
1447  }
1448 
1451  FwIndexType portNum,
1452  Fw::Buffer& data,
1453  const ComCfg::FrameContext& context
1454  ) const
1455  {
1456  FW_ASSERT(
1457  (0 <= portNum) && (portNum < this->getNum_dataOut_OutputPorts()),
1458  static_cast<FwAssertArgType>(portNum)
1459  );
1460 
1461  FW_ASSERT(
1462  this->m_dataOut_OutputPort[portNum].isConnected(),
1463  static_cast<FwAssertArgType>(portNum)
1464  );
1465  this->m_dataOut_OutputPort[portNum].invoke(
1466  data,
1467  context
1468  );
1469  }
1470 
1473  FwIndexType portNum,
1474  Fw::Buffer& data,
1475  const ComCfg::FrameContext& context
1476  ) const
1477  {
1478  FW_ASSERT(
1479  (0 <= portNum) && (portNum < this->getNum_dataReturnOut_OutputPorts()),
1480  static_cast<FwAssertArgType>(portNum)
1481  );
1482 
1483  FW_ASSERT(
1484  this->m_dataReturnOut_OutputPort[portNum].isConnected(),
1485  static_cast<FwAssertArgType>(portNum)
1486  );
1487  this->m_dataReturnOut_OutputPort[portNum].invoke(
1488  data,
1489  context
1490  );
1491  }
1492 
1495  FwIndexType portNum,
1496  U16 securityAssociationIndex,
1497  Fw::Buffer& data,
1498  const ComCfg::FrameContext& context
1499  ) const
1500  {
1501  FW_ASSERT(
1502  (0 <= portNum) && (portNum < this->getNum_encryptOut_OutputPorts()),
1503  static_cast<FwAssertArgType>(portNum)
1504  );
1505 
1506  FW_ASSERT(
1507  this->m_encryptOut_OutputPort[portNum].isConnected(),
1508  static_cast<FwAssertArgType>(portNum)
1509  );
1510  this->m_encryptOut_OutputPort[portNum].invoke(
1511  securityAssociationIndex,
1512  data,
1513  context
1514  );
1515  }
1516 
1519  FwIndexType portNum,
1520  Fw::Buffer& data,
1521  const ComCfg::FrameContext& context
1522  ) const
1523  {
1524  FW_ASSERT(
1525  (0 <= portNum) && (portNum < this->getNum_encryptReturnOut_OutputPorts()),
1526  static_cast<FwAssertArgType>(portNum)
1527  );
1528 
1529  FW_ASSERT(
1530  this->m_encryptReturnOut_OutputPort[portNum].isConnected(),
1531  static_cast<FwAssertArgType>(portNum)
1532  );
1533  this->m_encryptReturnOut_OutputPort[portNum].invoke(
1534  data,
1535  context
1536  );
1537  }
1538 
1539 #endif
1540 
1541  // ----------------------------------------------------------------------
1542  // Command response
1543  // ----------------------------------------------------------------------
1544 
1547  FwOpcodeType opCode,
1548  U32 cmdSeq,
1549  Fw::CmdResponse response
1550  )
1551  {
1553  this->cmdResponseOut_out(0, opCode, cmdSeq, response);
1554  }
1555 
1556  // ----------------------------------------------------------------------
1557  // Event logging functions
1558  // ----------------------------------------------------------------------
1559 
1562  {
1563  // Get the time
1564  Fw::Time _logTime;
1565  if (this->isConnected_timeCaller_OutputPort(0)) {
1566  this->timeCaller_out(0, _logTime);
1567  }
1568 
1569  const FwEventIdType _id = this->getIdBase() + EVENTID_ENCRYPTIONFAILED;
1570 
1571  // Check throttle value & throttle timeout
1572  {
1573  Os::ScopeLock scopedLock(this->m_eventLock);
1574 
1575  if (this->m_EncryptionFailedThrottle >= EVENTID_ENCRYPTIONFAILED_THROTTLE) {
1576  // The counter has overflowed, check if time interval has passed
1577  if (Fw::TimeInterval(this->m_EncryptionFailedThrottleTime, _logTime) >= Fw::TimeInterval(60, 0)) {
1578  // Reset the count
1579  this->m_EncryptionFailedThrottle = 0;
1580  } else {
1581  // Throttle the event
1582  return;
1583  }
1584  }
1585 
1586  // Reset the throttle time if needed
1587  if (this->m_EncryptionFailedThrottle == 0) {
1588  // This is the first event, reset the throttle time
1589  this->m_EncryptionFailedThrottleTime = _logTime;
1590  }
1591 
1592  // Increment the count
1593  this->m_EncryptionFailedThrottle++;
1594  }
1595 
1596  // Emit the event on the log port
1597  if (this->isConnected_logOut_OutputPort(0)) {
1598  Fw::LogBuffer _logBuff;
1600 
1601 #if FW_AMPCS_COMPATIBLE
1602  // Serialize the number of arguments
1603  _status = _logBuff.serializeFrom(static_cast<U8>(1));
1604  FW_ASSERT(
1605  _status == Fw::FW_SERIALIZE_OK,
1606  static_cast<FwAssertArgType>(_status)
1607  );
1608 #endif
1609 
1610 #if FW_AMPCS_COMPATIBLE
1611  // Serialize the argument size
1612  _status = _logBuff.serializeFrom(
1614  );
1615  FW_ASSERT(
1616  _status == Fw::FW_SERIALIZE_OK,
1617  static_cast<FwAssertArgType>(_status)
1618  );
1619 #endif
1620  _status = _logBuff.serializeFrom(status);
1621  FW_ASSERT(
1622  _status == Fw::FW_SERIALIZE_OK,
1623  static_cast<FwAssertArgType>(_status)
1624  );
1625 
1626  this->logOut_out(
1627  0,
1628  _id,
1629  _logTime,
1631  _logBuff
1632  );
1633  }
1634 
1635  // Emit the event on the text log port
1636 #if FW_ENABLE_TEXT_LOGGING
1637  if (this->isConnected_logTextOut_OutputPort(0)) {
1638 #if FW_OBJECT_NAMES == 1
1639  const char* _formatString =
1640  "(%s) %s: Failed to encrypt frame: %s";
1641 #else
1642  const char* _formatString =
1643  "%s: Failed to encrypt frame: %s";
1644 #endif
1645 
1646  Fw::String statusStr;
1647  status.toString(statusStr);
1648 
1649  Fw::TextLogString _logString;
1650  (void) _logString.format(
1651  _formatString,
1652 #if FW_OBJECT_NAMES == 1
1653  this->m_objName.toChar(),
1654 #endif
1655  "EncryptionFailed ",
1656  statusStr.toChar()
1657  );
1658 
1659  this->logTextOut_out(
1660  0,
1661  _id,
1662  _logTime,
1664  _logString
1665  );
1666  }
1667 #endif
1668  }
1669 
1672  {
1673  // Get the time
1674  Fw::Time _logTime;
1675  if (this->isConnected_timeCaller_OutputPort(0)) {
1676  this->timeCaller_out(0, _logTime);
1677  }
1678 
1680 
1681  // Check throttle value & throttle timeout
1682  {
1683  Os::ScopeLock scopedLock(this->m_eventLock);
1684 
1685  if (this->m_BufferAllocationFailedThrottle >= EVENTID_BUFFERALLOCATIONFAILED_THROTTLE) {
1686  // The counter has overflowed, check if time interval has passed
1687  if (Fw::TimeInterval(this->m_BufferAllocationFailedThrottleTime, _logTime) >= Fw::TimeInterval(60, 0)) {
1688  // Reset the count
1689  this->m_BufferAllocationFailedThrottle = 0;
1690  } else {
1691  // Throttle the event
1692  return;
1693  }
1694  }
1695 
1696  // Reset the throttle time if needed
1697  if (this->m_BufferAllocationFailedThrottle == 0) {
1698  // This is the first event, reset the throttle time
1699  this->m_BufferAllocationFailedThrottleTime = _logTime;
1700  }
1701 
1702  // Increment the count
1703  this->m_BufferAllocationFailedThrottle++;
1704  }
1705 
1706  // Emit the event on the log port
1707  if (this->isConnected_logOut_OutputPort(0)) {
1708  Fw::LogBuffer _logBuff;
1710 
1711 #if FW_AMPCS_COMPATIBLE
1712  // Serialize the number of arguments
1713  _status = _logBuff.serializeFrom(static_cast<U8>(1));
1714  FW_ASSERT(
1715  _status == Fw::FW_SERIALIZE_OK,
1716  static_cast<FwAssertArgType>(_status)
1717  );
1718 #endif
1719 
1720 #if FW_AMPCS_COMPATIBLE
1721  // Serialize the argument size
1722  _status = _logBuff.serializeFrom(
1723  static_cast<U8>(sizeof(FwSizeType))
1724  );
1725  FW_ASSERT(
1726  _status == Fw::FW_SERIALIZE_OK,
1727  static_cast<FwAssertArgType>(_status)
1728  );
1729 #endif
1730  _status = _logBuff.serializeFrom(allocationSize);
1731  FW_ASSERT(
1732  _status == Fw::FW_SERIALIZE_OK,
1733  static_cast<FwAssertArgType>(_status)
1734  );
1735 
1736  this->logOut_out(
1737  0,
1738  _id,
1739  _logTime,
1741  _logBuff
1742  );
1743  }
1744 
1745  // Emit the event on the text log port
1746 #if FW_ENABLE_TEXT_LOGGING
1747  if (this->isConnected_logTextOut_OutputPort(0)) {
1748 #if FW_OBJECT_NAMES == 1
1749  const char* _formatString =
1750  "(%s) %s: Failed to allocate frame buffer of size %" PRIu64 "";
1751 #else
1752  const char* _formatString =
1753  "%s: Failed to allocate frame buffer of size %" PRIu64 "";
1754 #endif
1755 
1756  Fw::TextLogString _logString;
1757  (void) _logString.format(
1758  _formatString,
1759 #if FW_OBJECT_NAMES == 1
1760  this->m_objName.toChar(),
1761 #endif
1762  "BufferAllocationFailed ",
1763  allocationSize
1764  );
1765 
1766  this->logTextOut_out(
1767  0,
1768  _id,
1769  _logTime,
1771  _logString
1772  );
1773  }
1774 #endif
1775  }
1776 
1777  // ----------------------------------------------------------------------
1778  // Event throttle reset functions
1779  // ----------------------------------------------------------------------
1780 
1783  {
1784  {
1785  Os::ScopeLock scopedLock(this->m_eventLock);
1786 
1787  // Reset throttle counter
1788  this->m_EncryptionFailedThrottle = 0;
1789 
1790  // Reset the throttle time
1791  this->m_EncryptionFailedThrottleTime = Fw::Time(0, 0);
1792  }
1793  }
1794 
1797  {
1798  {
1799  Os::ScopeLock scopedLock(this->m_eventLock);
1800 
1801  // Reset throttle counter
1802  this->m_BufferAllocationFailedThrottle = 0;
1803 
1804  // Reset the throttle time
1805  this->m_BufferAllocationFailedThrottleTime = Fw::Time(0, 0);
1806  }
1807  }
1808 
1809  // ----------------------------------------------------------------------
1810  // Parameter hook functions
1811  // ----------------------------------------------------------------------
1812 
1815  {
1816  // Do nothing by default
1817  }
1818 
1821  {
1822  // Do nothing by default
1823  }
1824 
1827  FwPrmIdType id,
1828  Fw::ParamValid valid
1829  )
1830  {
1831  if (FW_PARAM_OK(valid)) {
1832  this->parameterUpdated(id);
1833  }
1834  }
1835 
1836  // ----------------------------------------------------------------------
1837  // Parameter get functions
1838  // ----------------------------------------------------------------------
1839 
1842  {
1843  U16 _local{};
1844  this->m_paramLock.lock();
1845  valid = this->m_param_SA_INDEX_valid;
1846  if ((valid == Fw::ParamValid::VALID) || (valid == Fw::ParamValid::DEFAULT)) {
1847  _local = this->m_SA_INDEX;
1848  }
1849  this->m_paramLock.unlock();
1850  return _local;
1851  }
1852 
1853  // ----------------------------------------------------------------------
1854  // Time
1855  // ----------------------------------------------------------------------
1856 
1858  getTime() const
1859  {
1860  if (this->isConnected_timeCaller_OutputPort(0)) {
1861  Fw::Time _time;
1862  this->timeCaller_out(0, _time);
1863  return _time;
1864  }
1865  else {
1866  return Fw::Time(TimeBase::TB_NONE, 0, 0);
1867  }
1868  }
1869 
1870  // ----------------------------------------------------------------------
1871  // Calls for messages received on special input ports
1872  // ----------------------------------------------------------------------
1873 
1874  void CcsdsSdlsFramerComponentBase ::
1875  m_p_cmdIn_in(
1876  Fw::PassiveComponentBase* callComp,
1877  FwIndexType portNum,
1878  FwOpcodeType opCode,
1879  U32 cmdSeq,
1880  Fw::CmdArgBuffer& args
1881  )
1882  {
1883  FW_ASSERT(callComp != nullptr);
1884  CcsdsSdlsFramerComponentBase* compPtr = static_cast<CcsdsSdlsFramerComponentBase*>(callComp);
1885  compPtr->cmdIn_handlerBase(
1886  portNum,
1887  opCode,
1888  cmdSeq,
1889  args
1890  );
1891  }
1892 
1893  // ----------------------------------------------------------------------
1894  // Calls for messages received on typed input ports
1895  // ----------------------------------------------------------------------
1896 
1897  void CcsdsSdlsFramerComponentBase ::
1898  m_p_bufferReturnIn_in(
1899  Fw::PassiveComponentBase* callComp,
1900  FwIndexType portNum,
1901  Fw::Buffer& data,
1902  const ComCfg::FrameContext& context
1903  )
1904  {
1905  FW_ASSERT(callComp != nullptr);
1906  CcsdsSdlsFramerComponentBase* compPtr = static_cast<CcsdsSdlsFramerComponentBase*>(callComp);
1907  compPtr->bufferReturnIn_handlerBase(
1908  portNum,
1909  data,
1910  context
1911  );
1912  }
1913 
1914  void CcsdsSdlsFramerComponentBase ::
1915  m_p_comStatusIn_in(
1916  Fw::PassiveComponentBase* callComp,
1917  FwIndexType portNum,
1918  Fw::Success& condition
1919  )
1920  {
1921  FW_ASSERT(callComp != nullptr);
1922  CcsdsSdlsFramerComponentBase* compPtr = static_cast<CcsdsSdlsFramerComponentBase*>(callComp);
1923  compPtr->comStatusIn_handlerBase(
1924  portNum,
1925  condition
1926  );
1927  }
1928 
1929  void CcsdsSdlsFramerComponentBase ::
1930  m_p_dataIn_in(
1931  Fw::PassiveComponentBase* callComp,
1932  FwIndexType portNum,
1933  Fw::Buffer& data,
1934  const ComCfg::FrameContext& context
1935  )
1936  {
1937  FW_ASSERT(callComp != nullptr);
1938  CcsdsSdlsFramerComponentBase* compPtr = static_cast<CcsdsSdlsFramerComponentBase*>(callComp);
1939  compPtr->dataIn_handlerBase(
1940  portNum,
1941  data,
1942  context
1943  );
1944  }
1945 
1946  void CcsdsSdlsFramerComponentBase ::
1947  m_p_dataReturnIn_in(
1948  Fw::PassiveComponentBase* callComp,
1949  FwIndexType portNum,
1950  Fw::Buffer& data,
1951  const ComCfg::FrameContext& context
1952  )
1953  {
1954  FW_ASSERT(callComp != nullptr);
1955  CcsdsSdlsFramerComponentBase* compPtr = static_cast<CcsdsSdlsFramerComponentBase*>(callComp);
1956  compPtr->dataReturnIn_handlerBase(
1957  portNum,
1958  data,
1959  context
1960  );
1961  }
1962 
1963  void CcsdsSdlsFramerComponentBase ::
1964  m_p_encryptIn_in(
1965  Fw::PassiveComponentBase* callComp,
1966  FwIndexType portNum,
1967  const Svc::Ccsds::SdlsStatus& status,
1968  Fw::Buffer& data,
1969  const ComCfg::FrameContext& context
1970  )
1971  {
1972  FW_ASSERT(callComp != nullptr);
1973  CcsdsSdlsFramerComponentBase* compPtr = static_cast<CcsdsSdlsFramerComponentBase*>(callComp);
1974  compPtr->encryptIn_handlerBase(
1975  portNum,
1976  status,
1977  data,
1978  context
1979  );
1980  }
1981 
1982 #if !FW_DIRECT_PORT_CALLS
1983 
1984  // ----------------------------------------------------------------------
1985  // Invocation functions for special output ports
1986  // ----------------------------------------------------------------------
1987 
1988  void CcsdsSdlsFramerComponentBase ::
1989  cmdRegOut_out(
1990  FwIndexType portNum,
1991  FwOpcodeType opCode
1992  ) const
1993  {
1994  FW_ASSERT(
1995  (0 <= portNum) && (portNum < this->getNum_cmdRegOut_OutputPorts()),
1996  static_cast<FwAssertArgType>(portNum)
1997  );
1998 
1999  FW_ASSERT(
2000  this->m_cmdRegOut_OutputPort[portNum].isConnected(),
2001  static_cast<FwAssertArgType>(portNum)
2002  );
2003  this->m_cmdRegOut_OutputPort[portNum].invoke(
2004  opCode
2005  );
2006  }
2007 
2008  void CcsdsSdlsFramerComponentBase ::
2009  cmdResponseOut_out(
2010  FwIndexType portNum,
2011  FwOpcodeType opCode,
2012  U32 cmdSeq,
2013  const Fw::CmdResponse& response
2014  ) const
2015  {
2016  FW_ASSERT(
2017  (0 <= portNum) && (portNum < this->getNum_cmdResponseOut_OutputPorts()),
2018  static_cast<FwAssertArgType>(portNum)
2019  );
2020 
2021  FW_ASSERT(
2022  this->m_cmdResponseOut_OutputPort[portNum].isConnected(),
2023  static_cast<FwAssertArgType>(portNum)
2024  );
2025  this->m_cmdResponseOut_OutputPort[portNum].invoke(
2026  opCode,
2027  cmdSeq,
2028  response
2029  );
2030  }
2031 
2032  void CcsdsSdlsFramerComponentBase ::
2033  logOut_out(
2034  FwIndexType portNum,
2035  FwEventIdType id,
2036  Fw::Time& timeTag,
2037  const Fw::LogSeverity& severity,
2038  Fw::LogBuffer& args
2039  ) const
2040  {
2041  FW_ASSERT(
2042  (0 <= portNum) && (portNum < this->getNum_logOut_OutputPorts()),
2043  static_cast<FwAssertArgType>(portNum)
2044  );
2045 
2046  FW_ASSERT(
2047  this->m_logOut_OutputPort[portNum].isConnected(),
2048  static_cast<FwAssertArgType>(portNum)
2049  );
2050  this->m_logOut_OutputPort[portNum].invoke(
2051  id,
2052  timeTag,
2053  severity,
2054  args
2055  );
2056  }
2057 
2058 #if FW_ENABLE_TEXT_LOGGING
2059 
2060  void CcsdsSdlsFramerComponentBase ::
2061  logTextOut_out(
2062  FwIndexType portNum,
2063  FwEventIdType id,
2064  Fw::Time& timeTag,
2065  const Fw::LogSeverity& severity,
2066  Fw::TextLogString& text
2067  ) const
2068  {
2069  FW_ASSERT(
2070  (0 <= portNum) && (portNum < this->getNum_logTextOut_OutputPorts()),
2071  static_cast<FwAssertArgType>(portNum)
2072  );
2073 
2074  FW_ASSERT(
2075  this->m_logTextOut_OutputPort[portNum].isConnected(),
2076  static_cast<FwAssertArgType>(portNum)
2077  );
2078  this->m_logTextOut_OutputPort[portNum].invoke(
2079  id,
2080  timeTag,
2081  severity,
2082  text
2083  );
2084  }
2085 
2086 #endif
2087 
2088  Fw::ParamValid CcsdsSdlsFramerComponentBase ::
2089  prmGetOut_out(
2090  FwIndexType portNum,
2091  FwPrmIdType id,
2092  Fw::ParamBuffer& val
2093  ) const
2094  {
2095  FW_ASSERT(
2096  (0 <= portNum) && (portNum < this->getNum_prmGetOut_OutputPorts()),
2097  static_cast<FwAssertArgType>(portNum)
2098  );
2099 
2100  FW_ASSERT(
2101  this->m_prmGetOut_OutputPort[portNum].isConnected(),
2102  static_cast<FwAssertArgType>(portNum)
2103  );
2104  return this->m_prmGetOut_OutputPort[portNum].invoke(
2105  id,
2106  val
2107  );
2108  }
2109 
2110  void CcsdsSdlsFramerComponentBase ::
2111  prmSetOut_out(
2112  FwIndexType portNum,
2113  FwPrmIdType id,
2114  Fw::ParamBuffer& val
2115  ) const
2116  {
2117  FW_ASSERT(
2118  (0 <= portNum) && (portNum < this->getNum_prmSetOut_OutputPorts()),
2119  static_cast<FwAssertArgType>(portNum)
2120  );
2121 
2122  FW_ASSERT(
2123  this->m_prmSetOut_OutputPort[portNum].isConnected(),
2124  static_cast<FwAssertArgType>(portNum)
2125  );
2126  this->m_prmSetOut_OutputPort[portNum].invoke(
2127  id,
2128  val
2129  );
2130  }
2131 
2132  void CcsdsSdlsFramerComponentBase ::
2133  timeCaller_out(
2134  FwIndexType portNum,
2135  Fw::Time& time
2136  ) const
2137  {
2138  FW_ASSERT(
2139  (0 <= portNum) && (portNum < this->getNum_timeCaller_OutputPorts()),
2140  static_cast<FwAssertArgType>(portNum)
2141  );
2142 
2143  FW_ASSERT(
2144  this->m_timeCaller_OutputPort[portNum].isConnected(),
2145  static_cast<FwAssertArgType>(portNum)
2146  );
2147  this->m_timeCaller_OutputPort[portNum].invoke(
2148  time
2149  );
2150  }
2151 
2152 #endif
2153 
2154  // ----------------------------------------------------------------------
2155  // Parameter set functions
2156  // ----------------------------------------------------------------------
2157 
2158  Fw::CmdResponse CcsdsSdlsFramerComponentBase ::
2159  paramSet_SA_INDEX(Fw::SerialBufferBase& val)
2160  {
2161  U16 _localVal{};
2162  const Fw::SerializeStatus _stat = val.deserializeTo(_localVal);
2163  if (_stat != Fw::FW_SERIALIZE_OK) {
2165  }
2166 
2167  // Assign value only if successfully deserialized
2168  this->m_paramLock.lock();
2169  this->m_SA_INDEX = _localVal;
2170  this->m_param_SA_INDEX_valid = Fw::ParamValid::VALID;
2171  this->m_paramLock.unlock();
2172 
2173  // Call notifier
2175  return Fw::CmdResponse::OK;
2176  }
2177 
2178  // ----------------------------------------------------------------------
2179  // Parameter save functions
2180  // ----------------------------------------------------------------------
2181 
2182  Fw::CmdResponse CcsdsSdlsFramerComponentBase ::
2183  paramSave_SA_INDEX()
2184  {
2185  if (!this->isConnected_prmSetOut_OutputPort(0)) {
2187  }
2188  Fw::ParamBuffer _paramBuffer;
2189  const FwIdType idBase = this->getIdBase();
2191  // Serialize the parameter
2192  this->m_paramLock.lock();
2193  if ((this->m_param_SA_INDEX_valid == Fw::ParamValid::VALID) || (this->m_param_SA_INDEX_valid == Fw::ParamValid::DEFAULT)) {
2194  _stat = _paramBuffer.serializeFrom(m_SA_INDEX);
2195  }
2196  this->m_paramLock.unlock();
2197  if (_stat != Fw::FW_SERIALIZE_OK) {
2199  }
2200  // Save the parameter
2201  this->prmSetOut_out(
2202  0,
2203  static_cast<FwPrmIdType>(idBase + PARAMID_SA_INDEX),
2204  _paramBuffer
2205  );
2206  // Return the command response
2207  return Fw::CmdResponse::OK;
2208  }
2209 
2210  }
2211 
2212 }
Serialization/Deserialization operation was successful.
void dataIn_handlerBase(FwIndexType portNum, Fw::Buffer &data, const ComCfg::FrameContext &context)
Handler base-class function for input port dataIn.
void set_timeCaller_OutputPort(FwIndexType portNum, Fw::InputTimePort *port)
Connect port to timeCaller[portNum].
void addCallPort(InputTimePort *callPort)
Register an input port.
Definition: TimePortAc.cpp:157
void set_prmSetOut_OutputPort(FwIndexType portNum, Fw::InputPrmSetPort *port)
Connect port to prmSetOut[portNum].
FwIdType FwOpcodeType
The type of a command opcode.
void set_dataReturnOut_OutputPort(FwIndexType portNum, Svc::InputComDataWithContextPort *port)
Connect port to dataReturnOut[portNum].
#define FW_PARAM_OK(paramValid)
Definition: ParamValid.hpp:22
PlatformSizeType FwSizeType
bool isConnected_encryptOut_OutputPort(FwIndexType portNum) const
bool isConnected_logOut_OutputPort(FwIndexType portNum) const
I32 FwEnumStoreType
void bufferReturnIn_handlerBase(FwIndexType portNum, Fw::Buffer &data, const ComCfg::FrameContext &context)
Handler base-class function for input port bufferReturnIn.
virtual void comStatusIn_handler(FwIndexType portNum, Fw::Success &condition)=0
Handler for input port comStatusIn.
void set_prmGetOut_OutputPort(FwIndexType portNum, Fw::InputPrmGetPort *port)
Connect port to prmGetOut[portNum].
void invoke(U16 securityAssociationIndex, Fw::Buffer &data, const ComCfg::FrameContext &context) const
Invoke a port connection.
static constexpr FwIndexType getNum_dataIn_InputPorts()
bool isConnected_bufferDeallocate_OutputPort(FwIndexType portNum) const
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
void init()
Initialization function.
Definition: CmdPortAc.cpp:89
SerializeStatus deserializeTo(U8 &val, Endianness mode=Endianness::BIG) override
Deserialize an 8-bit unsigned integer value.
FwIdType FwPrmIdType
The type of a parameter identifier.
void addCallPort(InputPrmSetPort *callPort)
Register an input port.
bool isConnected_encryptReturnOut_OutputPort(FwIndexType portNum) const
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
static constexpr FwIndexType getNum_bufferDeallocate_OutputPorts()
Auto-generated base for CcsdsSdlsFramer component.
bool isConnected_comStatusOut_OutputPort(FwIndexType portNum) const
void comStatusIn_handlerBase(FwIndexType portNum, Fw::Success &condition)
Handler base-class function for input port comStatusIn.
static constexpr FwIndexType getNum_bufferReturnIn_InputPorts()
static constexpr FwIndexType getNum_prmSetOut_OutputPorts()
static constexpr FwIndexType getNum_encryptIn_InputPorts()
void comStatusOut_out(FwIndexType portNum, Fw::Success &condition) const
Invoke output port comStatusOut.
virtual void parameterUpdated(FwPrmIdType id)
Called whenever a parameter is updated.
static constexpr FwIndexType getNum_encryptOut_OutputPorts()
Svc::InputComDataWithContextPort * get_bufferReturnIn_InputPort(FwIndexType portNum)
Enum representing a command response.
void addCallPort(InputCcsdsSdlsEncryptionPort *callPort)
Register an input port.
No time base has been established (Required)
void dataReturnIn_handlerBase(FwIndexType portNum, Fw::Buffer &data, const ComCfg::FrameContext &context)
Handler base-class function for input port dataReturnIn.
SerializeStatus serializeFrom(U8 val, Endianness mode=Endianness::BIG) override
Serialize an 8-bit unsigned integer value.
void addCallPort(InputCmdRegPort *callPort)
Register an input port.
CcsdsSdlsFramerComponentBase(const char *compName="")
Construct CcsdsSdlsFramerComponentBase object.
void addCallPort(InputSuccessConditionPort *callPort)
Register an input port.
Event raised when the allocated frame buffer is too small for the security association index and encr...
void encryptOut_out(FwIndexType portNum, U16 securityAssociationIndex, Fw::Buffer &data, const ComCfg::FrameContext &context) const
Invoke output port encryptOut.
static constexpr FwIndexType getNum_cmdIn_InputPorts()
void log_WARNING_HI_BufferAllocationFailed(FwSizeType allocationSize)
void init()
Initialization function.
Svc::Ccsds::InputCcsdsSdlsDataPort * get_encryptIn_InputPort(FwIndexType portNum)
void addCallPort(InputComDataWithContextPort *callPort)
Register an input port.
void addCallPort(InputPrmGetPort *callPort)
Register an input port.
void init()
Object initializer.
Definition: ObjBase.cpp:24
Status of an SDLS (Space Data Link Security) encryption/decryption request.
SerializeStatus
forward declaration for string
Fw::InputSuccessConditionPort * get_comStatusIn_InputPort(FwIndexType portNum)
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
Definition: CmdPortAc.cpp:95
void addCallPort(InputBufferGetPort *callPort)
Register an input port.
virtual SerializeStatus deserializeTo(U8 &val, Endianness mode=Endianness::BIG)=0
Deserialize an 8-bit unsigned integer value.
void init()
Initialization function.
void set_logOut_OutputPort(FwIndexType portNum, Fw::InputLogPort *port)
Connect port to logOut[portNum].
static constexpr FwIndexType getNum_cmdRegOut_OutputPorts()
FwIdType FwEventIdType
The type of an event identifier.
void invoke(FwOpcodeType opCode) const
Invoke a port connection.
void set_bufferAllocate_OutputPort(FwIndexType portNum, Fw::InputBufferGetPort *port)
Connect port to bufferAllocate[portNum].
void bufferDeallocate_out(FwIndexType portNum, Fw::Buffer &fwBuffer) const
Invoke output port bufferDeallocate.
static constexpr FwIndexType getNum_dataOut_OutputPorts()
#define FW_OBJECT_NAMES
Indicates whether or not object names are stored (more memory, can be used for tracking objects) ...
Definition: FpConfig.h:40
static constexpr FwIndexType getNum_timeCaller_OutputPorts()
void init()
Initialization function.
Definition: TimePortAc.cpp:151
void set_comStatusOut_OutputPort(FwIndexType portNum, Fw::InputSuccessConditionPort *port)
Connect port to comStatusOut[portNum].
bool isConnected_timeCaller_OutputPort(FwIndexType portNum) const
Data was the wrong format (e.g. wrong packet type)
Fw::Buffer bufferAllocate_out(FwIndexType portNum, FwSizeType size) const
Invoke output port bufferAllocate.
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
void dataOut_out(FwIndexType portNum, Fw::Buffer &data, const ComCfg::FrameContext &context) const
Invoke output port dataOut.
void invoke(Fw::Buffer &fwBuffer) const
Invoke a port connection.
Fw::ParamValid invoke(FwPrmIdType id, Fw::ParamBuffer &val) const
void set_cmdResponseOut_OutputPort(FwIndexType portNum, Fw::InputCmdResponsePort *port)
Connect port to cmdResponseOut[portNum].
void addCallPort(InputBufferSendPort *callPort)
Register an input port.
static constexpr FwIndexType getNum_comStatusOut_OutputPorts()
void invoke(Fw::Time &time) const
Invoke a port connection.
Definition: TimePortAc.cpp:170
virtual ~CcsdsSdlsFramerComponentBase()
Destroy CcsdsSdlsFramerComponentBase object.
void invoke(FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdResponse &response) const
Invoke a port connection.
void invoke(Fw::Success &condition) const
Invoke a port connection.
void invoke(Fw::Buffer &data, const ComCfg::FrameContext &context) const
Invoke a port connection.
Security association index used when the incoming frame context does not specify one.
void cmdResponse_out(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdResponse response)
Emit command response.
static constexpr FwIndexType getNum_prmGetOut_OutputPorts()
bool isConnected_cmdResponseOut_OutputPort(FwIndexType portNum) const
static constexpr FwIndexType getNum_dataReturnIn_InputPorts()
A serious but recoverable event.
void encryptReturnOut_out(FwIndexType portNum, Fw::Buffer &data, const ComCfg::FrameContext &context) const
Invoke output port encryptReturnOut.
void log_WARNING_HI_EncryptionFailed(const Svc::Ccsds::SdlsStatus &status)
void init()
Initialization function.
const char * toChar() const
Convert to a C-style char*.
bool isConnected() const
Definition: PortBase.cpp:38
void encryptIn_handlerBase(FwIndexType portNum, const Svc::Ccsds::SdlsStatus &status, Fw::Buffer &data, const ComCfg::FrameContext &context)
Handler base-class function for input port encryptIn.
Enum representing event severity.
static constexpr FwIndexType getNum_dataReturnOut_OutputPorts()
#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
Command successfully executed.
static constexpr FwIndexType getNum_bufferAllocate_OutputPorts()
void loadParameters()
Load the parameters from a parameter source.
void setPortNum(FwIndexType portNum)
void log_WARNING_HI_BufferAllocationFailed_ThrottleClear()
Reset throttle value for BufferAllocationFailed.
bool isConnected_dataReturnOut_OutputPort(FwIndexType portNum) const
Fw::Buffer invoke(FwSizeType size) const
virtual void parametersLoaded()
Called whenever parameters are loaded.
void lock()
lock the mutex and assert success
void init()
Initialization function.
void set_encryptReturnOut_OutputPort(FwIndexType portNum, Svc::InputComDataWithContextPort *port)
Connect port to encryptReturnOut[portNum].
virtual void dataReturnIn_handler(FwIndexType portNum, Fw::Buffer &data, const ComCfg::FrameContext &context)=0
Handler for input port dataReturnIn.
void set_dataOut_OutputPort(FwIndexType portNum, Svc::InputComDataWithContextPort *port)
Connect port to dataOut[portNum].
Command had execution error.
void init()
Initialization function.
virtual void dataIn_handler(FwIndexType portNum, Fw::Buffer &data, const ComCfg::FrameContext &context)=0
Handler for input port dataIn.
void invoke(FwEventIdType id, Fw::Time &timeTag, const Fw::LogSeverity &severity, Fw::LogBuffer &args) const
Invoke a port connection.
Definition: LogPortAc.cpp:199
bool isConnected_cmdRegOut_OutputPort(FwIndexType portNum) const
void set_encryptOut_OutputPort(FwIndexType portNum, Svc::Ccsds::InputCcsdsSdlsEncryptionPort *port)
Connect port to encryptOut[portNum].
Svc::InputComDataWithContextPort * get_dataReturnIn_InputPort(FwIndexType portNum)
void log_WARNING_HI_EncryptionFailed_ThrottleClear()
Reset throttle value for EncryptionFailed.
Svc::InputComDataWithContextPort * get_dataIn_InputPort(FwIndexType portNum)
static constexpr FwIndexType getNum_encryptReturnOut_OutputPorts()
PlatformIndexType FwIndexType
virtual void bufferReturnIn_handler(FwIndexType portNum, Fw::Buffer &data, const ComCfg::FrameContext &context)=0
Handler for input port bufferReturnIn.
locks a mutex within the current scope
bool isConnected_prmGetOut_OutputPort(FwIndexType portNum) const
void addCallPort(InputLogPort *callPort)
Register an input port.
Definition: LogPortAc.cpp:186
void dataReturnOut_out(FwIndexType portNum, Fw::Buffer &data, const ComCfg::FrameContext &context) const
Invoke output port dataReturnOut.
void init()
Initialization function.
Type used to pass context info between components during framing/deframing.
void unlock()
alias for unLock to meet BasicLockable requirements
void init()
Initialization function.
Command failed validation.
RateGroupDivider component implementation.
Enum representing parameter validity.
void invoke(FwPrmIdType id, Fw::ParamBuffer &val) const
Invoke a port connection.
The size of the serial representation.
bool isConnected_prmSetOut_OutputPort(FwIndexType portNum) const
void regCommands()
Register commands with the Command Dispatcher.
void set_cmdRegOut_OutputPort(FwIndexType portNum, Fw::InputCmdRegPort *port)
Connect port to cmdRegOut[portNum].
Implementation of malloc based allocator.
static constexpr FwIndexType getNum_comStatusIn_InputPorts()
bool isConnected_bufferAllocate_OutputPort(FwIndexType portNum) const
static constexpr FwIndexType getNum_cmdResponseOut_OutputPorts()
void init()
Initialization function.
void init()
Initialization function.
void init()
Initialization function.
#define FW_ASSERT(...)
Definition: Assert.hpp:14
bool isConnected_dataOut_OutputPort(FwIndexType portNum) const
Success/Failure.
static constexpr FwIndexType getNum_logOut_OutputPorts()
Fw::InputCmdPort * get_cmdIn_InputPort(FwIndexType portNum)
void addCallPort(InputCmdResponsePort *callPort)
Register an input port.
virtual void encryptIn_handler(FwIndexType portNum, const Svc::Ccsds::SdlsStatus &status, Fw::Buffer &data, const ComCfg::FrameContext &context)=0
Handler for input port encryptIn.
void set_bufferDeallocate_OutputPort(FwIndexType portNum, Fw::InputBufferSendPort *port)
Connect port to bufferDeallocate[portNum].
void cmdIn_handlerBase(FwIndexType portNum, FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
Handler base-class function for input port cmdIn.
void init()
Initialization function.
U32 FwIdType
The id type.
virtual void parameterLoaded(FwPrmIdType id, Fw::ParamValid valid)
Called for each parameter when parameters are loaded.