F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
EventManagerComponentAc.cpp
Go to the documentation of this file.
1 // ======================================================================
2 // \title EventManagerComponentAc.cpp
3 // \author Generated by fpp-to-cpp
4 // \brief cpp file for EventManager 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 {
17  enum MsgTypeEnum {
18  EVENTMANAGER_COMPONENT_EXIT = Fw::ActiveComponentBase::ACTIVE_COMPONENT_EXIT,
19  PINGIN_PING,
20  RUN_SCHED,
21  CMD_SET_ID_FILTER,
22  CMD_DUMP_FILTER_STATE,
23  INT_IF_LOQQUEUE,
24  };
25 
26  // Get the max size by constructing a union of the async input, command, and
27  // internal port serialization sizes
28  union BuffUnion {
32  // Size of loqQueue argument list
33  BYTE loqQueueIntIfSize[
34  sizeof(FwEventIdType) +
38  ];
39  };
40 
41  // Define a message buffer class large enough to handle all the
42  // asynchronous inputs to the component
43  class ComponentIpcSerializableBuffer :
45  {
46 
47  public:
48 
49  enum {
50  // Offset into data in buffer: Size of message ID and port number
51  DATA_OFFSET = sizeof(FwEnumStoreType) + sizeof(FwIndexType),
52  // Max data size
53  MAX_DATA_SIZE = sizeof(BuffUnion),
54  // Max message size: Size of message id + size of port + max data size
55  SERIALIZATION_SIZE = DATA_OFFSET + MAX_DATA_SIZE
56  };
57 
58  ComponentIpcSerializableBuffer() : Fw::LinearBufferBase(m_buff, sizeof(m_buff)) {
59 
60  }
61 
62  private:
63  // Should be the max of all the input ports serialized sizes...
64  U8 m_buff[SERIALIZATION_SIZE];
65 
66  };
67  }
68 
69  // ----------------------------------------------------------------------
70  // Component initialization
71  // ----------------------------------------------------------------------
72 
75  FwSizeType queueDepth,
76  FwEnumStoreType instance
77  )
78  {
79  // Initialize base class
81 
82 #if !FW_DIRECT_PORT_CALLS
83  // Connect input port CmdDisp
84  for (
85  FwIndexType port = 0;
86  port < static_cast<FwIndexType>(this->getNum_CmdDisp_InputPorts());
87  port++
88  ) {
89  this->m_CmdDisp_InputPort[port].init();
90  this->m_CmdDisp_InputPort[port].addCallComp(
91  this,
92  m_p_CmdDisp_in
93  );
94  this->m_CmdDisp_InputPort[port].setPortNum(port);
95 
96 #if FW_OBJECT_NAMES == 1
97  Fw::ObjectName portName;
98  portName.format(
99  "%s_CmdDisp_InputPort[%" PRI_FwIndexType "]",
100  this->m_objName.toChar(),
101  port
102  );
103  this->m_CmdDisp_InputPort[port].setObjName(portName.toChar());
104 #endif
105  }
106 #endif
107 
108 #if !FW_DIRECT_PORT_CALLS
109  // Connect input port LogRecv
110  for (
111  FwIndexType port = 0;
112  port < static_cast<FwIndexType>(this->getNum_LogRecv_InputPorts());
113  port++
114  ) {
115  this->m_LogRecv_InputPort[port].init();
116  this->m_LogRecv_InputPort[port].addCallComp(
117  this,
118  m_p_LogRecv_in
119  );
120  this->m_LogRecv_InputPort[port].setPortNum(port);
121 
122 #if FW_OBJECT_NAMES == 1
123  Fw::ObjectName portName;
124  portName.format(
125  "%s_LogRecv_InputPort[%" PRI_FwIndexType "]",
126  this->m_objName.toChar(),
127  port
128  );
129  this->m_LogRecv_InputPort[port].setObjName(portName.toChar());
130 #endif
131  }
132 #endif
133 
134 #if !FW_DIRECT_PORT_CALLS
135  // Connect input port pingIn
136  for (
137  FwIndexType port = 0;
138  port < static_cast<FwIndexType>(this->getNum_pingIn_InputPorts());
139  port++
140  ) {
141  this->m_pingIn_InputPort[port].init();
142  this->m_pingIn_InputPort[port].addCallComp(
143  this,
144  m_p_pingIn_in
145  );
146  this->m_pingIn_InputPort[port].setPortNum(port);
147 
148 #if FW_OBJECT_NAMES == 1
149  Fw::ObjectName portName;
150  portName.format(
151  "%s_pingIn_InputPort[%" PRI_FwIndexType "]",
152  this->m_objName.toChar(),
153  port
154  );
155  this->m_pingIn_InputPort[port].setObjName(portName.toChar());
156 #endif
157  }
158 #endif
159 
160 #if !FW_DIRECT_PORT_CALLS
161  // Connect input port run
162  for (
163  FwIndexType port = 0;
164  port < static_cast<FwIndexType>(this->getNum_run_InputPorts());
165  port++
166  ) {
167  this->m_run_InputPort[port].init();
168  this->m_run_InputPort[port].addCallComp(
169  this,
170  m_p_run_in
171  );
172  this->m_run_InputPort[port].setPortNum(port);
173 
174 #if FW_OBJECT_NAMES == 1
175  Fw::ObjectName portName;
176  portName.format(
177  "%s_run_InputPort[%" PRI_FwIndexType "]",
178  this->m_objName.toChar(),
179  port
180  );
181  this->m_run_InputPort[port].setObjName(portName.toChar());
182 #endif
183  }
184 #endif
185 
186 #if !FW_DIRECT_PORT_CALLS
187  // Connect output port CmdReg
188  for (
189  FwIndexType port = 0;
190  port < static_cast<FwIndexType>(this->getNum_CmdReg_OutputPorts());
191  port++
192  ) {
193  this->m_CmdReg_OutputPort[port].init();
194 
195 #if FW_OBJECT_NAMES == 1
196  Fw::ObjectName portName;
197  portName.format(
198  "%s_CmdReg_OutputPort[%" PRI_FwIndexType "]",
199  this->m_objName.toChar(),
200  port
201  );
202  this->m_CmdReg_OutputPort[port].setObjName(portName.toChar());
203 #endif
204  }
205 #endif
206 
207 #if !FW_DIRECT_PORT_CALLS
208  // Connect output port CmdStatus
209  for (
210  FwIndexType port = 0;
211  port < static_cast<FwIndexType>(this->getNum_CmdStatus_OutputPorts());
212  port++
213  ) {
214  this->m_CmdStatus_OutputPort[port].init();
215 
216 #if FW_OBJECT_NAMES == 1
217  Fw::ObjectName portName;
218  portName.format(
219  "%s_CmdStatus_OutputPort[%" PRI_FwIndexType "]",
220  this->m_objName.toChar(),
221  port
222  );
223  this->m_CmdStatus_OutputPort[port].setObjName(portName.toChar());
224 #endif
225  }
226 #endif
227 
228 #if !FW_DIRECT_PORT_CALLS
229  // Connect output port Log
230  for (
231  FwIndexType port = 0;
232  port < static_cast<FwIndexType>(this->getNum_Log_OutputPorts());
233  port++
234  ) {
235  this->m_Log_OutputPort[port].init();
236 
237 #if FW_OBJECT_NAMES == 1
238  Fw::ObjectName portName;
239  portName.format(
240  "%s_Log_OutputPort[%" PRI_FwIndexType "]",
241  this->m_objName.toChar(),
242  port
243  );
244  this->m_Log_OutputPort[port].setObjName(portName.toChar());
245 #endif
246  }
247 #endif
248 
249 #if !FW_DIRECT_PORT_CALLS && FW_ENABLE_TEXT_LOGGING
250  // Connect output port LogText
251  for (
252  FwIndexType port = 0;
253  port < static_cast<FwIndexType>(this->getNum_LogText_OutputPorts());
254  port++
255  ) {
256  this->m_LogText_OutputPort[port].init();
257 
258 #if FW_OBJECT_NAMES == 1
259  Fw::ObjectName portName;
260  portName.format(
261  "%s_LogText_OutputPort[%" PRI_FwIndexType "]",
262  this->m_objName.toChar(),
263  port
264  );
265  this->m_LogText_OutputPort[port].setObjName(portName.toChar());
266 #endif
267  }
268 #endif
269 
270 #if !FW_DIRECT_PORT_CALLS
271  // Connect output port Time
272  for (
273  FwIndexType port = 0;
274  port < static_cast<FwIndexType>(this->getNum_Time_OutputPorts());
275  port++
276  ) {
277  this->m_Time_OutputPort[port].init();
278 
279 #if FW_OBJECT_NAMES == 1
280  Fw::ObjectName portName;
281  portName.format(
282  "%s_Time_OutputPort[%" PRI_FwIndexType "]",
283  this->m_objName.toChar(),
284  port
285  );
286  this->m_Time_OutputPort[port].setObjName(portName.toChar());
287 #endif
288  }
289 #endif
290 
291 #if !FW_DIRECT_PORT_CALLS
292  // Connect output port Tlm
293  for (
294  FwIndexType port = 0;
295  port < static_cast<FwIndexType>(this->getNum_Tlm_OutputPorts());
296  port++
297  ) {
298  this->m_Tlm_OutputPort[port].init();
299 
300 #if FW_OBJECT_NAMES == 1
301  Fw::ObjectName portName;
302  portName.format(
303  "%s_Tlm_OutputPort[%" PRI_FwIndexType "]",
304  this->m_objName.toChar(),
305  port
306  );
307  this->m_Tlm_OutputPort[port].setObjName(portName.toChar());
308 #endif
309  }
310 #endif
311 
312 #if !FW_DIRECT_PORT_CALLS
313  // Connect output port FatalAnnounce
314  for (
315  FwIndexType port = 0;
316  port < static_cast<FwIndexType>(this->getNum_FatalAnnounce_OutputPorts());
317  port++
318  ) {
319  this->m_FatalAnnounce_OutputPort[port].init();
320 
321 #if FW_OBJECT_NAMES == 1
322  Fw::ObjectName portName;
323  portName.format(
324  "%s_FatalAnnounce_OutputPort[%" PRI_FwIndexType "]",
325  this->m_objName.toChar(),
326  port
327  );
328  this->m_FatalAnnounce_OutputPort[port].setObjName(portName.toChar());
329 #endif
330  }
331 #endif
332 
333 #if !FW_DIRECT_PORT_CALLS
334  // Connect output port PktSend
335  for (
336  FwIndexType port = 0;
337  port < static_cast<FwIndexType>(this->getNum_PktSend_OutputPorts());
338  port++
339  ) {
340  this->m_PktSend_OutputPort[port].init();
341 
342 #if FW_OBJECT_NAMES == 1
343  Fw::ObjectName portName;
344  portName.format(
345  "%s_PktSend_OutputPort[%" PRI_FwIndexType "]",
346  this->m_objName.toChar(),
347  port
348  );
349  this->m_PktSend_OutputPort[port].setObjName(portName.toChar());
350 #endif
351  }
352 #endif
353 
354 #if !FW_DIRECT_PORT_CALLS
355  // Connect output port pingOut
356  for (
357  FwIndexType port = 0;
358  port < static_cast<FwIndexType>(this->getNum_pingOut_OutputPorts());
359  port++
360  ) {
361  this->m_pingOut_OutputPort[port].init();
362 
363 #if FW_OBJECT_NAMES == 1
364  Fw::ObjectName portName;
365  portName.format(
366  "%s_pingOut_OutputPort[%" PRI_FwIndexType "]",
367  this->m_objName.toChar(),
368  port
369  );
370  this->m_pingOut_OutputPort[port].setObjName(portName.toChar());
371 #endif
372  }
373 #endif
374 
375  // Create the queue
376  Os::Queue::Status qStat = this->createQueue(
377  queueDepth,
378  static_cast<FwSizeType>(ComponentIpcSerializableBuffer::SERIALIZATION_SIZE)
379  );
380  FW_ASSERT(
381  Os::Queue::Status::OP_OK == qStat,
382  static_cast<FwAssertArgType>(qStat)
383  );
384  }
385 
386 #if !FW_DIRECT_PORT_CALLS
387 
388  // ----------------------------------------------------------------------
389  // Getters for special input ports
390  // ----------------------------------------------------------------------
391 
394  {
395  FW_ASSERT(
396  (0 <= portNum) && (portNum < this->getNum_CmdDisp_InputPorts()),
397  static_cast<FwAssertArgType>(portNum)
398  );
399 
400  return &this->m_CmdDisp_InputPort[portNum];
401  }
402 
403 #endif
404 
405 #if !FW_DIRECT_PORT_CALLS
406 
407  // ----------------------------------------------------------------------
408  // Getters for typed input ports
409  // ----------------------------------------------------------------------
410 
413  {
414  FW_ASSERT(
415  (0 <= portNum) && (portNum < this->getNum_LogRecv_InputPorts()),
416  static_cast<FwAssertArgType>(portNum)
417  );
418 
419  return &this->m_LogRecv_InputPort[portNum];
420  }
421 
424  {
425  FW_ASSERT(
426  (0 <= portNum) && (portNum < this->getNum_pingIn_InputPorts()),
427  static_cast<FwAssertArgType>(portNum)
428  );
429 
430  return &this->m_pingIn_InputPort[portNum];
431  }
432 
435  {
436  FW_ASSERT(
437  (0 <= portNum) && (portNum < this->getNum_run_InputPorts()),
438  static_cast<FwAssertArgType>(portNum)
439  );
440 
441  return &this->m_run_InputPort[portNum];
442  }
443 
444 #endif
445 
446 #if !FW_DIRECT_PORT_CALLS
447 
448  // ----------------------------------------------------------------------
449  // Connect input ports to special output ports
450  // ----------------------------------------------------------------------
451 
454  FwIndexType portNum,
455  Fw::InputCmdRegPort* port
456  )
457  {
458  FW_ASSERT(
459  (0 <= portNum) && (portNum < this->getNum_CmdReg_OutputPorts()),
460  static_cast<FwAssertArgType>(portNum)
461  );
462 
463  this->m_CmdReg_OutputPort[portNum].addCallPort(port);
464  }
465 
468  FwIndexType portNum,
470  )
471  {
472  FW_ASSERT(
473  (0 <= portNum) && (portNum < this->getNum_CmdStatus_OutputPorts()),
474  static_cast<FwAssertArgType>(portNum)
475  );
476 
477  this->m_CmdStatus_OutputPort[portNum].addCallPort(port);
478  }
479 
482  FwIndexType portNum,
483  Fw::InputLogPort* port
484  )
485  {
486  FW_ASSERT(
487  (0 <= portNum) && (portNum < this->getNum_Log_OutputPorts()),
488  static_cast<FwAssertArgType>(portNum)
489  );
490 
491  this->m_Log_OutputPort[portNum].addCallPort(port);
492  }
493 
494 #if FW_ENABLE_TEXT_LOGGING == 1
495 
496  void EventManagerComponentBase ::
497  set_LogText_OutputPort(
498  FwIndexType portNum,
500  )
501  {
502  FW_ASSERT(
503  (0 <= portNum) && (portNum < this->getNum_LogText_OutputPorts()),
504  static_cast<FwAssertArgType>(portNum)
505  );
506 
507  this->m_LogText_OutputPort[portNum].addCallPort(port);
508  }
509 
510 #endif
511 
514  FwIndexType portNum,
515  Fw::InputTimePort* port
516  )
517  {
518  FW_ASSERT(
519  (0 <= portNum) && (portNum < this->getNum_Time_OutputPorts()),
520  static_cast<FwAssertArgType>(portNum)
521  );
522 
523  this->m_Time_OutputPort[portNum].addCallPort(port);
524  }
525 
528  FwIndexType portNum,
529  Fw::InputTlmPort* port
530  )
531  {
532  FW_ASSERT(
533  (0 <= portNum) && (portNum < this->getNum_Tlm_OutputPorts()),
534  static_cast<FwAssertArgType>(portNum)
535  );
536 
537  this->m_Tlm_OutputPort[portNum].addCallPort(port);
538  }
539 
540 #endif
541 
542 #if !FW_DIRECT_PORT_CALLS
543 
544  // ----------------------------------------------------------------------
545  // Connect typed input ports to typed output ports
546  // ----------------------------------------------------------------------
547 
550  FwIndexType portNum,
552  )
553  {
554  FW_ASSERT(
555  (0 <= portNum) && (portNum < this->getNum_FatalAnnounce_OutputPorts()),
556  static_cast<FwAssertArgType>(portNum)
557  );
558 
559  this->m_FatalAnnounce_OutputPort[portNum].addCallPort(port);
560  }
561 
564  FwIndexType portNum,
565  Fw::InputComPort* port
566  )
567  {
568  FW_ASSERT(
569  (0 <= portNum) && (portNum < this->getNum_PktSend_OutputPorts()),
570  static_cast<FwAssertArgType>(portNum)
571  );
572 
573  this->m_PktSend_OutputPort[portNum].addCallPort(port);
574  }
575 
578  FwIndexType portNum,
579  Svc::InputPingPort* port
580  )
581  {
582  FW_ASSERT(
583  (0 <= portNum) && (portNum < this->getNum_pingOut_OutputPorts()),
584  static_cast<FwAssertArgType>(portNum)
585  );
586 
587  this->m_pingOut_OutputPort[portNum].addCallPort(port);
588  }
589 
590 #endif
591 
592 #if !FW_DIRECT_PORT_CALLS && FW_PORT_SERIALIZATION
593 
594  // ----------------------------------------------------------------------
595  // Connect serial input ports to special output ports
596  // ----------------------------------------------------------------------
597 
600  FwIndexType portNum,
601  Fw::InputSerializePort* port
602  )
603  {
604  FW_ASSERT(
605  (0 <= portNum) && (portNum < this->getNum_CmdReg_OutputPorts()),
606  static_cast<FwAssertArgType>(portNum)
607  );
608 
609  this->m_CmdReg_OutputPort[portNum].registerSerialPort(port);
610  }
611 
614  FwIndexType portNum,
615  Fw::InputSerializePort* port
616  )
617  {
618  FW_ASSERT(
619  (0 <= portNum) && (portNum < this->getNum_CmdStatus_OutputPorts()),
620  static_cast<FwAssertArgType>(portNum)
621  );
622 
623  this->m_CmdStatus_OutputPort[portNum].registerSerialPort(port);
624  }
625 
628  FwIndexType portNum,
629  Fw::InputSerializePort* port
630  )
631  {
632  FW_ASSERT(
633  (0 <= portNum) && (portNum < this->getNum_Log_OutputPorts()),
634  static_cast<FwAssertArgType>(portNum)
635  );
636 
637  this->m_Log_OutputPort[portNum].registerSerialPort(port);
638  }
639 
640 #if FW_ENABLE_TEXT_LOGGING == 1
641 
642  void EventManagerComponentBase ::
643  set_LogText_OutputPort(
644  FwIndexType portNum,
645  Fw::InputSerializePort* port
646  )
647  {
648  FW_ASSERT(
649  (0 <= portNum) && (portNum < this->getNum_LogText_OutputPorts()),
650  static_cast<FwAssertArgType>(portNum)
651  );
652 
653  this->m_LogText_OutputPort[portNum].registerSerialPort(port);
654  }
655 
656 #endif
657 
660  FwIndexType portNum,
661  Fw::InputSerializePort* port
662  )
663  {
664  FW_ASSERT(
665  (0 <= portNum) && (portNum < this->getNum_Time_OutputPorts()),
666  static_cast<FwAssertArgType>(portNum)
667  );
668 
669  this->m_Time_OutputPort[portNum].registerSerialPort(port);
670  }
671 
674  FwIndexType portNum,
675  Fw::InputSerializePort* port
676  )
677  {
678  FW_ASSERT(
679  (0 <= portNum) && (portNum < this->getNum_Tlm_OutputPorts()),
680  static_cast<FwAssertArgType>(portNum)
681  );
682 
683  this->m_Tlm_OutputPort[portNum].registerSerialPort(port);
684  }
685 
686 #endif
687 
688 #if !FW_DIRECT_PORT_CALLS && FW_PORT_SERIALIZATION
689 
690  // ----------------------------------------------------------------------
691  // Connect serial input ports to typed output ports
692  // ----------------------------------------------------------------------
693 
696  FwIndexType portNum,
697  Fw::InputSerializePort* port
698  )
699  {
700  FW_ASSERT(
701  (0 <= portNum) && (portNum < this->getNum_FatalAnnounce_OutputPorts()),
702  static_cast<FwAssertArgType>(portNum)
703  );
704 
705  this->m_FatalAnnounce_OutputPort[portNum].registerSerialPort(port);
706  }
707 
710  FwIndexType portNum,
711  Fw::InputSerializePort* port
712  )
713  {
714  FW_ASSERT(
715  (0 <= portNum) && (portNum < this->getNum_PktSend_OutputPorts()),
716  static_cast<FwAssertArgType>(portNum)
717  );
718 
719  this->m_PktSend_OutputPort[portNum].registerSerialPort(port);
720  }
721 
724  FwIndexType portNum,
725  Fw::InputSerializePort* port
726  )
727  {
728  FW_ASSERT(
729  (0 <= portNum) && (portNum < this->getNum_pingOut_OutputPorts()),
730  static_cast<FwAssertArgType>(portNum)
731  );
732 
733  this->m_pingOut_OutputPort[portNum].registerSerialPort(port);
734  }
735 
736 #endif
737 
738  // ----------------------------------------------------------------------
739  // Command registration
740  // ----------------------------------------------------------------------
741 
744  {
746 
747  this->CmdReg_out(
748  0,
750  );
751 
752  this->CmdReg_out(
753  0,
755  );
756 
757  this->CmdReg_out(
758  0,
760  );
761  }
762 
763  // ----------------------------------------------------------------------
764  // Component construction and destruction
765  // ----------------------------------------------------------------------
766 
768  EventManagerComponentBase(const char* compName) :
769  Fw::ActiveComponentBase(compName)
770  {
771 
772  }
773 
776  {
777 
778  }
779 
780 #if !FW_DIRECT_PORT_CALLS
781 
782  // ----------------------------------------------------------------------
783  // Connection status queries for special output ports
784  // ----------------------------------------------------------------------
785 
788  {
789  FW_ASSERT(
790  (0 <= portNum) && (portNum < this->getNum_CmdReg_OutputPorts()),
791  static_cast<FwAssertArgType>(portNum)
792  );
793 
794  return this->m_CmdReg_OutputPort[portNum].isConnected();
795  }
796 
799  {
800  FW_ASSERT(
801  (0 <= portNum) && (portNum < this->getNum_CmdStatus_OutputPorts()),
802  static_cast<FwAssertArgType>(portNum)
803  );
804 
805  return this->m_CmdStatus_OutputPort[portNum].isConnected();
806  }
807 
810  {
811  FW_ASSERT(
812  (0 <= portNum) && (portNum < this->getNum_Log_OutputPorts()),
813  static_cast<FwAssertArgType>(portNum)
814  );
815 
816  return this->m_Log_OutputPort[portNum].isConnected();
817  }
818 
819 #if FW_ENABLE_TEXT_LOGGING == 1
820 
821  bool EventManagerComponentBase ::
822  isConnected_LogText_OutputPort(FwIndexType portNum) const
823  {
824  FW_ASSERT(
825  (0 <= portNum) && (portNum < this->getNum_LogText_OutputPorts()),
826  static_cast<FwAssertArgType>(portNum)
827  );
828 
829  return this->m_LogText_OutputPort[portNum].isConnected();
830  }
831 
832 #endif
833 
836  {
837  FW_ASSERT(
838  (0 <= portNum) && (portNum < this->getNum_Time_OutputPorts()),
839  static_cast<FwAssertArgType>(portNum)
840  );
841 
842  return this->m_Time_OutputPort[portNum].isConnected();
843  }
844 
847  {
848  FW_ASSERT(
849  (0 <= portNum) && (portNum < this->getNum_Tlm_OutputPorts()),
850  static_cast<FwAssertArgType>(portNum)
851  );
852 
853  return this->m_Tlm_OutputPort[portNum].isConnected();
854  }
855 
856 #endif
857 
858 #if !FW_DIRECT_PORT_CALLS
859 
860  // ----------------------------------------------------------------------
861  // Connection status queries for typed output ports
862  // ----------------------------------------------------------------------
863 
866  {
867  FW_ASSERT(
868  (0 <= portNum) && (portNum < this->getNum_FatalAnnounce_OutputPorts()),
869  static_cast<FwAssertArgType>(portNum)
870  );
871 
872  return this->m_FatalAnnounce_OutputPort[portNum].isConnected();
873  }
874 
877  {
878  FW_ASSERT(
879  (0 <= portNum) && (portNum < this->getNum_PktSend_OutputPorts()),
880  static_cast<FwAssertArgType>(portNum)
881  );
882 
883  return this->m_PktSend_OutputPort[portNum].isConnected();
884  }
885 
888  {
889  FW_ASSERT(
890  (0 <= portNum) && (portNum < this->getNum_pingOut_OutputPorts()),
891  static_cast<FwAssertArgType>(portNum)
892  );
893 
894  return this->m_pingOut_OutputPort[portNum].isConnected();
895  }
896 
897 #endif
898 
899  // ----------------------------------------------------------------------
900  // Port handler base-class functions for special input ports
901  //
902  // Call these functions directly to bypass the corresponding ports
903  // ----------------------------------------------------------------------
904 
907  FwIndexType portNum,
908  FwOpcodeType opCode,
909  U32 cmdSeq,
910  Fw::CmdArgBuffer& args
911  )
912  {
913 
914  const U32 idBase = this->getIdBase();
915  FW_ASSERT(opCode >= idBase, static_cast<FwAssertArgType>(opCode), static_cast<FwAssertArgType>(idBase));
916 
917  // Select base class function based on opcode
918  switch (opCode - idBase) {
921  opCode,
922  cmdSeq,
923  args
924  );
925  break;
926  }
927 
928  case OPCODE_SET_ID_FILTER: {
930  opCode,
931  cmdSeq,
932  args
933  );
934  break;
935  }
936 
939  opCode,
940  cmdSeq,
941  args
942  );
943  break;
944  }
945  default:
946  // Unknown opcode: ignore it
947  break;
948  }
949  }
950 
951  // ----------------------------------------------------------------------
952  // Port handler base-class functions for typed input ports
953  //
954  // Call these functions directly to bypass the corresponding ports
955  // ----------------------------------------------------------------------
956 
959  FwIndexType portNum,
960  FwEventIdType id,
961  Fw::Time& timeTag,
962  const Fw::LogSeverity& severity,
963  Fw::LogBuffer& args
964  )
965  {
966  // Make sure port number is valid
967  FW_ASSERT(
968  (0 <= portNum) && (portNum < this->getNum_LogRecv_InputPorts()),
969  static_cast<FwAssertArgType>(portNum)
970  );
971 
972  // Call handler function
973  this->LogRecv_handler(
974  portNum,
975  id,
976  timeTag,
977  severity,
978  args
979  );
980  }
981 
984  FwIndexType portNum,
985  U32 key
986  )
987  {
988  // Make sure port number is valid
989  FW_ASSERT(
990  (0 <= portNum) && (portNum < this->getNum_pingIn_InputPorts()),
991  static_cast<FwAssertArgType>(portNum)
992  );
993 
994  // Call pre-message hook
996  portNum,
997  key
998  );
999  ComponentIpcSerializableBuffer msg;
1001 
1002  // Serialize message ID
1003  _status = msg.serializeFrom(
1004  static_cast<FwEnumStoreType>(PINGIN_PING)
1005  );
1006  FW_ASSERT(
1007  _status == Fw::FW_SERIALIZE_OK,
1008  static_cast<FwAssertArgType>(_status)
1009  );
1010 
1011  // Serialize port number
1012  _status = msg.serializeFrom(portNum);
1013  FW_ASSERT(
1014  _status == Fw::FW_SERIALIZE_OK,
1015  static_cast<FwAssertArgType>(_status)
1016  );
1017 
1018  // Serialize argument key
1019  _status = msg.serializeFrom(key);
1020  FW_ASSERT(
1021  _status == Fw::FW_SERIALIZE_OK,
1022  static_cast<FwAssertArgType>(_status)
1023  );
1024 
1025  // Send message
1027  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1028 
1029  if (qStatus == Os::Queue::Status::FULL) {
1030  this->incNumMsgDropped();
1031  return;
1032  }
1033 
1034  FW_ASSERT(
1035  qStatus == Os::Queue::OP_OK,
1036  static_cast<FwAssertArgType>(qStatus)
1037  );
1038  }
1039 
1042  FwIndexType portNum,
1043  U32 context
1044  )
1045  {
1046  // Make sure port number is valid
1047  FW_ASSERT(
1048  (0 <= portNum) && (portNum < this->getNum_run_InputPorts()),
1049  static_cast<FwAssertArgType>(portNum)
1050  );
1051 
1052  // Call pre-message hook
1054  portNum,
1055  context
1056  );
1057  ComponentIpcSerializableBuffer msg;
1059 
1060  // Serialize message ID
1061  _status = msg.serializeFrom(
1062  static_cast<FwEnumStoreType>(RUN_SCHED)
1063  );
1064  FW_ASSERT(
1065  _status == Fw::FW_SERIALIZE_OK,
1066  static_cast<FwAssertArgType>(_status)
1067  );
1068 
1069  // Serialize port number
1070  _status = msg.serializeFrom(portNum);
1071  FW_ASSERT(
1072  _status == Fw::FW_SERIALIZE_OK,
1073  static_cast<FwAssertArgType>(_status)
1074  );
1075 
1076  // Serialize argument context
1077  _status = msg.serializeFrom(context);
1078  FW_ASSERT(
1079  _status == Fw::FW_SERIALIZE_OK,
1080  static_cast<FwAssertArgType>(_status)
1081  );
1082 
1083  // Send message
1085  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1086 
1087  if (qStatus == Os::Queue::Status::FULL) {
1088  this->incNumMsgDropped();
1089  return;
1090  }
1091 
1092  FW_ASSERT(
1093  qStatus == Os::Queue::OP_OK,
1094  static_cast<FwAssertArgType>(qStatus)
1095  );
1096  }
1097 
1098  // ----------------------------------------------------------------------
1099  // Pre-message hooks for typed async input ports
1100  //
1101  // Each of these functions is invoked just before processing a message
1102  // on the corresponding port. By default, they do nothing. You can
1103  // override them to provide specific pre-message behavior.
1104  // ----------------------------------------------------------------------
1105 
1108  FwIndexType portNum,
1109  U32 key
1110  )
1111  {
1112  // Default: no-op
1113  }
1114 
1117  FwIndexType portNum,
1118  U32 context
1119  )
1120  {
1121  // Default: no-op
1122  }
1123 
1124 #if !FW_DIRECT_PORT_CALLS
1125 
1126  // ----------------------------------------------------------------------
1127  // Invocation functions for typed output ports
1128  // ----------------------------------------------------------------------
1129 
1132  FwIndexType portNum,
1133  FwEventIdType Id
1134  ) const
1135  {
1136  FW_ASSERT(
1137  (0 <= portNum) && (portNum < this->getNum_FatalAnnounce_OutputPorts()),
1138  static_cast<FwAssertArgType>(portNum)
1139  );
1140 
1141  FW_ASSERT(
1142  this->m_FatalAnnounce_OutputPort[portNum].isConnected(),
1143  static_cast<FwAssertArgType>(portNum)
1144  );
1145  this->m_FatalAnnounce_OutputPort[portNum].invoke(
1146  Id
1147  );
1148  }
1149 
1152  FwIndexType portNum,
1153  Fw::ComBuffer& data,
1154  U32 context
1155  ) const
1156  {
1157  FW_ASSERT(
1158  (0 <= portNum) && (portNum < this->getNum_PktSend_OutputPorts()),
1159  static_cast<FwAssertArgType>(portNum)
1160  );
1161 
1162  FW_ASSERT(
1163  this->m_PktSend_OutputPort[portNum].isConnected(),
1164  static_cast<FwAssertArgType>(portNum)
1165  );
1166  this->m_PktSend_OutputPort[portNum].invoke(
1167  data,
1168  context
1169  );
1170  }
1171 
1174  FwIndexType portNum,
1175  U32 key
1176  ) const
1177  {
1178  FW_ASSERT(
1179  (0 <= portNum) && (portNum < this->getNum_pingOut_OutputPorts()),
1180  static_cast<FwAssertArgType>(portNum)
1181  );
1182 
1183  FW_ASSERT(
1184  this->m_pingOut_OutputPort[portNum].isConnected(),
1185  static_cast<FwAssertArgType>(portNum)
1186  );
1187  this->m_pingOut_OutputPort[portNum].invoke(
1188  key
1189  );
1190  }
1191 
1192 #endif
1193 
1194  // ----------------------------------------------------------------------
1195  // Internal interface base-class functions
1196  // ----------------------------------------------------------------------
1197 
1200  FwEventIdType id,
1201  const Fw::Time& timeTag,
1202  const Fw::LogSeverity& severity,
1203  const Fw::LogBuffer& args
1204  )
1205  {
1206  ComponentIpcSerializableBuffer msg;
1208 
1209  // Serialize the message ID
1210  _status = msg.serializeFrom(static_cast<FwEnumStoreType>(INT_IF_LOQQUEUE));
1211  FW_ASSERT (
1212  _status == Fw::FW_SERIALIZE_OK,
1213  static_cast<FwAssertArgType>(_status)
1214  );
1215 
1216  // Fake port number to make message dequeue work
1217  _status = msg.serializeFrom(static_cast<FwIndexType>(0));
1218  FW_ASSERT (
1219  _status == Fw::FW_SERIALIZE_OK,
1220  static_cast<FwAssertArgType>(_status)
1221  );
1222 
1223  _status = msg.serializeFrom(id);
1224  FW_ASSERT(
1225  _status == Fw::FW_SERIALIZE_OK,
1226  static_cast<FwAssertArgType>(_status)
1227  );
1228 
1229  _status = msg.serializeFrom(timeTag);
1230  FW_ASSERT(
1231  _status == Fw::FW_SERIALIZE_OK,
1232  static_cast<FwAssertArgType>(_status)
1233  );
1234 
1235  _status = msg.serializeFrom(severity);
1236  FW_ASSERT(
1237  _status == Fw::FW_SERIALIZE_OK,
1238  static_cast<FwAssertArgType>(_status)
1239  );
1240 
1241  _status = msg.serializeFrom(args);
1242  FW_ASSERT(
1243  _status == Fw::FW_SERIALIZE_OK,
1244  static_cast<FwAssertArgType>(_status)
1245  );
1246 
1247  // Send message
1249  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1250 
1251  if (qStatus == Os::Queue::Status::FULL) {
1252  this->incNumMsgDropped();
1253  return;
1254  }
1255 
1256  FW_ASSERT(
1257  qStatus == Os::Queue::OP_OK,
1258  static_cast<FwAssertArgType>(qStatus)
1259  );
1260  }
1261 
1262  // ----------------------------------------------------------------------
1263  // Command response
1264  // ----------------------------------------------------------------------
1265 
1268  FwOpcodeType opCode,
1269  U32 cmdSeq,
1270  Fw::CmdResponse response
1271  )
1272  {
1274  this->CmdStatus_out(0, opCode, cmdSeq, response);
1275  }
1276 
1277  // ----------------------------------------------------------------------
1278  // Command handler base-class functions
1279  //
1280  // Call these functions directly to bypass the command input port
1281  // ----------------------------------------------------------------------
1282 
1285  FwOpcodeType opCode,
1286  U32 cmdSeq,
1287  Fw::CmdArgBuffer& args
1288  )
1289  {
1290  // Deserialize the arguments
1292 
1293  // Reset the buffer
1294  args.resetDeser();
1295 
1297  _status = args.deserializeTo(filterLevel);
1298  if (_status != Fw::FW_SERIALIZE_OK) {
1299  if (this->isConnected_CmdStatus_OutputPort(0)) {
1300  this->CmdStatus_out(
1301  0,
1302  opCode,
1303  cmdSeq,
1305  );
1306  }
1307  return;
1308  }
1309 
1310  Svc::EventManager_Enabled filterEnabled;
1311  _status = args.deserializeTo(filterEnabled);
1312  if (_status != Fw::FW_SERIALIZE_OK) {
1313  if (this->isConnected_CmdStatus_OutputPort(0)) {
1314  this->CmdStatus_out(
1315  0,
1316  opCode,
1317  cmdSeq,
1319  );
1320  }
1321  return;
1322  }
1323 
1324 #if FW_CMD_CHECK_RESIDUAL
1325  // Make sure there was no data left over.
1326  // That means the argument buffer size was incorrect.
1327  if (args.getDeserializeSizeLeft() != 0) {
1328  if (this->isConnected_CmdStatus_OutputPort(0)) {
1329  this->CmdStatus_out(
1330  0,
1331  opCode,
1332  cmdSeq,
1334  );
1335  }
1336  return;
1337  }
1338 #endif
1339 
1341  opCode, cmdSeq,
1342  filterLevel,
1343  filterEnabled
1344  );
1345  }
1346 
1349  FwOpcodeType opCode,
1350  U32 cmdSeq,
1351  Fw::CmdArgBuffer& args
1352  )
1353  {
1354  // Call pre-message hook
1355  this->SET_ID_FILTER_preMsgHook(opCode,cmdSeq);
1356 
1357  // Defer deserializing arguments to the message dispatcher
1358  // to avoid deserializing and reserializing just for IPC
1359  ComponentIpcSerializableBuffer msg;
1361 
1362  // Serialize for IPC
1363  _status = msg.serializeFrom(static_cast<FwEnumStoreType>(CMD_SET_ID_FILTER));
1364  FW_ASSERT (
1365  _status == Fw::FW_SERIALIZE_OK,
1366  static_cast<FwAssertArgType>(_status)
1367  );
1368 
1369  // Fake port number to make message dequeue work
1370  FwIndexType port = 0;
1371 
1372  _status = msg.serializeFrom(port);
1373  FW_ASSERT (
1374  _status == Fw::FW_SERIALIZE_OK,
1375  static_cast<FwAssertArgType>(_status)
1376  );
1377 
1378  _status = msg.serializeFrom(opCode);
1379  FW_ASSERT (
1380  _status == Fw::FW_SERIALIZE_OK,
1381  static_cast<FwAssertArgType>(_status)
1382  );
1383 
1384  _status = msg.serializeFrom(cmdSeq);
1385  FW_ASSERT (
1386  _status == Fw::FW_SERIALIZE_OK,
1387  static_cast<FwAssertArgType>(_status)
1388  );
1389 
1390  _status = msg.serializeFrom(args);
1391  FW_ASSERT (
1392  _status == Fw::FW_SERIALIZE_OK,
1393  static_cast<FwAssertArgType>(_status)
1394  );
1395 
1396  // Send message
1398  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1399 
1400  FW_ASSERT(
1401  qStatus == Os::Queue::OP_OK,
1402  static_cast<FwAssertArgType>(qStatus)
1403  );
1404  }
1405 
1408  FwOpcodeType opCode,
1409  U32 cmdSeq,
1410  Fw::CmdArgBuffer& args
1411  )
1412  {
1413  // Call pre-message hook
1414  this->DUMP_FILTER_STATE_preMsgHook(opCode,cmdSeq);
1415 
1416  // Defer deserializing arguments to the message dispatcher
1417  // to avoid deserializing and reserializing just for IPC
1418  ComponentIpcSerializableBuffer msg;
1420 
1421  // Serialize for IPC
1422  _status = msg.serializeFrom(static_cast<FwEnumStoreType>(CMD_DUMP_FILTER_STATE));
1423  FW_ASSERT (
1424  _status == Fw::FW_SERIALIZE_OK,
1425  static_cast<FwAssertArgType>(_status)
1426  );
1427 
1428  // Fake port number to make message dequeue work
1429  FwIndexType port = 0;
1430 
1431  _status = msg.serializeFrom(port);
1432  FW_ASSERT (
1433  _status == Fw::FW_SERIALIZE_OK,
1434  static_cast<FwAssertArgType>(_status)
1435  );
1436 
1437  _status = msg.serializeFrom(opCode);
1438  FW_ASSERT (
1439  _status == Fw::FW_SERIALIZE_OK,
1440  static_cast<FwAssertArgType>(_status)
1441  );
1442 
1443  _status = msg.serializeFrom(cmdSeq);
1444  FW_ASSERT (
1445  _status == Fw::FW_SERIALIZE_OK,
1446  static_cast<FwAssertArgType>(_status)
1447  );
1448 
1449  _status = msg.serializeFrom(args);
1450  FW_ASSERT (
1451  _status == Fw::FW_SERIALIZE_OK,
1452  static_cast<FwAssertArgType>(_status)
1453  );
1454 
1455  // Send message
1457  Os::Queue::Status qStatus = this->m_queue.send(msg, 0, _block);
1458 
1459  FW_ASSERT(
1460  qStatus == Os::Queue::OP_OK,
1461  static_cast<FwAssertArgType>(qStatus)
1462  );
1463  }
1464 
1465  // ----------------------------------------------------------------------
1466  // Pre-message hooks for async commands
1467  //
1468  // Each of these functions is invoked just before processing the
1469  // corresponding command. By default they do nothing. You can
1470  // override them to provide specific pre-command behavior.
1471  // ----------------------------------------------------------------------
1472 
1475  FwOpcodeType opCode,
1476  U32 cmdSeq
1477  )
1478  {
1479  // Defaults to no-op; can be overridden
1480  (void) opCode;
1481  (void) cmdSeq;
1482  }
1483 
1486  FwOpcodeType opCode,
1487  U32 cmdSeq
1488  )
1489  {
1490  // Defaults to no-op; can be overridden
1491  (void) opCode;
1492  (void) cmdSeq;
1493  }
1494 
1495  // ----------------------------------------------------------------------
1496  // Event logging functions
1497  // ----------------------------------------------------------------------
1498 
1501  const Svc::EventManager_FilterSeverity& severity,
1502  bool enabled
1503  ) const
1504  {
1505  // Get the time
1506  Fw::Time _logTime;
1507  if (this->isConnected_Time_OutputPort(0)) {
1508  this->Time_out(0, _logTime);
1509  }
1510 
1512 
1513  // Emit the event on the log port
1514  if (this->isConnected_Log_OutputPort(0)) {
1515  Fw::LogBuffer _logBuff;
1517 
1518 #if FW_AMPCS_COMPATIBLE
1519  // Serialize the number of arguments
1520  _status = _logBuff.serializeFrom(static_cast<U8>(2));
1521  FW_ASSERT(
1522  _status == Fw::FW_SERIALIZE_OK,
1523  static_cast<FwAssertArgType>(_status)
1524  );
1525 #endif
1526 
1527 #if FW_AMPCS_COMPATIBLE
1528  // Serialize the argument size
1529  _status = _logBuff.serializeFrom(
1531  );
1532  FW_ASSERT(
1533  _status == Fw::FW_SERIALIZE_OK,
1534  static_cast<FwAssertArgType>(_status)
1535  );
1536 #endif
1537  _status = _logBuff.serializeFrom(severity);
1538  FW_ASSERT(
1539  _status == Fw::FW_SERIALIZE_OK,
1540  static_cast<FwAssertArgType>(_status)
1541  );
1542 
1543 #if FW_AMPCS_COMPATIBLE
1544  // Serialize the argument size
1545  _status = _logBuff.serializeFrom(
1546  static_cast<U8>(sizeof(U8))
1547  );
1548  FW_ASSERT(
1549  _status == Fw::FW_SERIALIZE_OK,
1550  static_cast<FwAssertArgType>(_status)
1551  );
1552 #endif
1553  _status = _logBuff.serializeFrom(enabled);
1554  FW_ASSERT(
1555  _status == Fw::FW_SERIALIZE_OK,
1556  static_cast<FwAssertArgType>(_status)
1557  );
1558 
1559  this->Log_out(
1560  0,
1561  _id,
1562  _logTime,
1564  _logBuff
1565  );
1566  }
1567 
1568  // Emit the event on the text log port
1569 #if FW_ENABLE_TEXT_LOGGING
1570  if (this->isConnected_LogText_OutputPort(0)) {
1571 #if FW_OBJECT_NAMES == 1
1572  const char* _formatString =
1573  "(%s) %s: %s filter state. %d";
1574 #else
1575  const char* _formatString =
1576  "%s: %s filter state. %d";
1577 #endif
1578 
1579  Fw::String severityStr;
1580  severity.toString(severityStr);
1581 
1582  Fw::TextLogString _logString;
1583  (void) _logString.format(
1584  _formatString,
1585 #if FW_OBJECT_NAMES == 1
1586  this->m_objName.toChar(),
1587 #endif
1588  "SEVERITY_FILTER_STATE ",
1589  severityStr.toChar(),
1590  enabled
1591  );
1592 
1593  this->LogText_out(
1594  0,
1595  _id,
1596  _logTime,
1598  _logString
1599  );
1600  }
1601 #endif
1602  }
1603 
1606  {
1607  // Get the time
1608  Fw::Time _logTime;
1609  if (this->isConnected_Time_OutputPort(0)) {
1610  this->Time_out(0, _logTime);
1611  }
1612 
1613  const FwEventIdType _id = this->getIdBase() + EVENTID_ID_FILTER_ENABLED;
1614 
1615  // Emit the event on the log port
1616  if (this->isConnected_Log_OutputPort(0)) {
1617  Fw::LogBuffer _logBuff;
1619 
1620 #if FW_AMPCS_COMPATIBLE
1621  // Serialize the number of arguments
1622  _status = _logBuff.serializeFrom(static_cast<U8>(1));
1623  FW_ASSERT(
1624  _status == Fw::FW_SERIALIZE_OK,
1625  static_cast<FwAssertArgType>(_status)
1626  );
1627 #endif
1628 
1629 #if FW_AMPCS_COMPATIBLE
1630  // Serialize the argument size
1631  _status = _logBuff.serializeFrom(
1632  static_cast<U8>(sizeof(FwEventIdType))
1633  );
1634  FW_ASSERT(
1635  _status == Fw::FW_SERIALIZE_OK,
1636  static_cast<FwAssertArgType>(_status)
1637  );
1638 #endif
1639  _status = _logBuff.serializeFrom(ID);
1640  FW_ASSERT(
1641  _status == Fw::FW_SERIALIZE_OK,
1642  static_cast<FwAssertArgType>(_status)
1643  );
1644 
1645  this->Log_out(
1646  0,
1647  _id,
1648  _logTime,
1650  _logBuff
1651  );
1652  }
1653 
1654  // Emit the event on the text log port
1655 #if FW_ENABLE_TEXT_LOGGING
1656  if (this->isConnected_LogText_OutputPort(0)) {
1657 #if FW_OBJECT_NAMES == 1
1658  const char* _formatString =
1659  "(%s) %s: ID %" PRIu32 " is filtered.";
1660 #else
1661  const char* _formatString =
1662  "%s: ID %" PRIu32 " is filtered.";
1663 #endif
1664 
1665  Fw::TextLogString _logString;
1666  (void) _logString.format(
1667  _formatString,
1668 #if FW_OBJECT_NAMES == 1
1669  this->m_objName.toChar(),
1670 #endif
1671  "ID_FILTER_ENABLED ",
1672  ID
1673  );
1674 
1675  this->LogText_out(
1676  0,
1677  _id,
1678  _logTime,
1680  _logString
1681  );
1682  }
1683 #endif
1684  }
1685 
1688  {
1689  // Get the time
1690  Fw::Time _logTime;
1691  if (this->isConnected_Time_OutputPort(0)) {
1692  this->Time_out(0, _logTime);
1693  }
1694 
1695  const FwEventIdType _id = this->getIdBase() + EVENTID_ID_FILTER_LIST_FULL;
1696 
1697  // Emit the event on the log port
1698  if (this->isConnected_Log_OutputPort(0)) {
1699  Fw::LogBuffer _logBuff;
1701 
1702 #if FW_AMPCS_COMPATIBLE
1703  // Serialize the number of arguments
1704  _status = _logBuff.serializeFrom(static_cast<U8>(1));
1705  FW_ASSERT(
1706  _status == Fw::FW_SERIALIZE_OK,
1707  static_cast<FwAssertArgType>(_status)
1708  );
1709 #endif
1710 
1711 #if FW_AMPCS_COMPATIBLE
1712  // Serialize the argument size
1713  _status = _logBuff.serializeFrom(
1714  static_cast<U8>(sizeof(FwEventIdType))
1715  );
1716  FW_ASSERT(
1717  _status == Fw::FW_SERIALIZE_OK,
1718  static_cast<FwAssertArgType>(_status)
1719  );
1720 #endif
1721  _status = _logBuff.serializeFrom(ID);
1722  FW_ASSERT(
1723  _status == Fw::FW_SERIALIZE_OK,
1724  static_cast<FwAssertArgType>(_status)
1725  );
1726 
1727  this->Log_out(
1728  0,
1729  _id,
1730  _logTime,
1732  _logBuff
1733  );
1734  }
1735 
1736  // Emit the event on the text log port
1737 #if FW_ENABLE_TEXT_LOGGING
1738  if (this->isConnected_LogText_OutputPort(0)) {
1739 #if FW_OBJECT_NAMES == 1
1740  const char* _formatString =
1741  "(%s) %s: ID filter list is full. Cannot filter %" PRIu32 " .";
1742 #else
1743  const char* _formatString =
1744  "%s: ID filter list is full. Cannot filter %" PRIu32 " .";
1745 #endif
1746 
1747  Fw::TextLogString _logString;
1748  (void) _logString.format(
1749  _formatString,
1750 #if FW_OBJECT_NAMES == 1
1751  this->m_objName.toChar(),
1752 #endif
1753  "ID_FILTER_LIST_FULL ",
1754  ID
1755  );
1756 
1757  this->LogText_out(
1758  0,
1759  _id,
1760  _logTime,
1762  _logString
1763  );
1764  }
1765 #endif
1766  }
1767 
1770  {
1771  // Get the time
1772  Fw::Time _logTime;
1773  if (this->isConnected_Time_OutputPort(0)) {
1774  this->Time_out(0, _logTime);
1775  }
1776 
1777  const FwEventIdType _id = this->getIdBase() + EVENTID_ID_FILTER_REMOVED;
1778 
1779  // Emit the event on the log port
1780  if (this->isConnected_Log_OutputPort(0)) {
1781  Fw::LogBuffer _logBuff;
1783 
1784 #if FW_AMPCS_COMPATIBLE
1785  // Serialize the number of arguments
1786  _status = _logBuff.serializeFrom(static_cast<U8>(1));
1787  FW_ASSERT(
1788  _status == Fw::FW_SERIALIZE_OK,
1789  static_cast<FwAssertArgType>(_status)
1790  );
1791 #endif
1792 
1793 #if FW_AMPCS_COMPATIBLE
1794  // Serialize the argument size
1795  _status = _logBuff.serializeFrom(
1796  static_cast<U8>(sizeof(FwEventIdType))
1797  );
1798  FW_ASSERT(
1799  _status == Fw::FW_SERIALIZE_OK,
1800  static_cast<FwAssertArgType>(_status)
1801  );
1802 #endif
1803  _status = _logBuff.serializeFrom(ID);
1804  FW_ASSERT(
1805  _status == Fw::FW_SERIALIZE_OK,
1806  static_cast<FwAssertArgType>(_status)
1807  );
1808 
1809  this->Log_out(
1810  0,
1811  _id,
1812  _logTime,
1814  _logBuff
1815  );
1816  }
1817 
1818  // Emit the event on the text log port
1819 #if FW_ENABLE_TEXT_LOGGING
1820  if (this->isConnected_LogText_OutputPort(0)) {
1821 #if FW_OBJECT_NAMES == 1
1822  const char* _formatString =
1823  "(%s) %s: ID filter ID %" PRIu32 " removed.";
1824 #else
1825  const char* _formatString =
1826  "%s: ID filter ID %" PRIu32 " removed.";
1827 #endif
1828 
1829  Fw::TextLogString _logString;
1830  (void) _logString.format(
1831  _formatString,
1832 #if FW_OBJECT_NAMES == 1
1833  this->m_objName.toChar(),
1834 #endif
1835  "ID_FILTER_REMOVED ",
1836  ID
1837  );
1838 
1839  this->LogText_out(
1840  0,
1841  _id,
1842  _logTime,
1844  _logString
1845  );
1846  }
1847 #endif
1848  }
1849 
1852  {
1853  // Get the time
1854  Fw::Time _logTime;
1855  if (this->isConnected_Time_OutputPort(0)) {
1856  this->Time_out(0, _logTime);
1857  }
1858 
1859  const FwEventIdType _id = this->getIdBase() + EVENTID_ID_FILTER_NOT_FOUND;
1860 
1861  // Emit the event on the log port
1862  if (this->isConnected_Log_OutputPort(0)) {
1863  Fw::LogBuffer _logBuff;
1865 
1866 #if FW_AMPCS_COMPATIBLE
1867  // Serialize the number of arguments
1868  _status = _logBuff.serializeFrom(static_cast<U8>(1));
1869  FW_ASSERT(
1870  _status == Fw::FW_SERIALIZE_OK,
1871  static_cast<FwAssertArgType>(_status)
1872  );
1873 #endif
1874 
1875 #if FW_AMPCS_COMPATIBLE
1876  // Serialize the argument size
1877  _status = _logBuff.serializeFrom(
1878  static_cast<U8>(sizeof(FwEventIdType))
1879  );
1880  FW_ASSERT(
1881  _status == Fw::FW_SERIALIZE_OK,
1882  static_cast<FwAssertArgType>(_status)
1883  );
1884 #endif
1885  _status = _logBuff.serializeFrom(ID);
1886  FW_ASSERT(
1887  _status == Fw::FW_SERIALIZE_OK,
1888  static_cast<FwAssertArgType>(_status)
1889  );
1890 
1891  this->Log_out(
1892  0,
1893  _id,
1894  _logTime,
1896  _logBuff
1897  );
1898  }
1899 
1900  // Emit the event on the text log port
1901 #if FW_ENABLE_TEXT_LOGGING
1902  if (this->isConnected_LogText_OutputPort(0)) {
1903 #if FW_OBJECT_NAMES == 1
1904  const char* _formatString =
1905  "(%s) %s: ID filter ID %" PRIu32 " not found.";
1906 #else
1907  const char* _formatString =
1908  "%s: ID filter ID %" PRIu32 " not found.";
1909 #endif
1910 
1911  Fw::TextLogString _logString;
1912  (void) _logString.format(
1913  _formatString,
1914 #if FW_OBJECT_NAMES == 1
1915  this->m_objName.toChar(),
1916 #endif
1917  "ID_FILTER_NOT_FOUND ",
1918  ID
1919  );
1920 
1921  this->LogText_out(
1922  0,
1923  _id,
1924  _logTime,
1926  _logString
1927  );
1928  }
1929 #endif
1930  }
1931 
1932  // ----------------------------------------------------------------------
1933  // Telemetry serialized write
1934  // ----------------------------------------------------------------------
1935 
1938  FwChanIdType id,
1939  Fw::TlmBuffer& _tlmBuff,
1940  Fw::Time _tlmTime
1941  ) const
1942  {
1943  if (this->isConnected_Tlm_OutputPort(0)) {
1944  if (
1945  this->isConnected_Time_OutputPort(0) &&
1946  (_tlmTime == Fw::ZERO_TIME)
1947  ) {
1948  this->Time_out(0, _tlmTime);
1949  }
1950 
1951  FwChanIdType _id;
1952  _id = this->getIdBase() + id;
1953 
1954  this->Tlm_out(
1955  0,
1956  _id,
1957  _tlmTime,
1958  _tlmBuff
1959  );
1960  }
1961  }
1962 
1963  // ----------------------------------------------------------------------
1964  // Telemetry write functions
1965  // ----------------------------------------------------------------------
1966 
1969  FwSizeType arg,
1970  Fw::Time _tlmTime
1971  )
1972  {
1973  // Check to see if it is the first time
1974  if (not this->m_first_update_EventsDropped) {
1975  // Check to see if value has changed. If not, don't write it.
1976  if (arg == this->m_last_EventsDropped) {
1977  return;
1978  }
1979  else {
1980  this->m_last_EventsDropped = arg;
1981  }
1982  }
1983  else {
1984  this->m_first_update_EventsDropped = false;
1985  this->m_last_EventsDropped = arg;
1986  }
1987 
1988  if (this->isConnected_Tlm_OutputPort(0)) {
1989  Fw::TlmBuffer _tlmBuff;
1990  Fw::SerializeStatus _stat = _tlmBuff.serializeFrom(arg);
1991  FW_ASSERT(
1992  _stat == Fw::FW_SERIALIZE_OK,
1993  static_cast<FwAssertArgType>(_stat)
1994  );
1995 
1996  this->tlmWrite(
1998  _tlmBuff,
1999  _tlmTime
2000  );
2001  }
2002  }
2003 
2004  // ----------------------------------------------------------------------
2005  // Time
2006  // ----------------------------------------------------------------------
2007 
2009  getTime() const
2010  {
2011  if (this->isConnected_Time_OutputPort(0)) {
2012  Fw::Time _time;
2013  this->Time_out(0, _time);
2014  return _time;
2015  }
2016  else {
2017  return Fw::Time(TimeBase::TB_NONE, 0, 0);
2018  }
2019  }
2020 
2021  // ----------------------------------------------------------------------
2022  // Message dispatch functions
2023  // ----------------------------------------------------------------------
2024 
2025  Fw::QueuedComponentBase::MsgDispatchStatus EventManagerComponentBase ::
2026  doDispatch()
2027  {
2028  ComponentIpcSerializableBuffer _msg;
2029  FwQueuePriorityType _priority = 0;
2030 
2031  Os::Queue::Status _msgStatus = this->m_queue.receive(
2032  _msg,
2034  _priority
2035  );
2036  FW_ASSERT(
2037  _msgStatus == Os::Queue::OP_OK,
2038  static_cast<FwAssertArgType>(_msgStatus)
2039  );
2040 
2041  // Reset to beginning of buffer
2042  _msg.resetDeser();
2043 
2044  FwEnumStoreType _desMsg = 0;
2045  Fw::SerializeStatus _deserStatus = _msg.deserializeTo(_desMsg);
2046  FW_ASSERT(
2047  _deserStatus == Fw::FW_SERIALIZE_OK,
2048  static_cast<FwAssertArgType>(_deserStatus)
2049  );
2050 
2051  MsgTypeEnum _msgType = static_cast<MsgTypeEnum>(_desMsg);
2052 
2053  if (_msgType == EVENTMANAGER_COMPONENT_EXIT) {
2054  return MSG_DISPATCH_EXIT;
2055  }
2056 
2057  FwIndexType portNum = 0;
2058  _deserStatus = _msg.deserializeTo(portNum);
2059  FW_ASSERT(
2060  _deserStatus == Fw::FW_SERIALIZE_OK,
2061  static_cast<FwAssertArgType>(_deserStatus)
2062  );
2063 
2064  switch (_msgType) {
2065  // Handle async input port pingIn
2066  case PINGIN_PING: {
2067  // Deserialize argument key
2068  U32 key;
2069  _deserStatus = _msg.deserializeTo(key);
2070  FW_ASSERT(
2071  _deserStatus == Fw::FW_SERIALIZE_OK,
2072  static_cast<FwAssertArgType>(_deserStatus)
2073  );
2074  // Call handler function
2075  this->pingIn_handler(
2076  portNum,
2077  key
2078  );
2079 
2080  break;
2081  }
2082 
2083  // Handle async input port run
2084  case RUN_SCHED: {
2085  // Deserialize argument context
2086  U32 context;
2087  _deserStatus = _msg.deserializeTo(context);
2088  FW_ASSERT(
2089  _deserStatus == Fw::FW_SERIALIZE_OK,
2090  static_cast<FwAssertArgType>(_deserStatus)
2091  );
2092  // Call handler function
2093  this->run_handler(
2094  portNum,
2095  context
2096  );
2097 
2098  break;
2099  }
2100 
2101  // Handle command SET_ID_FILTER
2102  case CMD_SET_ID_FILTER: {
2103  // Deserialize opcode
2104  FwOpcodeType _opCode = 0;
2105  _deserStatus = _msg.deserializeTo(_opCode);
2106  FW_ASSERT (
2107  _deserStatus == Fw::FW_SERIALIZE_OK,
2108  static_cast<FwAssertArgType>(_deserStatus)
2109  );
2110 
2111  // Deserialize command sequence
2112  U32 _cmdSeq = 0;
2113  _deserStatus = _msg.deserializeTo(_cmdSeq);
2114  FW_ASSERT (
2115  _deserStatus == Fw::FW_SERIALIZE_OK,
2116  static_cast<FwAssertArgType>(_deserStatus)
2117  );
2118 
2119  // Deserialize command argument buffer
2120  Fw::CmdArgBuffer args;
2121  _deserStatus = _msg.deserializeTo(args);
2122  FW_ASSERT (
2123  _deserStatus == Fw::FW_SERIALIZE_OK,
2124  static_cast<FwAssertArgType>(_deserStatus)
2125  );
2126 
2127  // Reset buffer
2128  args.resetDeser();
2129 
2130  // Deserialize argument ID
2131  FwEventIdType ID;
2132  _deserStatus = args.deserializeTo(ID);
2133  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
2134  if (this->isConnected_CmdStatus_OutputPort(0)) {
2135  this->cmdResponse_out(
2136  _opCode,
2137  _cmdSeq,
2139  );
2140  }
2141  // Don't crash the task if bad arguments were passed from the ground
2142  break;
2143  }
2144 
2145  // Deserialize argument idFilterEnabled
2146  Svc::EventManager_Enabled idFilterEnabled;
2147  _deserStatus = args.deserializeTo(idFilterEnabled);
2148  if (_deserStatus != Fw::FW_SERIALIZE_OK) {
2149  if (this->isConnected_CmdStatus_OutputPort(0)) {
2150  this->cmdResponse_out(
2151  _opCode,
2152  _cmdSeq,
2154  );
2155  }
2156  // Don't crash the task if bad arguments were passed from the ground
2157  break;
2158  }
2159 
2160  // Make sure there was no data left over.
2161  // That means the argument buffer size was incorrect.
2162 #if FW_CMD_CHECK_RESIDUAL
2163  if (args.getDeserializeSizeLeft() != 0) {
2164  if (this->isConnected_CmdStatus_OutputPort(0)) {
2165  this->cmdResponse_out(_opCode, _cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
2166  }
2167  // Don't crash the task if bad arguments were passed from the ground
2168  break;
2169  }
2170 #endif
2171 
2172  // Call handler function
2174  _opCode, _cmdSeq,
2175  ID,
2176  idFilterEnabled
2177  );
2178 
2179  break;
2180  }
2181 
2182  // Handle command DUMP_FILTER_STATE
2183  case CMD_DUMP_FILTER_STATE: {
2184  // Deserialize opcode
2185  FwOpcodeType _opCode = 0;
2186  _deserStatus = _msg.deserializeTo(_opCode);
2187  FW_ASSERT (
2188  _deserStatus == Fw::FW_SERIALIZE_OK,
2189  static_cast<FwAssertArgType>(_deserStatus)
2190  );
2191 
2192  // Deserialize command sequence
2193  U32 _cmdSeq = 0;
2194  _deserStatus = _msg.deserializeTo(_cmdSeq);
2195  FW_ASSERT (
2196  _deserStatus == Fw::FW_SERIALIZE_OK,
2197  static_cast<FwAssertArgType>(_deserStatus)
2198  );
2199 
2200  // Deserialize command argument buffer
2201  Fw::CmdArgBuffer args;
2202  _deserStatus = _msg.deserializeTo(args);
2203  FW_ASSERT (
2204  _deserStatus == Fw::FW_SERIALIZE_OK,
2205  static_cast<FwAssertArgType>(_deserStatus)
2206  );
2207 
2208  // Reset buffer
2209  args.resetDeser();
2210 
2211  // Make sure there was no data left over.
2212  // That means the argument buffer size was incorrect.
2213 #if FW_CMD_CHECK_RESIDUAL
2214  if (args.getDeserializeSizeLeft() != 0) {
2215  if (this->isConnected_CmdStatus_OutputPort(0)) {
2216  this->cmdResponse_out(_opCode, _cmdSeq, Fw::CmdResponse::FORMAT_ERROR);
2217  }
2218  // Don't crash the task if bad arguments were passed from the ground
2219  break;
2220  }
2221 #endif
2222 
2223  // Call handler function
2224  this->DUMP_FILTER_STATE_cmdHandler(_opCode, _cmdSeq);
2225 
2226  break;
2227  }
2228 
2229  // Handle internal interface loqQueue
2230  case INT_IF_LOQQUEUE: {
2231  FwEventIdType id;
2232  _deserStatus = _msg.deserializeTo(id);
2233 
2234  // Internal interface should always deserialize
2235  FW_ASSERT(
2236  Fw::FW_SERIALIZE_OK == _deserStatus,
2237  static_cast<FwAssertArgType>(_deserStatus)
2238  );
2239 
2240  Fw::Time timeTag;
2241  _deserStatus = _msg.deserializeTo(timeTag);
2242 
2243  // Internal interface should always deserialize
2244  FW_ASSERT(
2245  Fw::FW_SERIALIZE_OK == _deserStatus,
2246  static_cast<FwAssertArgType>(_deserStatus)
2247  );
2248 
2249  Fw::LogSeverity severity;
2250  _deserStatus = _msg.deserializeTo(severity);
2251 
2252  // Internal interface should always deserialize
2253  FW_ASSERT(
2254  Fw::FW_SERIALIZE_OK == _deserStatus,
2255  static_cast<FwAssertArgType>(_deserStatus)
2256  );
2257 
2258  Fw::LogBuffer args;
2259  _deserStatus = _msg.deserializeTo(args);
2260 
2261  // Internal interface should always deserialize
2262  FW_ASSERT(
2263  Fw::FW_SERIALIZE_OK == _deserStatus,
2264  static_cast<FwAssertArgType>(_deserStatus)
2265  );
2266 
2267  // Make sure there was no data left over.
2268  // That means the buffer size was incorrect.
2269  FW_ASSERT(
2270  _msg.getDeserializeSizeLeft() == 0,
2271  static_cast<FwAssertArgType>(_msg.getDeserializeSizeLeft())
2272  );
2273 
2274  // Call handler function
2276  id,
2277  timeTag,
2278  severity,
2279  args
2280  );
2281 
2282  break;
2283  }
2284 
2285  default:
2286  return MSG_DISPATCH_ERROR;
2287  }
2288 
2289  return MSG_DISPATCH_OK;
2290  }
2291 
2292  // ----------------------------------------------------------------------
2293  // Calls for messages received on special input ports
2294  // ----------------------------------------------------------------------
2295 
2296  void EventManagerComponentBase ::
2297  m_p_CmdDisp_in(
2298  Fw::PassiveComponentBase* callComp,
2299  FwIndexType portNum,
2300  FwOpcodeType opCode,
2301  U32 cmdSeq,
2302  Fw::CmdArgBuffer& args
2303  )
2304  {
2305  FW_ASSERT(callComp != nullptr);
2306  EventManagerComponentBase* compPtr = static_cast<EventManagerComponentBase*>(callComp);
2307  compPtr->CmdDisp_handlerBase(
2308  portNum,
2309  opCode,
2310  cmdSeq,
2311  args
2312  );
2313  }
2314 
2315  // ----------------------------------------------------------------------
2316  // Calls for messages received on typed input ports
2317  // ----------------------------------------------------------------------
2318 
2319  void EventManagerComponentBase ::
2320  m_p_LogRecv_in(
2321  Fw::PassiveComponentBase* callComp,
2322  FwIndexType portNum,
2323  FwEventIdType id,
2324  Fw::Time& timeTag,
2325  const Fw::LogSeverity& severity,
2326  Fw::LogBuffer& args
2327  )
2328  {
2329  FW_ASSERT(callComp != nullptr);
2330  EventManagerComponentBase* compPtr = static_cast<EventManagerComponentBase*>(callComp);
2331  compPtr->LogRecv_handlerBase(
2332  portNum,
2333  id,
2334  timeTag,
2335  severity,
2336  args
2337  );
2338  }
2339 
2340  void EventManagerComponentBase ::
2341  m_p_pingIn_in(
2342  Fw::PassiveComponentBase* callComp,
2343  FwIndexType portNum,
2344  U32 key
2345  )
2346  {
2347  FW_ASSERT(callComp != nullptr);
2348  EventManagerComponentBase* compPtr = static_cast<EventManagerComponentBase*>(callComp);
2349  compPtr->pingIn_handlerBase(
2350  portNum,
2351  key
2352  );
2353  }
2354 
2355  void EventManagerComponentBase ::
2356  m_p_run_in(
2357  Fw::PassiveComponentBase* callComp,
2358  FwIndexType portNum,
2359  U32 context
2360  )
2361  {
2362  FW_ASSERT(callComp != nullptr);
2363  EventManagerComponentBase* compPtr = static_cast<EventManagerComponentBase*>(callComp);
2364  compPtr->run_handlerBase(
2365  portNum,
2366  context
2367  );
2368  }
2369 
2370 #if !FW_DIRECT_PORT_CALLS
2371 
2372  // ----------------------------------------------------------------------
2373  // Invocation functions for special output ports
2374  // ----------------------------------------------------------------------
2375 
2376  void EventManagerComponentBase ::
2377  CmdReg_out(
2378  FwIndexType portNum,
2379  FwOpcodeType opCode
2380  ) const
2381  {
2382  FW_ASSERT(
2383  (0 <= portNum) && (portNum < this->getNum_CmdReg_OutputPorts()),
2384  static_cast<FwAssertArgType>(portNum)
2385  );
2386 
2387  FW_ASSERT(
2388  this->m_CmdReg_OutputPort[portNum].isConnected(),
2389  static_cast<FwAssertArgType>(portNum)
2390  );
2391  this->m_CmdReg_OutputPort[portNum].invoke(
2392  opCode
2393  );
2394  }
2395 
2396  void EventManagerComponentBase ::
2397  CmdStatus_out(
2398  FwIndexType portNum,
2399  FwOpcodeType opCode,
2400  U32 cmdSeq,
2401  const Fw::CmdResponse& response
2402  ) const
2403  {
2404  FW_ASSERT(
2405  (0 <= portNum) && (portNum < this->getNum_CmdStatus_OutputPorts()),
2406  static_cast<FwAssertArgType>(portNum)
2407  );
2408 
2409  FW_ASSERT(
2410  this->m_CmdStatus_OutputPort[portNum].isConnected(),
2411  static_cast<FwAssertArgType>(portNum)
2412  );
2413  this->m_CmdStatus_OutputPort[portNum].invoke(
2414  opCode,
2415  cmdSeq,
2416  response
2417  );
2418  }
2419 
2420  void EventManagerComponentBase ::
2421  Log_out(
2422  FwIndexType portNum,
2423  FwEventIdType id,
2424  Fw::Time& timeTag,
2425  const Fw::LogSeverity& severity,
2426  Fw::LogBuffer& args
2427  ) const
2428  {
2429  FW_ASSERT(
2430  (0 <= portNum) && (portNum < this->getNum_Log_OutputPorts()),
2431  static_cast<FwAssertArgType>(portNum)
2432  );
2433 
2434  FW_ASSERT(
2435  this->m_Log_OutputPort[portNum].isConnected(),
2436  static_cast<FwAssertArgType>(portNum)
2437  );
2438  this->m_Log_OutputPort[portNum].invoke(
2439  id,
2440  timeTag,
2441  severity,
2442  args
2443  );
2444  }
2445 
2446 #if FW_ENABLE_TEXT_LOGGING
2447 
2448  void EventManagerComponentBase ::
2449  LogText_out(
2450  FwIndexType portNum,
2451  FwEventIdType id,
2452  Fw::Time& timeTag,
2453  const Fw::LogSeverity& severity,
2454  Fw::TextLogString& text
2455  ) const
2456  {
2457  FW_ASSERT(
2458  (0 <= portNum) && (portNum < this->getNum_LogText_OutputPorts()),
2459  static_cast<FwAssertArgType>(portNum)
2460  );
2461 
2462  FW_ASSERT(
2463  this->m_LogText_OutputPort[portNum].isConnected(),
2464  static_cast<FwAssertArgType>(portNum)
2465  );
2466  this->m_LogText_OutputPort[portNum].invoke(
2467  id,
2468  timeTag,
2469  severity,
2470  text
2471  );
2472  }
2473 
2474 #endif
2475 
2476  void EventManagerComponentBase ::
2477  Time_out(
2478  FwIndexType portNum,
2479  Fw::Time& time
2480  ) const
2481  {
2482  FW_ASSERT(
2483  (0 <= portNum) && (portNum < this->getNum_Time_OutputPorts()),
2484  static_cast<FwAssertArgType>(portNum)
2485  );
2486 
2487  FW_ASSERT(
2488  this->m_Time_OutputPort[portNum].isConnected(),
2489  static_cast<FwAssertArgType>(portNum)
2490  );
2491  this->m_Time_OutputPort[portNum].invoke(
2492  time
2493  );
2494  }
2495 
2496  void EventManagerComponentBase ::
2497  Tlm_out(
2498  FwIndexType portNum,
2499  FwChanIdType id,
2500  Fw::Time& timeTag,
2501  Fw::TlmBuffer& val
2502  ) const
2503  {
2504  FW_ASSERT(
2505  (0 <= portNum) && (portNum < this->getNum_Tlm_OutputPorts()),
2506  static_cast<FwAssertArgType>(portNum)
2507  );
2508 
2509  FW_ASSERT(
2510  this->m_Tlm_OutputPort[portNum].isConnected(),
2511  static_cast<FwAssertArgType>(portNum)
2512  );
2513  this->m_Tlm_OutputPort[portNum].invoke(
2514  id,
2515  timeTag,
2516  val
2517  );
2518  }
2519 
2520 #endif
2521 
2522 }
Serialization/Deserialization operation was successful.
void run_handlerBase(FwIndexType portNum, U32 context)
Handler base-class function for input port run.
void addCallPort(InputTimePort *callPort)
Register an input port.
Definition: TimePortAc.cpp:157
void log_ACTIVITY_LO_SEVERITY_FILTER_STATE(const Svc::EventManager_FilterSeverity &severity, bool enabled) const
The size of the serial representation.
static constexpr FwIndexType getNum_Tlm_OutputPorts()
virtual void run_preMsgHook(FwIndexType portNum, U32 context)
Pre-message hook for async input port run.
void invoke(Fw::ComBuffer &data, U32 context) const
Invoke a port connection.
Definition: ComPortAc.cpp:181
void tlmWrite_EventsDropped(FwSizeType arg, Fw::Time _tlmTime=Fw::Time())
void set_CmdReg_OutputPort(FwIndexType portNum, Fw::InputCmdRegPort *port)
Connect port to CmdReg[portNum].
void init()
Initialization function.
Definition: ComPortAc.cpp:162
static constexpr FwSizeType CAPACITY
Definition: CmdPortAc.hpp:36
virtual void SET_EVENT_FILTER_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, const Svc::EventManager_FilterSeverity &filterLevel, const Svc::EventManager_Enabled &filterEnabled)=0
void pingIn_handlerBase(FwIndexType portNum, U32 key)
Handler base-class function for input port pingIn.
Enabled and disabled state.
Set filter for reporting events. Events are not stored in component.
void LogRecv_handlerBase(FwIndexType portNum, FwEventIdType id, Fw::Time &timeTag, const Fw::LogSeverity &severity, Fw::LogBuffer &args)
Handler base-class function for input port LogRecv.
FwIdType FwOpcodeType
The type of a command opcode.
Operation succeeded.
Definition: Os.hpp:27
PlatformSizeType FwSizeType
Status receive(U8 *destination, FwSizeType capacity, BlockingType blockType, FwSizeType &actualSize, FwQueuePriorityType &priority) override
receive a message from the queue through delegate
Definition: Queue.cpp:71
I32 FwEnumStoreType
Status
status returned from the queue send function
Definition: Queue.hpp:30
void init()
Initialization function.
Definition: SchedPortAc.cpp:73
BYTE pingInPortSize[Svc::PingPortBuffer::CAPACITY]
void init()
Initialization function.
Definition: CmdPortAc.cpp:89
SerializeStatus deserializeTo(U8 &val, Endianness mode=Endianness::BIG) override
Deserialize an 8-bit unsigned integer value.
bool isConnected_CmdStatus_OutputPort(FwIndexType portNum) const
Svc::InputPingPort * get_pingIn_InputPort(FwIndexType portNum)
void invoke(U32 key) const
Invoke a port connection.
Definition: PingPortAc.cpp:170
bool isConnected_PktSend_OutputPort(FwIndexType portNum) const
const Time ZERO_TIME
Definition: Time.cpp:5
bool isConnected_FatalAnnounce_OutputPort(FwIndexType portNum) const
bool isConnected_Tlm_OutputPort(FwIndexType portNum) const
void set_pingOut_OutputPort(FwIndexType portNum, Svc::InputPingPort *port)
Connect port to pingOut[portNum].
static constexpr FwIndexType getNum_CmdReg_OutputPorts()
void CmdDisp_handlerBase(FwIndexType portNum, FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
Handler base-class function for input port CmdDisp.
static constexpr FwIndexType getNum_LogRecv_InputPorts()
Fw::InputCmdPort * get_CmdDisp_InputPort(FwIndexType portNum)
void init()
Initialization function.
Definition: TlmPortAc.cpp:171
Enum representing a command response.
static constexpr FwIndexType getNum_pingOut_OutputPorts()
void invoke(FwEventIdType Id) const
Invoke a port connection.
No time base has been established (Required)
SerializeStatus serializeFrom(U8 val, Endianness mode=Endianness::BIG) override
Serialize an 8-bit unsigned integer value.
void addCallPort(InputCmdRegPort *callPort)
Register an input port.
void set_PktSend_OutputPort(FwIndexType portNum, Fw::InputComPort *port)
Connect port to PktSend[portNum].
Svc::InputSchedPort * get_run_InputPort(FwIndexType portNum)
Os::Queue m_queue
queue object for active component
void addCallPort(InputTlmPort *callPort)
Register an input port.
Definition: TlmPortAc.cpp:177
void init()
Object initializer.
Definition: ObjBase.cpp:24
static constexpr FwIndexType getNum_CmdStatus_OutputPorts()
void regCommands()
Register commands with the Command Dispatcher.
SerializeStatus
forward declaration for string
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
Definition: CmdPortAc.cpp:95
Message will block until space is available.
Definition: Queue.hpp:47
static constexpr FwIndexType getNum_pingIn_InputPorts()
FwIdType FwEventIdType
The type of an event identifier.
void invoke(FwOpcodeType opCode) const
Invoke a port connection.
static constexpr FwSizeType CAPACITY
Definition: PingPortAc.hpp:34
void init()
Initialization function.
Definition: LogPortAc.cpp:97
void SET_EVENT_FILTER_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
void addCallPort(InputFatalEventPort *callPort)
Register an input port.
void log_ACTIVITY_HI_ID_FILTER_ENABLED(FwEventIdType ID) const
#define FW_OBJECT_NAMES
Indicates whether or not object names are stored (more memory, can be used for tracking objects) ...
Definition: FpConfig.h:40
virtual void SET_ID_FILTER_preMsgHook(FwOpcodeType opCode, U32 cmdSeq)
Pre-message hook for command SET_ID_FILTER.
virtual void DUMP_FILTER_STATE_preMsgHook(FwOpcodeType opCode, U32 cmdSeq)
Pre-message hook for command DUMP_FILTER_STATE.
void init()
Initialization function.
Definition: TimePortAc.cpp:151
void set_Tlm_OutputPort(FwIndexType portNum, Fw::InputTlmPort *port)
Connect port to Tlm[portNum].
Less important informational events.
Os::Queue::Status createQueue(FwSizeType depth, FwSizeType msgSize)
void log_WARNING_LO_ID_FILTER_LIST_FULL(FwEventIdType ID) const
void tlmWrite(FwChanIdType id, Fw::TlmBuffer &_tlmBuff, Fw::Time _tlmTime=Fw::Time()) const
A less serious but recoverable event.
bool isConnected_Log_OutputPort(FwIndexType portNum) const
void init()
Initialization function.
Definition: PingPortAc.cpp:151
static constexpr FwIndexType getNum_FatalAnnounce_OutputPorts()
static constexpr FwIndexType getNum_PktSend_OutputPorts()
void invoke(Fw::Time &time) const
Invoke a port connection.
Definition: TimePortAc.cpp:170
Serializable::SizeType getDeserializeSizeLeft() const override
Get remaining deserialization buffer size.
void set_Time_OutputPort(FwIndexType portNum, Fw::InputTimePort *port)
Connect port to Time[portNum].
void invoke(FwOpcodeType opCode, U32 cmdSeq, const Fw::CmdResponse &response) const
Invoke a port connection.
FwIdType FwChanIdType
The type of a telemetry channel identifier.
void pingOut_out(FwIndexType portNum, U32 key) const
Invoke output port pingOut.
void addCallPort(InputPingPort *callPort)
Register an input port.
Definition: PingPortAc.cpp:157
static constexpr FwIndexType getNum_run_InputPorts()
Status send(const U8 *buffer, FwSizeType size, FwQueuePriorityType priority, BlockingType blockType) override
send a message into the queue through delegate
Definition: Queue.cpp:54
void FatalAnnounce_out(FwIndexType portNum, FwEventIdType Id) const
Invoke output port FatalAnnounce.
void resetDeser() override
Reset deserialization pointer to beginning of buffer.
void invoke(FwChanIdType id, Fw::Time &timeTag, Fw::TlmBuffer &val) const
Invoke a port connection.
Definition: TlmPortAc.cpp:190
const char * toChar() const
Convert to a C-style char*.
bool isConnected() const
Definition: PortBase.cpp:38
Enum representing event severity.
bool isConnected_Time_OutputPort(FwIndexType portNum) const
#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 addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
Definition: LogPortAc.cpp:103
void setPortNum(FwIndexType portNum)
uint8_t U8
8-bit unsigned integer
Definition: BasicTypes.h:54
void set_Log_OutputPort(FwIndexType portNum, Fw::InputLogPort *port)
Connect port to Log[portNum].
BlockingType
message type
Definition: Queue.hpp:46
void log_WARNING_LO_ID_FILTER_NOT_FOUND(FwEventIdType ID) const
bool isConnected_CmdReg_OutputPort(FwIndexType portNum) const
void loqQueue_internalInterfaceInvoke(FwEventIdType id, const Fw::Time &timeTag, const Fw::LogSeverity &severity, const Fw::LogBuffer &args)
Internal interface base-class function for loqQueue.
Command failed to deserialize.
PlatformQueuePriorityType FwQueuePriorityType
The type of queue priorities used.
virtual void pingIn_preMsgHook(FwIndexType portNum, U32 key)
Pre-message hook for async input port pingIn.
Important informational events.
virtual void run_handler(FwIndexType portNum, U32 context)=0
Handler for input port run.
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
Definition: SchedPortAc.cpp:79
void invoke(FwEventIdType id, Fw::Time &timeTag, const Fw::LogSeverity &severity, Fw::LogBuffer &args) const
Invoke a port connection.
Definition: LogPortAc.cpp:199
void set_CmdStatus_OutputPort(FwIndexType portNum, Fw::InputCmdResponsePort *port)
Connect port to CmdStatus[portNum].
void SET_ID_FILTER_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
void cmdResponse_out(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdResponse response)
Emit command response.
virtual void LogRecv_handler(FwIndexType portNum, FwEventIdType id, Fw::Time &timeTag, const Fw::LogSeverity &severity, Fw::LogBuffer &args)=0
Handler for input port LogRecv.
A message was sent requesting an exit of the loop.
virtual void pingIn_handler(FwIndexType portNum, U32 key)=0
Handler for input port pingIn.
PlatformIndexType FwIndexType
void DUMP_FILTER_STATE_cmdHandlerBase(FwOpcodeType opCode, U32 cmdSeq, Fw::CmdArgBuffer &args)
void addCallPort(InputLogPort *callPort)
Register an input port.
Definition: LogPortAc.cpp:186
virtual void DUMP_FILTER_STATE_cmdHandler(FwOpcodeType opCode, U32 cmdSeq)=0
void init()
Initialization function.
void incNumMsgDropped()
increment the number of messages dropped
void init()
Initialization function.
Definition: PingPortAc.cpp:73
static constexpr FwIndexType getNum_Time_OutputPorts()
static constexpr FwIndexType getNum_CmdDisp_InputPorts()
virtual void loqQueue_internalInterfaceHandler(FwEventIdType id, const Fw::Time &timeTag, const Fw::LogSeverity &severity, const Fw::LogBuffer &args)=0
Internal interface handler for loqQueue.
RateGroupDivider component implementation.
bool isConnected_pingOut_OutputPort(FwIndexType portNum) const
message sent/received okay
Definition: Queue.hpp:31
U8 BYTE
byte type
Definition: BasicTypes.h:57
static constexpr FwIndexType getNum_Log_OutputPorts()
void addCallPort(InputComPort *callPort)
Register an input port.
Definition: ComPortAc.cpp:168
void PktSend_out(FwIndexType portNum, Fw::ComBuffer &data, U32 context) const
Invoke output port PktSend.
void addCallComp(Fw::PassiveComponentBase *callComp, CompFuncPtr funcPtr)
Register a component.
Definition: PingPortAc.cpp:79
Message will return with status when space is unavailable.
Definition: Queue.hpp:48
void init()
Initialization function.
message to exit active component task
Implementation of malloc based allocator.
virtual ~EventManagerComponentBase()
Destroy EventManagerComponentBase object.
void init()
Initialization function.
EventManagerComponentBase(const char *compName="")
Construct EventManagerComponentBase object.
void set_FatalAnnounce_OutputPort(FwIndexType portNum, Svc::InputFatalEventPort *port)
Connect port to FatalAnnounce[portNum].
Fw::InputLogPort * get_LogRecv_InputPort(FwIndexType portNum)
#define FW_ASSERT(...)
Definition: Assert.hpp:14
static constexpr FwSizeType CAPACITY
Definition: SchedPortAc.hpp:34
void log_ACTIVITY_HI_ID_FILTER_REMOVED(FwEventIdType ID) const
PlatformAssertArgType FwAssertArgType
The type of arguments to assert functions.
void addCallPort(InputCmdResponsePort *callPort)
Register an input port.
BYTE cmdPortSize[Fw::CmdPortBuffer::CAPACITY]
virtual void SET_ID_FILTER_cmdHandler(FwOpcodeType opCode, U32 cmdSeq, FwEventIdType ID, const Svc::EventManager_Enabled &idFilterEnabled)=0